@content-blocks/js 0.7.7 → 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} +14541 -12905
- 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 +123 -73
- 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 +14605 -11951
- 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} +14516 -12868
- 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 +892 -198
- 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 +6 -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 +74 -64
- 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-398760b3.entry.js +0 -26
- package/dist/content-blocks/p-398760b3.entry.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-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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{r as t,g as e,h as i,H as s}from"./p-CLwOzPEO.js";import{R as n}from"./p-DzYwy_62.js";import{g as r}from"./p-CjR_4mPu.js";var o,a,h="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function l(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function u(t){if(t.__esModule)return t;var e=t.default;if("function"==typeof e){var i=function t(){return this instanceof t?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};i.prototype=e.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(t).forEach((function(e){var s=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:function(){return t[e]}})})),i}function c(){return a?o:(a=1,t="undefined"!=typeof window?window:void 0!==h?h:"undefined"!=typeof self?self:{},o=t);var t}var d,f,p=l(c()),v=u(Object.freeze({__proto__:null,default:{}}));function m(){if(f)return d;f=1;var t,e=void 0!==h?h:"undefined"!=typeof window?window:{};return"undefined"!=typeof document?t=document:(t=e["__GLOBAL_DOCUMENT_CACHE@4"])||(t=e["__GLOBAL_DOCUMENT_CACHE@4"]=v),d=t}var g=l(m()),y={exports:{}};function b(){return b=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},b.apply(null,arguments)}var j,w,T,S,k,x,A,E,I,D=u(Object.freeze({__proto__:null,get default(){return b}}));function C(){if(w)return j;w=1,j=function(e){if(!e)return!1;var i=t.call(e);return"[object Function]"===i||"function"==typeof e&&"[object RegExp]"!==i||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString;return j}function N(){if(S)return T;function t(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,s=new Array(e);i<e;i++)s[i]=t[i];return s}return S=1,T=function(){function e(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var i=e.prototype;return i.getIsEnabled=function(){return this.enabled_},i.enable=function(){this.enabled_=!0},i.disable=function(){this.enabled_=!1},i.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},i.addInterceptor=function(t,e){this.typeToInterceptorsMap_.has(t)||this.typeToInterceptorsMap_.set(t,new Set);var i=this.typeToInterceptorsMap_.get(t);return!i.has(e)&&(i.add(e),!0)},i.removeInterceptor=function(t,e){var i=this.typeToInterceptorsMap_.get(t);return!(!i||!i.has(e)||(i.delete(e),0))},i.clearInterceptorsByType=function(t){return!!this.typeToInterceptorsMap_.get(t)&&(this.typeToInterceptorsMap_.delete(t),this.typeToInterceptorsMap_.set(t,new Set),!0)},i.clear=function(){return!!this.typeToInterceptorsMap_.size&&(this.typeToInterceptorsMap_=new Map,!0)},i.getForType=function(t){return this.typeToInterceptorsMap_.get(t)||new Set},i.execute=function(e,i){for(var s,n=function(e,i){var s="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(s)return(s=s.call(e)).next.bind(s);if(Array.isArray(e)||(s=function(e,i){if(e){if("string"==typeof e)return t(e,i);var s=Object.prototype.toString.call(e).slice(8,-1);return"Object"===s&&e.constructor&&(s=e.constructor.name),"Map"===s||"Set"===s?Array.from(e):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?t(e,i):void 0}}(e))||i){s&&(e=s);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.getForType(e));!(s=n()).done;){var r=s.value;try{i=r(i)}catch(t){}}return i},e}()}var M,O,R,P,_,L,F,$=function(){if(I)return y.exports;I=1;var t=c(),e=D,i=C(),s=N(),n=function(){if(x)return k;x=1;var t=function(){function t(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var i=t.prototype;return i.getIsEnabled=function(){return this.enabled_},i.enable=function(){this.enabled_=!0},i.disable=function(){this.enabled_=!1},i.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},i.getMaxAttempts=function(){return this.maxAttempts_},i.setMaxAttempts=function(t){this.maxAttempts_=t},i.getDelayFactor=function(){return this.delayFactor_},i.setDelayFactor=function(t){this.delayFactor_=t},i.getFuzzFactor=function(){return this.fuzzFactor_},i.setFuzzFactor=function(t){this.fuzzFactor_=t},i.getInitialDelay=function(){return this.initialDelay_},i.setInitialDelay=function(t){this.initialDelay_=t},i.createRetry=function(t){var i=void 0===t?{}:t;return new e({maxAttempts:i.maxAttempts||this.maxAttempts_,delayFactor:i.delayFactor||this.delayFactor_,fuzzFactor:i.fuzzFactor||this.fuzzFactor_,initialDelay:i.initialDelay||this.initialDelay_})},t}(),e=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;return e.moveToNextAttempt=function(){this.currentAttempt_++,this.currentDelay_=this.currentDelay_+this.currentDelay_*this.delayFactor_},e.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},e.getCurrentDelay=function(){return this.currentDelay_},e.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},e.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},e.getCurrentFuzzedDelay=function(){var t=this.getCurrentMinPossibleDelay(),e=this.getCurrentMaxPossibleDelay();return t+Math.random()*(e-t)},t}();return k=t}();a.httpHandler=function(){if(E)return A;E=1;var t=c();return A=function(e,i){return void 0===i&&(i=!1),function(s,n,r){if(s)e(s);else if(n.statusCode>=400&&n.statusCode<=599){var o=r;if(i)if(t.TextDecoder){var a=(void 0===(h=n.headers&&n.headers["content-type"])&&(h=""),h.toLowerCase().split(";").reduce((function(t,e){var i=e.split("="),s=i[1];return"charset"===i[0].trim()?s.trim():t}),"utf-8"));try{o=new TextDecoder(a).decode(r)}catch(t){}}else o=String.fromCharCode.apply(null,new Uint8Array(r));e({cause:o})}else e(null,r);var h}}}(),a.requestInterceptorsStorage=new s,a.responseInterceptorsStorage=new s,a.retryManager=new n;
|
|
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
|
+
*/
|
|
9
|
+
var r=function(t){var e={};return t?(t.trim().split("\n").forEach((function(t){var i=t.indexOf(":"),s=t.slice(0,i).trim().toLowerCase(),n=t.slice(i+1).trim();void 0===e[s]?e[s]=n:Array.isArray(e[s])?e[s].push(n):e[s]=[e[s],n]})),e):e};function o(t,s,n){var r=t;return i(s)?(n=s,"string"==typeof t&&(r={uri:t})):r=e({},s,{uri:t}),r.callback=n,r}function a(t,e,i){return h(e=o(t,e,i))}function h(t){if(void 0===t.callback)throw new Error("callback argument missing");if(t.requestType&&a.requestInterceptorsStorage.getIsEnabled()){var e=a.requestInterceptorsStorage.execute(t.requestType,{uri:t.uri||t.url,headers:t.headers||{},body:t.body,metadata:t.metadata||{},retry:t.retry,timeout:t.timeout});t.uri=e.uri,t.headers=e.headers,t.body=e.body,t.metadata=e.metadata,t.retry=e.retry,t.timeout=e.timeout}var i=!1,s=function(e,s,n){i||(i=!0,t.callback(e,s,n))};function n(){var t=void 0;if(t=d.response?d.response:d.responseText||function(t){try{if("document"===t.responseType)return t.responseXML;if(""===t.responseType&&(!t.responseXML||"parsererror"!==t.responseXML.documentElement.nodeName))return t.responseXML}catch(t){}return null}(d),b)try{t=JSON.parse(t)}catch(t){}return t}function o(e){if(clearTimeout(f),clearTimeout(t.retryTimeout),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,c||!a.retryManager.getIsEnabled()||!t.retry||!t.retry.shouldRetry()){if(t.requestType&&a.responseInterceptorsStorage.getIsEnabled()){var i=a.responseInterceptorsStorage.execute(t.requestType,{headers:j.headers||{},body:j.body,responseUrl:d.responseURL,responseType:d.responseType});j.body=i.body,j.headers=i.headers}return s(e,j)}t.retryTimeout=setTimeout((function(){t.retry.moveToNextAttempt(),t.xhr=d,h(t)}),t.retry.getCurrentFuzzedDelay())}function l(){if(!c){var e;clearTimeout(f),clearTimeout(t.retryTimeout);var i=j,o=null;if(0!==(e=t.useXDR&&void 0===d.status?200:1223===d.status?204:d.status)?(i={body:n(),statusCode:e,method:v,headers:{},url:p,rawRequest:d},d.getAllResponseHeaders&&(i.headers=r(d.getAllResponseHeaders()))):o=new Error("Internal XMLHttpRequest Error"),t.requestType&&a.responseInterceptorsStorage.getIsEnabled()){var h=a.responseInterceptorsStorage.execute(t.requestType,{headers:i.headers||{},body:i.body,responseUrl:d.responseURL,responseType:d.responseType});i.body=h.body,i.headers=h.headers}return s(o,i,i.body)}}var u,c,d=t.xhr||null;d||(d=t.cors||t.useXDR?new a.XDomainRequest:new a.XMLHttpRequest);var f,p=d.url=t.uri||t.url,v=d.method=t.method||"GET",m=t.body||t.data,g=d.headers=t.headers||{},y=!!t.sync,b=!1,j={body:void 0,headers:{},statusCode:0,method:v,url:p,rawRequest:d};if("json"in t&&!1!==t.json&&(b=!0,g.accept||g.Accept||(g.Accept="application/json"),"GET"!==v&&"HEAD"!==v&&(g["content-type"]||g["Content-Type"]||(g["Content-Type"]="application/json"),m=JSON.stringify(!0===t.json?m:t.json))),d.onreadystatechange=function(){4!==d.readyState||a.responseInterceptorsStorage.getIsEnabled()||setTimeout(l,0)},d.onload=l,d.onerror=o,d.onprogress=function(){},d.onabort=function(){c=!0,clearTimeout(t.retryTimeout)},d.ontimeout=o,d.open(v,p,!y,t.username,t.password),y||(d.withCredentials=!!t.withCredentials),!y&&t.timeout>0&&(f=setTimeout((function(){if(!c){c=!0,d.abort("timeout");var t=new Error("XMLHttpRequest timeout");t.code="ETIMEDOUT",o(t)}}),t.timeout)),d.setRequestHeader)for(u in g)g.hasOwnProperty(u)&&d.setRequestHeader(u,g[u]);else if(t.headers&&!function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(d.responseType=t.responseType),"beforeSend"in t&&"function"==typeof t.beforeSend&&t.beforeSend(d),d.send(m||null),d}return y.exports=a,y.exports.default=a,a.XMLHttpRequest=t.XMLHttpRequest||function(){},a.XDomainRequest="withCredentials"in new a.XMLHttpRequest?a.XMLHttpRequest:t.XDomainRequest,function(t,e){for(var i=0;i<t.length;i++)e(t[i])}(["get","put","post","patch","head","delete"],(function(t){a["delete"===t?"del":t]=function(e,i,s){return(i=o(e,i,s)).method=t.toUpperCase(),h(i)}})),y.exports}(),B=l($),U={exports:{}};function q(){if(O)return M;O=1;var t=m(),e=Object.create||function(){function t(){}return function(e){if(1!==arguments.length)throw new Error("Object.create shim only accepts one parameter.");return t.prototype=e,new t}}();function i(t,e){this.name="ParsingError",this.code=t.code,this.message=e||t.message}function s(t){function e(t,e,i,s){return 3600*(0|t)+60*(0|e)+(0|i)+(0|s)/1e3}var i=t.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?e(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?e(i[1],i[2],0,i[4]):e(0,i[1],i[2],i[4]):null}function n(){this.values=e(null)}function r(t,e,i,s){var n=s?t.split(s):[t];for(var r in n)if("string"==typeof n[r]){var o=n[r].split(i);2===o.length&&e(o[0].trim(),o[1].trim())}}function o(t,e,o){var a=t;function h(){var e=s(t);if(null===e)throw new i(i.Errors.BadTimeStamp,"Malformed timestamp: "+a);return t=t.replace(/^[^\sa-zA-Z-]+/,""),e}function l(){t=t.replace(/^\s+/,"")}if(l(),e.startTime=h(),l(),"--\x3e"!==t.substr(0,3))throw new i(i.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+a);t=t.substr(3),l(),e.endTime=h(),l(),function(t,e){var i=new n;r(t,(function(t,e){switch(t){case"region":for(var s=o.length-1;s>=0;s--)if(o[s].id===e){i.set(t,o[s].region);break}break;case"vertical":i.alt(t,e,["rl","lr"]);break;case"line":var n=e.split(","),r=n[0];i.integer(t,r),i.percent(t,r)&&i.set("snapToLines",!1),i.alt(t,r,["auto"]),2===n.length&&i.alt("lineAlign",n[1],["start","center","end"]);break;case"position":n=e.split(","),i.percent(t,n[0]),2===n.length&&i.alt("positionAlign",n[1],["start","center","end"]);break;case"size":i.percent(t,e);break;case"align":i.alt(t,e,["start","center","end","left","right"])}}),/:/,/\s/),e.region=i.get("region",null),e.vertical=i.get("vertical","");try{e.line=i.get("line","auto")}catch(t){}e.lineAlign=i.get("lineAlign","start"),e.snapToLines=i.get("snapToLines",!0),e.size=i.get("size",100);try{e.align=i.get("align","center")}catch(t){e.align=i.get("align","middle")}try{e.position=i.get("position","auto")}catch(t){e.position=i.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},e.align)}e.positionAlign=i.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},e.align)}(t,e)}(i.prototype=e(Error.prototype)).constructor=i,i.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},n.prototype={set:function(t,e){this.get(t)||""===e||(this.values[t]=e)},get:function(t,e,i){return i?this.has(t)?this.values[t]:e[i]: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){/^-?\d+$/.test(e)&&this.set(t,parseInt(e,10))},percent:function(t,e){return!!(e.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(e=parseFloat(e))>=0&&e<=100)&&(this.set(t,e),!0)}};var a=t.createElement&&t.createElement("textarea"),h={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},l={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)"},u={v:"title",lang:"lang"},c={rt:"ruby"};function d(t,e){function i(){if(!e)return null;var t,i=e.match(/^([^<]*)(<[^>]*>?)?/);return e=e.substr((t=i[1]?i[1]:i[2]).length),t}function n(t,e){return!c[e.localName]||c[e.localName]===t.localName}function r(e,i){var s=h[e];if(!s)return null;var n=t.document.createElement(s),r=u[e];return r&&i&&(n[r]=i.trim()),n}for(var o,d,f=t.document.createElement("div"),p=f,v=[];null!==(o=i());)if("<"!==o[0])p.appendChild(t.document.createTextNode((a.innerHTML=o,d=a.textContent,a.textContent="",d)));else{if("/"===o[1]){v.length&&v[v.length-1]===o.substr(2).replace(">","")&&(v.pop(),p=p.parentNode);continue}var m,g=s(o.substr(1,o.length-2));if(g){m=t.document.createProcessingInstruction("timestamp",g),p.appendChild(m);continue}var y=o.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!y)continue;if(!(m=r(y[1],y[3])))continue;if(!n(p,m))continue;if(y[2]){var b=y[2].split(".");b.forEach((function(t){var e=/^bg_/.test(t),i=e?t.slice(3):t;l.hasOwnProperty(i)&&(m.style[e?"background-color":"color"]=l[i])})),m.className=b.join(" ")}v.push(y[1]),p.appendChild(m),p=m}return f}var f=[[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 p(t){for(var e=0;e<f.length;e++){var i=f[e];if(t>=i[0]&&t<=i[1])return!0}return!1}function v(t){var e=[],i="";if(!t||!t.childNodes)return"ltr";function s(t,e){for(var i=e.childNodes.length-1;i>=0;i--)t.push(e.childNodes[i])}function n(t){if(!t||!t.length)return null;var e=t.pop(),i=e.textContent||e.innerText;if(i){var r=i.match(/^.*(\n|\r)/);return r?(t.length=0,r[0]):i}return"ruby"===e.tagName?n(t):e.childNodes?(s(t,e),n(t)):void 0}for(s(e,t);i=n(e);)for(var r=0;r<i.length;r++)if(p(i.charCodeAt(r)))return"rtl";return"ltr"}function g(){}function y(t,e,i){g.call(this),this.cue=e,this.cueDiv=d(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":"lr"===e.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(s,this.cueDiv),this.div=t.document.createElement("div"),s={direction:v(this.cueDiv),writingMode:""===e.vertical?"horizontal-tb":"lr"===e.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:"middle"===e.align?"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}this.applyStyles(""===e.vertical?{left:this.formatStyle(n,"%"),width:this.formatStyle(e.size,"%")}:{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")})}}function b(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=void 0!==e?e:t.lineHeight}function j(t,e,i,s){var n=new b(e),r=e.cue,o=function(t){if("number"==typeof t.line&&(t.snapToLines||t.line>=0&&t.line<=100))return t.line;if(!t.track||!t.track.textTrackList||!t.track.textTrackList.mediaElement)return-1;for(var e=t.track,i=e.textTrackList,s=0,n=0;n<i.length&&i[n]!==e;n++)"showing"===i[n].mode&&s++;return-1*++s}(r),a=[];if(r.snapToLines){var h;switch(r.vertical){case"":a=["+y","-y"],h="height";break;case"rl":a=["+x","-x"],h="width";break;case"lr":a=["-x","+x"],h="width"}var l=n.lineHeight,u=l*Math.round(o),c=i[h]+l,d=a[0];Math.abs(u)>c&&(u=u<0?-1:1,u*=Math.ceil(c/l)*l),o<0&&(u+=""===r.vertical?i.height:i.width,a=a.reverse()),n.move(d,u)}else{var f=n.lineHeight/i.height*100;switch(r.lineAlign){case"center":o-=f/2;break;case"end":o-=f}switch(r.vertical){case"":e.applyStyles({top:e.formatStyle(o,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(o,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(o,"%")})}a=["+y","-x","+x","-y"],n=new b(e)}var p=function(t,e){for(var n,r=new b(t),o=1,a=0;a<e.length;a++){for(;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);o>h&&(n=new b(t),o=h),t=new b(r)}return n||r}(n,a);e.move(p.toCSSCompatValues(i))}function w(){}return g.prototype.applyStyles=function(t,e){for(var i in e=e||this.div,t)t.hasOwnProperty(i)&&(e.style[i]=t[i])},g.prototype.formatStyle=function(t,e){return 0===t?0:t+e},(y.prototype=e(g.prototype)).constructor=y,b.prototype.move=function(t,e){switch(e=void 0!==e?e:this.lineHeight,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}},b.prototype.overlaps=function(t){return this.left<t.right&&this.right>t.left&&this.top<t.bottom&&this.bottom>t.top},b.prototype.overlapsAny=function(t){for(var e=0;e<t.length;e++)if(this.overlaps(t[e]))return!0;return!1},b.prototype.within=function(t){return this.top>=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right},b.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}},b.prototype.intersectPercentage=function(t){return Math.max(0,Math.min(this.right,t.right)-Math.max(this.left,t.left))*Math.max(0,Math.min(this.bottom,t.bottom)-Math.max(this.top,t.top))/(this.height*this.width)},b.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}},b.getSimpleBoxPosition=function(t){var e=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0,i=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0,s=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;return{left:(t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t).left,right:t.right,top:t.top||s,height:t.height||e,bottom:t.bottom||s+(t.height||e),width:t.width||i}},w.StringDecoder=function(){return{decode:function(t){if(!t)return"";if("string"!=typeof t)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}},w.convertCueToDOMTree=function(t,e){return t&&e?d(t,e):null},w.processCues=function(t,e,i){if(!t||!e||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var s=t.document.createElement("div");if(s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin="1.5%",i.appendChild(s),function(t){for(var e=0;e<t.length;e++)if(t[e].hasBeenReset||!t[e].displayState)return!0;return!1}(e)){var n=[],r=b.getSimpleBoxPosition(s),o={font:Math.round(.05*r.height*100)/100+"px sans-serif"};!function(){for(var i,a,h=0;h<e.length;h++)i=new y(t,a=e[h],o),s.appendChild(i.div),j(0,i,r,n),a.displayState=i.div,n.push(b.getSimpleBoxPosition(i))}()}else for(var a=0;a<e.length;a++)s.appendChild(e[a].displayState)},(w.Parser=function(t,e,i){i||(i=e,e={}),e||(e={}),this.window=t,this.vttjs=e,this.state="INITIAL",this.buffer="",this.decoder=i||new TextDecoder("utf8"),this.regionList=[]}).prototype={reportOrThrowError:function(t){if(!(t instanceof i))throw t;this.onparsingerror&&this.onparsingerror(t)},parse:function(t){var e,a=this;function h(){for(var t=a.buffer,e=0;e<t.length&&"\r"!==t[e]&&"\n"!==t[e];)++e;var i=t.substr(0,e);return"\r"===t[e]&&++e,"\n"===t[e]&&++e,a.buffer=t.substr(e),i}t&&(a.buffer+=a.decoder.decode(t,{stream:!0}));try{var l;if("INITIAL"===a.state){if(!/\r\n|\n/.test(a.buffer))return this;var u=(l=h()).match(/^WEBVTT([ \t].*)?$/);if(!u||!u[0])throw new i(i.Errors.BadSignature);a.state="HEADER"}for(var c=!1;a.buffer;){if(!/\r\n|\n/.test(a.buffer))return this;switch(c?c=!1:l=h(),a.state){case"HEADER":/:/.test(l)?(e=l).match(/X-TIMESTAMP-MAP/)?r(e,(function(t,e){"X-TIMESTAMP-MAP"===t&&function(t){var e=new n;r(t,(function(t,i){switch(t){case"MPEGT":e.integer(t+"S",i);break;case"LOCA":e.set(t+"L",s(i))}}),/[^\d]:/,/,/),a.ontimestampmap&&a.ontimestampmap({MPEGTS:e.get("MPEGTS"),LOCAL:e.get("LOCAL")})}(e)}),/=/):r(e,(function(t,e){"Region"===t&&function(t){var e=new n;if(r(t,(function(t,i){switch(t){case"id":e.set(t,i);break;case"width":e.percent(t,i);break;case"lines":e.integer(t,i);break;case"regionanchor":case"viewportanchor":var s=i.split(",");if(2!==s.length)break;var r=new n;if(r.percent("x",s[0]),r.percent("y",s[1]),!r.has("x")||!r.has("y"))break;e.set(t+"X",r.get("x")),e.set(t+"Y",r.get("y"));break;case"scroll":e.alt(t,i,["up"])}}),/=/,/\s/),e.has("id")){var i=new(a.vttjs.VTTRegion||a.window.VTTRegion);i.width=e.get("width",100),i.lines=e.get("lines",3),i.regionAnchorX=e.get("regionanchorX",0),i.regionAnchorY=e.get("regionanchorY",100),i.viewportAnchorX=e.get("viewportanchorX",0),i.viewportAnchorY=e.get("viewportanchorY",100),i.scroll=e.get("scroll",""),a.onregion&&a.onregion(i),a.regionList.push({id:e.get("id"),region:i})}}(e)}),/:/):l||(a.state="ID");continue;case"NOTE":l||(a.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(l)){a.state="NOTE";break}if(!l)continue;a.cue=new(a.vttjs.VTTCue||a.window.VTTCue)(0,0,"");try{a.cue.align="center"}catch(t){a.cue.align="middle"}if(a.state="CUE",-1===l.indexOf("--\x3e")){a.cue.id=l;continue}case"CUE":try{o(l,a.cue,a.regionList)}catch(t){a.reportOrThrowError(t),a.cue=null,a.state="BADCUE";continue}a.state="CUETEXT";continue;case"CUETEXT":var d=-1!==l.indexOf("--\x3e");if(!l||d&&(c=!0)){a.oncue&&a.oncue(a.cue),a.cue=null,a.state="ID";continue}a.cue.text&&(a.cue.text+="\n"),a.cue.text+=l.replace(/\u2028/g,"\n").replace(/u2029/g,"\n");continue;case"BADCUE":l||(a.state="ID");continue}}}catch(t){a.reportOrThrowError(t),"CUETEXT"===a.state&&a.cue&&a.oncue&&a.oncue(a.cue),a.cue=null,a.state="INITIAL"===a.state?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{if(t.buffer+=t.decoder.decode(),(t.cue||"HEADER"===t.state)&&(t.buffer+="\n\n",t.parse()),"INITIAL"===t.state)throw new i(i.Errors.BadSignature)}catch(e){t.reportOrThrowError(e)}return t.onflush&&t.onflush(),this}},M=w}function V(){if(P)return R;P=1;var t={"":1,lr:1,rl:1},e={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function i(t){return"string"==typeof t&&!!e[t.toLowerCase()]&&t.toLowerCase()}function s(e,s,n){this.hasBeenReset=!1;var r="",o=!1,a=e,h=s,l=n,u=null,c="",d=!0,f="auto",p="start",v="auto",m="auto",g=100,y="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return r},set:function(t){r=""+t}},pauseOnExit:{enumerable:!0,get:function(){return o},set:function(t){o=!!t}},startTime:{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t)throw new TypeError("Start time must be set to a number.");a=t,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return h},set:function(t){if("number"!=typeof t)throw new TypeError("End time must be set to a number.");h=t,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return l},set:function(t){l=""+t,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return u},set:function(t){u=t,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return c},set:function(e){var i=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);if(!1===i)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");c=i,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return d},set:function(t){d=!!t,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return f},set:function(t){if("number"!=typeof t&&"auto"!==t)throw new SyntaxError("Line: an invalid number or illegal string was specified.");f=t,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return p},set:function(t){var e=i(t);e?(p=e,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return v},set:function(t){if(t<0||t>100)throw new Error("Position must be between 0 and 100.");v=t,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return m},set:function(t){var e=i(t);e?(m=e,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return g},set:function(t){if(t<0||t>100)throw new Error("Size must be between 0 and 100.");g=t,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return y},set:function(t){var e=i(t);if(!e)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");y=e,this.hasBeenReset=!0}}}),this.displayState=void 0}return s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},R=s}function z(){if(L)return _;L=1;var t={"":!0,up:!0};function e(t){return"number"==typeof t&&t>=0&&t<=100}return _=function(){var i=100,s=3,n=0,r=100,o=0,a=100,h="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(t){if(!e(t))throw new Error("Width must be between 0 and 100.");i=t}},lines:{enumerable:!0,get:function(){return s},set:function(t){if("number"!=typeof t)throw new TypeError("Lines must be set to a number.");s=t}},regionAnchorY:{enumerable:!0,get:function(){return r},set:function(t){if(!e(t))throw new Error("RegionAnchorX must be between 0 and 100.");r=t}},regionAnchorX:{enumerable:!0,get:function(){return n},set:function(t){if(!e(t))throw new Error("RegionAnchorY must be between 0 and 100.");n=t}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(t){if(!e(t))throw new Error("ViewportAnchorY must be between 0 and 100.");a=t}},viewportAnchorX:{enumerable:!0,get:function(){return o},set:function(t){if(!e(t))throw new Error("ViewportAnchorX must be between 0 and 100.");o=t}},scroll:{enumerable:!0,get:function(){return h},set:function(e){var i=function(e){return"string"==typeof e&&!!t[e.toLowerCase()]&&e.toLowerCase()}(e);!1===i?console.warn("Scroll: an invalid or illegal string was specified."):h=i}}})}}var H=l(function(){if(F)return U.exports;F=1;var t=c(),e=U.exports={WebVTT:q(),VTTCue:V(),VTTRegion:z()};t.vttjs=e,t.WebVTT=e.WebVTT;var i=e.VTTCue,s=e.VTTRegion,n=t.VTTCue,r=t.VTTRegion;return e.shim=function(){t.VTTCue=i,t.VTTRegion=s},e.restore=function(){t.VTTCue=n,t.VTTRegion=r},t.VTTCue||e.shim(),U.exports}()),X=function(t,e){if(/^[a-z]+:/i.test(e))return e;/^data:/.test(t)&&(t=p.location&&p.location.href||"");var i=/^\/\//.test(t),s=!p.location&&!/\/\//i.test(t);t=new p.URL(t,p.location||"https://example.com");var n=new URL(e,t);return s?n.href.slice(19):i?n.href.slice(n.protocol.length):n.href},G=function(){function t(){this.listeners={}}var e=t.prototype;return e.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},e.off=function(t,e){if(!this.listeners[t])return!1;var i=this.listeners[t].indexOf(e);return this.listeners[t]=this.listeners[t].slice(0),this.listeners[t].splice(i,1),i>-1},e.trigger=function(t){var e=this.listeners[t];if(e)if(2===arguments.length)for(var i=e.length,s=0;s<i;++s)e[s].call(this,arguments[1]);else for(var n=Array.prototype.slice.call(arguments,1),r=e.length,o=0;o<r;++o)e[o].apply(this,n)},e.dispose=function(){this.listeners={}},e.pipe=function(t){this.on("data",(function(e){t.push(e)}))},t}();function Y(t){for(var e,i=(e=t,p.atob?p.atob(e):Buffer.from(e,"base64").toString("binary")),s=new Uint8Array(i.length),n=0;n<i.length;n++)s[n]=i.charCodeAt(n);return s}
|
|
10
|
+
/*! @name m3u8-parser @version 7.2.1 @license Apache-2.0 */class W extends G{constructor(){super(),this.buffer=""}push(t){let e;for(this.buffer+=t,e=this.buffer.indexOf("\n");e>-1;e=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,e)),this.buffer=this.buffer.substring(e+1)}}const J=String.fromCharCode(9),K=function(t){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(t||""),i={};return e[1]&&(i.length=parseInt(e[1],10)),e[2]&&(i.offset=parseInt(e[2],10)),i},Q=function(t){const e={};if(!t)return e;const i=t.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))'));let s,n=i.length;for(;n--;)""!==i[n]&&(s=/([^=]*)=(.*)/.exec(i[n]).slice(1),s[0]=s[0].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^\s+|\s+$/g,""),s[1]=s[1].replace(/^['"](.*)['"]$/g,"$1"),e[s[0]]=s[1]);return e},Z=t=>{const e=t.split("x"),i={};return e[0]&&(i.width=parseInt(e[0],10)),e[1]&&(i.height=parseInt(e[1],10)),i};class tt extends G{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(t){let e,i;0!==(t=t.trim()).length&&("#"===t[0]?this.tagMappers.reduce(((e,i)=>{const s=i(t);return s===t?e:e.concat([s])}),[t]).forEach((t=>{for(let e=0;e<this.customParsers.length;e++)if(this.customParsers[e].call(this,t))return;if(0===t.indexOf("#EXT"))if(t=t.replace("\r",""),e=/^#EXTM3U/.exec(t),e)this.trigger("data",{type:"tag",tagType:"m3u"});else{if(e=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(t),e)return i={type:"tag",tagType:"inf"},e[1]&&(i.duration=parseFloat(e[1])),e[2]&&(i.title=e[2]),void this.trigger("data",i);if(e=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(t),e)return i={type:"tag",tagType:"targetduration"},e[1]&&(i.duration=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-VERSION:([0-9.]*)?/.exec(t),e)return i={type:"tag",tagType:"version"},e[1]&&(i.version=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(t),e)return i={type:"tag",tagType:"media-sequence"},e[1]&&(i.number=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(t),e)return i={type:"tag",tagType:"discontinuity-sequence"},e[1]&&(i.number=parseInt(e[1],10)),void this.trigger("data",i);if(e=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(t),e)return i={type:"tag",tagType:"playlist-type"},e[1]&&(i.playlistType=e[1]),void this.trigger("data",i);if(e=/^#EXT-X-BYTERANGE:(.*)?$/.exec(t),e)return i=b(K(e[1]),{type:"tag",tagType:"byterange"}),void this.trigger("data",i);if(e=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(t),e)return i={type:"tag",tagType:"allow-cache"},e[1]&&(i.allowed=!/NO/.test(e[1])),void this.trigger("data",i);if(e=/^#EXT-X-MAP:(.*)$/.exec(t),e){if(i={type:"tag",tagType:"map"},e[1]){const t=Q(e[1]);t.URI&&(i.uri=t.URI),t.BYTERANGE&&(i.byterange=K(t.BYTERANGE))}this.trigger("data",i)}else{if(e=/^#EXT-X-STREAM-INF:(.*)$/.exec(t),e)return i={type:"tag",tagType:"stream-inf"},e[1]&&(i.attributes=Q(e[1]),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=Z(i.attributes.RESOLUTION)),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),i.attributes["PROGRAM-ID"]&&(i.attributes["PROGRAM-ID"]=parseInt(i.attributes["PROGRAM-ID"],10))),void this.trigger("data",i);if(e=/^#EXT-X-MEDIA:(.*)$/.exec(t),e)return i={type:"tag",tagType:"media"},e[1]&&(i.attributes=Q(e[1])),void this.trigger("data",i);if(e=/^#EXT-X-ENDLIST/.exec(t),e)this.trigger("data",{type:"tag",tagType:"endlist"});else if(e=/^#EXT-X-DISCONTINUITY/.exec(t),e)this.trigger("data",{type:"tag",tagType:"discontinuity"});else{if(e=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(t),e)return i={type:"tag",tagType:"program-date-time"},e[1]&&(i.dateTimeString=e[1],i.dateTimeObject=new Date(e[1])),void this.trigger("data",i);if(e=/^#EXT-X-KEY:(.*)$/.exec(t),e)return i={type:"tag",tagType:"key"},e[1]&&(i.attributes=Q(e[1]),i.attributes.IV&&("0x"===i.attributes.IV.substring(0,2).toLowerCase()&&(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))),void this.trigger("data",i);if(e=/^#EXT-X-START:(.*)$/.exec(t),e)return i={type:"tag",tagType:"start"},e[1]&&(i.attributes=Q(e[1]),i.attributes["TIME-OFFSET"]=parseFloat(i.attributes["TIME-OFFSET"]),i.attributes.PRECISE=/YES/.test(i.attributes.PRECISE)),void this.trigger("data",i);if(e=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(t),e)return i={type:"tag",tagType:"cue-out-cont"},i.data=e[1]?e[1]:"",void this.trigger("data",i);if(e=/^#EXT-X-CUE-OUT:(.*)?$/.exec(t),e)return i={type:"tag",tagType:"cue-out"},i.data=e[1]?e[1]:"",void this.trigger("data",i);if(e=/^#EXT-X-CUE-IN:?(.*)?$/.exec(t),e)return i={type:"tag",tagType:"cue-in"},i.data=e[1]?e[1]:"",void this.trigger("data",i);if(e=/^#EXT-X-SKIP:(.*)$/.exec(t),e&&e[1])return i={type:"tag",tagType:"skip"},i.attributes=Q(e[1]),i.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(i.attributes["SKIPPED-SEGMENTS"]=parseInt(i.attributes["SKIPPED-SEGMENTS"],10)),i.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(i.attributes["RECENTLY-REMOVED-DATERANGES"]=i.attributes["RECENTLY-REMOVED-DATERANGES"].split(J)),void this.trigger("data",i);if(e=/^#EXT-X-PART:(.*)$/.exec(t),e&&e[1])return i={type:"tag",tagType:"part"},i.attributes=Q(e[1]),["DURATION"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=parseFloat(i.attributes[t]))})),["INDEPENDENT","GAP"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=/YES/.test(i.attributes[t]))})),i.attributes.hasOwnProperty("BYTERANGE")&&(i.attributes.byterange=K(i.attributes.BYTERANGE)),void this.trigger("data",i);if(e=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(t),e&&e[1])return i={type:"tag",tagType:"server-control"},i.attributes=Q(e[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=parseFloat(i.attributes[t]))})),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=/YES/.test(i.attributes[t]))})),void this.trigger("data",i);if(e=/^#EXT-X-PART-INF:(.*)$/.exec(t),e&&e[1])return i={type:"tag",tagType:"part-inf"},i.attributes=Q(e[1]),["PART-TARGET"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=parseFloat(i.attributes[t]))})),void this.trigger("data",i);if(e=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(t),e&&e[1])return i={type:"tag",tagType:"preload-hint"},i.attributes=Q(e[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach((function(t){if(i.attributes.hasOwnProperty(t)){i.attributes[t]=parseInt(i.attributes[t],10);const e="BYTERANGE-LENGTH"===t?"length":"offset";i.attributes.byterange=i.attributes.byterange||{},i.attributes.byterange[e]=i.attributes[t],delete i.attributes[t]}})),void this.trigger("data",i);if(e=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(t),e&&e[1])return i={type:"tag",tagType:"rendition-report"},i.attributes=Q(e[1]),["LAST-MSN","LAST-PART"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=parseInt(i.attributes[t],10))})),void this.trigger("data",i);if(e=/^#EXT-X-DATERANGE:(.*)$/.exec(t),e&&e[1]){i={type:"tag",tagType:"daterange"},i.attributes=Q(e[1]),["ID","CLASS"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=String(i.attributes[t]))})),["START-DATE","END-DATE"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=new Date(i.attributes[t]))})),["DURATION","PLANNED-DURATION"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=parseFloat(i.attributes[t]))})),["END-ON-NEXT"].forEach((function(t){i.attributes.hasOwnProperty(t)&&(i.attributes[t]=/YES/i.test(i.attributes[t]))})),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach((function(t){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]),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)}else if(e=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(t),e)this.trigger("data",{type:"tag",tagType:"independent-segments"});else if(e=/^#EXT-X-I-FRAMES-ONLY/.exec(t),e)this.trigger("data",{type:"tag",tagType:"i-frames-only"});else{if(e=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(t),e)return i={type:"tag",tagType:"content-steering"},i.attributes=Q(e[1]),void this.trigger("data",i);if(e=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(t),e)return i={type:"tag",tagType:"i-frame-playlist"},i.attributes=Q(e[1]),i.attributes.URI&&(i.uri=i.attributes.URI),i.attributes.BANDWIDTH&&(i.attributes.BANDWIDTH=parseInt(i.attributes.BANDWIDTH,10)),i.attributes.RESOLUTION&&(i.attributes.RESOLUTION=Z(i.attributes.RESOLUTION)),i.attributes["AVERAGE-BANDWIDTH"]&&(i.attributes["AVERAGE-BANDWIDTH"]=parseInt(i.attributes["AVERAGE-BANDWIDTH"],10)),i.attributes["FRAME-RATE"]&&(i.attributes["FRAME-RATE"]=parseFloat(i.attributes["FRAME-RATE"])),void this.trigger("data",i);if(e=/^#EXT-X-DEFINE:(.*)$/.exec(t),e)return i={type:"tag",tagType:"define"},i.attributes=Q(e[1]),void this.trigger("data",i);this.trigger("data",{type:"tag",data:t.slice(4)})}}}}else this.trigger("data",{type:"comment",text:t.slice(1)})})):this.trigger("data",{type:"uri",uri:t}))}addParser({expression:t,customType:e,dataParser:i,segment:s}){"function"!=typeof i&&(i=t=>t),this.customParsers.push((n=>{if(t.exec(n))return this.trigger("data",{type:"custom",data:i(n),customType:e,segment:s}),!0}))}addTagMapper({expression:t,map:e}){this.tagMappers.push((i=>t.test(i)?e(i):i))}}const et=function(t){const e={};return Object.keys(t).forEach((function(i){var s;e[(s=i,s.toLowerCase().replace(/-(\w)/g,(t=>t[1].toUpperCase())))]=t[i]})),e},it=function(t){const{serverControl:e,targetDuration:i,partTargetDuration:s}=t;if(!e)return;const n="#EXT-X-SERVER-CONTROL",r="holdBack",o="partHoldBack",a=i&&3*i,h=s&&2*s;i&&!e.hasOwnProperty(r)&&(e[r]=a,this.trigger("info",{message:`${n} defaulting HOLD-BACK to targetDuration * 3 (${a}).`})),a&&e[r]<a&&(this.trigger("warn",{message:`${n} clamping HOLD-BACK (${e[r]}) to targetDuration * 3 (${a})`}),e[r]=a),s&&!e.hasOwnProperty(o)&&(e[o]=3*s,this.trigger("info",{message:`${n} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[o]}).`})),s&&e[o]<h&&(this.trigger("warn",{message:`${n} clamping PART-HOLD-BACK (${e[o]}) to partTargetDuration * 2 (${h}).`}),e[o]=h)};class st extends G{constructor(t={}){super(),this.lineStream=new W,this.parseStream=new tt,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,i=[];let s,n,r={},o=!1;const a=function(){},h={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}};let l=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let u=0,c=0;const d={};this.on("end",(()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&s&&(r.map=s),!r.key&&n&&(r.key=n),r.timeline||"number"!=typeof l||(r.timeline=l),this.manifest.preloadSegment=r)})),this.parseStream.on("data",(function(t){let f,p;if(e.manifest.definitions)for(const i in e.manifest.definitions)if(t.uri&&(t.uri=t.uri.replace(`{$${i}}`,e.manifest.definitions[i])),t.attributes)for(const s in t.attributes)"string"==typeof t.attributes[s]&&(t.attributes[s]=t.attributes[s].replace(`{$${i}}`,e.manifest.definitions[i]));({tag(){({version(){t.version&&(this.manifest.version=t.version)},"allow-cache"(){this.manifest.allowCache=t.allowed,"allowed"in t||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const e={};"length"in t&&(r.byterange=e,e.length=t.length,"offset"in t||(t.offset=u)),"offset"in t&&(r.byterange=e,e.offset=t.offset),u=e.offset+e.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),t.title&&(r.title=t.title),t.duration>0&&(r.duration=t.duration),0===t.duration&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=i},key(){if(t.attributes)if("NONE"!==t.attributes.METHOD)if(t.attributes.URI){if("com.apple.streamingkeydelivery"===t.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:t.attributes});if("com.microsoft.playready"===t.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:t.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===t.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(t.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===t.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==t.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):t.attributes.KEYID&&"0x"===t.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:t.attributes.KEYFORMAT,keyId:t.attributes.KEYID.substring(2)},pssh:Y(t.attributes.URI.split(",")[1])})):void this.trigger("warn",{message:"invalid key ID provided for Widevine"}));t.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:t.attributes.METHOD||"AES-128",uri:t.attributes.URI},void 0!==t.attributes.IV&&(n.iv=t.attributes.IV)}else this.trigger("warn",{message:"ignoring key declaration without URI"});else n=null;else this.trigger("warn",{message:"ignoring key declaration without attribute list"})},"media-sequence"(){isFinite(t.number)?this.manifest.mediaSequence=t.number:this.trigger("warn",{message:"ignoring invalid media sequence: "+t.number})},"discontinuity-sequence"(){isFinite(t.number)?(this.manifest.discontinuitySequence=t.number,l=t.number):this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+t.number})},"playlist-type"(){/VOD|EVENT/.test(t.playlistType)?this.manifest.playlistType=t.playlistType:this.trigger("warn",{message:"ignoring unknown playlist type: "+t.playlist})},map(){s={},t.uri&&(s.uri=t.uri),t.byterange&&(s.byterange=t.byterange),n&&(s.key=n)},"stream-inf"(){this.manifest.playlists=i,this.manifest.mediaGroups=this.manifest.mediaGroups||h,t.attributes?(r.attributes||(r.attributes={}),b(r.attributes,t.attributes)):this.trigger("warn",{message:"ignoring empty stream-inf attributes"})},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||h,!(t.attributes&&t.attributes.TYPE&&t.attributes["GROUP-ID"]&&t.attributes.NAME))return void this.trigger("warn",{message:"ignoring incomplete or missing media group"});const e=this.manifest.mediaGroups[t.attributes.TYPE];e[t.attributes["GROUP-ID"]]=e[t.attributes["GROUP-ID"]]||{},f=e[t.attributes["GROUP-ID"]],p={default:/yes/i.test(t.attributes.DEFAULT)},p.autoselect=!!p.default||/yes/i.test(t.attributes.AUTOSELECT),t.attributes.LANGUAGE&&(p.language=t.attributes.LANGUAGE),t.attributes.URI&&(p.uri=t.attributes.URI),t.attributes["INSTREAM-ID"]&&(p.instreamId=t.attributes["INSTREAM-ID"]),t.attributes.CHARACTERISTICS&&(p.characteristics=t.attributes.CHARACTERISTICS),t.attributes.FORCED&&(p.forced=/yes/i.test(t.attributes.FORCED)),f[t.attributes.NAME]=p},discontinuity(){l+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(i.length)},"program-date-time"(){void 0===this.manifest.dateTimeString&&(this.manifest.dateTimeString=t.dateTimeString,this.manifest.dateTimeObject=t.dateTimeObject),r.dateTimeString=t.dateTimeString,r.dateTimeObject=t.dateTimeObject;const{lastProgramDateTime:e}=this;this.lastProgramDateTime=new Date(t.dateTimeString).getTime(),null===e&&this.manifest.segments.reduceRight(((t,e)=>(e.programDateTime=t-1e3*e.duration,e.programDateTime)),this.lastProgramDateTime)},targetduration(){!isFinite(t.duration)||t.duration<0?this.trigger("warn",{message:"ignoring invalid target duration: "+t.duration}):(this.manifest.targetDuration=t.duration,it.call(this,this.manifest))},start(){t.attributes&&!isNaN(t.attributes["TIME-OFFSET"])?this.manifest.start={timeOffset:t.attributes["TIME-OFFSET"],precise:t.attributes.PRECISE}:this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"})},"cue-out"(){r.cueOut=t.data},"cue-out-cont"(){r.cueOutCont=t.data},"cue-in"(){r.cueIn=t.data},skip(){this.manifest.skip=et(t.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",t.attributes,["SKIPPED-SEGMENTS"])},part(){o=!0;const e=this.manifest.segments.length,i=et(t.attributes);r.parts=r.parts||[],r.parts.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=c),c=i.byterange.offset+i.byterange.length),this.warnOnMissingAttributes_(`#EXT-X-PART #${r.parts.length-1} for segment #${e}`,t.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach(((t,e)=>{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=et(t.attributes);e.hasOwnProperty("canBlockReload")||(e.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),it.call(this,this.manifest),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,i=et(t.attributes),s=i.type&&"PART"===i.type;r.preloadHints=r.preloadHints||[],r.preloadHints.push(i),i.byterange&&(i.byterange.hasOwnProperty("offset")||(i.byterange.offset=s?c:0,s&&(c=i.byterange.offset+i.byterange.length)));const n=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${n} for segment #${e}`,t.attributes,["TYPE","URI"]),i.type)for(let t=0;t<r.preloadHints.length-1;t++){const s=r.preloadHints[t];s.type&&s.type===i.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${n} for segment #${e} has the same TYPE ${i.type} as preload hint #${t}`})}},"rendition-report"(){const e=et(t.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(e);const i=this.manifest.renditionReports.length-1,s=["LAST-MSN","URI"];o&&s.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${i}`,t.attributes,s)},"part-inf"(){this.manifest.partInf=et(t.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",t.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),it.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(et(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];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"}),i.duration&&i.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),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"}),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"}),i.duration&&i.endDate){const t=i.startDate.getTime()+1e3*i.duration;this.manifest.dateRanges[e].endDate=new Date(t)}if(d[i.id]){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]=b(this.manifest.dateRanges[t],i),d[i.id]=b(d[i.id],i),this.manifest.dateRanges.pop()}else d[i.id]=i},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=et(t.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",t.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const e=(t,e)=>{t in this.manifest.definitions?this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${t}`}):this.manifest.definitions[t]=e};if("QUERYPARAM"in t.attributes){if("NAME"in t.attributes||"IMPORT"in t.attributes)return void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});const i=this.params.get(t.attributes.QUERYPARAM);return i?void e(t.attributes.QUERYPARAM,decodeURIComponent(i)):void this.trigger("error",{message:`EXT-X-DEFINE: No query param ${t.attributes.QUERYPARAM}`})}return"NAME"in t.attributes?"IMPORT"in t.attributes?void this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"}):"VALUE"in t.attributes&&"string"==typeof t.attributes.VALUE?void e(t.attributes.NAME,t.attributes.VALUE):void this.trigger("error",{message:`EXT-X-DEFINE: No value for ${t.attributes.NAME}`}):"IMPORT"in t.attributes?this.mainDefinitions[t.attributes.IMPORT]?void e(t.attributes.IMPORT,this.mainDefinitions[t.attributes.IMPORT]):void this.trigger("error",{message:`EXT-X-DEFINE: No value ${t.attributes.IMPORT} to import, or IMPORT used on main playlist`}):void 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(){r.uri=t.uri,i.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),n&&(r.key=n),r.timeline=l,s&&(r.map=s),c=0,null!==this.lastProgramDateTime&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=1e3*r.duration),r={}},comment(){},custom(){t.segment?(r.custom=r.custom||{},r.custom[t.customType]=t.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[t.customType]=t.data)}})[t.type].call(e)}))}requiredCompatibilityversion(t,e){(t<e||!t)&&this.trigger("warn",{message:`manifest must be at least version ${e}`})}warnOnMissingAttributes_(t,e,i){const s=[];i.forEach((function(t){e.hasOwnProperty(t)||s.push(t)})),s.length&&this.trigger("warn",{message:`${t} lacks required attribute(s): ${s.join(", ")}`})}push(t){this.lineStream.push(t)}end(){this.lineStream.push("\n"),this.manifest.dateRanges.length&&null===this.lastProgramDateTime&&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 nt,rt,ot={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^/},at=["video","audio","text"],ht=["Video","Audio","Text"],lt=function(t){return t?t.replace(/avc1\.(\d+)\.(\d+)/i,(function(t,e,i){return"avc1."+("00"+Number(e).toString(16)).slice(-2)+"00"+("00"+Number(i).toString(16)).slice(-2)})):t},ut=function(t){void 0===t&&(t="");var e=t.split(","),i=[];return e.forEach((function(t){var e;t=t.trim(),at.forEach((function(s){var n=ot[s].exec(t.toLowerCase());if(n&&!(n.length<=1)){e=s;var r=t.substring(0,n[1].length),o=t.replace(r,"");i.push({type:r,details:o,mediaType:s})}})),e||i.push({type:t,details:"",mediaType:"unknown"})})),i},ct=function(t){return void 0===t&&(t=""),ot.audio.test(t.trim().toLowerCase())},dt=function(t){if(t&&"string"==typeof t){var e,i=t.toLowerCase().split(",").map((function(t){return lt(t.trim())})),s="video";1===i.length&&ct(i[0])?s="audio":1===i.length&&(void 0===(e=i[0])&&(e=""),ot.text.test(e.trim().toLowerCase()))&&(s="application");var n="mp4";return i.every((function(t){return ot.mp4.test(t)}))?n="mp4":i.every((function(t){return ot.webm.test(t)}))?n="webm":i.every((function(t){return ot.ogg.test(t)}))&&(n="ogg"),s+"/"+n+';codecs="'+t+'"'}},ft=function(t,e){return void 0===t&&(t=""),void 0===e&&(e=!1),p.MediaSource&&p.MediaSource.isTypeSupported&&p.MediaSource.isTypeSupported(dt(t))||e&&p.ManagedMediaSource&&p.ManagedMediaSource.isTypeSupported&&p.ManagedMediaSource.isTypeSupported(dt(t))||!1},pt=function(t){return void 0===t&&(t=""),t.toLowerCase().split(",").every((function(t){t=t.trim();for(var e=0;e<ht.length;e++)if(ot["muxer"+ht[e]].test(t))return!0;return!1}))},vt="mp4a.40.2",mt=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,gt=/^application\/dash\+xml/i,yt=function(t){return mt.test(t)?"hls":gt.test(t)?"dash":"application/vnd.videojs.vhs+json"===t?"vhs-json":null},bt=function(t){return"function"===ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer},jt=function(t){return t instanceof Uint8Array?t:(Array.isArray(t)||bt(t)||t instanceof ArrayBuffer||(t="number"!=typeof t||"number"==typeof t&&t!=t?0:[t]),new Uint8Array(t&&t.buffer||t,t&&t.byteOffset||0,t&&t.byteLength||0))},wt=p.BigInt||Number,Tt=[wt("0x1"),wt("0x100"),wt("0x10000"),wt("0x1000000"),wt("0x100000000"),wt("0x10000000000"),wt("0x1000000000000"),wt("0x100000000000000"),wt("0x10000000000000000")],St=function(t,e){var i=void 0===e?{}:e,s=i.signed,n=void 0!==s&&s,r=i.le,o=void 0!==r&&r;t=jt(t);var a=o?"reduce":"reduceRight",h=(t[a]?t[a]:Array.prototype[a]).call(t,(function(e,i,s){var n=o?s:Math.abs(s+1-t.length);return e+wt(i)*Tt[n]}),wt(0));if(n){var l=Tt[t.length]/wt(2)-wt(1);(h=wt(h))>l&&(h-=l,h-=l,h-=wt(2))}return Number(h)},kt=function(t,e){if("string"!=typeof t&&t&&"function"==typeof t.toString&&(t=t.toString()),"string"!=typeof t)return new Uint8Array;e||(t=unescape(encodeURIComponent(t)));for(var i=new Uint8Array(t.length),s=0;s<t.length;s++)i[s]=t.charCodeAt(s);return i},xt=function(t,e,i){var s=void 0===i?{}:i,n=s.offset,r=void 0===n?0:n,o=s.mask,a=void 0===o?[]:o;return t=jt(t),(e=jt(e)).length&&t.length-r>=e.length&&(e.every?e.every:Array.prototype.every).call(e,(function(e,i){return e===(a[i]?a[i]&t[r+i]:t[r+i])}))},At={},Et={},It={};function Dt(){if(nt)return It;function t(t,e){return void 0===e&&(e=Object),e&&"function"==typeof e.freeze?e.freeze(t):t}nt=1;var e=t({HTML:"text/html",isHTML:function(t){return t===e.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),i=t({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(t){return t===i.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"}),s=/[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]/,n=new RegExp("[\\-\\.0-9"+s.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),r=new RegExp("^"+s.source+n.source+"*(?::"+s.source+n.source+"*)?$");return It.assign=function(t,e){if(null===t||"object"!=typeof t)throw new TypeError("target is not an object");for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},It.find=function(t,e,i){if(void 0===i&&(i=Array.prototype),t&&"function"==typeof i.find)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(void 0,n,s,t))return n}},It.freeze=t,It.MIME_TYPE=e,It.NAMESPACE=i,It.nameStartChar=s,It.nameChar=n,It.tagNamePattern=r,It}function Ct(){if(rt)return Et;rt=1;var t=Dt(),e=t.find,i=t.NAMESPACE,s=t.tagNamePattern;function n(t){return""!==t}function r(t,e){return t.hasOwnProperty(e)||(t[e]=!0),t}function o(t){if(!t)return[];var e=function(t){return t?t.split(/[\t\n\f\r ]+/).filter(n):[]}(t);return Object.keys(e.reduce(r,{}))}function a(t,e){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}function h(t,e){var i=t.prototype;if(!(i instanceof e)){function s(){}s.prototype=e.prototype,a(i,s=new s),t.prototype=i=s}i.constructor!=t&&("function"!=typeof t&&console.error("unknown Class:"+t),i.constructor=t)}var l={},u=l.ELEMENT_NODE=1,c=l.ATTRIBUTE_NODE=2,d=l.TEXT_NODE=3,f=l.CDATA_SECTION_NODE=4,p=l.ENTITY_REFERENCE_NODE=5,v=l.ENTITY_NODE=6,m=l.PROCESSING_INSTRUCTION_NODE=7,g=l.COMMENT_NODE=8,y=l.DOCUMENT_NODE=9,b=l.DOCUMENT_TYPE_NODE=10,j=l.DOCUMENT_FRAGMENT_NODE=11,w=l.NOTATION_NODE=12,T={},S={};T.INDEX_SIZE_ERR=(S[1]="Index size error",1),T.DOMSTRING_SIZE_ERR=(S[2]="DOMString size error",2);var k=T.HIERARCHY_REQUEST_ERR=(S[3]="Hierarchy request error",3);T.WRONG_DOCUMENT_ERR=(S[4]="Wrong document",4);var x=T.INVALID_CHARACTER_ERR=(S[5]="Invalid character",5);T.NO_DATA_ALLOWED_ERR=(S[6]="No data allowed",6),T.NO_MODIFICATION_ALLOWED_ERR=(S[7]="No modification allowed",7);var A=T.NOT_FOUND_ERR=(S[8]="Not found",8);T.NOT_SUPPORTED_ERR=(S[9]="Not supported",9);var E=T.INUSE_ATTRIBUTE_ERR=(S[10]="Attribute in use",10),I=T.INVALID_STATE_ERR=(S[11]="Invalid state",11);function D(t,e){if(e instanceof Error)var i=e;else i=this,Error.call(this,S[t]),this.message=S[t],Error.captureStackTrace&&Error.captureStackTrace(this,D);return i.code=t,e&&(this.message=this.message+": "+e),i}function C(){}function N(t,e){this._node=t,this._refresh=e,M(this)}function M(t){var e=t._node._inc||t._node.ownerDocument._inc;if(t._inc!==e){var i=t._refresh(t._node);if(wt(t,"length",i.length),!t.$$length||i.length<t.$$length)for(var s=i.length;s in t;s++)Object.prototype.hasOwnProperty.call(t,s)&&delete t[s];a(i,t),t._inc=e}}function O(){this._nameIndex=Object.create(null)}function R(t,e){for(var i=t.length;i--;)if(t[i]===e)return i}function P(t,e){t._nameIndex[e.nodeName]===e&&delete t._nameIndex[e.nodeName]}function _(t,e,s,n){if(n?(e[R(e,n)]=s,P(e,n)):e[e.length++]=s,function(t,e){t._nameIndex[e.nodeName]=e}(e,s),t){s.ownerElement=t;var r=t.ownerDocument;r&&(n&&z(r,t,n),function(t,e,s){t&&t._inc++,s.namespaceURI===i.XMLNS&&(e._nsMap[s.prefix?s.localName:""]=s.value)}(r,t,s))}}function L(t,e,i){var s=R(e,i);if(!(s>=0))throw new D(A,new Error(t.tagName+"@"+i));for(var n=e.length-1;s<n;)e[s]=e[++s];if(e.length=n,P(e,i),t){var r=t.ownerDocument;r&&(z(r,t,i),i.ownerElement=null)}}function F(){}function $(){}function B(t){return("<"==t?"<":">"==t&&">")||"&"==t&&"&"||'"'==t&&"""||"&#"+t.charCodeAt()+";"}function U(t,e){return q(t,null,{enter:function(t){return!e(t)||q.STOP}})===q.STOP}function q(t,e,i){for(var s=[{node:t,context:e,phase:q.ENTER}];s.length>0;){var n=s.pop();if(n.phase===q.ENTER){var r=i.enter(n.node,n.context);if(r===q.STOP)return q.STOP;if(s.push({node:n.node,context:r,phase:q.EXIT}),null==r)continue;for(var o=n.node.lastChild;o;)s.push({node:o,context:r,phase:q.ENTER}),o=o.previousSibling}else i.exit&&i.exit(n.node,n.context)}}function V(){this.ownerDocument=this}function z(t,e,s){t&&t._inc++,s.namespaceURI===i.XMLNS&&delete e._nsMap[s.prefix?s.localName:""]}function H(t,e,i){if(t&&t._inc){t._inc++;var s=e.childNodes;if(i)s[s.length++]=i;else{for(var n=e.firstChild,r=0;n;)s[r++]=n,n=n.nextSibling;s.length=r,delete s[s.length]}}}function X(t,e){var i=e.previousSibling,s=e.nextSibling;return i?i.nextSibling=s:t.firstChild=s,s?s.previousSibling=i:t.lastChild=i,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,H(t.ownerDocument,t),e}function G(t){return t&&t.nodeType===$.DOCUMENT_TYPE_NODE}function Y(t){return t&&t.nodeType===$.ELEMENT_NODE}function W(t){return t&&t.nodeType===$.TEXT_NODE}function J(t,i){var s=t.childNodes||[];if(e(s,Y)||G(i))return!1;var n=e(s,G);return!(i&&n&&s.indexOf(n)>s.indexOf(i))}function K(t,i){var s=t.childNodes||[];if(e(s,(function(t){return Y(t)&&t!==i})))return!1;var n=e(s,G);return!(i&&n&&s.indexOf(n)>s.indexOf(i))}function Q(t,i,s){var n=t.childNodes||[],r=i.childNodes||[];if(i.nodeType===$.DOCUMENT_FRAGMENT_NODE){var o=r.filter(Y);if(o.length>1||e(r,W))throw new D(k,"More than one element or text in fragment");if(1===o.length&&!J(t,s))throw new D(k,"Element in fragment can not be inserted before doctype")}if(Y(i)&&!J(t,s))throw new D(k,"Only one element can be added and only after doctype");if(G(i)){if(e(n,G))throw new D(k,"Only one doctype is allowed");var a=e(n,Y);if(s&&n.indexOf(a)<n.indexOf(s))throw new D(k,"Doctype can only be inserted before an element");if(!s&&a)throw new D(k,"Doctype can not be appended since element is present")}}function Z(t,i,s){var n=t.childNodes||[],r=i.childNodes||[];if(i.nodeType===$.DOCUMENT_FRAGMENT_NODE){var o=r.filter(Y);if(o.length>1||e(r,W))throw new D(k,"More than one element or text in fragment");if(1===o.length&&!K(t,s))throw new D(k,"Element in fragment can not be inserted before doctype")}if(Y(i)&&!K(t,s))throw new D(k,"Only one element can be added and only after doctype");if(G(i)){function h(t){return G(t)&&t!==s}if(e(n,h))throw new D(k,"Only one doctype is allowed");var a=e(n,Y);if(s&&n.indexOf(a)<n.indexOf(s))throw new D(k,"Doctype can only be inserted before an element")}}function tt(t,e,i,s){(function(t,e,i){if(!function(t){return t&&(t.nodeType===$.DOCUMENT_NODE||t.nodeType===$.DOCUMENT_FRAGMENT_NODE||t.nodeType===$.ELEMENT_NODE)}(t))throw new D(k,"Unexpected parent node type "+t.nodeType);if(i&&i.parentNode!==t)throw new D(A,"child not in parent");if(!function(t){return t&&(Y(t)||W(t)||G(t)||t.nodeType===$.DOCUMENT_FRAGMENT_NODE||t.nodeType===$.COMMENT_NODE||t.nodeType===$.PROCESSING_INSTRUCTION_NODE)}(e)||G(e)&&t.nodeType!==$.DOCUMENT_NODE)throw new D(k,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)})(t,e,i),t.nodeType===$.DOCUMENT_NODE&&(s||Q)(t,e,i);var n=e.parentNode;if(n&&n.removeChild(e),e.nodeType===j){var r=e.firstChild;if(null==r)return e;var o=e.lastChild}else r=o=e;var a=i?i.previousSibling:t.lastChild;r.previousSibling=a,o.nextSibling=i,a?a.nextSibling=r:t.firstChild=r,null==i?t.lastChild=o:i.previousSibling=o;do{r.parentNode=t,et(r,t.ownerDocument||t)}while(r!==o&&(r=r.nextSibling));return H(t.ownerDocument||t,t),e.nodeType==j&&(e.firstChild=e.lastChild=null),e}function et(t,e){if(t.ownerDocument!==e){if(t.ownerDocument=e,t.nodeType===u&&t.attributes)for(var i=0;i<t.attributes.length;i++){var s=t.attributes.item(i);s&&(s.ownerDocument=e)}for(var n=t.firstChild;n;)et(n,e),n=n.nextSibling}}function it(){this._nsMap={}}function st(){}function nt(){}function ot(){}function at(){}function ht(){}function lt(){}function ut(){}function ct(){}function dt(){}function ft(){}function pt(){}function vt(){}function mt(t,e,i){var s=!!i&&!!i.requireWellFormed,n=[],r=9==this.nodeType&&this.documentElement||this,o=r.prefix,a=r.namespaceURI;if(a&&null==o&&null==(o=r.lookupPrefix(a)))var h=[{namespace:a,prefix:null}];return bt(this,n,t,e,h,s),n.join("")}function gt(t,e,s){var n=t.prefix||"",r=t.namespaceURI;if(!r)return!1;if("xml"===n&&r===i.XML||r===i.XMLNS)return!1;for(var o=s.length;o--;){var a=s[o];if(a.prefix===n)return a.namespace!==r}return!0}function yt(t,e,i,n){if(n&&!s.test(e))throw new D(I,'The attribute name "'+e+'" is not a valid XML QName');t.push(" ",e,'="',i.replace(/[<>&"\t\n\r]/g,B),'"')}function bt(t,e,n,r,o,a){o||(o=[]),q(t,{ns:o,isHTML:n},{enter:function(t,n){var o=n.ns,h=n.isHTML;if(r){if(!(t=r(t)))return null;if("string"==typeof t)return e.push(t),null}switch(t.nodeType){case u:var l=t.attributes,v=l.length,w=t.tagName,T=w;if(!(h=i.isHTML(t.namespaceURI)||h)&&!t.prefix&&t.namespaceURI){for(var S,k=0;k<l.length;k++)if("xmlns"===l.item(k).name){S=l.item(k).value;break}if(!S)for(var x=o.length-1;x>=0;x--)if(""===(A=o[x]).prefix&&A.namespace===t.namespaceURI){S=A.namespace;break}if(S!==t.namespaceURI)for(x=o.length-1;x>=0;x--){var A;if((A=o[x]).namespace===t.namespaceURI){A.prefix&&(T=A.prefix+":"+w);break}}}if(a&&!s.test(T))throw new D(I,'The element name "'+T+'" is not a valid XML QName');e.push("<",T);for(var E=o.slice(),C=0;C<v;C++)"xmlns"==(N=l.item(C)).prefix?E.push({prefix:N.localName,namespace:N.value}):"xmlns"==N.nodeName&&E.push({prefix:"",namespace:N.value});for(C=0;C<v;C++){var N;if(gt(N=l.item(C),0,E)){var M=N.prefix||"";yt(e,M?"xmlns:"+M:"xmlns",R=N.namespaceURI,a),E.push({prefix:M,namespace:R})}var O=r?r(N):N;O&&("string"==typeof O?e.push(O):yt(e,O.name,O.value,a))}if(w===T&>(t,0,E)){var R,P=t.prefix||"";yt(e,P?"xmlns:"+P:"xmlns",R=t.namespaceURI,a),E.push({prefix:P,namespace:R})}var _=t.firstChild;if(_||h&&!/^(?:meta|link|img|br|hr|input)$/i.test(w)){if(e.push(">"),h&&/^script$/i.test(w)){for(;_;)_.data?e.push(_.data):bt(_,e,h,r,E.slice(),a),_=_.nextSibling;return e.push("</",w,">"),null}return{ns:E,isHTML:h,tag:T}}return e.push("/>"),null;case y:case j:return{ns:o.slice(),isHTML:h,tag:null};case c:return yt(e,t.name,t.value,a),null;case d:return e.push(t.data.replace(/[<&>]/g,B)),null;case f:if(a&&-1!==t.data.indexOf("]]>"))throw new D(I,'The CDATASection data contains "]]>"');return e.push("<![CDATA[",t.data.replace(/]]>/g,"]]]]><![CDATA[>"),"]]>"),null;case g:if(a&&-1!==t.data.indexOf("--\x3e"))throw new D(I,'The comment node data contains "--\x3e"');return e.push("\x3c!--",t.data,"--\x3e"),null;case b:if(a){if(!s.test(t.name))throw new D(I,'The doctype name "'+t.name+'" is not a valid XML Name');if(t.publicId&&!/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(t.publicId))throw new D(I,"DocumentType publicId is not a valid PubidLiteral");if(t.systemId&&!/^("[^"]*"|'[^']*')$/.test(t.systemId))throw new D(I,"DocumentType systemId is not a valid SystemLiteral");if(t.internalSubset&&-1!==t.internalSubset.indexOf("]>"))throw new D(I,'DocumentType internalSubset contains "]>"')}var L=t.publicId,F=t.systemId;if(e.push("<!DOCTYPE ",t.name),L)e.push(" PUBLIC ",L),F&&"."!=F&&e.push(" ",F),e.push(">");else if(F&&"."!=F)e.push(" SYSTEM ",F,">");else{var $=t.internalSubset;$&&e.push(" [",$,"]"),e.push(">")}return null;case m:if(a){if(!s.test(t.target)||-1!==t.target.indexOf(":")||"xml"===t.target.toLowerCase())throw new D(I,'The processing instruction target "'+t.target+'" is not a valid XML NCName or is reserved');if(-1!==t.data.indexOf("?>"))throw new D(I,'The ProcessingInstruction data contains "?>"')}return e.push("<?",t.target," ",t.data,"?>"),null;case p:if(a&&!s.test(t.nodeName))throw new D(I,'The entity reference name "'+t.nodeName+'" is not a valid XML Name');return e.push("&",t.nodeName,";"),null;default:return e.push("??",t.nodeName),null}},exit:function(t,i){i&&i.tag&&e.push("</",i.tag,">")}})}function jt(t,e,i){var s;return q(e,null,{enter:function(e,n){var r=new e.constructor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var a=e[o];"object"!=typeof a&&a!=r[o]&&(r[o]=a)}e.childNodes&&(r.childNodes=new C),r.ownerDocument=t;var h=i;switch(r.nodeType){case u:var l=e.attributes,d=r.attributes=new O,f=l.length;d._ownerElement=r;for(var p=0;p<f;p++)r.setAttributeNode(jt(t,l.item(p),!0));break;case c:h=!0}return null!==n?n.appendChild(r):s=r,h?r:null}}),s}function wt(t,e,i){t[e]=i}T.SYNTAX_ERR=(S[12]="Syntax error",12),T.INVALID_MODIFICATION_ERR=(S[13]="Invalid modification",13),T.NAMESPACE_ERR=(S[14]="Invalid namespace",14),T.INVALID_ACCESS_ERR=(S[15]="Invalid access",15),D.prototype=Error.prototype,a(T,D),C.prototype={length:0,item:function(t){return t>=0&&t<this.length?this[t]:null},toString:function(t,e,i){for(var s=!!i&&!!i.requireWellFormed,n=[],r=0;r<this.length;r++)bt(this[r],n,t,e,null,s);return n.join("")},filter:function(t){return Array.prototype.filter.call(this,t)},indexOf:function(t){return Array.prototype.indexOf.call(this,t)}},N.prototype.item=function(t){return M(this),this[t]||null},h(N,C),O.prototype={length:0,item:C.prototype.item,getNamedItem:function(t){for(var e=this.length;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 D(E);var i=this._nameIndex[t.nodeName];return _(this._ownerElement,this,t,i),i},setNamedItemNS:function(t){var e,i=t.ownerElement;if(i&&i!=this._ownerElement)throw new D(E);return e=this.getNamedItemNS(t.namespaceURI,t.localName),_(this._ownerElement,this,t,e),e},removeNamedItem:function(t){var e=this.getNamedItem(t);return L(this._ownerElement,this,e),e},removeNamedItemNS:function(t,e){var i=this.getNamedItemNS(t,e);return L(this._ownerElement,this,i),i},getNamedItemNS:function(t,e){for(var i=this.length;i--;){var s=this[i];if(s.localName==e&&s.namespaceURI==t)return s}return null}},F.prototype={hasFeature:function(){return!0},createDocument:function(t,e,i){var s=new V;if(s.implementation=this,s.childNodes=new C,s.doctype=i||null,i&&s.appendChild(i),e){var n=s.createElementNS(t,e);s.appendChild(n)}return s},createDocumentType:function(t,e,i){var s=new lt;return s.name=t,s.nodeName=t,s.publicId=e||"",s.systemId=i||"",s}},$.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 tt(this,t,e)},replaceChild:function(t,e){tt(this,t,e,Z),e&&this.removeChild(e)},removeChild:function(t){return X(this,t)},appendChild:function(t){return this.insertBefore(t,null)},hasChildNodes:function(){return null!=this.firstChild},cloneNode:function(t){return jt(this.ownerDocument||this,this,t)},normalize:function(){q(this,null,{enter:function(t){for(var e=t.firstChild;e;){var i=e.nextSibling;if(null!==i&&i.nodeType===d&&e.nodeType===d){for(var s=[],n=i;null!==n&&n.nodeType===d;)s.push(n.data),n=n.nextSibling;for(var r=e.nextSibling;r!==n;){var o=r.nextSibling;r.parentNode=null,r.previousSibling=null,r.nextSibling=null,r=o}e.nextSibling=n,null!==n?n.previousSibling=e:t.lastChild=e,e.appendData(s.join("")),H(t.ownerDocument,t),e=n}else e=i}return!0}})},isSupported:function(t,e){return this.ownerDocument.implementation.hasFeature(t,e)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(t){for(var e=this;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==c?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var i=e._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,t))return i[t];e=e.nodeType==c?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){return null==this.lookupPrefix(t)}},a(l,$),a(l,$.prototype),q.STOP=Symbol("walkDOM.STOP"),q.ENTER=0,q.EXIT=1,V.prototype={nodeName:"#document",nodeType:y,doctype:null,documentElement:null,_inc:1,insertBefore:function(t,e){if(t.nodeType==j){for(var i=t.firstChild;i;){var s=i.nextSibling;this.insertBefore(i,e),i=s}return t}return tt(this,t,e),et(t,this),null===this.documentElement&&t.nodeType===u&&(this.documentElement=t),t},removeChild:function(t){return this.documentElement==t&&(this.documentElement=null),X(this,t)},replaceChild:function(t,e){tt(this,t,e,Z),et(t,this),e&&this.removeChild(e),Y(t)&&(this.documentElement=t)},importNode:function(t,e){return function(t,e,i){var s;return q(e,null,{enter:function(e,n){var r=e.cloneNode(!1);return r.ownerDocument=t,r.parentNode=null,null===n?s=r:n.appendChild(r),e.nodeType===c||i?r:null}}),s}(this,t,e)},getElementById:function(t){var e=null;return U(this.documentElement,(function(i){if(i.nodeType==u&&i.getAttribute("id")==t)return e=i,!0})),e},getElementsByClassName:function(t){var e=o(t);return new N(this,(function(i){var s=[];return e.length>0&&U(i.documentElement,(function(n){if(n!==i&&n.nodeType===u){var r=n.getAttribute("class");if(r){var a=t===r;if(!a){var h=o(r);a=e.every((l=h,function(t){return l&&-1!==l.indexOf(t)}))}a&&s.push(n)}}var l})),s}))},createElement:function(t){var e=new it;return e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new C,(e.attributes=new O)._ownerElement=e,e},createDocumentFragment:function(){var t=new ft;return t.ownerDocument=this,t.childNodes=new C,t},createTextNode:function(t){var e=new ot;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new at;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){if(-1!==t.indexOf("]]>"))throw new D(x,'data contains "]]>"');var e=new ht;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var i=new pt;return i.ownerDocument=this,i.tagName=i.nodeName=i.target=t,i.nodeValue=i.data=e,i},createAttribute:function(t){var e=new st;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){if(!s.test(t))throw new D(x,'not a valid xml name "'+t+'"');var e=new dt;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var i=new it,s=e.split(":"),n=i.attributes=new O;return i.childNodes=new C,i.ownerDocument=this,i.nodeName=e,i.tagName=e,i.namespaceURI=t,2==s.length?(i.prefix=s[0],i.localName=s[1]):i.localName=e,n._ownerElement=i,i},createAttributeNS:function(t,e){var i=new st,s=e.split(":");return i.ownerDocument=this,i.nodeName=e,i.name=e,i.namespaceURI=t,i.specified=!0,2==s.length?(i.prefix=s[0],i.localName=s[1]):i.localName=e,i}},h(V,$),V.prototype.getElementsByTagName=(it.prototype={nodeType:u,hasAttribute:function(t){return null!=this.getAttributeNode(t)},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){return t.nodeType===j?this.insertBefore(t,null):function(t,e){return e.parentNode&&e.parentNode.removeChild(e),e.parentNode=t,e.previousSibling=t.lastChild,e.nextSibling=null,e.previousSibling?e.previousSibling.nextSibling=e:t.firstChild=e,t.lastChild=e,H(t.ownerDocument,t,e),et(e,t.ownerDocument||t),e}(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 null!=this.getAttributeNodeNS(t,e)},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 N(this,(function(e){var i=[];return U(e,(function(s){s===e||s.nodeType!=u||"*"!==t&&s.tagName!=t||i.push(s)})),i}))},getElementsByTagNameNS:function(t,e){return new N(this,(function(i){var s=[];return U(i,(function(n){n===i||n.nodeType!==u||"*"!==t&&n.namespaceURI!==t||"*"!==e&&n.localName!=e||s.push(n)})),s}))}}).getElementsByTagName,V.prototype.getElementsByTagNameNS=it.prototype.getElementsByTagNameNS,h(it,$),st.prototype.nodeType=c,h(st,$),nt.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){this.nodeValue=this.data=t=this.data+t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(){throw new Error(S[k])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,i){var s=this.data.substring(0,t),n=this.data.substring(t+e);this.nodeValue=this.data=i=s+i+n,this.length=i.length}},h(nt,$),ot.prototype={nodeName:"#text",nodeType:d,splitText:function(t){var e=this.data,i=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var s=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}},h(ot,nt),at.prototype={nodeName:"#comment",nodeType:g},h(at,nt),ht.prototype={nodeName:"#cdata-section",nodeType:f},h(ht,nt),lt.prototype.nodeType=b,h(lt,$),ut.prototype.nodeType=w,h(ut,$),ct.prototype.nodeType=v,h(ct,$),dt.prototype.nodeType=p,h(dt,$),ft.prototype.nodeName="#document-fragment",ft.prototype.nodeType=j,h(ft,$),pt.prototype.nodeType=m,h(pt,$),vt.prototype.serializeToString=function(t,e,i,s){return mt.call(t,e,i,s)},$.prototype.toString=mt;try{Object.defineProperty&&(Object.defineProperty(N.prototype,"length",{get:function(){return M(this),this.$$length}}),Object.defineProperty($.prototype,"textContent",{get:function(){if(this.nodeType===u||this.nodeType===j){var t=[];return q(this,null,{enter:function(e){return e.nodeType===u||e.nodeType===j||(e.nodeType===m||e.nodeType===g?null:void t.push(e.nodeValue))}}),t.join("")}return this.nodeValue},set:function(t){switch(this.nodeType){case u:case j:for(;this.firstChild;)this.removeChild(this.firstChild);(t||String(t))&&this.appendChild(this.ownerDocument.createTextNode(t));break;default:this.data=t,this.value=t,this.nodeValue=t}}}),wt=function(t,e,i){t["$$"+e]=i})}catch(t){}return Et.DocumentType=lt,Et.DOMException=D,Et.DOMImplementation=F,Et.Element=it,Et.Node=$,Et.NodeList=C,Et.walkDOM=q,Et.XMLSerializer=vt,Et}var Nt,Mt={},Ot={};function Rt(){return Nt||(Nt=1,t=Ot,e=Dt().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),Ot;var t,e}var Pt,_t,Lt,Ft={};function $t(){if(Pt)return Ft;Pt=1;var t=Dt().NAMESPACE,e=Dt().tagNamePattern;function i(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,i)}function s(){}function n(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function r(e,i,s,n,r,o){function a(t,e,i){s.attributeNames.hasOwnProperty(t)&&o.fatalError("Attribute "+t+" redefined"),s.addValue(t,e.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),i)}for(var h,l=++i,u=0;;){var c=e.charAt(l);if(0===u&&"<"===c)throw new Error("unexpected < in tag name: "+e.slice(i,l));switch(c){case"=":if(1===u)h=e.slice(i,l),u=3;else{if(2!==u)throw new Error("attribute equal must after attrName");u=3}break;case"'":case'"':if(3===u||1===u){if(1===u&&(o.warning('attribute value must after "="'),h=e.slice(i,l)),!((l=e.indexOf(c,i=l+1))>0))throw new Error("attribute value no end '"+c+"' match");a(h,d=e.slice(i,l),i-1),u=5}else{if(4!=u)throw new Error('attribute value must after "="');a(h,d=e.slice(i,l),i),o.warning('attribute "'+h+'" missed start quot('+c+")!!"),i=l+1,u=5}break;case"/":switch(u){case 0:s.setTagName(e.slice(i,l));case 5:case 6:case 7:u=7,s.closed=!0;case 4:case 1:break;case 2:s.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),0==u&&s.setTagName(e.slice(i,l)),l;case">":switch(u){case 0:s.setTagName(e.slice(i,l));case 5:case 6:case 7:break;case 4:case 1:"/"===(d=e.slice(i,l)).slice(-1)&&(s.closed=!0,d=d.slice(0,-1));case 2:2===u&&(d=h),4==u?(o.warning('attribute "'+d+'" missed quot(")!'),a(h,d,i)):(t.isHTML(n[""])&&d.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),a(d,d,i));break;case 3:throw new Error("attribute value missed!!")}return l;case"":c=" ";default:if(c<=" ")switch(u){case 0:s.setTagName(e.slice(i,l)),u=6;break;case 1:h=e.slice(i,l),u=2;break;case 4:var d=e.slice(i,l);o.warning('attribute "'+d+'" missed quot(")!!'),a(h,d,i);case 5:u=6}else switch(u){case 2:t.isHTML(n[""])&&h.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+h+'" missed value!! "'+h+'" instead2!!'),a(h,h,i),i=l,u=1;break;case 5:o.warning('attribute space is required"'+h+'"!!');case 6:u=1,i=l;break;case 3:u=4,i=l;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}l++}}function o(e,i,s){for(var n=e.tagName,r=null,o=e.length;o--;){var a=e[o],h=a.qName,l=a.value;if((f=h.indexOf(":"))>0)var u=a.prefix=h.slice(0,f),c=h.slice(f+1),d="xmlns"===u&&c;else c=h,u=null,d="xmlns"===h&&"";a.localName=c,!1!==d&&(null==r&&(r={},s=Object.create(s)),s[d]=r[d]=l,a.uri=t.XMLNS,i.startPrefixMapping(d,l))}for(o=e.length;o--;)(u=(a=e[o]).prefix)&&("xml"===u&&(a.uri=t.XML),"xmlns"!==u&&(a.uri=s[u||""]));var f;(f=n.indexOf(":"))>0?(u=e.prefix=n.slice(0,f),c=e.localName=n.slice(f+1)):(u=null,c=e.localName=n);var p=e.uri=s[u||""];if(i.startElement(p,c,n,e),!e.closed)return e.currentNSMap=s,e.localNSMap=r,!0;if(i.endElement(p,c,n),r)for(u in r)Object.prototype.hasOwnProperty.call(r,u)&&i.endPrefixMapping(u)}function a(t,e,i,s,n){if(/^(?:script|textarea)$/i.test(i)){var r=t.indexOf("</"+i+">",e),o=t.substring(e+1,r);if(/[&<]/.test(o))return/^script$/i.test(i)?(n.characters(o,0,o.length),r):(o=o.replace(/&#?\w+;/g,s),n.characters(o,0,o.length),r)}return e+1}function h(t,e,i,s){var n=s[i];return null==n&&((n=t.lastIndexOf("</"+i+">"))<e&&(n=t.lastIndexOf("</"+i)),s[i]=n),n<e}function l(t,e,i,s){if("-"===t.charAt(e+2))return"-"===t.charAt(e+3)?(n=t.indexOf("--\x3e",e+4))>e?(i.comment(t,e+4,n-e-4),n+3):(s.error("Unclosed comment"),-1):-1;if("CDATA["==t.substr(e+3,6)){var n=t.indexOf("]]>",e+9);return i.startCDATA(),i.characters(t,e+9,n-e-9),i.endCDATA(),n+3}var r=function(t,e){var i,s=[],n=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(n.lastIndex=e,n.exec(t);i=n.exec(t);)if(s.push(i),i[1])return s}(t,e),o=r.length;if(o>1&&/!doctype/i.test(r[0][0])){var a=r[1][0],h=!1,l=!1;o>3&&(/^public$/i.test(r[2][0])?(h=r[3][0],l=o>4&&r[4][0]):/^system$/i.test(r[2][0])&&(l=r[3][0]));var u=r[o-1];return i.startDTD(a,h,l),i.endDTD(),u.index+u[0].length}return-1}function u(t,e,i){var s=t.indexOf("?>",e);if(s){var n=t.substring(e,s).match(/^<\?(\S*)\s*([\s\S]*?)$/);return n?(i.processingInstruction(n[1],n[2]),s+2):-1}return-1}function c(){this.attributeNames={}}return(i.prototype=new Error).name=i.name,s.prototype={parse:function(s,d,f){var p=this.domBuilder;p.startDocument(),function(t,e){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}(d,d={}),function(s,d,f,p,v){function m(t){var e,i=t.slice(1,-1);return Object.hasOwnProperty.call(f,i)?f[i]:"#"===i.charAt(0)?(e=parseInt(i.substr(1).replace("x","0x")))>65535?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):String.fromCharCode(e):(v.error("entity not found:"+t),t)}function g(t){if(t>x){var e=s.substring(x,t).replace(/&#?\w+;/g,m);T&&y(x),p.characters(e,0,t-x),x=t}}function y(t,e){for(;t>=j&&(e=w.exec(s));)j=(b=e.index)+e[0].length,T.lineNumber++;T.columnNumber=t-b+1}for(var b=0,j=0,w=/.*(?:\r\n?|\n)|.*$/g,T=p.locator,S=[{currentNSMap:d}],k={},x=0;;){try{var A=s.indexOf("<",x);if(A<0){if(!s.substr(x).match(/^\s*$/)){var E=p.doc,I=E.createTextNode(s.substr(x));E.appendChild(I),p.currentElement=I}return}switch(A>x&&g(A),s.charAt(A+1)){case"/":var D=s.indexOf(">",A+3),C=s.substring(A+2,D).replace(/^([\s\S]*?[^ \t\n\r])?[ \t\n\r]*$/,"$1"),N=S.pop();D<0?(C=s.substring(A+2).replace(/[\s<].*/,""),v.error("end tag name: "+C+" is not complete:"+N.tagName),D=A+1+C.length):C.match(/\s</)?(C=C.replace(/[\s<].*/,""),v.error("end tag name: "+C+" maybe not complete"),D=A+1+C.length):/[ \t\n\r]/.test(C)&&e.test(C.split(/[ \t\n\r]/)[0])&&v.error('end tag name is followed by whitespace and trailing content: "'+C+'"');var M=N.localNSMap,O=N.tagName==C;if(O||N.tagName&&N.tagName.toLowerCase()==C.toLowerCase()){if(p.endElement(N.uri,N.localName,C),M)for(var R in M)Object.prototype.hasOwnProperty.call(M,R)&&p.endPrefixMapping(R);O||v.fatalError("end tag name: "+C+" is not match the current start tagName:"+N.tagName)}else S.push(N);D++;break;case"?":T&&y(A),D=u(s,A,p);break;case"!":T&&y(A),D=l(s,A,p,v);break;default:T&&y(A);var P=new c,_=S[S.length-1].currentNSMap,L=(D=r(s,A,P,_,m,v),P.length);if(!P.closed&&h(s,D,P.tagName,k)&&(P.closed=!0,f.nbsp||v.warning("unclosed xml attribute")),T&&L){for(var F=n(T,{}),$=0;$<L;$++){var B=P[$];y(B.offset),B.locator=n(T,{})}p.locator=F,o(P,p,_)&&S.push(P),p.locator=T}else o(P,p,_)&&S.push(P);t.isHTML(P.uri)&&!P.closed?D=a(s,D,P.tagName,m,p):D++}}catch(t){if(t instanceof i)throw t;v.error("element parse error: "+t),D=-1}D>x?x=D:g(Math.max(A,x)+1)}}(s,d,f,p,this.errorHandler),p.endDocument()}},c.prototype={setTagName:function(t){if(!e.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,i,s){if(!e.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:i,offset:s}},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}},Ft.XMLReader=s,Ft.ParseError=i,Ft}var Bt=function(){if(Lt)return At;Lt=1;var t=Ct();return At.DOMImplementation=t.DOMImplementation,At.XMLSerializer=t.XMLSerializer,At.DOMParser=function(){if(_t)return Mt;_t=1;var t=Dt(),e=Ct(),i=Rt(),s=$t(),n=e.DOMImplementation,r=t.NAMESPACE,o=s.ParseError,a=s.XMLReader;function h(t){return t.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function l(t){this.options=t||{locator:{}}}function u(){this.cdata=!1}function c(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}function d(t){if(t)return"\n@"+(t.systemId||"")+"#[line:"+t.lineNumber+",col:"+t.columnNumber+"]"}function f(t,e,i){return"string"==typeof t?t.substr(e,i):t.length>=e+i||e?new java.lang.String(t,e,i)+"":t}function p(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}return l.prototype.parseFromString=function(t,e){var s=this.options,n=new a,o=s.domBuilder||new u,l=s.errorHandler,c=s.locator,f=s.xmlns||{},p=/\/x?html?$/.test(e),v=p?i.HTML_ENTITIES:i.XML_ENTITIES;return c&&o.setDocumentLocator(c),n.errorHandler=function(t,e,i){if(!t){if(e instanceof u)return e;t=e}var s={},n=t instanceof Function;function r(e){var r=t[e];!r&&n&&(r=2==t.length?function(i){t(e,i)}:t),s[e]=r&&function(t){r("[xmldom "+e+"]\t"+t+d(i))}||function(){}}return i=i||{},r("warning"),r("error"),r("fatalError"),s}(l,o,c),n.domBuilder=s.domBuilder||o,p&&(f[""]=r.HTML),f.xml=f.xml||r.XML,t&&"string"==typeof t?n.parse((s.normalizeLineEndings||h)(t),f,v):n.errorHandler.error("invalid doc source"),o.doc},u.prototype={startDocument:function(){this.doc=(new n).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,i,s){var n=this.doc,r=n.createElementNS(t,i||e),o=s.length;p(this,r),this.currentElement=r,this.locator&&c(this.locator,r);for(var a=0;a<o;a++){t=s.getURI(a);var h=s.getValue(a),l=(i=s.getQName(a),n.createAttributeNS(t,i));this.locator&&c(s.getLocator(a),l),l.value=l.nodeValue=h,r.setAttributeNode(l)}},endElement:function(){this.currentElement=this.currentElement.parentNode},startPrefixMapping:function(){},endPrefixMapping:function(){},processingInstruction:function(t,e){var i=this.doc.createProcessingInstruction(t,e);this.locator&&c(this.locator,i),p(this,i)},ignorableWhitespace:function(){},characters:function(t,e,i){if(t=f.apply(this,arguments)){if(this.cdata)var s=this.doc.createCDATASection(t);else s=this.doc.createTextNode(t);this.currentElement?this.currentElement.appendChild(s):/^\s*$/.test(t)&&this.doc.appendChild(s),this.locator&&c(this.locator,s)}},skippedEntity:function(){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(t){(this.locator=t)&&(t.lineNumber=0)},comment:function(t,e,i){t=f.apply(this,arguments);var s=this.doc.createComment(t);this.locator&&c(this.locator,s),p(this,s)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(t,e,i){var s=this.doc.implementation;if(s&&s.createDocumentType){var n=s.createDocumentType(t,e,i);this.locator&&c(this.locator,n),p(this,n),this.doc.doctype=n}},warning:function(t){console.warn("[xmldom warning]\t"+t,d(this.locator))},error:function(t){console.error("[xmldom error]\t"+t,d(this.locator))},fatalError:function(t){throw new o(t,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,(function(t){u.prototype[t]=function(){return null}})),Mt.__DOMHandler=u,Mt.normalizeLineEndings=h,Mt.DOMParser=l,Mt}().DOMParser,At}();
|
|
11
|
+
/*! @name mpd-parser @version 1.4.1 @license Apache-2.0 */const Ut=t=>!!t&&"object"==typeof t,qt=(...t)=>t.reduce(((t,e)=>("object"!=typeof e||Object.keys(e).forEach((i=>{t[i]=Array.isArray(t[i])&&Array.isArray(e[i])?t[i].concat(e[i]):Ut(t[i])&&Ut(e[i])?qt(t[i],e[i]):e[i]})),t)),{}),Vt=t=>Object.keys(t).map((e=>t[e])),zt=t=>t.reduce(((t,e)=>t.concat(e)),[]),Ht=t=>{if(!t.length)return[];const e=[];for(let i=0;i<t.length;i++)e.push(t[i]);return e};const Xt=({baseUrl:t="",source:e="",range:i="",indexRange:s=""})=>{const n={uri:e,resolvedUri:X(t||"",e)};if(i||s){const t=(i||s).split("-");let e,r=p.BigInt?p.BigInt(t[0]):parseInt(t[0],10),o=p.BigInt?p.BigInt(t[1]):parseInt(t[1],10);r<Number.MAX_SAFE_INTEGER&&"bigint"==typeof r&&(r=Number(r)),o<Number.MAX_SAFE_INTEGER&&"bigint"==typeof o&&(o=Number(o)),e="bigint"==typeof o||"bigint"==typeof r?p.BigInt(o)-p.BigInt(r)+p.BigInt(1):o-r+1,"bigint"==typeof e&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),n.byterange={length:e,offset:r}}return n},Gt=t=>(t&&"number"!=typeof t&&(t=parseInt(t,10)),isNaN(t)?null:t),Yt={static(t){const{duration:e,timescale:i=1,sourceDuration:s,periodDuration:n}=t,r=Gt(t.endNumber),o=e/i;return"number"==typeof r?{start:0,end:r}:"number"==typeof n?{start:0,end:n/o}:{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=1/0}=t,l=Gt(t.endNumber),u=(e+i)/1e3,c=s+o,d=Math.ceil((u+a-c)*n/r),f=Math.floor((u-c-h)*n/r),p=Math.floor((u-c)*n/r);return{start:Math.max(0,f),end:"number"==typeof l?l:Math.min(d,p)}}},Wt=t=>{const{type:e,duration:i,timescale:s=1,periodDuration:n,sourceDuration:r}=t,{start:o,end:a}=Yt[e](t),h=((t,e)=>{const i=[];for(let s=t;s<e;s++)i.push(s);return i})(o,a).map((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}})(t));if("static"===e){const t=h.length-1;h[t].duration=("number"==typeof n?n:r)-i/s*t}return h},Jt=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("NO_BASE_URL");const l=Xt({baseUrl:e,source:i.sourceURL,range:i.range}),u=Xt({baseUrl:e,source:e,indexRange:n});if(u.map=l,h){const e=Wt(t);e.length&&(u.duration=e[0].duration,u.timeline=e[0].timeline)}else s&&(u.duration=s,u.timeline=r);return u.presentationTime=o||r,u.number=a,[u]},Kt=(t,e,i)=>{const s=t.sidx.map?t.sidx.map:null,n=t.sidx.duration,r=t.timeline||0,o=t.sidx.byterange,a=o.offset+o.length,h=e.timescale,l=e.references.filter((t=>1!==t.referenceType)),u=[],c=t.endList?"static":"dynamic",d=t.sidx.timeline;let f,v=d,m=t.mediaSequence||0;f="bigint"==typeof e.firstOffset?p.BigInt(a)+e.firstOffset:a+e.firstOffset;for(let t=0;t<l.length;t++){const o=e.references[t],a=o.referencedSize,l=o.subsegmentDuration;let g;g="bigint"==typeof f?f+p.BigInt(a)-p.BigInt(1):f+a-1;const y=Jt({baseUrl:i,timescale:h,timeline:r,periodStart:d,presentationTime:v,number:m,duration:l,sourceDuration:n,indexRange:`${f}-${g}`,type:c})[0];s&&(y.map=s),u.push(y),f+="bigint"==typeof f?p.BigInt(a):a,v+=l/h,m++}return t.segments=u,t},Qt=["AUDIO","SUBTITLES"],Zt=1/60,te=t=>{return(e=t,i=({timeline:t})=>t,Vt(e.reduce(((t,e)=>(e.forEach((e=>{t[i(e)]=e})),t)),{}))).sort(((t,e)=>t.timeline>e.timeline?1:-1));var e,i},ee=t=>{let e=[];var i,s;return i=t,s=t=>{e=e.concat(t.playlists||[])},Qt.forEach((function(t){for(var e in i.mediaGroups[t])for(var n in i.mediaGroups[t][e])s(i.mediaGroups[t][e][n])})),e},ie=({playlist:t,mediaSequence:e})=>{t.mediaSequence=e,t.segments.forEach(((e,i)=>{e.number=t.mediaSequence+i}))},se=t=>t&&t.uri+"-"+(t=>{let e;return e="bigint"==typeof t.offset||"bigint"==typeof t.length?p.BigInt(t.offset)+p.BigInt(t.length)-p.BigInt(1):t.offset+t.length-1,`${t.offset}-${e}`})(t.byterange),ne=t=>{const e=t.reduce((function(t,e){return t[e.attributes.baseUrl]||(t[e.attributes.baseUrl]=[]),t[e.attributes.baseUrl].push(e),t}),{});let i=[];return Object.values(e).forEach((t=>{const e=Vt(t.reduce(((t,e)=>{const i=e.attributes.id+(e.attributes.lang||"");return t[i]?(e.segments&&(e.segments[0]&&(e.segments[0].discontinuity=!0),t[i].segments.push(...e.segments)),e.attributes.contentProtection&&(t[i].attributes.contentProtection=e.attributes.contentProtection)):(t[i]=e,t[i].attributes.timelineStarts=[]),t[i].attributes.timelineStarts.push({start:e.attributes.periodStart,timeline:e.attributes.periodStart}),t}),{}));i=i.concat(e)})),i.map((t=>(t.discontinuityStarts=(t.segments||[]).reduce(((t,e,i)=>(e.discontinuity&&t.push(i),t)),[]),t)))},re=(t,e)=>{const i=se(t.sidx),s=i&&e[i]&&e[i].sidx;return s&&Kt(t,s,t.sidx.resolvedUri),t},oe=(t,e={})=>{if(!Object.keys(e).length)return t;for(const i in t)t[i]=re(t[i],e);return t},ae=({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:"static"===t.type,timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,discontinuityStarts:s,timelineStarts:t.timelineStarts,segments:e};return t.frameRate&&(n.attributes["FRAME-RATE"]=t.frameRate),void 0!==t.qualityRanking&&(n.attributes.SCORE=1/(t.qualityRanking+1)),t.contentProtection&&(n.contentProtection=t.contentProtection),t.serviceLocation&&(n.attributes.serviceLocation=t.serviceLocation),i&&(n.sidx=i),n},he=({attributes:t})=>"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType,le=({attributes:t})=>"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType,ue=({attributes:t})=>"text/vtt"===t.mimeType||"text"===t.contentType,ce=t=>t?Object.keys(t).reduce(((e,i)=>e.concat(t[i].playlists)),[]):[],de=({dashPlaylists:t,locations:e,contentSteering:i,sidxMapping:s={},previousManifest:n,eventStream:r})=>{if(!t.length)return{};const{sourceDuration:o,type:a,suggestedPresentationDelay:h,minimumUpdatePeriod:l}=t[0].attributes,u=ne(t.filter(he)).map(ae),c=ne(t.filter(le)),d=ne(t.filter(ue)),f=t.map((t=>t.attributes.captionServices)).filter(Boolean),p={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:o,playlists:oe(u,s)};l>=0&&(p.minimumUpdatePeriod=1e3*l),e&&(p.locations=e),i&&(p.contentSteering=i),"dynamic"===a&&(p.suggestedPresentationDelay=h),r&&r.length>0&&(p.eventStream=r);const v=c.length?((t,e={},i=!1)=>{let s;const n=t.reduce(((t,n)=>{const r=n.attributes.role&&n.attributes.role.value||"",o=n.attributes.lang||"";let a=n.attributes.label||"main";o&&!n.attributes.label&&(a=`${n.attributes.lang}${r?` (${r})`:""}`),t[a]||(t[a]={language:o,autoselect:!0,default:"main"===r,playlists:[],uri:""});const h=re((({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:"static"===t.type,timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,discontinuitySequence:n,discontinuityStarts:r,timelineStarts:t.timelineStarts,mediaSequence:s,segments:e};return t.contentProtection&&(a.contentProtection=t.contentProtection),t.serviceLocation&&(a.attributes.serviceLocation=t.serviceLocation),i&&(a.sidx=i),o&&(a.attributes.AUDIO="audio",a.attributes.SUBTITLES="subs"),a})(n,i),e);return t[a].playlists.push(h),void 0===s&&"main"===r&&(s=n,s.default=!0),t}),{});return s||(n[Object.keys(n)[0]].default=!0),n})(c,s,0===p.playlists.length):null,m=d.length?((t,e={})=>t.reduce(((t,i)=>{const s=i.attributes.label||i.attributes.lang||"text";return t[s]||(t[s]={language:i.attributes.lang||"und",default:!1,autoselect:!1,playlists:[],uri:""}),t[s].playlists.push(re((({attributes:t,segments:e,mediaSequence:i,discontinuityStarts:s,discontinuitySequence:n})=>{void 0===e&&(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};t.codecs&&(r.CODECS=t.codecs);const o={attributes:r,uri:"",endList:"static"===t.type,timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,timelineStarts:t.timelineStarts,discontinuityStarts:s,discontinuitySequence:n,mediaSequence:i,segments:e};return t.serviceLocation&&(o.attributes.serviceLocation=t.serviceLocation),o})(i),e)),t}),{}))(d,s):null,g=u.concat(ce(v),ce(m)),y=g.map((({timelineStarts:t})=>t));var b;return p.timelineStarts=te(y),b=p.timelineStarts,g.forEach((t=>{t.mediaSequence=0,t.discontinuitySequence=b.findIndex((function({timeline:e}){return e===t.timeline})),t.segments&&t.segments.forEach(((t,e)=>{t.number=e}))})),v&&(p.mediaGroups.AUDIO.audio=v),m&&(p.mediaGroups.SUBTITLES.subs=m),f.length&&(p.mediaGroups["CLOSED-CAPTIONS"].cc=f.reduce(((t,e)=>e?(e.forEach((e=>{const{channel:i,language:s}=e;t[s]={autoselect:!1,default:!1,instreamId:i,language:s},e.hasOwnProperty("aspectRatio")&&(t[s].aspectRatio=e.aspectRatio),e.hasOwnProperty("easyReader")&&(t[s].easyReader=e.easyReader),e.hasOwnProperty("3D")&&(t[s]["3D"]=e["3D"])})),t):t),{})),n?(({oldManifest:t,newManifest:e})=>{const i=t.playlists.concat(ee(t)),s=e.playlists.concat(ee(e));return e.timelineStarts=te([t.timelineStarts,e.timelineStarts]),(({oldPlaylists:t,newPlaylists:e,timelineStarts:i})=>{e.forEach((e=>{e.discontinuitySequence=i.findIndex((function({timeline:t}){return t===e.timeline}));const s=((t,e)=>{for(let i=0;i<t.length;i++)if(t[i].attributes.NAME===e)return t[i];return null})(t,e.attributes.NAME);if(!s)return;if(e.sidx)return;const n=e.segments[0],r=s.segments.findIndex((function(t){return Math.abs(t.presentationTime-n.presentationTime)<Zt}));if(-1===r)return ie({playlist:e,mediaSequence:s.mediaSequence+s.segments.length}),e.segments[0].discontinuity=!0,e.discontinuityStarts.unshift(0),void((!s.segments.length&&e.timeline>s.timeline||s.segments.length&&e.timeline>s.segments[s.segments.length-1].timeline)&&e.discontinuitySequence--);s.segments[r].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,e.discontinuityStarts.unshift(0),e.discontinuitySequence--),ie({playlist:e,mediaSequence:s.segments[r].number})}))})({oldPlaylists:i,newPlaylists:s,timelineStarts:e.timelineStarts}),e})({oldManifest:n,newManifest:p}):p},fe=(t,e,i)=>{const{NOW:s,clientOffset:n,availabilityStartTime:r,timescale:o=1,periodStart:a=0,minimumUpdatePeriod:h=0}=t;return Math.ceil((((s+n)/1e3+h-(r+a))*o-e)/i)},pe=(t,e)=>{const{type:i,minimumUpdatePeriod:s=0,media:n="",sourceDuration:r,timescale:o=1,startNumber:a=1,periodStart:h}=t,l=[];let u=-1;for(let c=0;c<e.length;c++){const d=e[c],f=d.d,p=d.r||0,v=d.t||0;let m;if(u<0&&(u=v),v&&v>u&&(u=v),p<0){const a=c+1;m=a===e.length?"dynamic"===i&&s>0&&n.indexOf("$Number$")>0?fe(t,u,f):(r*o-u)/f:(e[a].t-u)/f}else m=p+1;const g=a+l.length+m;let y=a+l.length;for(;y<g;)l.push({number:y,duration:f/o,time:u,timeline:h}),u+=f,y++}return l},ve=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,me=(t,e)=>t.replace(ve,(t=>(e,i,s,n)=>{if("$$"===e)return"$";if(void 0===t[i])return e;const r=""+t[i];return"RepresentationID"===i?r:(n=s?parseInt(n,10):1,r.length>=n?r:`${new Array(n-r.length+1).join("0")}${r}`)})(e)),ge=(t,e)=>{const i={RepresentationID:t.id,Bandwidth:t.bandwidth||0},{initialization:s={sourceURL:"",range:""}}=t,n=Xt({baseUrl:t.baseUrl,source:me(s.sourceURL,i),range:s.range}),r=((t,e)=>t.duration||e?t.duration?Wt(t):pe(t,e):[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}])(t,e);return r.map((e=>{i.Number=e.number,i.Time=e.time;const s=me(t.media||"",i),r=t.periodStart+(e.time-(t.presentationTimeOffset||0))/(t.timescale||1);return{uri:s,timeline:e.timeline,duration:e.duration,resolvedUri:X(t.baseUrl||"",s),map:n,number:e.number,presentationTime:r}}))},ye=(t,e)=>{const{duration:i,segmentUrls:s=[],periodStart:n}=t;if(!i&&!e||i&&e)throw new Error("SEGMENT_TIME_UNSPECIFIED");const r=s.map((e=>((t,e)=>{const{baseUrl:i,initialization:s={}}=t,n=Xt({baseUrl:i,source:s.sourceURL,range:s.range}),r=Xt({baseUrl:i,source:e.media,range:e.mediaRange});return r.map=n,r})(t,e)));let o;return i&&(o=Wt(t)),e&&(o=pe(t,e)),o.map(((e,i)=>{if(r[i]){const s=r[i],o=t.timescale||1,a=t.presentationTimeOffset||0;return s.timeline=e.timeline,s.duration=e.duration,s.number=e.number,s.presentationTime=n+(e.time-a)/o,s}})).filter((t=>t))},be=({attributes:t,segmentInfo:e})=>{let i,s;e.template?(s=ge,i=qt(t,e.template)):e.base?(s=Jt,i=qt(t,e.base)):e.list&&(s=ye,i=qt(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 i.duration=r.length?r.reduce(((t,e)=>Math.max(t,Math.ceil(e.duration))),0):0;return n.attributes=i,n.segments=r,e.base&&i.indexRange&&(n.sidx=r[0],n.segments=[]),n},je=(t,e)=>Ht(t.childNodes).filter((({tagName:t})=>t===e)),we=t=>t.textContent.trim(),Te=t=>{const e=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(t);if(!e)return 0;const[i,s,n,r,o,a]=e.slice(1);return 31536e3*parseFloat(i||0)+2592e3*parseFloat(s||0)+86400*parseFloat(n||0)+3600*parseFloat(r||0)+60*parseFloat(o||0)+parseFloat(a||0)},Se={mediaPresentationDuration:t=>Te(t),availabilityStartTime(t){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(e=t)&&(e+="Z"),Date.parse(e)/1e3;var e},minimumUpdatePeriod:t=>Te(t),suggestedPresentationDelay:t=>Te(t),type:t=>t,timeShiftBufferDepth:t=>Te(t),start:t=>Te(t),width:t=>parseInt(t,10),height:t=>parseInt(t,10),bandwidth:t=>parseInt(t,10),frameRate:t=>(t=>parseFloat(t.split("/").reduce(((t,e)=>t/e))))(t),startNumber:t=>parseInt(t,10),timescale:t=>parseInt(t,10),presentationTimeOffset:t=>parseInt(t,10),duration(t){const e=parseInt(t,10);return isNaN(e)?Te(t):e},d:t=>parseInt(t,10),t:t=>parseInt(t,10),r:t=>parseInt(t,10),presentationTime:t=>parseInt(t,10),qualityRanking:t=>parseInt(t,10),qualityranking:t=>parseInt(t,10),DEFAULT:t=>t},ke={qualityranking:"qualityRanking"},xe=t=>t&&t.attributes?Ht(t.attributes).reduce(((t,e)=>(t[ke[e.name]||e.name]=(Se[e.name]||Se.DEFAULT)(e.value),t)),{}):{},Ae={"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"},Ee=(t,e)=>e.length?zt(t.map((function(t){return e.map((function(e){const i=we(e),s=X(t.baseUrl,i),n=qt(xe(e),{baseUrl:s});return s!==i&&!n.serviceLocation&&t.serviceLocation&&(n.serviceLocation=t.serviceLocation),n}))}))):t,Ie=t=>{const e=je(t,"SegmentTemplate")[0],i=je(t,"SegmentList")[0],s=i&&je(i,"SegmentURL").map((t=>qt({tag:"SegmentURL"},xe(t)))),n=je(t,"SegmentBase")[0],r=i||e,o=r&&je(r,"SegmentTimeline")[0],a=i||n||e,h=a&&je(a,"Initialization")[0],l=e&&xe(e);l&&h?l.initialization=h&&xe(h):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});const u={template:l,segmentTimeline:o&&je(o,"S").map((t=>xe(t))),list:i&&qt(xe(i),{segmentUrls:s,initialization:xe(h)}),base:n&&qt(xe(n),{initialization:xe(h)})};return Object.keys(u).forEach((t=>{u[t]||delete u[t]})),u},De=t=>zt(je(t.node,"EventStream").map((e=>{const i=xe(e),s=i.schemeIdUri;return je(e,"Event").map((e=>{const n=xe(e),r=i.timescale||1,o=(n.presentationTime||0)/r+t.attributes.start;return{schemeIdUri:s,value:i.value,id:n.id,start:o,end:o+(n.duration||0)/r,messageData:we(e)||n.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}}))}))),Ce=(t,e)=>i=>{const s=Ee(e,je(i.node,"BaseURL")),n=qt(t,{periodStart:i.attributes.start});"number"==typeof i.attributes.duration&&(n.periodDuration=i.attributes.duration);const r=je(i.node,"AdaptationSet"),o=Ie(i.node);return zt(r.map(((t,e,i)=>s=>{const n=xe(s),r=Ee(e,je(s,"BaseURL")),o=je(s,"Role")[0],a={role:xe(o)};let h=qt(t,n,a);const l=je(s,"Accessibility")[0],u="urn:scte:dash:cc:cea-608:2015"===(c=xe(l)).schemeIdUri?("string"!=typeof c.value?[]:c.value.split(";")).map((t=>{let e,i;return i=t,/^CC\d=/.test(t)?[e,i]=t.split("="):/^CC\d$/.test(t)&&(e=t),{channel:e,language:i}})):"urn:scte:dash:cc:cea-708:2015"===c.schemeIdUri?("string"!=typeof c.value?[]:c.value.split(";")).map((t=>{const e={channel:void 0,language:void 0,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(":");"lang"===i?e.language=s:"er"===i?e.easyReader=Number(s):"war"===i?e.aspectRatio=Number(s):"3D"===i&&(e["3D"]=Number(s))}))}else e.language=t;return e.channel&&(e.channel="SERVICE"+e.channel),e})):void 0;var c;u&&(h=qt(h,{captionServices:u}));const d=je(s,"Label")[0];if(d&&d.childNodes.length){const t=d.childNodes[0].nodeValue.trim();h=qt(h,{label:t})}const f=je(s,"ContentProtection").reduce(((t,e)=>{const i=xe(e);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());const s=Ae[i.schemeIdUri];if(s){t[s]={attributes:i};const n=je(e,"cenc:pssh")[0];if(n){const e=we(n);t[s].pssh=e&&Y(e)}}return t}),{});Object.keys(f).length&&(h=qt(h,{contentProtection:f}));const p=Ie(s),v=je(s,"Representation"),m=qt(i,p);return zt(v.map(((t,e,i)=>s=>{const n=je(s,"BaseURL"),r=Ee(e,n),o=qt(t,xe(s)),a=Ie(s);return r.map((t=>({segmentInfo:qt(i,a),attributes:qt(o,t)})))})(h,r,m)))})(n,s,o)))},Ne=(t,e)=>{if(t.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!t.length)return null;const i=qt({serverURL:we(t[0])},xe(t[0]));return i.queryBeforeStart="true"===i.queryBeforeStart,i},Me=t=>{if(""===t)throw new Error("DASH_EMPTY_MANIFEST");const e=new Bt.DOMParser;let i,s;try{i=e.parseFromString(t,"application/xml"),s=i&&"MPD"===i.documentElement.tagName?i.documentElement:null}catch(t){}if(!s||s&&s.getElementsByTagName("parsererror").length>0)throw new Error("DASH_INVALID_XML");return s};var Oe,Re,Pe,_e,Le=l(function(){if(_e)return Pe;_e=1;var t=function(){if(Re)return Oe;Re=1;var t=Math.pow(2,32);return Oe={getUint64:function(e){var i,s=new DataView(e.buffer,e.byteOffset,e.byteLength);return s.getBigUint64?(i=s.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(i):i:s.getUint32(0)*t+s.getUint32(4)},MAX_UINT32:t}}().getUint64;return Pe=function(e){var i=new DataView(e.buffer,e.byteOffset,e.byteLength),s={version:e[0],flags:new Uint8Array(e.subarray(1,4)),references:[],referenceId:i.getUint32(4),timescale:i.getUint32(8)},n=12;0===s.version?(s.earliestPresentationTime=i.getUint32(n),s.firstOffset=i.getUint32(n+4),n+=8):(s.earliestPresentationTime=t(e.subarray(n)),s.firstOffset=t(e.subarray(n+8)),n+=16);var r=i.getUint16(n+=2);for(n+=2;r>0;n+=12,r--)s.references.push({referenceType:(128&e[n])>>>7,referencedSize:2147483647&i.getUint32(n),subsegmentDuration:i.getUint32(n+4),startsWithSap:!!(128&e[n+8]),sapType:(112&e[n+8])>>>4,sapDeltaTime:268435455&i.getUint32(n+8)});return s}}()),Fe=jt([73,68,51]),$e=function t(e,i){return void 0===i&&(i=0),(e=jt(e)).length-i<10||!xt(e,Fe,{offset:i})?i:(i+=function(t,e){void 0===e&&(e=0);var i=(t=jt(t))[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9];return(16&t[e+5])>>4?i+20:i+10}(e,i),t(e,i))},Be=function(t){return"string"==typeof t?kt(t):t},Ue=function t(e,i,s){void 0===s&&(s=!1),i=function(t){return Array.isArray(t)?t.map((function(t){return Be(t)})):[Be(t)]}(i),e=jt(e);var n=[];if(!i.length)return n;for(var r=0;r<e.length;){var o=(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3])>>>0,a=e.subarray(r+4,r+8);if(0===o)break;var h=r+o;if(h>e.length){if(s)break;h=e.length}var l=e.subarray(r+8,h);xt(a,i[0])&&(1===i.length?n.push(l):n.push.apply(n,t(l,i.slice(1),s))),r=h}return n},qe={EBML:jt([26,69,223,163]),DocType:jt([66,130]),Segment:jt([24,83,128,103]),SegmentInfo:jt([21,73,169,102]),Tracks:jt([22,84,174,107]),Track:jt([174]),TrackNumber:jt([215]),DefaultDuration:jt([35,227,131]),TrackEntry:jt([174]),TrackType:jt([131]),FlagDefault:jt([136]),CodecID:jt([134]),CodecPrivate:jt([99,162]),VideoTrack:jt([224]),AudioTrack:jt([225]),Cluster:jt([31,67,182,117]),Timestamp:jt([231]),TimestampScale:jt([42,215,177]),BlockGroup:jt([160]),BlockDuration:jt([155]),Block:jt([161]),SimpleBlock:jt([163])},Ve=[128,64,32,16,8,4,2,1],ze=function(t,e,i,s){void 0===i&&(i=!0),void 0===s&&(s=!1);var n=function(t){for(var e=1,i=0;i<Ve.length&&!(t&Ve[i]);i++)e++;return e}(t[e]),r=t.subarray(e,e+n);return i&&((r=Array.prototype.slice.call(t,e,e+n))[0]^=Ve[n-1]),{length:n,value:St(r,{signed:s}),bytes:r}},He=function t(e){return"string"==typeof e?e.match(/.{1,2}/g).map((function(e){return t(e)})):"number"==typeof e?function(t){var e={}.le,i=void 0!==e&&e;("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&t!=t)&&(t=0),t=wt(t);for(var s=Math.ceil(t.toString(2).length/8),n=new Uint8Array(new ArrayBuffer(s)),r=0;r<s;r++){var o=i?r:Math.abs(r+1-n.length);n[o]=Number(t/Tt[r]&wt(255)),t<0&&(n[o]=Math.abs(~n[o]),n[o]-=0===r?1:2)}return n}(e):e},Xe=function t(e,i,s){if(s>=i.length)return i.length;var n=ze(i,s,!1);if(xt(e.bytes,n.bytes))return s;var r=ze(i,s+n.length);return t(e,i,s+r.length+r.value+n.length)},Ge=function t(e,i){i=function(t){return Array.isArray(t)?t.map((function(t){return He(t)})):[He(t)]}(i),e=jt(e);var s=[];if(!i.length)return s;for(var n=0;n<e.length;){var r=ze(e,n,!1),o=ze(e,n+r.length),a=n+r.length+o.length;127===o.value&&(o.value=Xe(r,e,a),o.value!==e.length&&(o.value-=a));var h=e.subarray(a,a+o.value>e.length?e.length:a+o.value);xt(i[0],r.bytes)&&(1===i.length?s.push(h):s=s.concat(t(h,i.slice(1)))),n+=r.length+o.length+h.length}return s},Ye=jt([0,0,0,1]),We=jt([0,0,1]),Je=jt([0,0,3]),Ke=function(t){for(var e=[],i=1;i<t.length-2;)xt(t.subarray(i,i+3),Je)&&(e.push(i+2),i++),i++;if(0===e.length)return t;var s=t.length-e.length,n=new Uint8Array(s),r=0;for(i=0;i<s;r++,i++)r===e[0]&&(r++,e.shift()),n[i]=t[r];return n},Qe=function(t,e,i,s){t=jt(t),i=[].concat(i);for(var n,r=0,o=0;r<t.length&&(o<s||n);){var a=void 0;if(xt(t.subarray(r),Ye)?a=4:xt(t.subarray(r),We)&&(a=3),a){if(o++,n)return Ke(t.subarray(n,r));var h=void 0;"h264"===e?h=31&t[r+a]:"h265"===e&&(h=t[r+a]>>1&63),-1!==i.indexOf(h)&&(n=r+a),r+=a+("h264"===e?1:2)}else r++}return t.subarray(0,0)},Ze={webm:jt([119,101,98,109]),matroska:jt([109,97,116,114,111,115,107,97]),flac:jt([102,76,97,67]),ogg:jt([79,103,103,83]),ac3:jt([11,119]),riff:jt([82,73,70,70]),avi:jt([65,86,73]),wav:jt([87,65,86,69]),"3gp":jt([102,116,121,112,51,103]),mp4:jt([102,116,121,112]),fmp4:jt([115,116,121,112]),mov:jt([102,116,121,112,113,116]),moov:jt([109,111,111,118]),moof:jt([109,111,111,102]),vtt:jt([87,69,66,86,84,84])},ti={aac:function(t){var e=$e(t);return xt(t,[255,16],{offset:e,mask:[255,22]})},mp3:function(t){var e=$e(t);return xt(t,[255,2],{offset:e,mask:[255,6]})},webm:function(t){var e=Ge(t,[qe.EBML,qe.DocType])[0];return xt(e,Ze.webm)},mkv:function(t){var e=Ge(t,[qe.EBML,qe.DocType])[0];return xt(e,Ze.matroska)},mp4:function(t){return!ti["3gp"](t)&&!ti.mov(t)&&(!(!xt(t,Ze.mp4,{offset:4})&&!xt(t,Ze.fmp4,{offset:4}))||!(!xt(t,Ze.moof,{offset:4})&&!xt(t,Ze.moov,{offset:4}))||void 0)},mov:function(t){return xt(t,Ze.mov,{offset:4})},"3gp":function(t){return xt(t,Ze["3gp"],{offset:4})},ac3:function(t){var e=$e(t);return xt(t,Ze.ac3,{offset:e})},vtt:function(t){return xt(t,Ze.vtt)},ts:function(t){if(t.length<189&&t.length>=1)return 71===t[0];for(var e=0;e+188<t.length&&e<188;){if(71===t[e]&&71===t[e+188])return!0;e+=1}return!1},flac:function(t){var e=$e(t);return xt(t,Ze.flac,{offset:e})},ogg:function(t){return xt(t,Ze.ogg)},avi:function(t){return xt(t,Ze.riff)&&xt(t,Ze.avi,{offset:8})},wav:function(t){return xt(t,Ze.riff)&&xt(t,Ze.wav,{offset:8})},h264:function(t){return function(t){return Qe(t,"h264",7,3)}(t).length},h265:function(t){return function(t){return Qe(t,"h265",[32,33],3)}(t).length}},ei=Object.keys(ti).filter((function(t){return"ts"!==t&&"h264"!==t&&"h265"!==t})).concat(["ts","h264","h265"]);ei.forEach((function(t){var e=ti[t];ti[t]=function(t){return e(jt(t))}}));var ii,si,ni=ti,ri=function(t){t=jt(t);for(var e=0;e<ei.length;e++){var i=ei[e];if(ni[i](t))return i}return""},oi=function(){if(si)return ii;si=1;var t,e,i,s,n,r,o,a=9e4;return n=function(e,i){return t(s(e,i))},r=function(t,s){return e(i(t),s)},o=function(t,e,s){return i(s?t:t-e)},ii={ONE_SECOND_IN_TS:a,secondsToVideoTs:t=function(t){return t*a},secondsToAudioTs:e=function(t,e){return t*e},videoTsToSeconds:i=function(t){return t/a},audioTsToSeconds:s=function(t,e){return t/e},audioTsToVideoTs:n,videoTsToAudioTs:r,metadataTsToSeconds:o}}(),ai="8.24.2";const hi={},li=function(t,e){return hi[t]=hi[t]||[],e&&(hi[t]=hi[t].concat(e)),hi[t]},ui=function(t,e){const i=li(t).indexOf(e);return!(i<=-1||(hi[t]=hi[t].slice(),hi[t].splice(i,1),0))},ci={prefixed:!0},di=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],fi=di[0];let pi;for(let t=0;t<di.length;t++)if(di[t][1]in g){pi=di[t];break}if(pi){for(let t=0;t<pi.length;t++)ci[fi[t]]=pi[t];ci.prefixed=pi[0]!==fi[0]}let vi=[];const mi=function t(e,i=":",s=""){let n,r="info";function o(...t){n("log",r,t)}return n=((t,e,i)=>(s,n,r)=>{const o=e.levels[n],a=new RegExp(`^(${o})$`);let h=t;if("log"!==s&&r.unshift(s.toUpperCase()+":"),i&&(h=`%c${t}`,r.unshift(i)),r.unshift(h+":"),vi){vi.push([].concat(r));const t=vi.length-1e3;vi.splice(0,t>0?t:0)}if(!p.console)return;let l=p.console[s];l||"debug"!==s||(l=p.console.info||p.console.log),l&&o&&a.test(s)&&l[Array.isArray(r)?"apply":"call"](p.console,r)})(e,o,s),o.createLogger=(n,r,o)=>{const a=void 0!==r?r:i;return t(`${e} ${a} ${n}`,a,void 0!==o?o:s)},o.createNewLogger=(e,i,s)=>t(e,i,s),o.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:r},o.level=t=>{if("string"==typeof t){if(!o.levels.hasOwnProperty(t))throw new Error(`"${t}" in not a valid log level`);r=t}return r},(o.history=()=>vi?[].concat(vi):[]).filter=t=>(vi||[]).filter((e=>new RegExp(`.*${t}.*`).test(e[0]))),o.history.clear=()=>{vi&&(vi.length=0)},o.history.disable=()=>{null!==vi&&(vi.length=0,vi=null)},o.history.enable=()=>{null===vi&&(vi=[])},o.error=(...t)=>n("error",r,t),o.warn=(...t)=>n("warn",r,t),o.debug=(...t)=>n("debug",r,t),o}("VIDEOJS"),gi=mi.createLogger,yi=Object.prototype.toString,bi=function(t){return Ti(t)?Object.keys(t):[]};function ji(t,e){bi(t).forEach((i=>e(t[i],i)))}function wi(t,e,i=0){return bi(t).reduce(((i,s)=>e(i,t[s],s)),i)}function Ti(t){return!!t&&"object"==typeof t}function Si(t){return Ti(t)&&"[object Object]"===yi.call(t)&&t.constructor===Object}function ki(...t){const e={};return t.forEach((t=>{t&&ji(t,((t,i)=>{Si(t)?(Si(e[i])||(e[i]={}),e[i]=ki(e[i],t)):e[i]=t}))})),e}function xi(t={}){const e=[];for(const i in t)t.hasOwnProperty(i)&&e.push(t[i]);return e}function Ai(t,e,i,s=!0){const n=i=>Object.defineProperty(t,e,{value:i,enumerable:!0,writable:!0}),r={configurable:!0,enumerable:!0,get(){const t=i();return n(t),t}};return s&&(r.set=n),Object.defineProperty(t,e,r)}var Ei=Object.freeze({__proto__:null,each:ji,reduce:wi,isObject:Ti,isPlain:Si,merge:ki,values:xi,defineLazyProperty:Ai});let Ii,Di=!1,Ci=null,Ni=!1,Mi=!1,Oi=!1,Ri=!1,Pi=!1,_i=null,Li=null;const Fi=Boolean(p.cast&&p.cast.framework&&p.cast.framework.CastReceiverContext);let $i=null,Bi=!1,Ui=!1,qi=!1,Vi=!1,zi=!1,Hi=!1,Xi=!1;const Gi=Boolean(Zi()&&("ontouchstart"in p||p.navigator.maxTouchPoints||p.DocumentTouch&&p.document instanceof p.DocumentTouch)),Yi=p.navigator&&p.navigator.userAgentData;if(Yi&&Yi.platform&&Yi.brands&&(Ni="Android"===Yi.platform,Oi=Boolean(Yi.brands.find((t=>"Microsoft Edge"===t.brand))),Ri=Boolean(Yi.brands.find((t=>"Chromium"===t.brand))),Pi=!Oi&&Ri,_i=Li=(Yi.brands.find((t=>"Chromium"===t.brand))||{}).version||null,Ui="Windows"===Yi.platform),!Ri){const t=p.navigator&&p.navigator.userAgent||"";Di=/iPod/i.test(t),Ci=function(){const e=t.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Ni=/Android/i.test(t),Ii=function(){const e=t.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const i=e[1]&&parseFloat(e[1]),s=e[2]&&parseFloat(e[2]);return i&&s?parseFloat(e[1]+"."+e[2]):i||null}(),Mi=/Firefox/i.test(t),Oi=/Edg/i.test(t),Ri=/Chrome/i.test(t)||/CriOS/i.test(t),Pi=!Oi&&Ri,_i=Li=function(){const e=t.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),$i=function(){const e=/MSIE\s(\d+)\.\d/.exec(t);let i=e&&parseFloat(e[1]);return!i&&/Trident\/7.0/i.test(t)&&/rv:11.0/.test(t)&&(i=11),i}(),zi=/Tizen/i.test(t),Hi=/Web0S/i.test(t),Xi=zi||Hi,Bi=/Safari/i.test(t)&&!Pi&&!Ni&&!Oi&&!Xi,Ui=/Windows/i.test(t),qi=/iPad/i.test(t)||Bi&&Gi&&!/iPhone/i.test(t),Vi=/iPhone/i.test(t)&&!qi}const Wi=Vi||qi||Di,Ji=(Bi||Wi)&&!Pi;var Ki=Object.freeze({__proto__:null,get IS_IPOD(){return Di},get IOS_VERSION(){return Ci},get IS_ANDROID(){return Ni},get ANDROID_VERSION(){return Ii},get IS_FIREFOX(){return Mi},get IS_EDGE(){return Oi},get IS_CHROMIUM(){return Ri},get IS_CHROME(){return Pi},get CHROMIUM_VERSION(){return _i},get CHROME_VERSION(){return Li},IS_CHROMECAST_RECEIVER:Fi,get IE_VERSION(){return $i},get IS_SAFARI(){return Bi},get IS_WINDOWS(){return Ui},get IS_IPAD(){return qi},get IS_IPHONE(){return Vi},get IS_TIZEN(){return zi},get IS_WEBOS(){return Hi},get IS_SMART_TV(){return Xi},TOUCH_ENABLED:Gi,IS_IOS:Wi,IS_ANY_SAFARI:Ji});function Qi(t){return"string"==typeof t&&Boolean(t.trim())}function Zi(){return g===p.document}function ts(t){return Ti(t)&&1===t.nodeType}function es(){try{return p.parent!==p.self}catch(t){return!0}}function is(t){return function(e,i){if(!Qi(e))return g[t](null);Qi(i)&&(i=g.querySelector(i));const s=ts(i)?i:g;return s[t]&&s[t](e)}}function ss(t="div",e={},i={},s){const n=g.createElement(t);return Object.getOwnPropertyNames(e).forEach((function(t){const i=e[t];"textContent"===t?ns(n,i):n[t]===i&&"tabIndex"!==t||(n[t]=i)})),Object.getOwnPropertyNames(i).forEach((function(t){n.setAttribute(t,i[t])})),s&&Ss(n,s),n}function ns(t,e){return void 0===t.textContent?t.innerText=e:t.textContent=e,t}function rs(t,e){e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}function os(t,e){return function(t){if(t.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}(e),t.classList.contains(e)}function as(t,...e){return t.classList.add(...e.reduce(((t,e)=>t.concat(e.split(/\s+/))),[])),t}function hs(t,...e){return t?(t.classList.remove(...e.reduce(((t,e)=>t.concat(e.split(/\s+/))),[])),t):(mi.warn("removeClass was called with an element that doesn't exist"),null)}function ls(t,e,i){return"function"==typeof i&&(i=i(t,e)),"boolean"!=typeof i&&(i=void 0),e.split(/\s+/).forEach((e=>t.classList.toggle(e,i))),t}function us(t,e){Object.getOwnPropertyNames(e).forEach((function(i){const s=e[i];null==s||!1===s?t.removeAttribute(i):t.setAttribute(i,!0===s?"":s)}))}function cs(t){const e={},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;i.includes(n)&&(r=null!==r),e[n]=r}}return e}function ds(t,e){return t.getAttribute(e)}function fs(t,e,i){t.setAttribute(e,i)}function ps(t,e){t.removeAttribute(e)}function vs(){g.body.focus(),g.onselectstart=function(){return!1}}function ms(){g.onselectstart=function(){return!0}}function gs(t){if(t&&t.getBoundingClientRect&&t.parentNode){const e=t.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach((t=>{void 0!==e[t]&&(i[t]=e[t])})),i.height||(i.height=parseFloat(Is(t,"height"))),i.width||(i.width=parseFloat(Is(t,"width"))),i}}function ys(t){if(!t||t&&!t.offsetParent)return{left:0,top:0,width:0,height:0};const e=t.offsetWidth,i=t.offsetHeight;let s=0,n=0;for(;t.offsetParent&&t!==g[ci.fullscreenElement];)s+=t.offsetLeft,n+=t.offsetTop,t=t.offsetParent;return{left:s,top:n,width:e,height:i}}function bs(t,e){const i={x:0,y:0};if(Wi){let e=t;for(;e&&"html"!==e.nodeName.toLowerCase();){const t=Is(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&&p.WebKitCSSMatrix){const t=p.getComputedStyle(e.assignedSlot.parentElement).transform,s=new p.WebKitCSSMatrix(t);i.x+=s.m41,i.y+=s.m42}e=e.parentNode||e.host}}const s={},n=ys(e.target),r=ys(t),o=r.width;let a=e.offsetY-(r.top-n.top),h=e.offsetX-(r.left-n.left);return e.changedTouches&&(h=e.changedTouches[0].pageX-r.left,a=e.changedTouches[0].pageY+r.top,Wi&&(h-=i.x,a-=i.y)),s.y=1-Math.max(0,Math.min(1,a/r.height)),s.x=Math.max(0,Math.min(1,h/o)),s}function js(t){return Ti(t)&&3===t.nodeType}function ws(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function Ts(t){return"function"==typeof t&&(t=t()),(Array.isArray(t)?t:[t]).map((t=>("function"==typeof t&&(t=t()),ts(t)||js(t)?t:"string"==typeof t&&/\S/.test(t)?g.createTextNode(t):void 0))).filter((t=>t))}function Ss(t,e){return Ts(e).forEach((e=>t.appendChild(e))),t}function ks(t,e){return Ss(ws(t),e)}function xs(t){return void 0===t.button&&void 0===t.buttons||0===t.button&&void 0===t.buttons||"mouseup"===t.type&&0===t.button&&0===t.buttons||"mousedown"===t.type&&0===t.button&&0===t.buttons||0===t.button&&1===t.buttons}const As=is("querySelector"),Es=is("querySelectorAll");function Is(t,e){if(!t||!e)return"";if("function"==typeof p.getComputedStyle){let i;try{i=p.getComputedStyle(t)}catch(t){return""}return i?i.getPropertyValue(e)||i[e]:""}return""}function Ds(t){[...g.styleSheets].forEach((e=>{try{const i=[...e.cssRules].map((t=>t.cssText)).join(""),s=g.createElement("style");s.textContent=i,t.document.head.appendChild(s)}catch(i){const s=g.createElement("link");s.rel="stylesheet",s.type=e.type,s.media=e.media.mediaText,s.href=e.href,t.document.head.appendChild(s)}}))}var Cs=Object.freeze({__proto__:null,isReal:Zi,isEl:ts,isInFrame:es,createEl:ss,textContent:ns,prependTo:rs,hasClass:os,addClass:as,removeClass:hs,toggleClass:ls,setAttributes:us,getAttributes:cs,getAttribute:ds,setAttribute:fs,removeAttribute:ps,blockTextSelection:vs,unblockTextSelection:ms,getBoundingClientRect:gs,findPosition:ys,getPointerPosition:bs,isTextNode:js,emptyEl:ws,normalizeContent:Ts,appendContent:Ss,insertContent:ks,isSingleLeftClick:xs,$:As,$$:Es,computedStyle:Is,copyStyleSheetsToWindow:Ds});let Ns,Ms=!1;const Os=function(){if(!1===Ns.options.autoSetup)return;const t=Array.prototype.slice.call(g.getElementsByTagName("video")),e=Array.prototype.slice.call(g.getElementsByTagName("audio")),i=Array.prototype.slice.call(g.getElementsByTagName("video-js")),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){Rs(1);break}void 0===e.player&&null!==e.getAttribute("data-setup")&&Ns(e)}else Ms||Rs(1)};function Rs(t,e){Zi()&&(e&&(Ns=e),p.setTimeout(Os,t))}function Ps(){Ms=!0,p.removeEventListener("load",Ps)}Zi()&&("complete"===g.readyState?Ps():p.addEventListener("load",Ps));const _s=function(t){const e=g.createElement("style");return e.className=t,e},Ls=function(t,e){t.styleSheet?t.styleSheet.cssText=e:t.textContent=e};var Fs=new WeakMap;let $s,Bs=3;function Us(){return Bs++}function qs(t,e){if(!Fs.has(t))return;const i=Fs.get(t);0===i.handlers[e].length&&(delete i.handlers[e],t.removeEventListener?t.removeEventListener(e,i.dispatcher,!1):t.detachEvent&&t.detachEvent("on"+e,i.dispatcher)),Object.getOwnPropertyNames(i.handlers).length<=0&&(delete i.handlers,delete i.dispatcher,delete i.disabled),0===Object.getOwnPropertyNames(i).length&&Fs.delete(t)}function Vs(t,e,i,s){i.forEach((function(i){t(e,i,s)}))}function zs(t){if(t.fixed_)return t;function e(){return!0}function i(){return!1}if(!t||!t.isPropagationStopped||!t.isImmediatePropagationStopped){const s=t||p.event;t={};const n=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const e in s)n.includes(e)||"returnValue"===e&&s.preventDefault||(t[e]=s[e]);if(t.target||(t.target=t.srcElement||g),t.relatedTarget||(t.relatedTarget=t.fromElement===t.target?t.toElement:t.fromElement),t.preventDefault=function(){s.preventDefault&&s.preventDefault(),t.returnValue=!1,s.returnValue=!1,t.defaultPrevented=!0},t.defaultPrevented=!1,t.stopPropagation=function(){s.stopPropagation&&s.stopPropagation(),t.cancelBubble=!0,s.cancelBubble=!0,t.isPropagationStopped=e},t.isPropagationStopped=i,t.stopImmediatePropagation=function(){s.stopImmediatePropagation&&s.stopImmediatePropagation(),t.isImmediatePropagationStopped=e,t.stopPropagation()},t.isImmediatePropagationStopped=i,null!=t.clientX){const e=g.documentElement,i=g.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,null!=t.button&&(t.button=1&t.button?0:4&t.button?1:2&t.button?2:0)}return t.fixed_=!0,t}const Hs=["touchstart","touchmove"];function Xs(t,e,i){if(Array.isArray(e))return Vs(Xs,t,e,i);Fs.has(t)||Fs.set(t,{});const s=Fs.get(t);if(s.handlers||(s.handlers={}),s.handlers[e]||(s.handlers[e]=[]),i.guid||(i.guid=Us()),s.handlers[e].push(i),s.dispatcher||(s.disabled=!1,s.dispatcher=function(e,i){if(s.disabled)return;e=zs(e);const n=s.handlers[e.type];if(n){const s=n.slice(0);for(let n=0,r=s.length;n<r&&!e.isImmediatePropagationStopped();n++)try{s[n].call(t,e,i)}catch(t){mi.error(t)}}}),1===s.handlers[e].length)if(t.addEventListener){let i=!1;(function(){if("boolean"!=typeof $s){$s=!1;try{const t=Object.defineProperty({},"passive",{get(){$s=!0}});p.addEventListener("test",null,t),p.removeEventListener("test",null,t)}catch(t){}}return $s})()&&Hs.indexOf(e)>-1&&(i={passive:!0}),t.addEventListener(e,s.dispatcher,i)}else t.attachEvent&&t.attachEvent("on"+e,s.dispatcher)}function Gs(t,e,i){if(!Fs.has(t))return;const s=Fs.get(t);if(!s.handlers)return;if(Array.isArray(e))return Vs(Gs,t,e,i);const n=function(t,e){s.handlers[e]=[],qs(t,e)};if(void 0===e){for(const e in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},e)&&n(t,e);return}const r=s.handlers[e];if(r)if(i){if(i.guid)for(let t=0;t<r.length;t++)r[t].guid===i.guid&&r.splice(t--,1);qs(t,e)}else n(t,e)}function Ys(t,e,i){const s=Fs.has(t)?Fs.get(t):{},n=t.parentNode||t.ownerDocument;if("string"==typeof e?e={type:e,target:t}:e.target||(e.target=t),e=zs(e),s.dispatcher&&s.dispatcher.call(t,e,i),n&&!e.isPropagationStopped()&&!0===e.bubbles)Ys.call(null,n,e,i);else if(!n&&!e.defaultPrevented&&e.target&&e.target[e.type]){Fs.has(e.target)||Fs.set(e.target,{});const t=Fs.get(e.target);e.target[e.type]&&(t.disabled=!0,"function"==typeof e.target[e.type]&&e.target[e.type](),t.disabled=!1)}return!e.defaultPrevented}function Ws(t,e,i){if(Array.isArray(e))return Vs(Ws,t,e,i);const s=function(){Gs(t,e,s),i.apply(this,arguments)};s.guid=i.guid=i.guid||Us(),Xs(t,e,s)}function Js(t,e,i){const s=function(){Gs(t,e,s),i.apply(this,arguments)};s.guid=i.guid=i.guid||Us(),Xs(t,e,s)}var Ks=Object.freeze({__proto__:null,fixEvent:zs,on:Xs,off:Gs,trigger:Ys,one:Ws,any:Js});const Qs=30,Zs=function(t,e,i){e.guid||(e.guid=Us());const s=e.bind(t);return s.guid=i?i+"_"+e.guid:e.guid,s},tn=function(t,e){let i=p.performance.now();return function(...s){const n=p.performance.now();n-i>=e&&(t(...s),i=n)}},en=function(t,e,i,s=p){let n;const r=function(){const r=this,o=arguments;let a=function(){n=null,a=null,i||t.apply(r,o)};!n&&i&&t.apply(r,o),s.clearTimeout(n),n=s.setTimeout(a,e)};return r.cancel=()=>{s.clearTimeout(n),n=null},r};var sn=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Qs,bind_:Zs,throttle:tn,debounce:en});let nn;class rn{on(t,e){const i=this.addEventListener;this.addEventListener=()=>{},Xs(this,t,e),this.addEventListener=i}off(t,e){Gs(this,t,e)}one(t,e){const i=this.addEventListener;this.addEventListener=()=>{},Ws(this,t,e),this.addEventListener=i}any(t,e){const i=this.addEventListener;this.addEventListener=()=>{},Js(this,t,e),this.addEventListener=i}trigger(t){const e=t.type||t;"string"==typeof t&&(t={type:e}),t=zs(t),this.allowedEvents_[e]&&this["on"+e]&&this["on"+e](t),Ys(this,t)}queueTrigger(t){nn||(nn=new Map);const e=t.type||t;let i=nn.get(this);i||(i=new Map,nn.set(this,i));const s=i.get(e);i.delete(e),p.clearTimeout(s);const n=p.setTimeout((()=>{i.delete(e),0===i.size&&(i=null,nn.delete(this)),this.trigger(t)}),0);i.set(e,n)}}rn.prototype.allowedEvents_={},rn.prototype.addEventListener=rn.prototype.on,rn.prototype.removeEventListener=rn.prototype.off,rn.prototype.dispatchEvent=rn.prototype.trigger;const on=t=>"function"==typeof t.name?t.name():"string"==typeof t.name?t.name:t.name_?t.name_:t.constructor&&t.constructor.name?t.constructor.name:typeof t,an=t=>t instanceof rn||!!t.eventBusEl_&&["on","one","off","trigger"].every((e=>"function"==typeof t[e])),hn=t=>"string"==typeof t&&/\S/.test(t)||Array.isArray(t)&&!!t.length,ln=(t,e,i)=>{if(!t||!t.nodeName&&!an(t))throw new Error(`Invalid target for ${on(e)}#${i}; must be a DOM node or evented object.`)},un=(t,e,i)=>{if(!hn(t))throw new Error(`Invalid event type for ${on(e)}#${i}; must be a non-empty string or array.`)},cn=(t,e,i)=>{if("function"!=typeof t)throw new Error(`Invalid listener for ${on(e)}#${i}; must be a function.`)},dn=(t,e,i)=>{const s=e.length<3||e[0]===t||e[0]===t.eventBusEl_;let n,r,o;return s?(n=t.eventBusEl_,e.length>=3&&e.shift(),[r,o]=e):(n=e[0],r=e[1],o=e[2]),ln(n,t,i),un(r,t,i),cn(o,t,i),o=Zs(t,o),{isTargetingSelf:s,target:n,type:r,listener:o}},fn=(t,e,i,s)=>{ln(t,t,e),t.nodeName?Ks[e](t,i,s):t[e](i,s)},pn={on(...t){const{isTargetingSelf:e,target:i,type:s,listener:n}=dn(this,t,"on");if(fn(i,"on",s,n),!e){const t=()=>this.off(i,s,n);t.guid=n.guid;const e=()=>this.off("dispose",t);e.guid=n.guid,fn(this,"on","dispose",t),fn(i,"on","dispose",e)}},one(...t){const{isTargetingSelf:e,target:i,type:s,listener:n}=dn(this,t,"one");if(e)fn(i,"one",s,n);else{const t=(...e)=>{this.off(i,s,t),n.apply(null,e)};t.guid=n.guid,fn(i,"one",s,t)}},any(...t){const{isTargetingSelf:e,target:i,type:s,listener:n}=dn(this,t,"any");if(e)fn(i,"any",s,n);else{const t=(...e)=>{this.off(i,s,t),n.apply(null,e)};t.guid=n.guid,fn(i,"any",s,t)}},off(t,e,i){if(!t||hn(t))Gs(this.eventBusEl_,t,e);else{const s=t,n=e;ln(s,this,"off"),un(n,this,"off"),cn(i,this,"off"),i=Zs(this,i),this.off("dispose",i),s.nodeName?(Gs(s,n,i),Gs(s,"dispose",i)):an(s)&&(s.off(n,i),s.off("dispose",i))}},trigger(t,e){if(ln(this.eventBusEl_,this,"trigger"),!hn(t&&"string"!=typeof t?t.type:t))throw new Error(`Invalid event type for ${on(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Ys(this.eventBusEl_,t,e)}};function vn(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_=ss("span",{className:"vjs-event-bus"});return Object.assign(t,pn),t.eventedCallbacks&&t.eventedCallbacks.forEach((t=>{t()})),t.on("dispose",(()=>{t.off(),[t,t.el_,t.eventBusEl_].forEach((function(t){t&&Fs.has(t)&&Fs.delete(t)})),p.setTimeout((()=>{t.eventBusEl_=null}),0)})),t}const mn={state:{},setState(t){let e;return"function"==typeof t&&(t=t()),ji(t,((t,i)=>{this.state[i]!==t&&(e=e||{},e[i]={from:this.state[i],to:t}),this.state[i]=t})),e&&an(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function gn(t,e){return Object.assign(t,mn),t.state=Object.assign({},t.state,e),"function"==typeof t.handleStateChanged&&an(t)&&t.on("statechanged",t.handleStateChanged),t}const yn=function(t){return"string"!=typeof t?t:t.replace(/./,(t=>t.toLowerCase()))},bn=function(t){return"string"!=typeof t?t:t.replace(/./,(t=>t.toUpperCase()))},jn=function(t,e){return bn(t)===bn(e)};var wn=Object.freeze({__proto__:null,toLowerCase:yn,toTitleCase:bn,titleCaseEquals:jn});class Tn{constructor(t,e,i){if(this.player_=!t&&this.play?t=this:t,this.isDisposed_=!1,this.parentComponent_=null,this.options_=ki({},this.options_),e=this.options_=ki(this.options_,e),this.id_=e.id||e.el&&e.el.id,!this.id_){const e=t&&t.id&&t.id()||"no_player";this.id_=`${e}_component_${Us()}`}this.name_=e.name||null,e.el?this.el_=e.el:!1!==e.createEl&&(this.el_=this.createEl()),e.className&&this.el_&&e.className.split(" ").forEach((t=>this.addClass(t))),["on","off","one","any","trigger"].forEach((t=>{this[t]=void 0})),!1!==e.evented&&(vn(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),gn(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,!1!==e.initChildren&&this.initChildren(),this.ready(i),!1!==e.reportTouchActivity&&this.enableTouchActivity()}dispose(t={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(t.restoreEl?this.el_.parentNode.replaceChild(t.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(t){return t?(this.options_=ki(this.options_,t),this.options_):this.options_}el(){return this.el_}createEl(t,e,i){return ss(t,e,i)}localize(t,e,i=t){const s=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),r=n&&n[s],o=s&&s.split("-")[0],a=n&&n[o];let h=i;return r&&r[t]?h=r[t]:a&&a[t]&&(h=a[t]),e&&(h=h.replace(/\{(\d+)\}/g,(function(t,i){const s=e[i-1];let n=s;return void 0===s&&(n=t),n}))),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 this.childNameIndex_[t]}getDescendant(...t){t=t.reduce(((t,e)=>t.concat(e)),[]);let e=this;for(let i=0;i<t.length;i++)if(e=e.getChild(t[i]),!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",s=ss("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),n=g.createElementNS(i,"svg");n.setAttributeNS(null,"viewBox","0 0 512 512");const r=g.createElementNS(i,"use");return n.appendChild(r),r.setAttributeNS(null,"href",`#vjs-icon-${t}`),s.appendChild(n),this.iconIsSet_?e.replaceChild(s,e.querySelector(".vjs-icon-placeholder")):e.appendChild(s),this.iconIsSet_=!0,s}addChild(t,e={},i=this.children_.length){let s,n;if("string"==typeof t){n=bn(t);const i=e.componentClass||n;e.name=n;const r=Tn.getComponent(i);if(!r)throw new Error(`Component ${i} does not exist`);if("function"!=typeof r)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,"function"==typeof s.id&&(this.childIndex_[s.id()]=s),n=n||s.name&&bn(s.name()),n&&(this.childNameIndex_[n]=s,this.childNameIndex_[yn(n)]=s),"function"==typeof s.el&&s.el()){let t=null;this.children_[i+1]&&(this.children_[i+1].el_?t=this.children_[i+1].el_:ts(this.children_[i+1])&&(t=this.children_[i+1])),this.contentEl().insertBefore(s.el(),t)}return s}removeChild(t){if("string"==typeof t&&(t=this.getChild(t)),!t||!this.children_)return;let e=!1;for(let i=this.children_.length-1;i>=0;i--)if(this.children_[i]===t){e=!0,this.children_.splice(i,1);break}if(!e)return;t.parentComponent_=null,this.childIndex_[t.id()]=null,this.childNameIndex_[bn(t.name())]=null,this.childNameIndex_[yn(t.name())]=null;const i=t.el();i&&i.parentNode===this.contentEl()&&this.contentEl().removeChild(t.el())}initChildren(){const t=this.options_.children;if(t){const e=this.options_,i=t=>{const i=t.name;let s=t.opts;if(void 0!==e[i]&&(s=e[i]),!1===s)return;!0===s&&(s={}),s.playerOptions=this.options_.playerOptions;const n=this.addChild(i,s);n&&(this[i]=n)};let s;const n=Tn.getComponent("Tech");s=Array.isArray(t)?t:Object.keys(t),s.concat(Object.keys(this.options_).filter((function(t){return!s.some((function(e){return"string"==typeof e?t===e:t===e.name}))}))).map((e=>{let i,s;return"string"==typeof e?(i=e,s=t[i]||this.options_[i]||{}):(i=e.name,s=e),{name:i,opts:s}})).filter((t=>{const e=Tn.getComponent(t.opts.componentClass||bn(t.name));return e&&!n.isTech(e)})).forEach(i)}}buildCSSClass(){return""}ready(t,e=!1){if(t)return this.isReady_?void(e?t.call(this):this.setTimeout(t,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(t))}triggerReady(){this.isReady_=!0,this.setTimeout((function(){const t=this.readyQueue_;this.readyQueue_=[],t&&t.length>0&&t.forEach((function(t){t.call(this)}),this),this.trigger("ready")}),1)}$(t,e){return As(t,e||this.contentEl())}$$(t,e){return Es(t,e||this.contentEl())}hasClass(t){return os(this.el_,t)}addClass(...t){as(this.el_,...t)}removeClass(...t){hs(this.el_,...t)}toggleClass(t,e){ls(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 ds(this.el_,t)}setAttribute(t,e){fs(this.el_,t,e)}removeAttribute(t){ps(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,!0),this.height(e)}dimension(t,e,i){if(void 0!==e)return null!==e&&e==e||(e=0),this.el_.style[t]=-1!==(""+e).indexOf("%")||-1!==(""+e).indexOf("px")?e:"auto"===e?"":e+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;const s=this.el_.style[t],n=s.indexOf("px");return-1!==n?parseInt(s.slice(0,n),10):parseInt(this.el_["offset"+bn(t)],10)}currentDimension(t){let e=0;if("width"!==t&&"height"!==t)throw new Error("currentDimension only accepts width or height value");if(e=Is(this.el_,t),e=parseFloat(e),0===e||isNaN(e)){const i=`offset${bn(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();return{boundingClientRect:{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left},center:{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}}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(t){this.player_&&("Tab"===t.key||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,e=0,i=null;this.on("touchstart",(function(s){1===s.touches.length&&(i={pageX:s.touches[0].pageX,pageY:s.touches[0].pageY},e=p.performance.now(),t=!0)})),this.on("touchmove",(function(e){if(e.touches.length>1)t=!1;else if(i){const s=e.touches[0].pageX-i.pageX,n=e.touches[0].pageY-i.pageY;Math.sqrt(s*s+n*n)>10&&(t=!1)}}));const s=function(){t=!1};this.on("touchleave",s),this.on("touchcancel",s),this.on("touchend",(function(s){i=null,!0===t&&p.performance.now()-e<200&&(s.preventDefault(),this.trigger("tap"))}))}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const t=Zs(this.player(),this.player().reportUserActivity);let e;this.on("touchstart",(function(){t(),this.clearInterval(e),e=this.setInterval(t,250)}));const i=function(){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}setTimeout(t,e){var i;return t=Zs(this,t),this.clearTimersOnDispose_(),i=p.setTimeout((()=>{this.setTimeoutIds_.has(i)&&this.setTimeoutIds_.delete(i),t()}),e),this.setTimeoutIds_.add(i),i}clearTimeout(t){return this.setTimeoutIds_.has(t)&&(this.setTimeoutIds_.delete(t),p.clearTimeout(t)),t}setInterval(t,e){t=Zs(this,t),this.clearTimersOnDispose_();const i=p.setInterval(t,e);return this.setIntervalIds_.add(i),i}clearInterval(t){return this.setIntervalIds_.has(t)&&(this.setIntervalIds_.delete(t),p.clearInterval(t)),t}requestAnimationFrame(t){var e;return this.clearTimersOnDispose_(),t=Zs(this,t),e=p.requestAnimationFrame((()=>{this.rafIds_.has(e)&&this.rafIds_.delete(e),t()})),this.rafIds_.add(e),e}requestNamedAnimationFrame(t,e){this.namedRafs_.has(t)&&this.cancelNamedAnimationFrame(t),this.clearTimersOnDispose_(),e=Zs(this,e);const i=this.requestAnimationFrame((()=>{e(),this.namedRafs_.has(t)&&this.namedRafs_.delete(t)}));return this.namedRafs_.set(t,i),t}cancelNamedAnimationFrame(t){this.namedRafs_.has(t)&&(this.cancelAnimationFrame(this.namedRafs_.get(t)),this.namedRafs_.delete(t))}cancelAnimationFrame(t){return this.rafIds_.has(t)&&(this.rafIds_.delete(t),p.cancelAnimationFrame(t)),t}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",(()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach((([t,e])=>{this[t].forEach(((t,i)=>this[e](i)))})),this.clearingTimersOnDispose_=!1})))}getIsDisabled(){return Boolean(this.el_.disabled)}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(t){return(t||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(t){function e(t){const e=p.getComputedStyle(t,null),i=e.getPropertyValue("visibility");return"none"!==e.getPropertyValue("display")&&!["hidden","collapse"].includes(i)}return t||(t=this.el()),!!(function(t){if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width===0)return!1;const e={x:t.getBoundingClientRect().left+t.offsetWidth/2,y:t.getBoundingClientRect().top+t.offsetHeight/2};if(e.x<0)return!1;if(e.x>(g.documentElement.clientWidth||p.innerWidth))return!1;if(e.y<0)return!1;if(e.y>(g.documentElement.clientHeight||p.innerHeight))return!1;let i=g.elementFromPoint(e.x,e.y);for(;i;){if(i===t)return!0;if(!i.parentNode)return!1;i=i.parentNode}}(t)&&(i=t,e(i.parentElement)&&e(i)&&"0"!==i.style.opacity&&"0px"!==p.getComputedStyle(i).height&&"0px"!==p.getComputedStyle(i).width)&&(!t.parentElement||t.tabIndex>=0));var i}static registerComponent(t,e){if("string"!=typeof t||!t)throw new Error(`Illegal component name, "${t}"; must be a non-empty string.`);const i=Tn.getComponent("Tech"),s=i&&i.isTech(e),n=Tn===e||Tn.prototype.isPrototypeOf(e.prototype);if(s||!n){let e;throw e=s?"techs must be registered using Tech.registerTech()":"must be a Component subclass",new Error(`Illegal component, "${t}"; ${e}.`)}t=bn(t),Tn.components_||(Tn.components_={});const r=Tn.getComponent("Player");if("Player"===t&&r&&r.players){const t=r.players,e=Object.keys(t);if(t&&e.length>0)for(let i=0;i<e.length;i++)if(null!==t[e[i]])throw new Error("Can not register Player component after player has been created.")}return Tn.components_[t]=e,Tn.components_[yn(t)]=e,e}static getComponent(t){if(t&&Tn.components_)return Tn.components_[t]}}function Sn(t,e,i,s){return function(t,e,i){if("number"!=typeof e||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}).`)}(t,s,i.length-1),i[s][e]}function kn(t){let e;return e=void 0===t||0===t.length?{length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:{length:t.length,start:Sn.bind(null,"start",0,t),end:Sn.bind(null,"end",1,t)},p.Symbol&&p.Symbol.iterator&&(e[p.Symbol.iterator]=()=>(t||[]).values()),e}function xn(t,e){return Array.isArray(t)?kn(t):void 0===t||void 0===e?kn():kn([[t,e]])}Tn.registerComponent("Component",Tn);const An=function(t,e){t=t<0?0:t;let i=Math.floor(t%60),s=Math.floor(t/60%60),n=Math.floor(t/3600);const r=Math.floor(e/60%60),o=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(n=s=i="-"),n=n>0||o>0?n+":":"",s=((n||r>=10)&&s<10?"0"+s:s)+":",i=i<10?"0"+i:i,n+s+i};let En=An;function In(t){En=t}function Dn(){En=An}function Cn(t,e=t){return En(t,e)}var Nn=Object.freeze({__proto__:null,createTimeRanges:xn,createTimeRange:xn,setFormatTime:In,resetFormatTime:Dn,formatTime:Cn});function Mn(t,e){let i,s,n=0;if(!e)return 0;t&&t.length||(t=xn(0,0));for(let r=0;r<t.length;r++)i=t.start(r),s=t.end(r),s>e&&(s=e),n+=s-i;return n/e}function On(t){if(t instanceof On)return t;"number"==typeof t?this.code=t:"string"==typeof t?this.message=t:Ti(t)&&("number"==typeof t.code&&(this.code=t.code),Object.assign(this,t)),this.message||(this.message=On.defaultMessages[this.code]||"")}function Rn(t){return null!=t&&"function"==typeof t.then}function Pn(t){Rn(t)&&t.then(null,(()=>{}))}On.prototype.code=0,On.prototype.message="",On.prototype.status=null,On.prototype.metadata=null,On.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],On.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."},On.MEDIA_ERR_CUSTOM=0,On.prototype.MEDIA_ERR_CUSTOM=0,On.MEDIA_ERR_ABORTED=1,On.prototype.MEDIA_ERR_ABORTED=1,On.MEDIA_ERR_NETWORK=2,On.prototype.MEDIA_ERR_NETWORK=2,On.MEDIA_ERR_DECODE=3,On.prototype.MEDIA_ERR_DECODE=3,On.MEDIA_ERR_SRC_NOT_SUPPORTED=4,On.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,On.MEDIA_ERR_ENCRYPTED=5,On.prototype.MEDIA_ERR_ENCRYPTED=5;const _n=function(t){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce(((e,i)=>(t[i]&&(e[i]=t[i]),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}}))})};var Ln=_n;const Fn="vjs-modal-dialog";class $n extends Tn{constructor(t,e){super(t,e),this.handleKeyDown_=t=>this.handleKeyDown(t),this.close_=t=>this.close(t),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=ss("div",{className:`${Fn}-content`},{role:"document"}),this.descEl_=ss("p",{className:`${Fn}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),ns(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`${Fn} 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.");return this.closeable()&&(t+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),t}open(){if(this.opened_)return void(this.options_.fillAlways&&this.fill());const t=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!t.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&t.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=t.controls(),t.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(t){return"boolean"==typeof t&&this[t?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const t=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&t.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&t.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(t){if("boolean"==typeof t){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_)}!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(),i=e.parentNode,s=e.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,i.removeChild(e),this.empty(),ks(e,t),this.trigger("modalfill"),s?i.insertBefore(e,s):i.appendChild(e);const n=this.getChild("closeButton");n&&i.appendChild(n.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),ws(this.contentEl()),this.trigger("modalempty")}content(t){return void 0!==t&&(this.content_=t),this.content_}conditionalFocus_(){const t=g.activeElement,e=this.player_.el_;this.previouslyActiveEl_=null,(e.contains(t)||e===t)&&(this.previouslyActiveEl_=t,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(t){if(this.trigger({type:"modalKeydown",originalEvent:t,target:this,bubbles:!0}),t.stopPropagation(),"Escape"===t.key&&this.closeable())return t.preventDefault(),void this.close();if("Tab"!==t.key)return;const e=this.focusableEls_(),i=this.el_.querySelector(":focus");let s;for(let t=0;t<e.length;t++)if(i===e[t]){s=t;break}g.activeElement===this.el_&&(s=0),t.shiftKey&&0===s?(e[e.length-1].focus(),t.preventDefault()):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 p.HTMLAnchorElement||t instanceof p.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof p.HTMLInputElement||t instanceof p.HTMLSelectElement||t instanceof p.HTMLTextAreaElement||t instanceof p.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof p.HTMLIFrameElement||t instanceof p.HTMLObjectElement||t instanceof p.HTMLEmbedElement||t.hasAttribute("tabindex")&&-1!==t.getAttribute("tabindex")||t.hasAttribute("contenteditable")))}}$n.prototype.options_={pauseOnOpen:!0,temporary:!0},Tn.registerComponent("ModalDialog",$n);class Bn extends rn{constructor(t=[]){super(),this.tracks_=[];for(let e=0;e<t.length;e++)this.addTrack(t[e])}get length(){return this.tracks_.length}addTrack(t){const e=this.tracks_.length;""+e in this||Object.defineProperty(this,e,{get(){return this.tracks_[e]}}),-1===this.tracks_.indexOf(t)&&(this.tracks_.push(t),this.trigger({track:t,type:"addtrack",target:this})),t.labelchange_=()=>{this.trigger({track:t,type:"labelchange",target:this})},an(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],e.off&&e.off(),this.tracks_.splice(i,1);break}e&&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}}Bn.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const t in Bn.prototype.allowedEvents_)Bn.prototype["on"+t]=null;const Un=function(t,e){for(let i=0;i<t.length;i++)Object.keys(t[i]).length&&e.id!==t[i].id&&(t[i].enabled=!1)};class qn extends Bn{constructor(t=[]){for(let e=t.length-1;e>=0;e--)if(t[e].enabled){Un(t,t[e]);break}super(t),this.changing_=!1}addTrack(t){t.enabled&&Un(this,t),super.addTrack(t),t.addEventListener&&(t.enabledChange_=()=>{this.changing_||(this.changing_=!0,Un(this,t),this.changing_=!1,this.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))}removeTrack(t){super.removeTrack(t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)}}const Vn=function(t,e){for(let i=0;i<t.length;i++)Object.keys(t[i]).length&&e.id!==t[i].id&&(t[i].selected=!1)};class zn extends Bn{constructor(t=[]){for(let e=t.length-1;e>=0;e--)if(t[e].selected){Vn(t,t[e]);break}super(t),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set(){}})}addTrack(t){t.selected&&Vn(this,t),super.addTrack(t),t.addEventListener&&(t.selectedChange_=()=>{this.changing_||(this.changing_=!0,Vn(this,t),this.changing_=!1,this.trigger("change"))},t.addEventListener("selectedchange",t.selectedChange_))}removeTrack(t){super.removeTrack(t),t.removeEventListener&&t.selectedChange_&&(t.removeEventListener("selectedchange",t.selectedChange_),t.selectedChange_=null)}}class Hn extends Bn{addTrack(t){super.addTrack(t),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),t.addEventListener("modechange",this.queueChange_),-1===["metadata","chapters"].indexOf(t.kind)&&t.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(t){super.removeTrack(t),t.removeEventListener&&(this.queueChange_&&t.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&t.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map((t=>t.toJSON()))}}class Xn{constructor(t){Xn.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){""+t in this||Object.defineProperty(this,""+t,{get(){return this.cues_[t]}})};if(e<s)for(i=e;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 Gn={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},Yn={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},Wn={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Jn={disabled:"disabled",hidden:"hidden",showing:"showing"};class Kn extends rn{constructor(t={}){super();const e={id:t.id||"vjs_track_"+Us(),kind:t.kind||"",language:t.language||""};let i=t.label||"";for(const t in e)Object.defineProperty(this,t,{get:()=>e[t],set(){}});Object.defineProperty(this,"label",{get:()=>i,set(t){t!==i&&(i=t,this.trigger("labelchange"))}})}}const Qn=function(t){return new URL(t,g.baseURI)},Zn=function(t){return new URL(t,g.baseURI).href},tr=function(t){if("string"==typeof t){const e=t.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return e?e[1].toLowerCase():""}return""},er=function(t,e=p.location){return Qn(t).origin!==e.origin};var ir=Object.freeze({__proto__:null,parseUrl:Qn,getAbsoluteURL:Zn,getFileExtension:tr,isCrossOrigin:er});const sr=function(t,e){const i=new p.WebVTT.Parser(p,p.vttjs,p.WebVTT.StringDecoder()),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),s.length>0&&(p.console&&p.console.groupCollapsed&&p.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),s.forEach((t=>mi.error(t))),p.console&&p.console.groupEnd&&p.console.groupEnd()),i.flush()},nr=function(t,e){const i={uri:t},s=er(t);s&&(i.cors=s);const n="use-credentials"===e.tech_.crossOrigin();n&&(i.withCredentials=n),B(i,Zs(this,(function(t,i,s){if(t)return mi.error(t,i);e.loaded_=!0,"function"!=typeof p.WebVTT?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],(t=>{if("vttjserror"!==t.type)return sr(s,e);mi.error(`vttjs failed to load, stopping trying to process ${e.src}`)})):sr(s,e)})))};class rr extends Kn{constructor(t={}){if(!t.tech)throw new Error("A tech was not provided.");const e=ki(t,{kind:Wn[t.kind]||"subtitles",language:t.language||t.srclang||""});let i=Jn[e.mode]||"disabled";const s=e.default;"metadata"!==e.kind&&"chapters"!==e.kind||(i="hidden"),super(e),this.tech_=e.tech,this.cues_=[],this.activeCues_=[],this.preload_=!1!==this.tech_.preloadTextTracks;const n=new Xn(this.cues_),r=new Xn(this.activeCues_);let o=!1;this.timeupdateHandler=Zs(this,(function(t={}){this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),"timeupdate"!==t.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==t.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))})),this.tech_.one("dispose",(()=>{this.stopTracking()})),"disabled"!==i&&this.startTracking(),Object.defineProperties(this,{default:{get:()=>s,set(){}},mode:{get:()=>i,set(t){Jn[t]&&i!==t&&(i=t,this.preload_||"disabled"===i||0!==this.cues.length||nr(this.src,this),this.stopTracking(),"disabled"!==i&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(0===this.cues.length)return r;const t=this.tech_.currentTime(),e=[];for(let i=0,s=this.cues.length;i<s;i++){const s=this.cues[i];s.startTime<=t&&s.endTime>=t&&e.push(s)}if(o=!1,e.length!==this.activeCues_.length)o=!0;else for(let t=0;t<e.length;t++)-1===this.activeCues_.indexOf(e[t])&&(o=!0);return this.activeCues_=e,r.setCues_(this.activeCues_),r},set(){}}}),e.src?(this.src=e.src,this.preload_||(this.loaded_=!0),(this.preload_||"subtitles"!==e.kind&&"captions"!==e.kind)&&nr(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(t){let e=t;if(!("getCueAsHTML"in e)){e=new p.vttjs.VTTCue(t.startTime,t.endTime,t.text);for(const i in t)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++)i[t]!==this&&i[t].removeCue(e);this.cues_.push(e),this.cues.setCues_(this.cues_)}toJSON(){return Ln(this)}removeCue(t){let e=this.cues_.length;for(;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}}}}rr.prototype.allowedEvents_={cuechange:"cuechange"};class or extends Kn{constructor(t={}){const e=ki(t,{kind:Yn[t.kind]||""});super(e);let i=!1;Object.defineProperty(this,"enabled",{get:()=>i,set(t){"boolean"==typeof t&&t!==i&&(i=t,this.trigger("enabledchange"))}}),e.enabled&&(this.enabled=e.enabled),this.loaded_=!0}}class ar extends Kn{constructor(t={}){const e=ki(t,{kind:Gn[t.kind]||""});super(e);let i=!1;Object.defineProperty(this,"selected",{get:()=>i,set(t){"boolean"==typeof t&&t!==i&&(i=t,this.trigger("selectedchange"))}}),e.selected&&(this.selected=e.selected)}}class hr extends rn{constructor(t={}){let e;super();const i=new rr(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:()=>e},track:{get:()=>i}}),e=hr.NONE,i.addEventListener("loadeddata",(()=>{e=hr.LOADED,this.trigger({type:"load",target:this})}))}}hr.prototype.allowedEvents_={load:"load"},hr.NONE=0,hr.LOADING=1,hr.LOADED=2,hr.ERROR=3;const lr={audio:{ListClass:qn,TrackClass:or,capitalName:"Audio"},video:{ListClass:zn,TrackClass:ar,capitalName:"Video"},text:{ListClass:Hn,TrackClass:rr,capitalName:"Text"}};Object.keys(lr).forEach((function(t){lr[t].getterName=`${t}Tracks`,lr[t].privateName=`${t}Tracks_`}));const ur={remoteText:{ListClass:Hn,TrackClass:rr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:class{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;""+e in this||Object.defineProperty(this,e,{get(){return this.trackElements_[e]}}),-1===this.trackElements_.indexOf(t)&&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]){this.trackElements_[e].track&&"function"==typeof this.trackElements_[e].track.off&&this.trackElements_[e].track.off(),"function"==typeof this.trackElements_[e].off&&this.trackElements_[e].off(),this.trackElements_.splice(e,1);break}}},TrackClass:hr,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},cr=Object.assign({},lr,ur);ur.names=Object.keys(ur),lr.names=Object.keys(lr),cr.names=[].concat(ur.names).concat(lr.names);class dr extends Tn{constructor(t={},e=function(){}){t.reportTouchActivity=!1,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_=!1,this.on("playing",(function(){this.hasStarted_=!0})),this.on("loadstart",(function(){this.hasStarted_=!1})),cr.names.forEach((e=>{const i=cr[e];t&&t[i.getterName]&&(this[i.privateName]=t[i.getterName])})),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach((e=>{!1===t[`native${e}Tracks`]&&(this[`featuresNative${e}Tracks`]=!1)})),!1===t.nativeCaptions||!1===t.nativeTextTracks?this.featuresNativeTextTracks=!1:!0!==t.nativeCaptions&&!0!==t.nativeTextTracks||(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=!1!==t.preloadTextTracks,this.autoRemoteTextTracks_=new cr.text.ListClass,this.initTrackListeners(),t.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(t){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=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(t){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Zs(this,(function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,1===t&&this.stopTrackingProgress()})),500)}onDurationChange(t){this.duration_=this.duration()}buffered(){return xn(0,0)}bufferedPercent(){return Mn(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval((function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}),250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(lr.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(t){(t=[].concat(t)).forEach((t=>{const e=this[`${t}Tracks`]()||[];let i=e.length;for(;i--;){const s=e[i];"text"===t&&this.removeRemoteTextTrack(s),e.removeTrack(s)}}))}cleanupAutoTextTracks(){const t=this.autoRemoteTextTracks_||[];let e=t.length;for(;e--;)this.removeRemoteTextTrack(t[e])}reset(){}crossOrigin(){}setCrossOrigin(){}error(t){return void 0!==t&&(this.error_=new On(t),this.trigger("error")),this.error_}played(){return this.hasStarted_?xn(0,0):xn()}play(){}setScrubbing(t){}scrubbing(){}setCurrentTime(t){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){lr.names.forEach((t=>{const e=()=>{this.trigger(`${t}trackchange`)},i=this[lr[t].getterName]();i.addEventListener("removetrack",e),i.addEventListener("addtrack",e),this.on("dispose",(()=>{i.removeEventListener("removetrack",e),i.removeEventListener("addtrack",e)}))}))}addWebVttScript_(){if(!p.WebVTT)if(g.body.contains(this.el())){if(!this.options_["vtt.js"]&&Si(H)&&Object.keys(H).length>0)return void this.trigger("vttjsloaded");const t=g.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})),p.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const t=this.textTracks(),e=this.remoteTextTracks(),i=e=>t.addTrack(e.track),s=e=>t.removeTrack(e.track);e.on("addtrack",i),e.on("removetrack",s),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),r=()=>{n();for(let e=0;e<t.length;e++){const i=t[e];i.removeEventListener("cuechange",n),"showing"===i.mode&&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++)t[e].removeEventListener("cuechange",n)}))}addTextTrack(t,e,i){if(!t)throw new Error("TextTrack kind is required but was not provided");return function(t,e,i,s,n={}){const r=t.textTracks();n.kind=e,i&&(n.label=i),s&&(n.language=s),n.tech=t;const o=new cr.text.TrackClass(n);return r.addTrack(o),o}(this,t,e,i)}createRemoteTextTrack(t){const e=ki(t,{tech:this});return new ur.remoteTextEl.TrackClass(e)}addRemoteTextTrack(t={},e){const i=this.createRemoteTextTrack(t);return"boolean"!=typeof e&&(e=!1),this.remoteTextTrackEls().addTrackElement_(i),this.remoteTextTracks().addTrack(i.track),!1===e&&this.ready((()=>this.autoRemoteTextTracks_.addTrack(i.track))),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!0}setDisablePictureInPicture(){}requestVideoFrameCallback(t){const e=Us();return!this.isReady_||this.paused()?(this.queuedHanders_.add(e),this.one("playing",(()=>{this.queuedHanders_.has(e)&&(this.queuedHanders_.delete(e),t())}))):this.requestNamedAnimationFrame(e,t),e}cancelVideoFrameCallback(t){this.queuedHanders_.has(t)?this.queuedHanders_.delete(t):this.cancelNamedAnimationFrame(t)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(t){}overrideNativeVideoTracks(t){}canPlayType(t){return""}static canPlayType(t){return""}static canPlaySource(t,e){return dr.canPlayType(t.type)}static isTech(t){return t.prototype instanceof dr||t instanceof dr||t===dr}static registerTech(t,e){if(dr.techs_||(dr.techs_={}),!dr.isTech(e))throw new Error(`Tech ${t} must be a Tech`);if(!dr.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!dr.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return t=bn(t),dr.techs_[t]=e,dr.techs_[yn(t)]=e,"Tech"!==t&&dr.defaultTechOrder_.push(t),e}static getTech(t){if(t)return dr.techs_&&dr.techs_[t]?dr.techs_[t]:(t=bn(t),p&&p.videojs&&p.videojs[t]?(mi.warn(`The ${t} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),p.videojs[t]):void 0)}}cr.names.forEach((function(t){const e=cr[t];dr.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}})),dr.prototype.featuresVolumeControl=!0,dr.prototype.featuresMuteControl=!0,dr.prototype.featuresFullscreenResize=!1,dr.prototype.featuresPlaybackRate=!1,dr.prototype.featuresProgressEvents=!1,dr.prototype.featuresSourceset=!1,dr.prototype.featuresTimeupdateEvents=!1,dr.prototype.featuresNativeTextTracks=!1,dr.prototype.featuresVideoFrameCallback=!1,dr.withSourceHandlers=function(t){t.registerSourceHandler=function(e,i){let s=t.sourceHandlers;s||(s=t.sourceHandlers=[]),void 0===i&&(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++)if(s=i[t].canPlayType(e),s)return s;return""},t.selectSourceHandler=function(e,i){const s=t.sourceHandlers||[];let n;for(let t=0;t<s.length;t++)if(n=s[t].canHandleSource(e,i),n)return s[t];return null},t.canPlaySource=function(e,i){const s=t.selectSourceHandler(e,i);return s?s.canHandleSource(e,i):""},["seekable","seeking","duration"].forEach((function(t){const e=this[t];"function"==typeof e&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):e.apply(this,arguments)})}),t.prototype),t.prototype.setSource=function(e){let i=t.selectSourceHandler(e,this.options_);i||(t.nativeSourceHandler?i=t.nativeSourceHandler:mi.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),i!==t.nativeSourceHandler&&(this.currentSource_=e),this.sourceHandler_=i.handleSource(e,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},t.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},Tn.registerComponent("Tech",dr),dr.registerTech("Tech",dr),dr.defaultTechOrder_=[];const fr={},pr={},vr={};function mr(t,e,i){t.setTimeout((()=>Tr(e,fr[e.type],i,t)),1)}function gr(t,e,i,s=null){const n="call"+bn(i),r=t.reduce(wr(n),s),o=r===vr,a=o?null:e[i](r);return function(t,e,i,s){for(let n=t.length-1;n>=0;n--){const r=t[n];r[e]&&r[e](s,i)}}(t,i,a,o),a}const yr={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},br={setCurrentTime:1,setMuted:1,setVolume:1},jr={play:1,pause:1};function wr(t){return(e,i)=>e===vr?vr:i[t]?i[t](e):e}function Tr(t={},e=[],i,s,n=[],r=!1){const[o,...a]=e;if("string"==typeof o)Tr(t,fr[o],i,s,n,r);else if(o){const e=function(t,e){const i=pr[t.id()];let s=null;if(null==i)return s=e(t),pr[t.id()]=[[e,s]],s;for(let t=0;t<i.length;t++){const[n,r]=i[t];n===e&&(s=r)}return null===s&&(s=e(t),i.push([e,s])),s}(s,o);if(!e.setSource)return n.push(e),Tr(t,a,i,s,n,r);e.setSource(Object.assign({},t),(function(o,h){if(o)return Tr(t,a,i,s,n,r);n.push(e),Tr(h,t.type===h.type?a:fr[h.type],i,s,n,r)}))}else a.length?Tr(t,a,i,s,n,r):r?i(t,n):Tr(t,fr["*"],i,s,n,!0)}const Sr={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"},kr=function(t=""){const e=tr(t);return Sr[e.toLowerCase()]||""},xr=function(t){if(Array.isArray(t)){let e=[];t.forEach((function(t){t=xr(t),Array.isArray(t)?e=e.concat(t):Ti(t)&&e.push(t)})),t=e}else t="string"==typeof t&&t.trim()?[Ar({src:t})]:Ti(t)&&"string"==typeof t.src&&t.src&&t.src.trim()?[Ar(t)]:[];return t};function Ar(t){if(!t.type){const e=kr(t.src);e&&(t.type=e)}return t}const Er=zi?10009:Hi?461:8,Ir={codes:{play:415,pause:19,ff:417,rw:412,back:Er},names:{415:"play",19:"pause",417:"ff",412:"rw",[Er]:"back"},isEventKey(t,e){return e=e.toLowerCase(),!(!this.names[t.keyCode]||this.names[t.keyCode]!==e)},getEventName(t){return this.names[t.keyCode]?this.names[t.keyCode]:this.codes[t.code]?this.names[this.codes[t.code]]:null}};class Dr extends rn{constructor(t){super(),this.player_=t,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",(()=>{this.focus(this.updateFocusableComponents()[0])})),this.player_.on("modalclose",(()=>{this.refocusComponent()})),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",(()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())})))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(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(Ir.isEventKey(e,"play")||Ir.isEventKey(e,"pause")||Ir.isEventKey(e,"ff")||Ir.isEventKey(e,"rw")){e.preventDefault();const t=Ir.getEventName(e);this.performMediaAction_(t)}else Ir.isEventKey(e,"Back")&&t.target&&"function"==typeof t.target.closeable&&t.target.closeable()&&(e.preventDefault(),t.target.close())}performMediaAction_(t){if(this.player_)switch(t){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+5);break;case"rw":this.userSeek_(this.player_.currentTime()-5)}}userSeek_(t){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(t)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(t){const e=t.relatedTarget;let i=null;const s=this.getCurrentComponent(t.target);e&&(i=Boolean(e.closest(".video-js")),e.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(t.currentTarget.contains(t.relatedTarget)||i)&&e||(s&&"CloseButton"===s.name()?this.refocusComponent():(this.pause(),s&&s.el()&&(this.lastFocusedComponent_=s)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const t=[];function e(i){for(const s of i)s.hasOwnProperty("el_")&&s.getIsFocusable()&&s.getIsAvailableToBeFocused(s.el())&&t.push(s),s.hasOwnProperty("children_")&&s.children_.length>0&&e(s.children_)}return this.player_.children_.forEach((i=>{if(i.hasOwnProperty("el_")){if(i.getIsFocusable&&i.getIsAvailableToBeFocused&&i.getIsFocusable()&&i.getIsAvailableToBeFocused(i.el()))return void t.push(i);i.hasOwnProperty("children_")&&i.children_.length>0?e(i.children_):i.hasOwnProperty("items")&&i.items.length>0?e(i.items):this.findSuitableDOMChild(i)&&t.push(i)}if("ErrorDisplay"===i.name_&&i.opened_){const e=i.el_.querySelector(".vjs-errors-ok-button-container");e&&e.querySelectorAll("button").forEach(((e,i)=>{t.push({name:()=>"ModalButton"+(i+1),el:()=>e,getPositions:()=>{const t=e.getBoundingClientRect();return{boundingClientRect:{x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,right:t.right,bottom:t.bottom,left:t.left},center:{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}}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:()=>!0,focus:()=>e.focus()})}))}})),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(t){return t.el()?function e(i){if(t.getIsFocusable(i)&&t.getIsAvailableToBeFocused(i))return i;for(let t=0;t<i.children.length;t++){const s=e(i.children[t]);if(s)return s}return null}(t.el()):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];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())return this.focusableComponents.splice(e,1),void this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}clear(){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(),s=this.focusableComponents.filter((s=>s!==e&&this.isInDirection_(i.boundingClientRect,s.getPositions().boundingClientRect,t))),n=this.findBestCandidate_(i.center,s,t);n?this.focus(n):this.trigger({type:"endOfFocusableComponents",direction:t,focusedComponent:e})}findBestCandidate_(t,e,i){let s=1/0,n=null;for(const r of e){const e=r.getPositions().center,o=this.calculateDistance_(t,e,i);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!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===this.lastFocusedComponent_.name())return void this.focus(this.focusableComponents[t])}else this.focus(this.updateFocusableComponents()[0])}focus(t){"object"==typeof t&&(t.getIsAvailableToBeFocused(t.el())?t.focus():this.findSuitableDOMChild(t)&&this.findSuitableDOMChild(t).focus())}calculateDistance_(t,e,i){const s=Math.abs(t.x-e.x),n=Math.abs(t.y-e.y);let r;switch(i){case"right":case"left":r=s+100*n;break;case"up":r=2*n+.5*s;break;case"down":r=5*n+s;break;default:r=s+n}return r}searchForTrackSelect_(){const t=this;for(const e of t.updateFocusableComponents())if("TextTrackSelect"===e.constructor.name){t.focus(e);break}}}Tn.registerComponent("MediaLoader",class extends Tn{constructor(t,e,i){if(super(t,ki({createEl:!1},e),i),e.playerOptions.sources&&0!==e.playerOptions.sources.length)t.src(e.playerOptions.sources);else for(let i=0,s=e.playerOptions.techOrder;i<s.length;i++){const e=bn(s[i]);let n=dr.getTech(e);if(e||(n=Tn.getComponent(e)),n&&n.isSupported()){t.loadTech_(e);break}}}});class Cr extends Tn{constructor(t,e){super(t,e),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),"button"===t&&mi.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=ss(t,e,i);return this.player_.options_.experimentalSvgIcons||s.appendChild(ss("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(t){return this.controlTextEl_=ss("span",{className:"vjs-control-text"},{"aria-live":"polite"}),t&&t.appendChild(this.controlTextEl_),this.controlText(this.controlText_,t),this.controlTextEl_}controlText(t,e=this.el()){if(void 0===t)return this.controlText_||"Need Text";const i=this.localize(t);this.controlText_=t,ns(this.controlTextEl_,i),this.nonIconControl||this.player_.options_.noUITitleAttributes||e.setAttribute("title",i)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),void 0!==this.tabIndex_&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),void 0!==this.tabIndex_&&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){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(t){" "===t.key||"Enter"===t.key?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):super.handleKeyDown(t)}}Tn.registerComponent("ClickableComponent",Cr);class Nr extends Cr{constructor(t,e){super(t,e);const{mainContent:i}=e&&e.playerOptions||{};this.isMainContent=i,this.update(),this.update_=t=>this.update(t),t.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return ss("div",{className:"vjs-poster"})}crossOrigin(t){if(void 0===t)return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;null===t||"anonymous"===t||"use-credentials"===t?this.$("img")&&(this.$("img").crossOrigin=t):this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${t}"`)}update(t){const e=this.player().poster();this.setSrc(e),e?this.show():this.hide()}setSrc(t){t?(this.$("img")||this.el_.appendChild(ss("picture",{className:"vjs-poster",tabIndex:-1},{},ss("img",{loading:this.isMainContent?"eager":"lazy",fetchPriority:this.isMainContent?"high":"auto",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=t):this.el_.textContent=""}handleClick(t){if(!this.player_.controls())return;const e=this.player_.getChild("controlBar"),i=e&&e.getChild("playToggle");Oi?(i||this.player_).focus():this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?Pn(this.player_.play()):this.player_.pause()}}Nr.prototype.crossorigin=Nr.prototype.crossOrigin,Tn.registerComponent("PosterImage",Nr);const Mr="#222",Or="#ccc",Rr={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 Pr(t,e){let i;if(4===t.length)i=t[1]+t[1]+t[2]+t[2]+t[3]+t[3];else{if(7!==t.length)throw new Error("Invalid color code provided, "+t+"; must be formatted as e.g. #f0e or #f604e2.");i=t.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+e+")"}function _r(t,e,i){try{t.style[e]=i}catch(t){return}}function Lr(t){return t?`${t}px`:""}Tn.registerComponent("TextTrackDisplay",class extends Tn{constructor(t,e,i){super(t,e,i);const s=t=>this.updateDisplay(t),n=t=>{this.updateDisplayOverlay(),this.updateDisplay(t)};t.on("loadstart",(t=>this.toggleDisplay(t))),t.on("useractive",s),t.on("userinactive",s),t.on("texttrackchange",s),t.on("loadedmetadata",(t=>{this.updateDisplayOverlay(),this.preselectTrack(t)})),t.ready(Zs(this,(function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)return void this.hide();t.on("fullscreenchange",n),t.on("playerresize",n);const e=p.screen.orientation||p,i=p.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],!0);this.preselectTrack()})))}preselectTrack(){const t={captions:1,subtitles:1},e=this.player_.textTracks(),i=this.player_.cache_.selectedLanguage;let s,n,r;for(let o=0;o<e.length;o++){const a=e[o];i&&i.enabled&&i.language&&i.language===a.language&&a.kind in t?a.kind===i.kind?r=a:r||(r=a):i&&!i.enabled?(r=null,s=null,n=null):a.default&&("descriptions"!==a.kind||s?a.kind in t&&!n&&(n=a):s=a)}r?r.mode="showing":n?n.mode="showing":s&&(s.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){"function"==typeof p.WebVTT&&p.WebVTT.processCues(p,[],this.el_)}updateDisplay(){const t=this.player_.textTracks(),e=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),e){const e=[];for(let i=0;i<t.length;++i){const s=t[i];"showing"===s.mode&&e.push(s)}return void this.updateForTrack(e)}let i=null,s=null,n=t.length;for(;n--;){const e=t[n];"showing"===e.mode&&("descriptions"===e.kind?i=e:s=e)}if(s?("off"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","off"),this.updateForTrack(s)):i&&("assertive"!==this.getAttribute("aria-live")&&this.setAttribute("aria-live","assertive"),this.updateForTrack(i)),void 0===p.CSS||!p.CSS.supports("inset","10px")){const t=this.el_,e=t.querySelectorAll(".vjs-text-track-cue"),i=this.player_.controlBar.el_.getBoundingClientRect().height,s=this.player_.el_.getBoundingClientRect().height;t.style="",_r(t,"position","relative"),_r(t,"height",s-i+"px"),_r(t,"top","unset"),_r(t,"bottom",Xi?s+"px":"0px"),e.length>0&&e.forEach((t=>{if(t.style.inset){const e=t.style.inset.split(" ");3===e.length&&Object.assign(t.style,{top:e[0],right:e[1],bottom:e[2],left:"unset"})}}))}}updateDisplayOverlay(){if(!this.player_.videoHeight()||void 0===p.CSS||!p.CSS.supports("inset-inline: 10px"))return;const t=this.player_.currentWidth(),e=this.player_.currentHeight(),i=t/e,s=this.player_.videoWidth()/this.player_.videoHeight();let n=0,r=0;Math.abs(i-s)>.1&&(i>s?n=Math.round((t-e*s)/2):r=Math.round((e-t/s)/2)),_r(this.el_,"insetInline",Lr(n)),_r(this.el_,"insetBlock",Lr(r))}updateDisplayState(t){const e=this.player_.textTrackSettings.getValues(),i=t.activeCues;let s=i.length;for(;s--;){const t=i[s];if(!t)continue;const n=t.displayState;if(e.color&&(n.firstChild.style.color=e.color),e.textOpacity&&_r(n.firstChild,"color",Pr(e.color||"#fff",e.textOpacity)),e.backgroundColor&&(n.firstChild.style.backgroundColor=e.backgroundColor),e.backgroundOpacity&&_r(n.firstChild,"backgroundColor",Pr(e.backgroundColor||"#000",e.backgroundOpacity)),e.windowColor&&(e.windowOpacity?_r(n,"backgroundColor",Pr(e.windowColor,e.windowOpacity)):n.style.backgroundColor=e.windowColor),e.edgeStyle&&("dropshadow"===e.edgeStyle?n.firstChild.style.textShadow=`2px 2px 3px ${Mr}, 2px 2px 4px ${Mr}, 2px 2px 5px ${Mr}`:"raised"===e.edgeStyle?n.firstChild.style.textShadow=`1px 1px ${Mr}, 2px 2px ${Mr}, 3px 3px ${Mr}`:"depressed"===e.edgeStyle?n.firstChild.style.textShadow=`1px 1px ${Or}, 0 1px ${Or}, -1px -1px ${Mr}, 0 -1px ${Mr}`:"uniform"===e.edgeStyle&&(n.firstChild.style.textShadow=`0 0 4px ${Mr}, 0 0 4px ${Mr}, 0 0 4px ${Mr}, 0 0 4px ${Mr}`)),e.fontPercent&&1!==e.fontPercent){const t=p.parseFloat(n.style.fontSize);n.style.fontSize=t*e.fontPercent+"px",n.style.height="auto",n.style.top="auto"}e.fontFamily&&"default"!==e.fontFamily&&("small-caps"===e.fontFamily?n.firstChild.style.fontVariant="small-caps":n.firstChild.style.fontFamily=Rr[e.fontFamily])}}updateForTrack(t){if(Array.isArray(t)||(t=[t]),"function"!=typeof p.WebVTT||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])}p.WebVTT.processCues(p,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;as(s,"vjs-text-track-cue","vjs-text-track-cue-"+(i.language?i.language:e)),i.language&&fs(s,"lang",i.language)}this.player_.textTrackSettings&&this.updateDisplayState(i)}}}),Tn.registerComponent("LoadingSpinner",class extends Tn{createEl(){const t=this.player_.isAudio(),e=this.localize(t?"Audio Player":"Video Player"),i=ss("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[e])}),s=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return s.appendChild(i),s}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}});class Fr extends Cr{createEl(t,e={},i={}){const s=ss("button",e=Object.assign({className:this.buildCSSClass()},e),i=Object.assign({type:"button"},i));return this.player_.options_.experimentalSvgIcons||s.appendChild(ss("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(s),s}addChild(t,e={}){return mi.warn(`Adding an actionable (user controllable) child to a Button (${this.constructor.name}) is not supported; use a ClickableComponent instead.`),Tn.prototype.addChild.call(this,t,e)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(t){" "!==t.key&&"Enter"!==t.key?super.handleKeyDown(t):t.stopPropagation()}}Tn.registerComponent("Button",Fr);class $r extends Fr{constructor(t,e){super(t,e),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",(t=>this.handleMouseDown(t)))}buildCSSClass(){return"vjs-big-play-button"}handleClick(t){const e=this.player_.play(),i=this.player_.getChild("controlBar"),s=i&&i.getChild("playToggle");if("tap"===t.type||this.mouseused_&&"clientX"in t&&"clientY"in t)return Pn(e),void(Oi?(s||this.player_).focus():this.player_.tech(!0)&&this.player_.tech(!0).focus());if(!s)return void this.player_.tech(!0).focus();const n=()=>s.focus();Rn(e)?e.then(n,(()=>{})):this.setTimeout(n,1)}handleKeyDown(t){this.mouseused_=!1,super.handleKeyDown(t)}handleMouseDown(t){this.mouseused_=!0}}$r.prototype.controlText_="Play Video",Tn.registerComponent("BigPlayButton",$r),Tn.registerComponent("CloseButton",class extends Fr{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:!1})}handleKeyDown(t){"Escape"===t.key?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):super.handleKeyDown(t)}});class Br extends Fr{constructor(t,e={}){super(t,e),e.replay=void 0===e.replay||e.replay,this.setIcon("play"),this.on(t,"play",(t=>this.handlePlay(t))),this.on(t,"pause",(t=>this.handlePause(t))),e.replay&&this.on(t,"ended",(t=>this.handleEnded(t)))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(t){this.player_.paused()?Pn(this.player_.play()):this.player_.pause()}handleSeeked(t){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(t):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)))}}Br.prototype.controlText_="Play",Tn.registerComponent("PlayToggle",Br);class Ur extends Tn{constructor(t,e){super(t,e),this.on(t,["timeupdate","ended","seeking"],(t=>this.update(t))),this.updateTextNode_()}createEl(){const t=this.buildCSSClass(),e=super.createEl("div",{className:`${t} vjs-time-control vjs-control`}),i=ss("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return e.appendChild(i),this.contentEl_=ss("span",{className:`${t}-display`},{role:"presentation"}),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(t){(this.player_.options_.enableSmoothSeeking||"seeking"!==t.type)&&this.updateContent(t)}updateTextNode_(t=0){t=Cn(t),this.formattedTime_!==t&&(this.formattedTime_=t,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",(()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,mi.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_=g.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))})))}updateContent(t){}}Ur.prototype.labelText_="Time",Ur.prototype.controlText_="Time",Tn.registerComponent("TimeDisplay",Ur);class qr extends Ur{buildCSSClass(){return"vjs-current-time"}updateContent(t){let e;e=this.player_.ended()?this.player_.duration():t&&t.target&&"function"==typeof t.target.pendingSeekTime&&null!==t.target.pendingSeekTime()?t.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(e)}}qr.prototype.labelText_="Current Time",qr.prototype.controlText_="Current Time",Tn.registerComponent("CurrentTimeDisplay",qr);class Vr extends Ur{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)}}Vr.prototype.labelText_="Duration",Vr.prototype.controlText_="Duration",Tn.registerComponent("DurationDisplay",Vr),Tn.registerComponent("TimeDivider",class extends Tn{createEl(){const t=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),e=super.createEl("div"),i=super.createEl("span",{textContent:"/"});return e.appendChild(i),t.appendChild(e),t}});class zr extends Ur{constructor(t,e){super(t,e),this.on(t,"durationchange",(t=>this.updateContent(t)))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const t=super.createEl();return!1!==this.options_.displayNegative&&t.insertBefore(ss("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t}updateContent(t){if("number"!=typeof this.player_.duration())return;let e;e=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(e)}}zr.prototype.labelText_="Remaining Time",zr.prototype.controlText_="Remaining Time",Tn.registerComponent("RemainingTimeDisplay",zr),Tn.registerComponent("LiveDisplay",class extends Tn{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"});return this.contentEl_=ss("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ss("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(g.createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,super.dispose()}updateShowing(t){this.player().duration()===1/0?this.show():this.hide()}});class Hr extends Fr{constructor(t,e){super(t,e),this.updateLiveEdgeStatus(),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"});return this.setIcon("circle",t),this.textEl_=ss("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}function Xr(t,e,i){return t=Number(t),Math.min(i,Math.max(e,isNaN(t)?e:t))}Hr.prototype.controlText_="Seek to live, currently playing live",Tn.registerComponent("SeekToLive",Hr);var Gr=Object.freeze({__proto__:null,clamp:Xr});class Yr extends Tn{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(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const 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"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(t,e={},i={}){return 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),super.createEl(t,e,i)}handleMouseDown(t){const e=this.bar.el_.ownerDocument;"mousedown"===t.type&&t.preventDefault(),"touchstart"!==t.type||Pi||t.preventDefault(),vs(),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,!0)}handleMouseMove(t){}handleMouseUp(t){const e=this.bar.el_.ownerDocument;ms(),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();return t===this.progress_||(this.progress_=t,this.requestNamedAnimationFrame("Slider#update",(()=>{const e=this.vertical()?"height":"width";this.bar.el().style[e]=(100*t).toFixed(2)+"%"}))),t}getProgress(){return Number(Xr(this.getPercent(),0,1).toFixed(4))}calculateDistance(t){const e=bs(this.el_,t);return this.vertical()?e.y:e.x}handleKeyDown(t){const e=this.options_.playerOptions.spatialNavigation,i=e&&e.horizontalSeek;e&&e.enabled?i&&"ArrowLeft"===t.key||!i&&"ArrowDown"===t.key?(t.preventDefault(),t.stopPropagation(),this.stepBack()):i&&"ArrowRight"===t.key||!i&&"ArrowUp"===t.key?(t.preventDefault(),t.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(t)):"ArrowLeft"===t.key||"ArrowDown"===t.key?(t.preventDefault(),t.stopPropagation(),this.stepBack()):"ArrowUp"===t.key||"ArrowRight"===t.key?(t.preventDefault(),t.stopPropagation(),this.stepForward()):super.handleKeyDown(t)}handleClick(t){t.stopPropagation(),t.preventDefault()}vertical(t){if(void 0===t)return this.vertical_||!1;this.vertical_=!!t,this.addClass(this.vertical_?"vjs-slider-vertical":"vjs-slider-horizontal")}}Tn.registerComponent("Slider",Yr);const Wr=(t,e)=>Xr(t/e*100,0,100).toFixed(2)+"%";Tn.registerComponent("LoadProgressBar",class extends Tn{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"}),e=ss("span",{className:"vjs-control-text"}),i=ss("span",{textContent:this.localize("Loaded")}),s=g.createTextNode(": ");return this.percentageEl_=ss("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(e),e.appendChild(i),e.appendChild(s),e.appendChild(this.percentageEl_),t}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(t){this.requestNamedAnimationFrame("LoadProgressBar#update",(()=>{const t=this.player_.liveTracker,e=this.player_.buffered(),i=t&&t.isLive()?t.seekableEnd():this.player_.duration(),s=this.player_.bufferedEnd(),n=this.partEls_,r=Wr(s,i);this.percent_!==r&&(this.el_.style.width=r,ns(this.percentageEl_,r),this.percent_=r);for(let t=0;t<e.length;t++){const i=e.start(t),r=e.end(t);let o=n[t];o||(o=this.el_.appendChild(ss()),n[t]=o),o.dataset.start===i&&o.dataset.end===r||(o.dataset.start=i,o.dataset.end=r,o.style.left=Wr(i,s),o.style.width=Wr(r-i,s))}for(let t=n.length;t>e.length;t--)this.el_.removeChild(n[t-1]);n.length=e.length}))}}),Tn.registerComponent("TimeTooltip",class extends Tn{constructor(t,e){super(t,e),this.update=tn(Zs(this,this.update),Qs)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(t,e,i){const s=ys(this.el_),n=gs(this.player_.el()),r=t.width*e;if(!n||!s)return;let o=t.left-n.left+r,a=t.width-r+(n.right-t.right);a||(a=t.width-r,o=r);let h=s.width/2;o<h?h+=h-o:a<h&&(h=a),h<0?h=0:h>s.width&&(h=s.width),h=Math.round(h),this.el_.style.right=`-${h}px`,this.write(i)}write(t){ns(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(),i=t-e*t;n=(i<1?"":"-")+Cn(i,t)}else n=Cn(i,r);this.update(t,e,n),s&&s()}))}});class Jr extends Tn{constructor(t,e){super(t,e),this.setIcon("circle"),this.update=tn(Zs(this,this.update),Qs)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(t,e,i){const s=this.getChild("timeTooltip");if(!s)return;const n=i&&i.target&&"function"==typeof i.target.pendingSeekTime?i.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(t,e,n)}}Jr.prototype.options_={children:[]},Wi||Ni||Jr.prototype.options_.children.push("timeTooltip"),Tn.registerComponent("PlayProgressBar",Jr);class Kr extends Tn{constructor(t,e){super(t,e),this.update=tn(Zs(this,this.update),Qs)}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"}))}}Kr.prototype.options_={children:["timeTooltip"]},Tn.registerComponent("MouseTimeDisplay",Kr);class Qr extends Yr{constructor(t,e){(e=ki(Qr.prototype.options_,e)).children=[...e.children];const i=t.options_.disableSeekWhileScrubbingOnMobile&&(Wi||Ni)||t.options_.disableSeekWhileScrubbingOnSTV;(!Wi&&!Ni||i)&&e.children.splice(1,0,"mouseTimeDisplay"),super(t,e),this.shouldDisableSeekWhileScrubbing_=i,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=Zs(this,this.update),this.update=tn(this.update_,Qs),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=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_),"hidden"in g&&"visibilityState"in g&&this.on(g,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(t){"hidden"===g.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(t)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Qs))}disableInterval_(t){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&t&&"ended"!==t.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(t){if("hidden"===g.visibilityState)return;const e=super.update();return this.requestNamedAnimationFrame("SeekBar#update",(()=>{const i=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),s=this.player_.liveTracker;let n=this.player_.duration();s&&s.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==e&&(this.el_.setAttribute("aria-valuenow",(100*e).toFixed(2)),this.percent_=e),this.currentTime_===i&&this.duration_===n||(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Cn(i,n),Cn(n,n)],"{1} of {2}")),this.currentTime_=i,this.duration_=n),this.bar&&this.bar.update(gs(this.el()),this.getProgress(),t)})),e}userSeek_(t){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()}pendingSeekTime(t){if(void 0!==t)if(null!==t){const e=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(t,e))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(null!==this.pendingSeekTime())return this.pendingSeekTime()/this.player_.duration();const t=this.getCurrentTime_();let e;const i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e}handleMouseDown(t){xs(t)&&(t.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(t))}handleMouseMove(t,e=!1){if(!xs(t)||isNaN(this.player_.duration()))return;let i;e||this.player_.scrubbing()||this.player_.scrubbing(!0);const s=this.calculateDistance(t),n=this.player_.liveTracker;if(n&&n.isLive()){if(s>=.99)return void n.seekToLiveEdge();const t=n.seekableStart(),e=n.liveCurrentTime();if(i=t+s*n.liveWindow(),i>=e&&(i=e),i<=t&&(i=t+.1),i===1/0)return}else i=s*this.player_.duration(),i===this.player_.duration()&&(i-=.1);this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(i):this.userSeek_(i),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const t=this.getChild("mouseTimeDisplay");t&&t.show()}disable(){super.disable();const t=this.getChild("mouseTimeDisplay");t&&t.hide()}handleMouseUp(t){super.handleMouseUp(t),t&&t.stopPropagation(),this.player_.scrubbing(!1),null!==this.pendingSeekTime()&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?Pn(this.player_.play()):this.update_()}handlePendingSeek_(t){this.player_.paused()||this.player_.pause();const e=null!==this.pendingSeekTime()?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(e+t),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(t){null!==this.pendingSeekTime()&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(t){const e=this.player_.liveTracker;if(" "===t.key||"Enter"===t.key)t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if("Home"===t.key)t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if("End"===t.key)t.preventDefault(),t.stopPropagation(),e&&e.isLive()?this.userSeek_(e.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(t.key)){t.preventDefault(),t.stopPropagation();const i=.1*parseInt(t.key,10);e&&e.isLive()?this.userSeek_(e.seekableStart()+e.liveWindow()*i):this.userSeek_(this.player_.duration()*i)}else"PageDown"===t.key?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):"PageUp"===t.key?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(t)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in g&&"visibilityState"in g&&this.off(g,"visibilitychange",this.toggleVisibility_),super.dispose()}}Qr.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12},Tn.registerComponent("SeekBar",Qr);class Zr extends Tn{constructor(t,e){super(t,e),this.handleMouseMove=tn(Zs(this,this.handleMouseMove),Qs),this.throttledHandleMouseSeek=tn(Zs(this,this.handleMouseSeek),Qs),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"),s=e.getChild("mouseTimeDisplay");if(!i&&!s)return;const n=e.el(),r=ys(n);let o=bs(n,t).x;o=Xr(o,0,1),s&&s.update(r,o),i&&i.update(r,e.getProgress())}handleMouseSeek(t){const e=this.getChild("seekBar");e&&e.handleMouseMove(t)}enabled(){return this.enabled_}disable(){if(this.children().forEach((t=>t.disable&&t.disable())),this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const t=this.getChild("seekBar");this.player_.scrubbing(!1),t.videoWasPlaying&&Pn(this.player_.play())}}enable(){this.children().forEach((t=>t.enable&&t.enable())),this.enabled()||(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}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,i=this.getChild("seekBar");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");e&&e.handleMouseUp(t),this.removeListenersAddedOnMousedownAndTouchstart()}}Zr.prototype.options_={children:["seekBar"]},Tn.registerComponent("ProgressControl",Zr);class to extends Fr{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(){"audio"===this.player_.currentType().substring(0,5)||this.player_.audioPosterMode()||this.player_.audioOnlyMode()?(this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()):this.show()}handlePictureInPictureEnabledChange(){g.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in p?this.enable():this.disable()}handlePictureInPictureChange(t){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(t){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){"function"==typeof g.exitPictureInPicture&&super.show()}}to.prototype.controlText_="Picture-in-Picture",Tn.registerComponent("PictureInPictureToggle",to);class eo extends Fr{constructor(t,e){super(t,e),this.setIcon("fullscreen-enter"),this.on(t,"fullscreenchange",(t=>this.handleFullscreenChange(t))),!1===g[t.fsApi_.fullscreenEnabled]&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(t){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(t){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}eo.prototype.controlText_="Fullscreen",Tn.registerComponent("FullscreenToggle",eo),Tn.registerComponent("VolumeLevel",class extends Tn{createEl(){const t=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",t),t.appendChild(super.createEl("span",{className:"vjs-control-text"})),t}}),Tn.registerComponent("VolumeLevelTooltip",class extends Tn{constructor(t,e){super(t,e),this.update=tn(Zs(this,this.update),Qs)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(t,e,i,s){if(!i){const i=gs(this.el_),s=gs(this.player_.el()),n=t.width*e;if(!s||!i)return;const r=t.left-s.left+n,o=t.width-n+(s.right-t.right);let a=i.width/2;r<a?a+=a-r:o<a&&(a=o),a<0?a=0:a>i.width&&(a=i.width),this.el_.style.right=`-${a}px`}this.write(`${s}%`)}write(t){ns(this.el_,t)}updateVolume(t,e,i,s,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",(()=>{this.update(t,e,i,s.toFixed(0)),n&&n()}))}});class io extends Tn{constructor(t,e){super(t,e),this.update=tn(Zs(this,this.update),Qs)}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,(()=>{i?this.el_.style.bottom=t.height*e+"px":this.el_.style.left=t.width*e+"px"}))}}io.prototype.options_={children:["volumeLevelTooltip"]},Tn.registerComponent("MouseVolumeLevelDisplay",io);class so extends Yr{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){xs(t)&&super.handleMouseDown(t)}handleMouseMove(t){const e=this.getChild("mouseVolumeLevelDisplay");if(e){const i=this.el(),s=gs(i),n=this.vertical();let r=bs(i,t);r=n?r.y:r.x,r=Xr(r,0,1),e.update(s,r,n)}xs(t)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(t)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(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(100*this.player_.volume())}updateLastVolume_(){const t=this.player_.volume();this.one("sliderinactive",(()=>{0===this.player_.volume()&&this.player_.lastVolume_(t)}))}}so.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},Wi||Ni||so.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),so.prototype.playerEvent="volumechange",Tn.registerComponent("VolumeBar",so);class no extends Tn{constructor(t,e={}){e.vertical=e.vertical||!1,(void 0===e.volumeBar||Si(e.volumeBar))&&(e.volumeBar=e.volumeBar||{},e.volumeBar.vertical=e.vertical),super(t,e),function(t,e){e.tech_&&!e.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",(function(){e.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")}))}(this,t),this.throttledHandleMouseMove=tn(Zs(this,this.handleMouseMove),Qs),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";return this.options_.vertical&&(t="vjs-volume-vertical"),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)}}no.prototype.options_={children:["volumeBar"]},Tn.registerComponent("VolumeControl",no);class ro extends Fr{constructor(t,e){super(t,e),function(t,e){e.tech_&&!e.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",(function(){e.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")}))}(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(),i=this.player_.lastVolume_();0===e?(this.player_.volume(i<.1?.1:i),this.player_.muted(!1)):this.player_.muted(!this.player_.muted())}update(t){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const t=this.player_.volume();let e=3;this.setIcon("volume-high"),Wi&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===t||this.player_.muted()?(this.setIcon("volume-mute"),e=0):t<.33?(this.setIcon("volume-low"),e=1):t<.67&&(this.setIcon("volume-medium"),e=2),hs(this.el_,[0,1,2,3].reduce(((t,e)=>t+`${e?" ":""}vjs-vol-${e}`),"")),as(this.el_,`vjs-vol-${e}`)}updateControlText_(){const t=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}ro.prototype.controlText_="Mute",Tn.registerComponent("MuteToggle",ro);class oo extends Tn{constructor(t,e={}){e.inline=void 0===e.inline||e.inline,(void 0===e.volumeControl||Si(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_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${t}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(t){"Escape"===t.key&&this.muteToggle.focus()}handleMouseOver(t){this.addClass("vjs-hover"),Xs(g,"keyup",this.handleKeyPressHandler_)}handleMouseOut(t){this.removeClass("vjs-hover"),Gs(g,"keyup",this.handleKeyPressHandler_)}handleKeyPress(t){"Escape"===t.key&&this.handleMouseOut()}}oo.prototype.options_={children:["muteToggle","volumeControl"]},Tn.registerComponent("VolumePanel",oo);class ao extends Fr{constructor(t,e){super(t,e),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(t.language())])),this.show()):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(),i=this.player_.liveTracker,s=i&&i.isLive()?i.seekableEnd():this.player_.duration();let n;n=e+this.skipTime<=s?e+this.skipTime:s,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}ao.prototype.controlText_="Skip Forward",Tn.registerComponent("SkipForward",ao);class ho extends Fr{constructor(t,e){super(t,e),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(t.language())])),this.show()):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(),i=this.player_.liveTracker,s=i&&i.isLive()&&i.seekableStart();let n;n=s&&e-this.skipTime<=s?s:e>=this.skipTime?e-this.skipTime:0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}ho.prototype.controlText_="Skip Backward",Tn.registerComponent("SkipBackward",ho);class lo extends Tn{constructor(t,e){super(t,e),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){t instanceof Tn&&(this.on(t,"blur",this.boundHandleBlur_),this.on(t,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(t){t instanceof Tn&&(this.off(t,"blur",this.boundHandleBlur_),this.off(t,["tap","click"],this.boundHandleTapClick_))}removeChild(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),super.removeChild(t)}addItem(t){const e=this.addChild(t);e&&this.addEventListenerForItem(e)}createEl(){this.contentEl_=ss(this.options_.contentElType||"ul",{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),Xs(t,"click",(function(t){t.preventDefault(),t.stopImmediatePropagation()})),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(t){const e=t.relatedTarget||g.activeElement;if(!this.children().some((t=>t.el()===e))){const t=this.menuButton_;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;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}}handleKeyDown(t){"ArrowLeft"===t.key||"ArrowDown"===t.key?(t.preventDefault(),t.stopPropagation(),this.stepForward()):"ArrowRight"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),t.stopPropagation(),this.stepBack())}stepForward(){let t=0;void 0!==this.focusedChild_&&(t=this.focusedChild_+1),this.focus(t)}stepBack(){let t=0;void 0!==this.focusedChild_&&(t=this.focusedChild_-1),this.focus(t)}focus(t=0){const e=this.children().slice();e.length&&e[0].hasClass("vjs-menu-title")&&e.shift(),e.length>0&&(t<0?t=0:t>=e.length&&(t=e.length-1),this.focusedChild_=t,e[t].el_.focus())}}Tn.registerComponent("Menu",lo);class uo extends Tn{constructor(t,e={}){super(t,e),this.menuButton_=new Fr(t,e),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=Fr.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;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(),Xs(g,"keyup",this.handleMenuKeyUp_)})),this.on("mouseleave",(t=>this.handleMouseLeave(t))),this.on("keydown",(t=>this.handleSubmenuKeyDown(t)))}update(){const t=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=t,this.addChild(t),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const t=new lo(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const e=ss("li",{className:"vjs-menu-title",textContent:bn(this.options_.title),tabIndex:-1}),i=new Tn(this.player_,{el:e});t.addItem(i)}if(this.items=this.createItems(),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){return super.setIcon(t,this.menuButton_.el_)}buildWrapperCSSClass(){let t="vjs-menu-button";return t+=!0===this.options_.inline?"-inline":"-popup",`vjs-menu-button ${t} ${Fr.prototype.buildCSSClass()} ${super.buildCSSClass()}`}buildCSSClass(){let t="vjs-menu-button";return t+=!0===this.options_.inline?"-inline":"-popup",`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){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(t){this.removeClass("vjs-hover"),Gs(g,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(t){"Escape"===t.key||"Tab"===t.key?(this.buttonPressed_&&this.unpressButton(),"Tab"===!t.key&&(t.preventDefault(),this.menuButton_.focus())):"Up"!==t.key&&("Down"!==t.key||this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)||this.buttonPressed_||(t.preventDefault(),this.pressButton())}handleMenuKeyUp(t){"Escape"!==t.key&&"Tab"!==t.key||this.removeClass("vjs-hover")}handleSubmenuKeyPress(t){this.handleSubmenuKeyDown(t)}handleSubmenuKeyDown(t){"Escape"!==t.key&&"Tab"!==t.key||(this.buttonPressed_&&this.unpressButton(),"Tab"===!t.key&&(t.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Wi&&es())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}Tn.registerComponent("MenuButton",uo);class co extends uo{constructor(t,e){const i=e.tracks;super(t,e),this.items.length<=1&&this.hide(),i&&(this.updateHandler_=Zs(this,this.update),this.cleanupHandler_=Zs(this,this.cleanupTrackListeners_),i.addEventListener("removetrack",this.updateHandler_),i.addEventListener("addtrack",this.updateHandler_),i.addEventListener("labelchange",this.updateHandler_),this.player_.on("ready",this.updateHandler_),this.player_.on("dispose",this.cleanupHandler_))}cleanupTrackListeners_(){if(!this.updateHandler_)return;const t=this.options_.tracks;t&&(t.removeEventListener("removetrack",this.updateHandler_),t.removeEventListener("addtrack",this.updateHandler_),t.removeEventListener("labelchange",this.updateHandler_)),this.player_&&(this.player_.off("ready",this.updateHandler_),this.player_.off("dispose",this.cleanupHandler_)),this.updateHandler_=null,this.cleanupHandler_=null}dispose(){this.cleanupTrackListeners_(),super.dispose()}}Tn.registerComponent("TrackButton",co);class fo extends Cr{constructor(t,e){super(t,e),this.selectable=e.selectable,this.isSelected_=e.selected||!1,this.multiSelectable=e.multiSelectable,this.selected(this.isSelected_),this.el_.setAttribute("role",this.selectable?this.multiSelectable?"menuitemcheckbox":"menuitemradio":"menuitem")}createEl(t,e,i){this.nonIconControl=!0;const s=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},e),i),n=ss("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?s.appendChild(n):s.replaceChild(n,s.querySelector(".vjs-icon-placeholder")),s}handleKeyDown(t){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(t.key)||super.handleKeyDown(t)}handleClick(t){this.selected(!0)}selected(t){this.selectable&&(t?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}Tn.registerComponent("MenuItem",fo);class po extends fo{constructor(t,e){const i=e.track,s=t.textTracks();e.label=i.label||i.language||"Unknown",e.selected="showing"===i.mode,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)},r=(...t)=>{this.handleSelectedLanguageChange.apply(this,t)};if(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)})),void 0===s.onchange){let t;this.on(["tap","click"],(function(){if("object"!=typeof p.Event)try{t=new p.Event("change")}catch(t){}t||(t=g.createEvent("Event"),t.initEvent("change",!0,!0)),s.dispatchEvent(t)}))}this.handleTracksChange()}handleClick(t){const e=this.track,i=this.player_.textTracks();if(super.handleClick(t),i)for(let t=0;t<i.length;t++){const s=i[t];-1!==this.kinds.indexOf(s.kind)&&(s===e?"showing"!==s.mode&&(s.mode="showing"):"disabled"!==s.mode&&(s.mode="disabled"))}}handleTracksChange(t){const e="showing"===this.track.mode;e!==this.isSelected_&&this.selected(e)}handleSelectedLanguageChange(t){if("showing"===this.track.mode){const t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}Tn.registerComponent("TextTrackMenuItem",po);class vo extends po{constructor(t,e){e.track={player:t,kind:e.kind,kinds:e.kinds,default:!1,mode:"disabled"},e.kinds||(e.kinds=[e.kind]),e.track.label=e.label?e.label:e.kinds.join(" and ")+" off",e.selectable=!0,e.multiSelectable=!1,super(t,e)}handleTracksChange(t){const e=this.player().textTracks();let i=!0;for(let t=0,s=e.length;t<s;t++){const s=e[t];if(this.options_.kinds.indexOf(s.kind)>-1&&"showing"===s.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)}handleSelectedLanguageChange(t){const e=this.player().textTracks();let i=!0;for(let t=0,s=e.length;t<s;t++){const s=e[t];if(["captions","descriptions","subtitles"].indexOf(s.kind)>-1&&"showing"===s.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}Tn.registerComponent("OffTextTrackMenuItem",vo);class mo extends co{constructor(t,e={}){e.tracks=t.textTracks(),super(t,e)}createItems(t=[],e=po){let i;this.label_&&(i=`${this.label_} off`),t.push(new vo(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;const s=this.player_.textTracks();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:!0,multiSelectable:!1});i.addClass(`vjs-${n.kind}-menu-item`),t.push(i)}}return t}}Tn.registerComponent("TextTrackButton",mo);class go extends fo{constructor(t,e){const i=e.track,s=e.cue,n=t.currentTime();e.selectable=!0,e.multiSelectable=!1,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)}}Tn.registerComponent("ChaptersTrackMenuItem",go);class yo extends mo{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&&"chapters"!==t.track.kind)return;const e=this.findChaptersTrack();e!==this.track_?(this.setTrack(e),super.update()):(!this.items||e&&e.cues&&e.cues.length!==this.items.length)&&super.update()}setTrack(t){if(this.track_!==t){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=t,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const 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(){return this.track_&&this.track_.label?this.track_.label:this.localize(bn(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),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=new go(this.player_,{track:this.track_,cue:e[i]});t.push(s)}return t}}yo.prototype.kind_="chapters",yo.prototype.controlText_="Chapters",Tn.registerComponent("ChaptersButton",yo);class bo extends mo{constructor(t,e,i){super(t,e,i),this.setIcon("audio-description");const s=t.textTracks(),n=Zs(this,this.handleTracksChange);s.addEventListener("change",n),this.on("dispose",(function(){s.removeEventListener("change",n)}))}handleTracksChange(t){const e=this.player().textTracks();let i=!1;for(let t=0,s=e.length;t<s;t++){const s=e[t];if(s.kind!==this.kind_&&"showing"===s.mode){i=!0;break}}i?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}bo.prototype.kind_="descriptions",bo.prototype.controlText_="Descriptions",Tn.registerComponent("DescriptionsButton",bo);class jo extends mo{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()}`}}jo.prototype.kind_="subtitles",jo.prototype.controlText_="Subtitles",Tn.registerComponent("SubtitlesButton",jo);class wo extends po{constructor(t,e){e.track={player:t,kind:e.kind,label:e.kind+" settings",selectable:!1,default:!1,mode:"disabled"},e.selectable=!1,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()}}Tn.registerComponent("CaptionSettingsMenuItem",wo);class To extends mo{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=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new wo(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(t)}}To.prototype.kind_="captions",To.prototype.controlText_="Captions",Tn.registerComponent("CaptionsButton",To);class So extends po{createEl(t,e,i){const s=super.createEl(t,e,i),n=s.querySelector(".vjs-menu-item-text");return"captions"===this.options_.track.kind&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",s):n.appendChild(ss("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ss("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),s}}Tn.registerComponent("SubsCapsMenuItem",So);class ko extends mo{constructor(t,e={}){super(t,e),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(bn(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new wo(this.player_,{kind:this.label_})),this.hideThreshold_+=1),t=super.createItems(t,So),t}}ko.prototype.kinds_=["captions","subtitles"],ko.prototype.controlText_="Subtitles",Tn.registerComponent("SubsCapsButton",ko);class xo extends fo{constructor(t,e){const i=e.track,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),n=s.querySelector(".vjs-menu-item-text");return["main-desc","descriptions","description"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(ss("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(ss("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),s}handleClick(t){if(super.handleClick(t),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let e=0;e<t.length;e++){const i=t[e];i!==this.track&&(i.enabled=i===this.track)}}}handleTracksChange(t){this.selected(this.track.enabled)}}Tn.registerComponent("AudioTrackMenuItem",xo);class Ao extends co{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++)t.push(new xo(this.player_,{track:e[i],selectable:!0,multiSelectable:!1}));return t}}Ao.prototype.controlText_="Audio Track",Tn.registerComponent("AudioTrackButton",Ao);class Eo extends fo{constructor(t,e){const i=e.rate,s=parseFloat(i,10);e.label=i,e.selected=s===t.playbackRate(),e.selectable=!0,e.multiSelectable=!1,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)}}Eo.prototype.contentElType="button",Tn.registerComponent("PlaybackRateMenuItem",Eo);class Io extends uo{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();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ss("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),t.appendChild(this.labelEl_),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(),e=[];for(let i=t.length-1;i>=0;i--)e.push(new Eo(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){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(t){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Io.prototype.controlText_="Playback Rate",Tn.registerComponent("PlaybackRateMenuButton",Io);class Do extends Tn{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(t="div",e={},i={}){return e.className||(e.className=this.buildCSSClass()),super.createEl(t,e,i)}}Tn.registerComponent("Spacer",Do),Tn.registerComponent("CustomControlSpacer",class extends Do{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}});class Co extends Tn{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Co.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},Tn.registerComponent("ControlBar",Co);class No extends $n{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):""}}No.prototype.options_=Object.assign({},$n.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Tn.registerComponent("ErrorDisplay",No);class Mo extends Tn{constructor(t,e={}){super(t,e),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),ss("select",{id:this.options_.id},{},this.options_.SelectOptions.map((t=>{const e=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${Us()}`)+"-"+t[1].replace(/\W+/g,""),i=ss("option",{id:e,value:this.localize(t[0]),textContent:this.localize(t[1])});return i.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${e}`),i})))}}Tn.registerComponent("TextTrackSelect",Mo);class Oo extends Tn{constructor(t,e={}){super(t,e);const i=ss("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],s=i.className,n=i.id.replace("%s",this.options_.id_);let r=null;const o=`vjs_select_${Us()}`;if("colors"===this.options_.type){r=ss("span",{className:s});const t=ss("label",{id:n,className:"vjs-label",textContent:this.localize(i.label)});t.setAttribute("for",o),r.appendChild(t)}const a=new Mo(t,{SelectOptions:i.options,legendId:this.options_.legendId,id:o,labelId:n});this.addChild(a),"colors"===this.options_.type&&(r.appendChild(a.el()),this.el().appendChild(r))}}createEl(){return ss("fieldset",{className:this.options_.className})}}Tn.registerComponent("TextTrackFieldset",Oo);class Ro extends Tn{constructor(t,e={}){super(t,e);const i=this.options_.textTrackComponentid,s=new Oo(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 Oo(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 Oo(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(){return ss("div",{className:"vjs-track-settings-colors"})}}Tn.registerComponent("TextTrackSettingsColors",Ro);class Po extends Tn{constructor(t,e={}){super(t,e);const i=this.options_.textTrackComponentid,s=new Oo(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 Oo(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 Oo(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(){return ss("div",{className:"vjs-track-settings-font"})}}Tn.registerComponent("TextTrackSettingsFont",Po);class _o extends Tn{constructor(t,e={}){super(t,e);const i=new Fr(t,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});i.el().classList.remove("vjs-control","vjs-button"),i.el().textContent=this.localize("Reset"),this.addChild(i);const s=this.localize("Done"),n=new Fr(t,{controlText:s,className:"vjs-done-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=s,this.addChild(n)}createEl(){return ss("div",{className:"vjs-track-settings-controls"})}}Tn.registerComponent("TrackSettingsControls",_o);const Lo="vjs-text-track-settings",Fo=["#000","Black"],$o=["#00F","Blue"],Bo=["#0FF","Cyan"],Uo=["#0F0","Green"],qo=["#F0F","Magenta"],Vo=["#F00","Red"],zo=["#FFF","White"],Ho=["#FF0","Yellow"],Xo=["1","Opaque"],Go=["0.5","Semi-Transparent"],Yo=["0","Transparent"],Wo={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Fo,zo,Vo,Uo,$o,Ho,qo,Bo],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Xo,Go,Yo],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[zo,Fo,Vo,Uo,$o,Ho,qo,Bo],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=>"1.00"===t?null:Number(t)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Xo,Go],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:[Yo,Go,Xo],className:"vjs-window-opacity vjs-opacity"}};function Jo(t,e){if(e&&(t=e(t)),t&&"none"!==t)return t}Wo.windowColor.options=Wo.backgroundColor.options,Tn.registerComponent("TextTrackSettings",class extends $n{constructor(t,e){e.temporary=!1,super(t,e),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(t),this.endDialog=ss("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),void 0===e.persistTextTrackSettings&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(t){const e=new Ro(t,{textTrackComponentid:this.id_,selectConfigs:Wo,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(e);const i=new Po(t,{textTrackComponentid:this.id_,selectConfigs:Wo,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(i);const s=new _o(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()})),ji(Wo,(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 wi(Wo,((t,e,i)=>{const s=Jo((n=this.$(e.selector)).options[n.options.selectedIndex].value,e.parser);var n;return void 0!==s&&(t[i]=s),t}),{})}setValues(t){ji(Wo,((e,i)=>{!function(t,e,i){if(e)for(let s=0;s<t.options.length;s++)if(Jo(t.options[s].value,i)===e){t.selectedIndex=s;break}}(this.$(e.selector),t[i],e.parser)}))}setDefaults(){ji(Wo,(t=>{const e=t.hasOwnProperty("default")?t.default:0;this.$(t.selector).selectedIndex=e}))}restoreSettings(){let t;try{t=JSON.parse(p.localStorage.getItem(Lo))}catch(t){mi.warn(t)}t&&this.setValues(t)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const t=this.getValues();try{Object.keys(t).length?p.localStorage.setItem(Lo,JSON.stringify(t)):p.localStorage.removeItem(Lo)}catch(t){mi.warn(t)}}updateDisplay(){const t=this.player_.getChild("textTrackDisplay");t&&t.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}),Tn.registerComponent("ResizeManager",class extends Tn{constructor(t,e){let i=e.ResizeObserver||p.ResizeObserver;null===e.ResizeObserver&&(i=!1),super(t,ki({createEl:!i,reportTouchActivity:!1},e)),this.ResizeObserver=e.ResizeObserver||p.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=en((()=>{this.resizeHandler()}),100,!1,this),i?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(t.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const t=this.debouncedHandler_;let e=this.unloadListener_=function(){Gs(this,"resize",t),Gs(this,"unload",e),e=null};Xs(this.el_.contentWindow,"unload",e),Xs(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(){this.player_&&this.player_.trigger&&this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}});const Ko={trackingThreshold:20,liveTolerance:15};Tn.registerComponent("LiveTracker",class extends Tn{constructor(t,e){super(t,ki(Ko,e,{createEl:!1})),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(p.performance.now().toFixed(4)),i=-1===this.lastTime_?0:(e-this.lastTime_)/1e3;this.lastTime_=e,this.pastSeekEnd_=this.pastSeekEnd()+i;const s=this.liveCurrentTime(),n=this.player_.currentTime();let r=this.player_.paused()||this.seekedBehindLive_||Math.abs(s-n)>this.options_.liveTolerance;this.timeupdateSeen_&&s!==1/0||(r=!1),r!==this.behindLiveEdge_&&(this.behindLiveEdge_=r,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Qs),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const t=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&t>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const t=this.player_.seekable(),e=[];let i=t?t.length:0;for(;i--;)e.push(t.end(i));return e.length?e.sort()[e.length-1]:1/0}seekableStart(){const t=this.player_.seekable(),e=[];let i=t?t.length:0;for(;i--;)e.push(t.start(i));return e.length?e.sort()[0]:0}liveWindow(){const t=this.liveCurrentTime();return t===1/0?0:t-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const t=this.seekableEnd();return-1!==this.lastSeekEnd_&&t!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=t,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return"number"==typeof this.trackingInterval_}seekToLiveEdge(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}),Tn.registerComponent("TitleBar",class extends Tn{constructor(t,e){super(t,e),this.on("statechanged",(()=>this.updateDom_())),this.updateDom_()}createEl(){return this.els={title:ss("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${Us()}`}),description:ss("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${Us()}`})},ss("div",{className:"vjs-title-bar"},{},xi(this.els))}updateDom_(){const t=this.player_.tech_,e=t&&t.el_,i={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach((t=>{const s=this.state[t],n=this.els[t],r=i[t];ws(n),s&&ns(n,s),e&&(e.removeAttribute(r),s&&e.setAttribute(r,n.id))})),this.state.title||this.state.description?this.show():this.hide()}update(t){this.setState(t)}dispose(){const t=this.player_.tech_,e=t&&t.el_;e&&(e.removeAttribute("aria-labelledby"),e.removeAttribute("aria-describedby")),super.dispose(),this.els=null}});const Qo={initialDisplay:4e3,position:[],takeFocus:!1};Tn.registerComponent("TransientButton",class extends Fr{constructor(t,e){super(t,e=ki(Qo,e)),this.controlText(e.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],(()=>{this.removeClass("force-display")}))}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map((t=>`vjs-${t}`)).join(" ")}`}createEl(){const t=ss("button",{},{type:"button",class:this.buildCSSClass()},ss("span"));return this.controlTextEl_=t.querySelector("span"),t}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout((()=>{this.removeClass("force-display")}),this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}});const Zo=t=>{const e=t.el();if(e.hasAttribute("src"))return t.triggerSourceset(e.src),!0;const i=t.$$("source"),s=[];let n="";if(!i.length)return!1;for(let t=0;t<i.length;t++){const e=i[t].src;e&&-1===s.indexOf(e)&&s.push(e)}return!!s.length&&(1===s.length&&(n=s[0]),t.triggerSourceset(n),!0)},ta=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(t){const e=g.createElement(this.nodeName.toLowerCase());e.innerHTML=t;const i=g.createDocumentFragment();for(;e.childNodes.length;)i.appendChild(e.childNodes[0]);return this.innerText="",p.Element.prototype.appendChild.call(this,i),this.innerHTML}}),ea=(t,e)=>{let i={};for(let s=0;s<t.length&&(i=Object.getOwnPropertyDescriptor(t[s],e),!(i&&i.set&&i.get));s++);return i.enumerable=!0,i.configurable=!0,i},ia=function(t){const e=t.el();if(e.resetSourceWatch_)return;const i={},s=(t=>ea([t.el(),p.HTMLMediaElement.prototype,p.Element.prototype,ta],"innerHTML"))(t),n=i=>(...s)=>{const n=i.apply(e,s);return Zo(t),n};["append","appendChild","insertAdjacentHTML"].forEach((t=>{e[t]&&(i[t]=e[t],e[t]=n(i[t]))})),Object.defineProperty(e,"innerHTML",ki(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_)},sa=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Zn(p.Element.prototype.getAttribute.call(this,"src")):""},set(t){return p.Element.prototype.setAttribute.call(this,"src",t),t}});class na extends dr{constructor(t,e){super(t,e);const i=t.source;let s=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&"VIDEO"===this.el_.tagName,i&&(this.el_.currentSrc!==i.src||t.tag&&3===t.tag.initNetworkState_)?this.setSource(i):this.handleLateInit_(this.el_),t.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const t=this.el_.childNodes;let e=t.length;const i=[];for(;e--;){const n=t[e];"track"===n.nodeName.toLowerCase()&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),this.textTracks().addTrack(n.track),s||this.el_.hasAttribute("crossorigin")||!er(n.src)||(s=!0)):i.push(n))}for(let t=0;t<i.length;t++)this.el_.removeChild(i[t])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&s&&mi.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),this.restoreMetadataTracksInIOSNativePlayer_(),(Gi||Vi)&&!0===t.nativeControlsForTouch&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),na.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){!function(t){if(!t.featuresSourceset)return;const e=t.el();if(e.resetSourceset_)return;const i=(t=>ea([t.el(),p.HTMLMediaElement.prototype,sa],"src"))(t),s=e.setAttribute,n=e.load;Object.defineProperty(e,"src",ki(i,{set:s=>{const n=i.set.call(e,s);return t.triggerSourceset(e.src),n}})),e.setAttribute=(i,n)=>{const r=s.call(e,i,n);return/src/i.test(i)&&t.triggerSourceset(e.src),r},e.load=()=>{const i=n.call(e);return Zo(t)||(t.triggerSourceset(""),ia(t)),i},e.currentSrc?t.triggerSourceset(e.currentSrc):Zo(t)||ia(t),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=n,e.setAttribute=s,Object.defineProperty(e,"src",i),e.resetSourceWatch_&&e.resetSourceWatch_()}}(this)}restoreMetadataTracksInIOSNativePlayer_(){const t=this.textTracks();let e;const i=()=>{e=[];for(let i=0;i<t.length;i++){const s=t[i];"metadata"===s.kind&&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];"disabled"===i.track.mode&&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();this[`${i}TracksListeners_`]&&Object.keys(this[`${i}TracksListeners_`]).forEach((t=>{this.el()[`${i}Tracks`].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=lr[t],i=this.el()[e.getterName],s=this[e.getterName]();if(!this[`featuresNative${e.capitalName}Tracks`]||!i||!i.addEventListener)return;const n={change:()=>{const e={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(e),"text"===t&&this[ur.remoteText.getterName]().trigger(e)},addtrack(t){s.addTrack(t.track)},removetrack(t){s.removeTrack(t.track)}},r=function(){const t=[];for(let e=0;e<s.length;e++){let n=!1;for(let t=0;t<i.length;t++)if(i[t]===s[e]){n=!0;break}n||t.push(s[e])}for(;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",(()=>i.removeEventListener(t,e)))})),this.on("loadstart",r),this.on("dispose",(()=>this.off("loadstart",r)))}proxyNativeTracks_(){lr.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(!0);t.parentNode&&t.parentNode.insertBefore(e,t),na.disposeMediaElement(t),t=e}else{t=g.createElement("video");const e=ki({},this.options_.tag&&cs(this.options_.tag));Gi&&!0===this.options_.nativeControlsForTouch||delete e.controls,us(t,Object.assign(e,{id:this.options_.techId,class:"vjs-tech"}))}t.playerId=this.options_.playerId}void 0!==this.options_.preload&&fs(t,"preload",this.options_.preload),void 0!==this.options_.disablePictureInPicture&&(t.disablePictureInPicture=this.options_.disablePictureInPicture);const e=["loop","muted","playsinline","autoplay"];for(let i=0;i<e.length;i++){const s=e[i],n=this.options_[s];void 0!==n&&(n?fs(t,s,s):ps(t,s),t[s]=n)}return t}handleLateInit_(t){if(0===t.networkState||3===t.networkState)return;if(0===t.readyState){let t=!1;const e=function(){t=!0};this.on("loadstart",e);const i=function(){t||this.trigger("loadstart")};return this.on("loadedmetadata",i),void this.ready((function(){this.off("loadstart",e),this.off("loadedmetadata",i),t||this.trigger("loadstart")}))}const e=["loadstart"];e.push("loadedmetadata"),t.readyState>=2&&e.push("loadeddata"),t.readyState>=3&&e.push("canplay"),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{this.isScrubbing_&&this.el_.fastSeek&&Ji?this.el_.fastSeek(t):this.el_.currentTime=t}catch(t){mi(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Ni&&Pi&&0===this.el_.currentTime){const t=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",t))};return this.on("timeupdate",t),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:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},e=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",e),this.on("dispose",(()=>{this.off("webkitbeginfullscreen",e),this.off("webkitendfullscreen",t)}))}supportsFullScreen(){return"function"==typeof this.el_.webkitEnterFullScreen}enterFullScreen(){const t=this.el_;if(t.paused&&t.networkState<=t.HAVE_METADATA)Pn(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(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(t){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(t):super.requestVideoFrameCallback(t)}cancelVideoFrameCallback(t){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(t):super.cancelVideoFrameCallback(t)}src(t){if(void 0===t)return this.el_.src;this.setSrc(t)}addSourceElement(t,e){if(!t)return mi.error("Invalid source URL."),!1;const i={src:t};e&&(i.type=e);const s=ss("source",{},i);return this.el_.appendChild(s),!0}removeSourceElement(t){if(!t)return mi.error("Source URL is required to remove the source element."),!1;const e=this.el_.querySelectorAll("source");for(const i of e)if(i.src===t)return this.el_.removeChild(i),!0;return mi.warn(`No matching source element found with src: ${t}`),!1}reset(){na.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(t){this.el_.controls=!!t}addTextTrack(t,e,i){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,e,i):super.addTextTrack(t,e,i)}createRemoteTextTrack(t){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(t);const e=g.createElement("track");return t.kind&&(e.kind=t.kind),t.label&&(e.label=t.label),(t.language||t.srclang)&&(e.srclang=t.language||t.srclang),t.default&&(e.default=t.default),t.id&&(e.id=t.id),t.src&&(e.src=t.src),e}addRemoteTextTrack(t,e){const i=super.addRemoteTextTrack(t,e);return this.featuresNativeTextTracks&&this.el().appendChild(i),i}removeRemoteTextTrack(t){if(super.removeRemoteTextTrack(t),this.featuresNativeTextTracks){const e=this.$$("track");let i=e.length;for(;i--;)t!==e[i]&&t!==e[i].track||this.el().removeChild(e[i])}}getVideoPlaybackQuality(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();const t={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(t.droppedVideoFrames=this.el().webkitDroppedFrameCount,t.totalVideoFrames=this.el().webkitDecodedFrameCount),p.performance&&(t.creationTime=p.performance.now()),t}}Ai(na,"TEST_VID",(function(){if(!Zi())return;const t=g.createElement("video"),e=g.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",t.appendChild(e),t})),na.isSupported=function(){try{na.TEST_VID.volume=.5}catch(t){return!1}return!(!na.TEST_VID||!na.TEST_VID.canPlayType)},na.canPlayType=function(t){return na.TEST_VID.canPlayType(t)},na.canPlaySource=function(t){return na.canPlayType(t.type)},na.canControlVolume=function(){try{const t=na.TEST_VID.volume;na.TEST_VID.volume=t/2+.1;const e=t!==na.TEST_VID.volume;return e&&Wi?(p.setTimeout((()=>{na&&na.prototype&&(na.prototype.featuresVolumeControl=t!==na.TEST_VID.volume)})),!1):e}catch(t){return!1}},na.canMuteVolume=function(){try{const t=na.TEST_VID.muted;return na.TEST_VID.muted=!t,na.TEST_VID.muted?fs(na.TEST_VID,"muted","muted"):ps(na.TEST_VID,"muted"),t!==na.TEST_VID.muted}catch(t){return!1}},na.canControlPlaybackRate=function(){if(Ni&&Pi&&Li<58)return!1;try{const t=na.TEST_VID.playbackRate;return na.TEST_VID.playbackRate=t/2+.1,t!==na.TEST_VID.playbackRate}catch(t){return!1}},na.canOverrideAttributes=function(){try{const t=()=>{};Object.defineProperty(g.createElement("video"),"src",{get:t,set:t}),Object.defineProperty(g.createElement("audio"),"src",{get:t,set:t}),Object.defineProperty(g.createElement("video"),"innerHTML",{get:t,set:t}),Object.defineProperty(g.createElement("audio"),"innerHTML",{get:t,set:t})}catch(t){return!1}return!0},na.supportsNativeTextTracks=function(){return Ji||Wi&&Pi},na.supportsNativeVideoTracks=function(){return!(!na.TEST_VID||!na.TEST_VID.videoTracks)},na.supportsNativeAudioTracks=function(){return!(!na.TEST_VID||!na.TEST_VID.audioTracks)},na.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]){Ai(na.prototype,t,(()=>na[e]()),!0)})),na.prototype.featuresVolumeControl=na.canControlVolume(),na.prototype.movingMediaElementInDOM=!Wi,na.prototype.featuresFullscreenResize=!0,na.prototype.featuresProgressEvents=!0,na.prototype.featuresTimeupdateEvents=!0,na.prototype.featuresVideoFrameCallback=!(!na.TEST_VID||!na.TEST_VID.requestVideoFrameCallback),na.disposeMediaElement=function(t){if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("src"),"function"==typeof t.load&&function(){try{t.load()}catch(t){}}()}},na.resetMediaElement=function(t){if(!t)return;const e=t.querySelectorAll("source");let i=e.length;for(;i--;)t.removeChild(e[i]);t.removeAttribute("src"),"function"==typeof t.load&&function(){try{t.load()}catch(t){}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach((function(t){na.prototype[t]=function(){return this.el_[t]||this.el_.hasAttribute(t)}})),["muted","defaultMuted","autoplay","loop","playsinline"].forEach((function(t){na.prototype["set"+bn(t)]=function(e){this.el_[t]=e,e?this.el_.setAttribute(t,t):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){na.prototype[t]=function(){return this.el_[t]}})),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach((function(t){na.prototype["set"+bn(t)]=function(e){this.el_[t]=e}})),["pause","load","play"].forEach((function(t){na.prototype[t]=function(){return this.el_[t]()}})),dr.withSourceHandlers(na),na.nativeSourceHandler={},na.nativeSourceHandler.canPlayType=function(t){try{return na.TEST_VID.canPlayType(t)}catch(t){return""}},na.nativeSourceHandler.canHandleSource=function(t){if(t.type)return na.nativeSourceHandler.canPlayType(t.type);if(t.src){const e=tr(t.src);return na.nativeSourceHandler.canPlayType(`video/${e}`)}return""},na.nativeSourceHandler.handleSource=function(t,e){e.setSrc(t.src)},na.nativeSourceHandler.dispose=function(){},na.registerSourceHandler(na.nativeSourceHandler),dr.registerTech("Html5",na);const ra=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],oa={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},aa=["tiny","xsmall","small","medium","large","xlarge","huge"],ha={};aa.forEach((t=>{const e="x"===t.charAt(0)?`x-${t.substring(1)}`:t;ha[t]=`vjs-layout-${e}`}));const la={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class ua extends Tn{constructor(t,e,i){if(t.id=t.id||e.id||`vjs_video_${Us()}`,(e=Object.assign(ua.getTagSettings(t),e)).initChildren=!1,e.createEl=!1,e.evented=!1,e.reportTouchActivity=!1,!e.language){const i=t.closest("[lang]");i&&(e.language=i.getAttribute("lang"))}if(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_=!1,this.log=gi(this.id_),this.fsApi_=ci,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=t,this.tagAttributes=t&&cs(t),this.language(this.options_.language),e.languages){const t={};Object.getOwnPropertyNames(e.languages).forEach((function(i){t[i.toLowerCase()]=e.languages[i]})),this.languages_=t}else this.languages_=ua.prototype.options_.languages;this.resetCache_(),this.poster_=e.poster||"",this.controls_=!!e.controls,t.controls=!1,t.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],t.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),e.plugins&&Object.keys(e.plugins).forEach((t=>{if("function"!=typeof this[t])throw new Error(`plugin "${t}" does not exist`)})),this.scrubbing_=!1,this.el_=this.createEl(),vn(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Xs(g,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const s=ki(this.options_);if(e.plugins&&Object.keys(e.plugins).forEach((t=>{this[t](e.plugins[t])})),e.debug&&this.debug(!0),this.options_.playerOptions=s,this.middleware_=[],this.playbackRates(e.playbackRates),e.experimentalSvgIcons){const t=(new p.DOMParser).parseFromString('<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>',"image/svg+xml");if(t.querySelector("parsererror"))mi.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const e=t.documentElement;e.style.display="none",this.el_.appendChild(e),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio("audio"===t.nodeName.toLowerCase()),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),e.spatialNavigation&&e.spatialNavigation.enabled&&(this.spatialNavigation=new Dr(this),this.addClass("vjs-spatial-navigation-enabled")),Gi&&this.addClass("vjs-touch-enabled"),Wi||this.addClass("vjs-workinghover"),ua.players[this.id_]=this;const n=ai.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),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(){var t;this.trigger("dispose"),this.off("dispose"),Gs(g,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Gs(g,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),ua.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),pr.hasOwnProperty((t=this).id())&&delete pr[t.id()],cr.names.forEach((t=>{const e=this[cr[t].getterName]();e&&e.off&&e.off()})),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let t,e=this.tag,i=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const s="video-js"===this.tag.tagName.toLowerCase();i?t=this.el_=e.parentNode:s||(t=this.el_=super.createEl("div"));const n=cs(e);if(s){for(t=this.el_=e,e=this.tag=g.createElement("video");t.children.length;)e.appendChild(t.firstChild);os(t,"video-js")||as(t,"video-js"),t.appendChild(e),i=this.playerElIngest_=t,Object.keys(t).forEach((i=>{try{e[i]=t[i]}catch(t){}}))}e.setAttribute("tabindex","-1"),n.tabindex="-1",Pi&&Ui&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach((function(i){s&&"class"===i||t.setAttribute(i,n[i]),s&&e.setAttribute(i,n[i])})),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.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=>Ki[t])).map((t=>"vjs-device-"+t.substring(3).toLowerCase().replace(/\_/g,"-")));if(this.addClass(...r),!0!==p.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=_s("vjs-styles-dimensions");const t=As(".vjs-styles-defaults"),e=As("head");e.insertBefore(this.styleEl_,t?t.nextSibling:e.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=e.getElementsByTagName("a");for(let t=0;t<o.length;t++){const e=o.item(t);as(e,"vjs-hidden"),e.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!i&&e.parentNode.insertBefore(t,e),rs(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t}crossOrigin(t){if(void 0===t)return this.techGet_("crossOrigin");null===t||"anonymous"===t||"use-credentials"===t?(this.techCall_("setCrossOrigin",t),this.posterImage&&this.posterImage.crossOrigin(t)):mi.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${t}"`)}width(t){return this.dimension("width",t)}height(t){return this.dimension("height",t)}dimension(t,e){const i=t+"_";if(void 0===e)return this[i]||0;if(""===e||"auto"===e)return this[i]=void 0,void this.updateStyleEl_();const s=parseFloat(e);isNaN(s)?mi.error(`Improper value "${e}" supplied for for ${t}`):(this[i]=s,this.updateStyleEl_())}fluid(t){if(void 0===t)return!!this.fluid_;var e,i;this.fluid_=!!t,an(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),t?(this.addClass("vjs-fluid"),this.fill(!1),i=()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)},an(e=this)?i():(e.eventedCallbacks||(e.eventedCallbacks=[]),e.eventedCallbacks.push(i))):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(t){if(void 0===t)return!!this.fill_;this.fill_=!!t,t?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(t){if(void 0===t)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(!0),this.updateStyleEl_()}updateStyleEl_(){if(!0===p.VIDEOJS_NO_DYNAMIC_STYLE){const t="number"==typeof this.width_?this.width_:this.options_.width,e="number"==typeof this.height_?this.height_:this.options_.height,i=this.tech_&&this.tech_.el();return void(i&&(t>=0&&(i.width=t),e>=0&&(i.height=e)))}let t,e,i,s;i=void 0!==this.aspectRatio_&&"auto"!==this.aspectRatio_?this.aspectRatio_:this.videoWidth()>0?this.videoWidth()+":"+this.videoHeight():"16:9";const n=i.split(":"),r=n[1]/n[0];t=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,e=void 0!==this.height_?this.height_:t*r,s=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(s),Ls(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: ${100*r}%;\n }\n `)}loadTech_(t,e){this.tech_&&this.unloadTech_();const i=bn(t),s=t.charAt(0).toLowerCase()+t.slice(1);"Html5"!==i&&this.tag&&(dr.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=i,this.isReady_=!1;let n=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(n=!1);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_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};cr.names.forEach((t=>{const e=cr[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()]),this.tag&&(r.tag=this.tag),e&&e.src===this.cache_.src&&this.cache_.currentTime>0&&(r.startTime=this.cache_.currentTime);const o=dr.getTech(t);if(!o)throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`);var a;this.tech_=new o(r),this.tech_.ready(Zs(this,this.handleTechReady_),!0),a=this.tech_,(this.textTracksJson_||[]).forEach((function(t){const e=a.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach((t=>e.addCue(t)))})),a.textTracks(),ra.forEach((t=>{this.on(this.tech_,t,(e=>this[`handleTech${bn(t)}_`](e)))})),Object.keys(oa).forEach((t=>{this.on(this.tech_,t,(e=>{0===this.tech_.playbackRate()&&this.tech_.seeking()?this.queuedCallbacks_.push({callback:this[`handleTech${oa[t]}_`].bind(this),event:e}):this[`handleTech${oa[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")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===i&&this.tag||rs(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){cr.names.forEach((t=>{const e=cr[t];this[e.privateName]=this[e.getterName]()})),this.textTracksJson_=function(t){const e=t.$$("track"),i=Array.prototype.map.call(e,(t=>t.track));return Array.prototype.map.call(e,(function(t){const e=_n(t.track);return t.src&&(e.src=t.src),e})).concat(Array.prototype.filter.call(t.textTracks(),(function(t){return-1===i.indexOf(t)})).map(_n))}(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(t){return void 0===t&&mi.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_}version(){return{"video.js":ai}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(t){if(!this.tech_||"string"!=typeof t)return;const e=()=>{const t=this.muted();this.muted(!0);const e=()=>{this.muted(t)};this.playTerminatedQueue_.push(e);const i=this.play();if(Rn(i))return i.catch((t=>{throw e(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${t||""}`)}))};let i;return"any"!==t||this.muted()?i="muted"!==t||this.muted()?this.play():e():(i=this.play(),Rn(i)&&(i=i.catch(e))),Rn(i)?i.then((()=>{this.trigger({type:"autoplay-success",autoplay:t})})).catch((()=>{this.trigger({type:"autoplay-failure",autoplay:t})})):void 0}updateSourceCaches_(t=""){let e=t,i="";"string"!=typeof e&&(e=t.src,i=t.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],e&&!i&&(i=((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 kr(e)})(this,e)),this.cache_.source=ki({},t,{src:e,type:i});const s=this.cache_.sources.filter((t=>t.src&&t.src===e)),n=[],r=this.$$("source"),o=[];for(let t=0;t<r.length;t++){const i=cs(r[t]);n.push(i),i.src&&i.src===e&&o.push(i.src)}o.length&&!s.length?this.cache_.sources=n: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,s=t.src;i&&!/^blob:/.test(i)&&/^blob:/.test(s)&&(!this.lastSource_||this.lastSource_.tech!==s&&this.lastSource_.player!==i)&&(e=()=>{}),e(s),t.src||this.tech_.any(["sourceset","loadstart"],(t=>{if("sourceset"===t.type)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(void 0===t)return this.hasStarted_;t!==this.hasStarted_&&(this.hasStarted_=t,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&0===this.cache_.lastPlaybackRate&&(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(),e=()=>{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"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(t){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,t):this.paused()?Pn(this.play()):this.pause()))}handleTechDoubleClick_(t){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),(e=>e.contains(t.target)))||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,t):this.isInPictureInPicture()&&!g.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(t){t.cancelable&&t.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(t){const e=t.target.player;if(e&&e!==this)return;const i=this.el();let s=g[this.fsApi_.fullscreenElement]===i;!s&&i.matches&&(s=i.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(s)}handleTechFullscreenChange_(t,e){e&&(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_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(t){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(t){this.isInPictureInPicture(!1)}handleTechError_(){const t=this.tech_.error();t&&this.error(t)}handleTechTextData_(){let t=null;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 br)return function(t,e,i,s){return e[i](t.reduce(wr(i),s))}(this.middleware_,this.tech_,t,e);if(t in jr)return gr(this.middleware_,this.tech_,t,e);try{this.tech_&&this.tech_[t](e)}catch(t){throw mi(t),t}}),!0)}techGet_(t){if(this.tech_&&this.tech_.isReady_){if(t in yr)return function(t,e,i){return t.reduceRight(wr(i),e[i]())}(this.middleware_,this.tech_,t);if(t in jr)return gr(this.middleware_,this.tech_,t);try{return this.tech_[t]()}catch(e){if(void 0===this.tech_[t])throw mi(`Video.js: ${t} method not defined for ${this.techName_} playback technology.`,e),e;if("TypeError"===e.name)throw mi(`Video.js: ${t} unavailable on ${this.techName_} playback technology element.`,e),this.tech_.isReady_=!1,e;throw mi(e),e}}}play(){return new Promise((t=>{this.play_(t)}))}play_(t=Pn){this.playCallbacks_.push(t);const e=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc())),i=Boolean(Ji||Wi);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!e)return this.waitToPlay_=()=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(!e&&i&&this.load());const s=this.techGet_("play");i&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),null===s?this.runPlayTerminatedQueue_():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!1!==this.techGet_("paused")}played(){return this.techGet_("played")||xn(0,0)}scrubbing(t){if(void 0===t)return this.scrubbing_;this.scrubbing_=!!t,this.techCall_("setScrubbing",this.scrubbing_),t?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(t){return void 0===t?(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime):(t<0&&(t=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",t),this.cache_.initTime=0,void(isFinite(t)&&(this.cache_.currentTime=Number(t)))):(this.cache_.initTime=t,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_)))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(t){if(void 0===t)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(t=parseFloat(t))<0&&(t=1/0),t!==this.cache_.duration&&(this.cache_.duration=t,t===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),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");return t&&t.length||(t=xn(0,0)),t}seekable(){let t=this.techGet_("seekable");return t&&t.length||(t=xn(0,0)),t}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Mn(this.buffered(),this.duration())}bufferedEnd(){const t=this.buffered(),e=this.duration();let i=t.end(t.length-1);return i>e&&(i=e),i}volume(t){let e;return void 0!==t?(e=Math.max(0,Math.min(1,t)),this.cache_.volume=e,this.techCall_("setVolume",e),void(e>0&&this.lastVolume_(e))):(e=parseFloat(this.techGet_("volume")),isNaN(e)?1:e)}muted(t){if(void 0===t)return this.techGet_("muted")||!1;this.techCall_("setMuted",t)}defaultMuted(t){return void 0!==t&&this.techCall_("setDefaultMuted",t),this.techGet_("defaultMuted")||!1}lastVolume_(t){if(void 0===t||0===t)return this.cache_.lastVolume;this.cache_.lastVolume=t}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(t){if(void 0!==t){const e=this.isFullscreen_;return this.isFullscreen_=Boolean(t),this.isFullscreen_!==e&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_}requestFullscreen(t){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);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||{},void 0!==t&&(e=t)),this.fsApi_.requestFullscreen){const t=this.el_[this.fsApi_.requestFullscreen](e);return t&&t.then((()=>this.isFullscreen(!0)),(()=>this.isFullscreen(!1))),t}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):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_();o&&(o.then(s,s),o.then(e,i))}))}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const t=g[this.fsApi_.exitFullscreen]();return t&&Pn(t.then((()=>this.isFullscreen(!1)))),t}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=g.documentElement.style.overflow,Xs(g,"keydown",this.boundFullWindowOnEscKey_),g.documentElement.style.overflow="hidden",as(g.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(t){"Escape"===t.key&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Gs(g,"keydown",this.boundFullWindowOnEscKey_),g.documentElement.style.overflow=this.docOrigOverflow,hs(g.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(t){if(void 0===t)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",t),this.options_.disablePictureInPicture=t,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(t){return void 0!==t?(this.isInPictureInPicture_=!!t,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&p.documentPictureInPicture){const t=g.createElement(this.el().tagName);return t.classList=this.el().classList,t.classList.add("vjs-pip-container"),this.posterImage&&t.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&t.appendChild(this.titleBar.el().cloneNode(!0)),t.appendChild(ss("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),p.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then((e=>(Ds(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(!0),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(!1),this.player_.trigger("leavepictureinpicture")})),e)))}return"pictureInPictureEnabled"in g&&!1===this.disablePictureInPicture()?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){return p.documentPictureInPicture&&p.documentPictureInPicture.window?(p.documentPictureInPicture.window.close(),Promise.resolve()):"pictureInPictureEnabled"in g?g.exitPictureInPicture():void 0}handleKeyDown(t){const{userActions:e}=this.options_;e&&e.hotkeys&&((t=>{const e=t.tagName.toLowerCase();return!!t.isContentEditable||("input"===e?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(t.type):-1!==["textarea"].indexOf(e))})(this.el_.ownerDocument.activeElement)||("function"==typeof e.hotkeys?e.hotkeys.call(this,t):this.handleHotkeys(t)))}handleHotkeys(t){const e=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:i=()=>"f"===t.key.toLowerCase(),muteKey:s=()=>"m"===t.key.toLowerCase(),playPauseKey:n=()=>"k"===t.key.toLowerCase()||" "===t.key.toLowerCase()}=e;if(i.call(this,t)){t.preventDefault(),t.stopPropagation();const e=Tn.getComponent("FullscreenToggle");!1!==g[this.fsApi_.fullscreenEnabled]&&e.prototype.handleClick.call(this,t)}else s.call(this,t)?(t.preventDefault(),t.stopPropagation(),Tn.getComponent("MuteToggle").prototype.handleClick.call(this,t)):n.call(this,t)&&(t.preventDefault(),t.stopPropagation(),Tn.getComponent("PlayToggle").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=dr.getTech(n);if(r||(r=Tn.getComponent(n)),r){if(r.isSupported()&&(e=r.canPlayType(t),e))return e}else mi.error(`The "${n}" tech is undefined. Skipped browser support check for that tech.`)}return""}selectSource(t){const e=this.options_.techOrder.map((t=>[t,dr.getTech(t)])).filter((([t,e])=>e?e.isSupported():(mi.error(`The "${t}" tech is undefined. Skipped browser support check for that tech.`),!1))),i=function(t,e,i){let s;return t.some((t=>e.some((e=>{if(s=i(t,e),s)return!0})))),s};let s;const n=([t,e],i)=>{if(e.canPlaySource(i,this.options_[t.toLowerCase()]))return{source:i,tech:t}};var r;return s=this.options_.sourceOrder?i(t,e,(r=n,(t,e)=>r(e,t))):i(e,t,n),s||!1}handleSrc_(t,e){if(void 0===t)return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const i=xr(t);if(i.length){if(this.changingSrc_=!0,e||(this.cache_.sources=i),this.updateSourceCaches_(i[0]),mr(this,i[0],((t,s)=>{if(this.middleware_=s,e||(this.cache_.sources=i),this.updateSourceCaches_(t),this.src_(t))return i.length>1?this.handleSrc_(i.slice(1)):(this.changingSrc_=!1,this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0),void this.triggerReady());var n;n=this.tech_,s.forEach((t=>t.setTech&&t.setTech(n)))})),i.length>1){const t=()=>{this.error(null),this.handleSrc_(i.slice(1),!0)},e=()=>{this.off("error",t)};this.one("error",t),this.one("playing",e),this.resetRetryOnError_=()=>{this.off("error",t),this.off("playing",e)}}}else this.setTimeout((function(){this.error({code:4,message:this.options_.notSupportedMessage})}),0)}src(t){return this.handleSrc_(t,!1)}src_(t){const e=this.selectSource([t]);return!e||(jn(e.tech,this.techName_)?(this.ready((function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",t):this.techCall_("src",t.src),this.changingSrc_=!1}),!0),!1):(this.changingSrc_=!0,this.loadTech_(e.tech,e.source),this.tech_.ready((()=>{this.changingSrc_=!1})),!1))}addSourceElement(t,e){return!!this.tech_&&this.tech_.addSourceElement(t,e)}removeSourceElement(t){return!!this.tech_&&this.tech_.removeSourceElement(t)}load(){this.tech_&&this.tech_.vhs?this.src(this.currentSource()):this.techCall_("load")}reset(){this.paused()?this.doReset_():Pn(this.play().then((()=>this.doReset_())))}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),an(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||{},{seekBar:n}=i||{};t&&t.updateContent(),e&&e.updateContent(),s&&s.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const t=this.currentSource(),e=[];return 0!==Object.keys(t).length&&e.push(t),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){return void 0!==t?(this.techCall_("setPreload",t),void(this.options_.preload=t)):this.techGet_("preload")}autoplay(t){if(void 0===t)return this.options_.autoplay||!1;let e;"string"==typeof t&&/(any|play|muted)/.test(t)||!0===t&&this.options_.normalizeAutoplay?(this.options_.autoplay=t,this.manualAutoplay_("string"==typeof t?t:"play"),e=!1):this.options_.autoplay=!!t,e=void 0===e?this.options_.autoplay:e,this.tech_&&this.techCall_("setAutoplay",e)}playsinline(t){return void 0!==t&&(this.techCall_("setPlaysinline",t),this.options_.playsinline=t),this.techGet_("playsinline")}loop(t){return void 0!==t?(this.techCall_("setLoop",t),void(this.options_.loop=t)):this.techGet_("loop")}poster(t){if(void 0===t)return this.poster_;t||(t=""),t!==this.poster_&&(this.poster_=t,this.techCall_("setPoster",t),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const t=this.tech_.poster()||"";t!==this.poster_&&(this.poster_=t,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(t){if(void 0===t)return!!this.controls_;this.controls_!==(t=!!t)&&(this.controls_=t,this.usingNativeControls()&&this.techCall_("setControls",t),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(t){if(void 0===t)return!!this.usingNativeControls_;this.usingNativeControls_!==(t=!!t)&&(this.usingNativeControls_=t,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(t){if(void 0===t)return this.error_||null;if(li("beforeerror").forEach((e=>{const i=e(this,t);Ti(i)&&!Array.isArray(i)||"string"==typeof i||"number"==typeof i||null===i?t=i:this.log.error("please return a value that MediaError expects in beforeerror hooks")})),this.options_.suppressNotSupportedError&&t&&4===t.code){const e=function(){this.error(t)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],e),void this.one("loadstart",(function(){this.off(["click","touchstart"],e)}))}if(null===t)return this.error_=null,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new On(t),this.addClass("vjs-error"),mi.error(`(CODE:${this.error_.code} ${On.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),li("error").forEach((t=>t(this,this.error_)))}reportUserActivity(t){this.userActivity_=!0}userActive(t){if(void 0===t)return this.userActive_;if((t=!!t)!==this.userActive_){if(this.userActive_=t,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",(function(t){t.stopPropagation(),t.preventDefault()})),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let t,e,i;const s=Zs(this,this.reportUserActivity),n=function(){s(),this.clearInterval(t)};this.on("mousedown",(function(){s(),this.clearInterval(t),t=this.setInterval(s,250)})),this.on("mousemove",(function(t){t.screenX===e&&t.screenY===i||(e=t.screenX,i=t.screenY,s())})),this.on("mouseup",n),this.on("mouseleave",n);const r=this.getChild("controlBar");let o;!r||Wi||Ni||(r.on("mouseenter",(function(){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0})),r.on("mouseleave",(function(){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout}))),this.on("keydown",s),this.on("keyup",s),this.setInterval((function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(o);const t=this.options_.inactivityTimeout;t<=0||(o=this.setTimeout((function(){this.userActivity_||this.userActive(!1)}),t))}),250)}playbackRate(t){if(void 0===t)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",t)}defaultPlaybackRate(t){return void 0!==t?this.techCall_("setDefaultPlaybackRate",t):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(t){if(void 0===t)return!!this.isAudio_;this.isAudio_=!!t}updatePlayerHeightOnAudioOnlyMode_(){const t=this.getChild("ControlBar");t&&this.audioOnlyCache_.controlBarHeight!==t.currentHeight()&&(this.audioOnlyCache_.controlBarHeight=t.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const t=this.children(),e=this.getChild("ControlBar"),i=e&&e.currentHeight();t.forEach((t=>{t!==e&&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("boolean"!=typeof t||t===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=t,t){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then((()=>this.enableAudioOnlyUI_()))}return Promise.resolve().then((()=>this.disableAudioOnlyUI_()))}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(t){return"boolean"!=typeof t||t===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=t,t?this.audioOnlyMode()?this.audioOnlyMode(!1).then((()=>{this.enablePosterModeUI_()})):Promise.resolve().then((()=>{this.enablePosterModeUI_()})):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),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(void 0===t)return this.language_;this.language_!==String(t).toLowerCase()&&(this.language_=String(t).toLowerCase(),an(this)&&this.trigger("languagechange"))}languages(){return ki(ua.prototype.options_.languages,this.languages_)}toJSON(){const t=ki(this.options_),e=t.tracks;t.tracks=[];for(let i=0;i<e.length;i++){let s=e[i];s=ki(s),s.player=void 0,t.tracks[i]=s}return t}createModal(t,e){(e=e||{}).content=t||"";const i=new $n(this,e);return this.addChild(i),i.on("dispose",(()=>{this.removeChild(i)})),i.open(),i}updateCurrentBreakpoint_(){if(!this.responsive())return;const t=this.currentBreakpoint(),e=this.currentWidth();for(let i=0;i<aa.length;i++){const s=aa[i];if(e<=this.breakpoints_[s]){if(t===s)return;t&&this.removeClass(ha[t]),this.addClass(ha[s]),this.breakpoint_=s;break}}}removeCurrentBreakpoint_(){const t=this.currentBreakpointClass();this.breakpoint_="",t&&this.removeClass(t)}breakpoints(t){return void 0===t||(this.removeCurrentBreakpoint_(),this.breakpoints_=Object.assign({},la,t),this.updateCurrentBreakpoint_()),Object.assign(this.breakpoints_)}responsive(t){return void 0===t?this.responsive_:(t=Boolean(t))!==this.responsive_?(this.responsive_=t,t?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),t):void 0}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return ha[this.breakpoint_]||""}loadMedia(t,e){if(!t||"object"!=typeof t)return;const i=this.crossOrigin();this.reset(),this.cache_.media=ki(t);const{artist:s,artwork:n,description:r,poster:o,src:a,textTracks:h,title:l}=this.cache_.media;!n&&o&&(this.cache_.media.artwork=[{src:o,type:kr(o)}]),i&&this.crossOrigin(i),a&&this.src(a),o&&this.poster(o),Array.isArray(h)&&h.forEach((t=>this.addRemoteTextTrack(t,!1))),this.titleBar&&this.titleBar.update({title:l,description:r||s||""}),this.ready(e)}getMedia(){if(!this.cache_.media){const t=this.poster(),e={src:this.currentSources(),textTracks:Array.prototype.map.call(this.remoteTextTracks(),(t=>({kind:t.kind,label:t.label,language:t.language,src:t.src})))};return t&&(e.poster=t,e.artwork=[{src:e.poster,type:kr(e.poster)}]),e}return ki(this.cache_.media)}static getTagSettings(t){const e={sources:[],tracks:[]},i=cs(t),s=i["data-setup"];if(os(t,"vjs-fill")&&(i.fill=!0),os(t,"vjs-fluid")&&(i.fluid=!0),null!==s)try{Object.assign(i,JSON.parse(s||"{}"))}catch(t){mi.error("data-setup",t)}if(Object.assign(e,i),t.hasChildNodes()){const i=t.childNodes;for(let t=0,s=i.length;t<s;t++){const s=i[t],n=s.nodeName.toLowerCase();"source"===n?e.sources.push(cs(s)):"track"===n&&e.tracks.push(cs(s))}}return e}debug(t){if(void 0===t)return this.debugEnabled_;t?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(t){if(void 0===t)return this.cache_.playbackRates;Array.isArray(t)&&t.every((t=>"number"==typeof t))&&(this.cache_.playbackRates=t,this.trigger("playbackrateschange"))}}ua.prototype.videoTracks=()=>{},ua.prototype.audioTracks=()=>{},ua.prototype.textTracks=()=>{},ua.prototype.remoteTextTracks=()=>{},ua.prototype.remoteTextTrackEls=()=>{},cr.names.forEach((function(t){const e=cr[t];ua.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}})),ua.prototype.crossorigin=ua.prototype.crossOrigin,ua.players={};const ca=p.navigator;ua.prototype.options_={techOrder:dr.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:ca&&(ca.languages&&ca.languages[0]||ca.userLanguage||ca.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1},ra.forEach((function(t){ua.prototype[`handleTech${bn(t)}_`]=function(){return this.trigger(t)}})),Tn.registerComponent("Player",ua);const da="plugin",fa="activePlugins_",pa={},va=t=>pa.hasOwnProperty(t),ma=t=>va(t)?pa[t]:void 0,ga=(t,e)=>{t[fa]=t[fa]||{},t[fa][e]=!0},ya=(t,e,i)=>{const s=(i?"before":"")+"pluginsetup";t.trigger(s,e),t.trigger(s+":"+e.name,e)},ba=(t,e)=>(e.prototype.name=t,function(...i){ya(this,{name:t,plugin:e,instance:null},!0);const s=new e(...[this,...i]);return this[t]=()=>s,ya(this,s.getEventHash()),s});class ja{constructor(t){if(this.constructor===ja)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=t,this.log||(this.log=this.player.log.createLogger(this.name)),vn(this),delete this.trigger,gn(this,this.constructor.defaultState),ga(t,this.name),this.dispose=this.dispose.bind(this),t.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(t={}){return t.name=this.name,t.plugin=this.constructor,t.instance=this,t}trigger(t,e={}){return Ys(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[fa][t]=!1,this.player=this.state=null,e[t]=ba(t,pa[t])}static isBasic(t){const e="string"==typeof t?ma(t):t;return"function"==typeof e&&!ja.prototype.isPrototypeOf(e.prototype)}static registerPlugin(t,e){if("string"!=typeof t)throw new Error(`Illegal plugin name, "${t}", must be a string, was ${typeof t}.`);if(va(t))mi.warn(`A plugin named "${t}" already exists. You may want to avoid re-registering plugins!`);else if(ua.prototype.hasOwnProperty(t))throw new Error(`Illegal plugin name, "${t}", cannot share a name with an existing player method!`);if("function"!=typeof e)throw new Error(`Illegal plugin for "${t}", must be a function, was ${typeof e}.`);return pa[t]=e,t!==da&&(ua.prototype[t]=ja.isBasic(e)?function(t,e){const i=function(){ya(this,{name:t,plugin:e,instance:null},!0);const i=e.apply(this,arguments);return ga(this,t),ya(this,{name:t,plugin:e,instance:i}),i};return Object.keys(e).forEach((function(t){i[t]=e[t]})),i}(t,e):ba(t,e)),e}static deregisterPlugin(t){if(t===da)throw new Error("Cannot de-register base plugin.");va(t)&&(delete pa[t],delete ua.prototype[t])}static getPlugins(t=Object.keys(pa)){let e;return t.forEach((t=>{const i=ma(t);i&&(e=e||{},e[t]=i)})),e}static getPluginVersion(t){const e=ma(t);return e&&e.VERSION||""}}function wa(t,e,i,s){return function(t,e){let i=!1;return function(...s){return i||mi.warn(t),i=!0,e.apply(this,s)}}(`${e} is deprecated and will be removed in ${t}.0; please use ${i} instead.`,s)}ja.getPlugin=ma,ja.BASE_PLUGIN_NAME=da,ja.registerPlugin(da,ja),ua.prototype.usingPlugin=function(t){return!!this[fa]&&!0===this[fa][t]},ua.prototype.hasPlugin=function(t){return!!va(t)};const Ta=t=>0===t.indexOf("#")?t.slice(1):t;function Sa(t,e,i){let s=Sa.getPlayer(t);if(s)return e&&mi.warn(`Player "${t}" is already initialised. Options will not be applied.`),i&&s.ready(i),s;const n="string"==typeof t?As("#"+Ta(t)):t;if(!ts(n))throw new TypeError("The element or ID supplied is not valid. (videojs)");const r="getRootNode"in n&&n.getRootNode()instanceof p.ShadowRoot?n.getRootNode():n.ownerDocument.body;n.ownerDocument.defaultView&&r.contains(n)||mi.warn("The element supplied is not included in the DOM"),!0===(e=e||{}).restoreEl&&(e.restoreEl=(n.parentNode&&n.parentNode.hasAttribute&&n.parentNode.hasAttribute("data-vjs-player")?n.parentNode:n).cloneNode(!0)),li("beforesetup").forEach((t=>{const i=t(n,ki(e));Ti(i)&&!Array.isArray(i)?e=ki(e,i):mi.error("please return an object in beforesetup hooks")}));const o=Tn.getComponent("Player");return s=new o(n,e,i),li("setup").forEach((t=>t(s))),s}if(Sa.hooks_=hi,Sa.hooks=li,Sa.hook=function(t,e){li(t,e)},Sa.hookOnce=function(t,e){li(t,[].concat(e).map((e=>{const i=(...s)=>(ui(t,i),e(...s));return i})))},Sa.removeHook=ui,!0!==p.VIDEOJS_NO_DYNAMIC_STYLE&&Zi()){let t=As(".vjs-styles-defaults");if(!t){t=_s("vjs-styles-defaults");const e=As("head");e&&e.insertBefore(t,e.firstChild),Ls(t,"\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 ")}}Rs(1,Sa),Sa.VERSION=ai,Sa.options=ua.prototype.options_,Sa.getPlayers=()=>ua.players,Sa.getPlayer=t=>{const e=ua.players;let i;if("string"==typeof t){const s=Ta(t),n=e[s];if(n)return n;i=As("#"+s)}else i=t;if(ts(i)){const{player:t,playerId:s}=i;if(t||e[s])return t||e[s]}},Sa.getAllPlayers=()=>Object.keys(ua.players).map((t=>ua.players[t])).filter(Boolean),Sa.players=ua.players,Sa.getComponent=Tn.getComponent,Sa.registerComponent=(t,e)=>(dr.isTech(e)&&mi.warn(`The ${t} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),Tn.registerComponent.call(Tn,t,e)),Sa.getTech=dr.getTech,Sa.registerTech=dr.registerTech,Sa.use=function(t,e){fr[t]=fr[t]||[],fr[t].push(e)},Object.defineProperty(Sa,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Sa.middleware,"TERMINATOR",{value:vr,writeable:!1,enumerable:!0}),Sa.browser=Ki,Sa.obj=Ei,Sa.mergeOptions=wa(9,"videojs.mergeOptions","videojs.obj.merge",ki),Sa.defineLazyProperty=wa(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Ai),Sa.bind=wa(9,"videojs.bind","native Function.prototype.bind",Zs),Sa.registerPlugin=ja.registerPlugin,Sa.deregisterPlugin=ja.deregisterPlugin,Sa.plugin=(t,e)=>(mi.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ja.registerPlugin(t,e)),Sa.getPlugins=ja.getPlugins,Sa.getPlugin=ja.getPlugin,Sa.getPluginVersion=ja.getPluginVersion,Sa.addLanguage=function(t,e){return t=(""+t).toLowerCase(),(Sa.options.languages=ki(Sa.options.languages,{[t]:e}))[t]},Sa.log=mi,Sa.createLogger=gi,Sa.time=Nn,Sa.createTimeRange=wa(9,"videojs.createTimeRange","videojs.time.createTimeRanges",xn),Sa.createTimeRanges=wa(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",xn),Sa.formatTime=wa(9,"videojs.formatTime","videojs.time.formatTime",Cn),Sa.setFormatTime=wa(9,"videojs.setFormatTime","videojs.time.setFormatTime",In),Sa.resetFormatTime=wa(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Dn),Sa.parseUrl=wa(9,"videojs.parseUrl","videojs.url.parseUrl",Qn),Sa.isCrossOrigin=wa(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",er),Sa.EventTarget=rn,Sa.any=Js,Sa.on=Xs,Sa.one=Ws,Sa.off=Gs,Sa.trigger=Ys,Sa.xhr=B,Sa.TrackList=Bn,Sa.TextTrack=rr,Sa.TextTrackList=Hn,Sa.AudioTrack=or,Sa.AudioTrackList=qn,Sa.VideoTrack=ar,Sa.VideoTrackList=zn,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach((t=>{Sa[t]=function(){return mi.warn(`videojs.${t}() is deprecated; use videojs.dom.${t}() instead`),Cs[t].apply(null,arguments)}})),Sa.computedStyle=wa(9,"videojs.computedStyle","videojs.dom.computedStyle",Is),Sa.dom=Cs,Sa.fn=sn,Sa.num=Gr,Sa.str=wn,Sa.url=ir,Sa.Error={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"};
|
|
12
|
+
/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */
|
|
13
|
+
class ka{constructor(t){let e=this;return 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:()=>e.enabled_(),set(t){e.enabled_(t)}}),e}}class xa extends Sa.EventTarget{constructor(){super();let t=this;return t.levels_=[],t.selectedIndex_=-1,Object.defineProperty(t,"selectedIndex",{get:()=>t.selectedIndex_}),Object.defineProperty(t,"length",{get:()=>t.levels_.length}),t[Symbol.iterator]=()=>t.levels_.values(),t}addQualityLevel(t){let e=this.getQualityLevelById(t.id);if(e)return e;const i=this.levels_.length;return e=new ka(t),""+i in this||Object.defineProperty(this,i,{get(){return this.levels_[i]}}),this.levels_.push(e),this.trigger({qualityLevel:e,type:"addqualitylevel"}),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],this.selectedIndex_===i?this.selectedIndex_=-1:this.selectedIndex_>i&&this.selectedIndex_--;break}return e&&this.trigger({qualityLevel:t,type:"removequalitylevel"}),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}}xa.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const t in xa.prototype.allowedEvents_)xa.prototype["on"+t]=null;var Aa="4.1.0";const Ea=function(t){return function(t){const e=t.qualityLevels,i=new xa,s=function(){i.dispose(),t.qualityLevels=e,t.off("dispose",s)};return t.on("dispose",s),t.qualityLevels=()=>i,t.qualityLevels.VERSION=Aa,i}(this,Sa.obj.merge({},t))};Sa.registerPlugin("qualityLevels",Ea),Ea.VERSION=Aa;
|
|
14
|
+
/*! @name @videojs/http-streaming @version 3.17.5 @license Apache-2.0 */
|
|
15
|
+
const Ia=X,Da=(t,e)=>e&&e.responseURL&&t!==e.responseURL?e.responseURL:t,Ca=t=>Sa.log.debug?Sa.log.debug.bind(Sa,"VHS:",`${t} >`):function(){};function Na(...t){const e=Sa.obj||Sa;return(e.merge||e.mergeOptions).apply(e,t)}function Ma(...t){const e=Sa.time||Sa;return(e.createTimeRanges||e.createTimeRanges).apply(e,t)}const Oa=1/30,Ra=.1,Pa=function(t,e){const i=[];let s;if(t&&t.length)for(s=0;s<t.length;s++)e(t.start(s),t.end(s))&&i.push([t.start(s),t.end(s)]);return Ma(i)},_a=function(t,e){return Pa(t,(function(t,i){return t-Ra<=e&&i+Ra>=e}))},La=function(t,e){return Pa(t,(function(t){return t-Oa>=e}))},Fa=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(", ")},$a=t=>{const e=[];for(let i=0;i<t.length;i++)e.push({start:t.start(i),end:t.end(i)});return e},Ba=function(t){if(t&&t.length&&t.end)return t.end(t.length-1)},Ua=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),r=t.end(s);e>r||(i+=e>n&&e<=r?r-e:r-n)}return i},qa=(t,e)=>{if(!e.preload)return e.duration;let i=0;return(e.parts||[]).forEach((function(t){i+=t.duration})),(e.preloadHints||[]).forEach((function(e){"PART"===e.type&&(i+=t.partTargetDuration)})),i},Va=t=>(t.segments||[]).reduce(((t,e,i)=>(e.parts?e.parts.forEach((function(s,n){t.push({duration:s.duration,segmentIndex:i,partIndex:n,part:s,segment:e})})):t.push({duration:e.duration,segmentIndex:i,partIndex:null,segment:e,part:null}),t)),[]),za=t=>{const e=t.segments&&t.segments.length&&t.segments[t.segments.length-1];return e&&e.parts||[]},Ha=({preloadSegment:t})=>{if(!t)return;const{parts:e,preloadHints:i}=t;let s=(i||[]).reduce(((t,e)=>t+("PART"===e.type?1:0)),0);return s+=e&&e.length?e.length:0,s},Xa=(t,e)=>{if(e.endList)return 0;if(t&&t.suggestedPresentationDelay)return t.suggestedPresentationDelay;const i=za(e).length>0;return i&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:i&&e.partTargetDuration?3*e.partTargetDuration:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?3*e.targetDuration:0},Ga=function(t,e,i){if(void 0===e&&(e=t.mediaSequence+t.segments.length),e<t.mediaSequence)return 0;const s=function(t,e){let i=0,s=e-t.mediaSequence,n=t.segments[s];if(n){if(void 0!==n.start)return{result:n.start,precise:!0};if(void 0!==n.end)return{result:n.end-n.duration,precise:!0}}for(;s--;){if(n=t.segments[s],void 0!==n.end)return{result:i+n.end,precise:!0};if(i+=qa(t,n),void 0!==n.start)return{result:i+n.start,precise:!0}}return{result:i,precise:!1}}(t,e);if(s.precise)return s.result;const n=function(t,e){let i,s=0,n=e-t.mediaSequence;for(;n<t.segments.length;n++){if(i=t.segments[n],void 0!==i.start)return{result:i.start-s,precise:!0};if(s+=qa(t,i),void 0!==i.end)return{result:i.end-s,precise:!0}}return{result:-1,precise:!1}}(t,e);return n.precise?n.result:s.result+i},Ya=function(t,e,i){if(!t)return 0;if("number"!=typeof i&&(i=0),void 0===e){if(t.totalDuration)return t.totalDuration;if(!t.endList)return p.Infinity}return Ga(t,e,i)},Wa=function({defaultDuration:t,durationList:e,startIndex:i,endIndex:s}){let n=0;if(i>s&&([i,s]=[s,i]),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},Ja=function(t,e,i,s){if(!t||!t.segments)return null;if(t.endList)return Ya(t);if(null===e)return null;let n=Ga(t,t.mediaSequence+t.segments.length,e=e||0);return i&&(n-=s="number"==typeof s?s:Xa(null,t)),Math.max(0,n)},Ka=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()},Qa=function(t){return t.excludeUntil&&t.excludeUntil===1/0},Za=function(t){const e=Ka(t);return!t.disabled&&!e},th=function(t,e){return e.attributes&&e.attributes[t]},eh=(t,e)=>{if(1===t.playlists.length)return!0;const i=e.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===t.playlists.filter((t=>!!Za(t)&&(t.attributes.BANDWIDTH||0)<i)).length},ih=(t,e)=>!(!t&&!e||!t&&e||t&&!e||t!==e&&(!t.id||!e.id||t.id!==e.id)&&(!t.resolvedUri||!e.resolvedUri||t.resolvedUri!==e.resolvedUri)&&(!t.uri||!e.uri||t.uri!==e.uri)),sh=function(t,e){const i=t&&t.mediaGroups&&t.mediaGroups.AUDIO||{};let s=!1;for(const t in i){for(const n in i[t])if(s=e(i[t][n]),s)break;if(s)break}return!!s},nh=t=>{if(!t||!t.playlists||!t.playlists.length)return sh(t,(t=>t.playlists&&t.playlists.length||t.uri));for(let e=0;e<t.playlists.length;e++){const i=t.playlists[e],s=i.attributes&&i.attributes.CODECS;if((!s||!s.split(",").every((t=>ct(t))))&&!sh(t,(t=>ih(i,t))))return!1}return!0};var rh={liveEdgeDelay:Xa,duration:Ya,seekable:function(t,e,i){const s=e||0;let n=Ja(t,e,!0,i);return null===n?Ma():(n<s&&(n=s),Ma(s,n))},getMediaInfoForTime:function({playlist:t,currentTime:e,startingSegmentIndex:i,startingPartIndex:s,startTime:n,exactManifestTimings:r}){let o=e-n;const a=Va(t);let h=0;for(let t=0;t<a.length;t++){const e=a[t];if(i===e.segmentIndex&&("number"!=typeof s||"number"!=typeof e.partIndex||s===e.partIndex)){h=t;break}}if(o<0){if(h>0)for(let e=h-1;e>=0;e--){const i=a[e];if(o+=i.duration,r){if(o<0)continue}else if(o+Oa<=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n-Wa({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++)if(o-=t.targetDuration,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];if(o-=i.duration,0!==o&&!(i.duration>Oa&&o+Oa>=0)||e===a.length-1){if(r){if(o>0)continue}else if(o-Oa>=0)continue;return{partIndex:i.partIndex,segmentIndex:i.segmentIndex,startTime:n+Wa({defaultDuration:t.targetDuration,durationList:a,startIndex:h,endIndex:e})}}}return{segmentIndex:a[a.length-1].segmentIndex,partIndex:a[a.length-1].partIndex,startTime:e}},isEnabled:Za,isDisabled:function(t){return t.disabled},isExcluded:Ka,isIncompatible:Qa,playlistEnd:Ja,isAes:function(t){for(let e=0;e<t.segments.length;e++)if(t.segments[e].key)return!0;return!1},hasAttribute:th,estimateSegmentRequestTime:function(t,e,i,s=0){return th("BANDWIDTH",i)?(t*i.attributes.BANDWIDTH-8*s)/e:NaN},isLowestEnabledRendition:eh,isAudioOnly:nh,playlistMatch:ih,segmentDurationWithParts:qa};const{log:oh}=Sa,ah=(t,e)=>`${t}-${e}`,hh=(t,e,i)=>`placeholder-uri-${t}-${e}-${i}`,lh=(t,e)=>{t.mediaGroups&&["AUDIO","SUBTITLES"].forEach((i=>{if(t.mediaGroups[i])for(const s in t.mediaGroups[i])for(const n in t.mediaGroups[i][s])e(t.mediaGroups[i][s][n],i,s,n)}))},uh=({playlist:t,uri:e,id:i})=>{t.id=i,t.playlistErrors_=0,e&&(t.uri=e),t.attributes=t.attributes||{}},ch=(t,e,i=hh)=>{t.uri=e;for(let e=0;e<t.playlists.length;e++)t.playlists[e].uri||(t.playlists[e].uri=`placeholder-uri-${e}`);const s=nh(t);lh(t,((e,n,r,o)=>{if(!e.playlists||!e.playlists.length){if(s&&"AUDIO"===n&&!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=[b({},e)]}e.playlists.forEach((function(e,s){const a=i(n,r,o,e),h=ah(s,a);e.uri?e.resolvedUri=e.resolvedUri||Ia(t.uri,e.uri):(e.uri=0===s?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}))})),(t=>{let e=t.playlists.length;for(;e--;){const i=t.playlists[e];uh({playlist:i,id:ah(e,i.uri)}),i.resolvedUri=Ia(t.uri,i.uri),t.playlists[i.id]=i,t.playlists[i.uri]=i,i.attributes.BANDWIDTH||oh.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}})(t),(t=>{lh(t,(e=>{e.uri&&(e.resolvedUri=Ia(t.uri,e.uri))}))})(t)};class dh{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(t=[]){if(null!==this.offset_)return;if(!t.length)return;const[e]=t;void 0!==e.programDateTime&&(this.offset_=e.programDateTime/1e3)}setPendingDateRanges(t=[]){if(!t.length)return;const[e]=t,i=e.startDate.getTime();this.trimProcessedDateRanges_(i),this.pendingDateRanges_=t.reduce(((t,e)=>(t.set(e.id,e),t)),new Map)}processDateRange(t){this.pendingDateRanges_.delete(t.id),this.processedDateRanges_.set(t.id,t)}getDateRangesToProcess(){if(null===this.offset_)return[];const t={},e=[];this.pendingDateRanges_.forEach(((i,s)=>{if(!this.processedDateRanges_.has(s)&&(i.startTime=i.startDate.getTime()/1e3-this.offset_,i.processDateRange=()=>this.processDateRange(i),e.push(i),i.class))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]||[];i.endTime=i.endDate?i.endDate.getTime()/1e3-this.offset_:i.endOnNext&&e[i.classListIndex+1]?e[i.classListIndex+1].startTime:i.duration?i.startTime+i.duration:i.plannedDuration?i.startTime+i.plannedDuration:i.startTime}return e}trimProcessedDateRanges_(t){new Map(this.processedDateRanges_).forEach(((e,i)=>{e.startDate.getTime()<t&&this.processedDateRanges_.delete(i)}))}}const fh=({requestType:t,request:e,error:i,parseFailure:s})=>{const n=e.status>=400&&e.status<=499,r={uri:e.uri,requestType:t},o=(e.status<200||e.status>299)&&!n||s;return i&&n?(r.error=b({},i),r.errorType=Sa.Error.NetworkRequestFailed):e.aborted?r.errorType=Sa.Error.NetworkRequestAborted:e.timedout?r.errorType=Sa.Error.NetworkRequestTimeout:o&&(r.errorType=s?Sa.Error.NetworkBodyParserFailed:Sa.Error.NetworkBadStatus,r.status=e.status,r.headers=e.headers),r},ph=Ca("CodecUtils"),vh=function(t){const e=t.attributes||{};if(e.CODECS)return ut(e.CODECS)},mh=(t,e)=>{const i=e.attributes||{};return t&&t.mediaGroups&&t.mediaGroups.AUDIO&&i.AUDIO&&t.mediaGroups.AUDIO[i.AUDIO]},gh=function(t){const e={};return t.forEach((({mediaType:t,type:i,details:s})=>{e[t]=e[t]||[],e[t].push(lt(`${i}${s}`))})),Object.keys(e).forEach((function(t){if(e[t].length>1)return ph(`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.`),void(e[t]=null);e[t]=e[t][0]})),e},yh=function(t){let e=0;return t.audio&&e++,t.video&&e++,e},bh=function(t,e){const i=e.attributes||{},s=gh(vh(e)||[]);if(mh(t,e)&&!s.audio&&!((t,e)=>{if(!mh(t,e))return!0;const i=t.mediaGroups.AUDIO[(e.attributes||{}).AUDIO];for(const t in i)if(!i[t].uri&&!i[t].playlists)return!0;return!1})(t,e)){const e=gh(function(t,e){if(!t.mediaGroups.AUDIO||!e)return null;var i=t.mediaGroups.AUDIO[e];if(!i)return null;for(var s in i){var n=i[s];if(n.default&&n.playlists)return ut(n.playlists[0].attributes.CODECS)}return null}(t,i.AUDIO)||[]);e.audio&&(s.audio=e.audio)}return s},{EventTarget:jh}=Sa,wh=(t,e)=>{if(!t)return e;const i=Na(t,e);if(t.preloadHints&&!e.preloadHints&&delete i.preloadHints,t.parts&&!e.parts)delete i.parts;else if(t.parts&&e.parts)for(let s=0;s<e.parts.length;s++)t.parts&&t.parts[s]&&(i.parts[s]=Na(t.parts[s],e.parts[s]));return!t.skipped&&e.skipped&&(i.skipped=!1),t.preload&&!e.preload&&(i.preload=!1),i},Th=(t,e)=>{!t.resolvedUri&&t.uri&&(t.resolvedUri=Ia(e,t.uri)),t.key&&!t.key.resolvedUri&&(t.key.resolvedUri=Ia(e,t.key.uri)),t.map&&!t.map.resolvedUri&&(t.map.resolvedUri=Ia(e,t.map.uri)),t.map&&t.map.key&&!t.map.key.resolvedUri&&(t.map.key.resolvedUri=Ia(e,t.map.key.uri)),t.parts&&t.parts.length&&t.parts.forEach((t=>{t.resolvedUri||(t.resolvedUri=Ia(e,t.uri))})),t.preloadHints&&t.preloadHints.length&&t.preloadHints.forEach((t=>{t.resolvedUri||(t.resolvedUri=Ia(e,t.uri))}))},Sh=function(t){const e=t.segments||[],i=t.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints)for(let t=0;t<i.preloadHints.length;t++)if("MAP"===i.preloadHints[t].type)return e;i.duration=t.targetDuration,i.preload=!0,e.push(i)}return e},kh=(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,xh=(t,e,i=kh)=>{const s=Na(t,{}),n=s.playlists[e.id];if(!n)return null;if(i(n,e))return null;e.segments=Sh(e);const r=Na(n,e);if(r.preloadSegment&&!e.preloadSegment&&delete r.preloadSegment,n.segments){if(e.skip){e.segments=e.segments||[];for(let t=0;t<e.skip.skippedSegments;t++)e.segments.unshift({skipped:!0})}r.segments=((t,e,i)=>{const s=t.slice(),n=e.slice();i=i||0;const r=[];let o;for(let t=0;t<n.length;t++){const e=s[t+i],a=n[t];e?(o=e.map||o,r.push(wh(e,a))):(o&&!a.map&&(a.map=o),r.push(a))}return r})(n.segments,e.segments,e.mediaSequence-n.mediaSequence)}r.segments.forEach((t=>{Th(t,r.resolvedUri)}));for(let t=0;t<s.playlists.length;t++)s.playlists[t].id===e.id&&(s.playlists[t]=r);return s.playlists[e.id]=r,s.playlists[e.uri]=r,lh(t,(t=>{if(t.playlists)for(let i=0;i<t.playlists.length;i++)e.id===t.playlists[i].id&&(t.playlists[i]=r)})),s},Ah=(t,e)=>{const i=t.segments||[],s=i[i.length-1],n=s&&s.parts&&s.parts[s.parts.length-1],r=n&&n.duration||s&&s.duration;return e&&r?1e3*r:500*(t.partTargetDuration||t.targetDuration||10)},Eh=(t,e,i)=>{if(!t)return;const s=[];return 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})})),{type:e,isLive:i,renditions:s}};class Ih extends jh{constructor(t,e,i={}){if(super(),!t)throw new Error("A non-empty playlist URL or object is required");this.logger_=Ca("PlaylistLoader");const{withCredentials:s=!1}=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 dh,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();e.length&&this.addDateRangesToTextTrack_&&this.addDateRangesToTextTrack_(e)}handleMediaupdatetimeout_(){if("HAVE_METADATA"!==this.state)return;const t=this.media();let e=Ia(this.main.uri,t.uri);this.llhls&&(e=((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||[],r=Ha(e)-1;r>-1&&r!==n.length-1&&(i._HLS_part=r),(r>-1||n.length)&&s--}i._HLS_msn=s}if(e.serverControl&&e.serverControl.canSkipUntil&&(i._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){const e=new p.URL(t);["_HLS_skip","_HLS_msn","_HLS_part"].forEach((function(t){i.hasOwnProperty(t)&&e.searchParams.set(t,i[t])})),t=e.toString()}return t})(e,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:e,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t=>{if(this.request)return t?this.playlistRequestError(this.request,this.media(),"HAVE_METADATA"):void 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,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:fh({requestType:t.requestType,request:t,error:t.error})},this.trigger("error")}parseManifest_({url:t,manifestString:e}){try{const i=(({onwarn:t,oninfo:e,manifestString:i,customTagParsers:s=[],customTagMappers:n=[],llhls:r})=>{const o=new st;t&&o.on("warn",t),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){a.hasOwnProperty(t)&&delete a[t]})),a.segments&&a.segments.forEach((function(t){["parts","preloadHints"].forEach((function(e){t.hasOwnProperty(e)&&delete t[e]}))}))),!a.targetDuration){let e=10;a.segments&&a.segments.length&&(e=a.segments.reduce(((t,e)=>Math.max(t,e.duration)),0)),t&&t({message:`manifest has no targetDuration defaulting to ${e}`}),a.targetDuration=e}const h=za(a);if(h.length&&!a.partTargetDuration){const e=h.reduce(((t,e)=>Math.max(t,e.duration)),0);t&&(t({message:`manifest has no partTargetDuration defaulting to ${e}`}),oh.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})({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});return i.playlists&&i.playlists.length?(this.excludeAudioOnlyVariants(i.playlists),i):i}catch(t){this.error=t,this.error.metadata={errorType:Sa.Error.StreamingHlsPlaylistParserError,error:t}}}excludeAudioOnlyVariants(t){const e=t=>{const e=t.attributes||{},{width:i,height:s}=e.RESOLUTION||{};if(i&&s)return!0;const n=vh(t)||[],r=gh(n);return Boolean(r.video)};t.some(e)&&t.forEach((t=>{e(t)||(t.excludeUntil=1/0)}))}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(),uh({playlist:r,uri:i,id:s});const o=xh(this.main,r);this.targetDuration=r.partTargetDuration||r.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[s]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Ah(this.media(),!!o)),n.parsedPlaylist=Eh(this.main.playlists,n.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:n}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),p.clearTimeout(this.mediaUpdateTimeout),p.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new dh,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("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof t){if(!this.main.playlists[t])throw new Error("Unknown playlist URI: "+t);t=this.main.playlists[t]}if(p.clearTimeout(this.finalRenditionTimeout),e){const e=(t.partTargetDuration||t.targetDuration)/2*1e3||5e3;return void(this.finalRenditionTimeout=p.setTimeout(this.media.bind(this,t,!1),e))}const i=this.state,s=!this.media_||t.id!==this.media_.id,n=this.main.playlists[t.id];if(n&&n.endList||t.endList&&t.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=t,void(s&&(this.trigger("mediachanging"),this.trigger("HAVE_MAIN_MANIFEST"===i?"loadedmetadata":"mediachange")));if(this.updateMediaUpdateTimeout_(Ah(t,!0)),!s)return;if(this.state="SWITCHING_MEDIA",this.request){if(t.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}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){if(t.lastRequest=Date.now(),t.resolvedUri=Da(t.resolvedUri,s),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}),this.trigger("HAVE_MAIN_MANIFEST"===i?"loadedmetadata":"mediachange")}}))}pause(){this.mediaUpdateTimeout&&(p.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.state=this.media_?"HAVE_METADATA":"HAVE_MAIN_MANIFEST":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")}load(t){this.mediaUpdateTimeout&&(p.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const e=this.media();t?this.mediaUpdateTimeout=p.setTimeout((()=>{this.mediaUpdateTimeout=null,this.load()}),e?(e.partTargetDuration||e.targetDuration)/2*1e3:5e3):this.started?this.trigger(e&&!e.endList?"mediaupdatetimeout":"loadedplaylist"):this.start()}updateMediaUpdateTimeout_(t){this.mediaUpdateTimeout&&(p.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=p.setTimeout((()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(t)}),t))}start(){if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=p.location.href),this.src.resolvedUri=this.src.uri,void setTimeout((()=>{this.setupInitialPlaylist(this.src)}),0);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;if(this.request=null,e)return this.error={status:i.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:i.responseText,code:2,metadata:fh({requestType:i.requestType,request:i,error:e})},"HAVE_NOTHING"===this.state&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:t}),this.src=Da(this.src,i),this.trigger({type:"playlistparsestart",metadata:t});const s=this.parseManifest_({manifestString:i.responseText,url:this.src});t.parsedPlaylist=Eh(s.playlists,t.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:t}),this.setupInitialPlaylist(s)}))}srcUri(){return"string"==typeof this.src?this.src:this.src.uri}setupInitialPlaylist(t){if(this.state="HAVE_MAIN_MANIFEST",t.playlists)return this.main=t,ch(this.main,this.srcUri()),t.playlists.forEach((t=>{t.segments=Sh(t),t.segments.forEach((e=>{Th(e,t.resolvedUri)}))})),this.trigger("loadedplaylist"),void(this.request||this.media(this.main.playlists[0]));const e=this.srcUri()||p.location.href;this.main=((t,e)=>{const i=ah(0,e),s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:p.location.href,resolvedUri:p.location.href,playlists:[{uri:e,id:i,resolvedUri:e,attributes:{}}]};return s.playlists[i]=s.playlists[0],s.playlists[e]=s.playlists[0],s})(0,e),this.haveMetadata({playlistObject:t,url:e,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(t,e){const i=this.main,s=t.ID;let n=i.playlists.length;for(;n--;){const r=i.playlists[n];if(r.attributes["PATHWAY-ID"]===s){const o=r.resolvedUri,a=r.id;if(e){const e=this.createCloneURI_(r.resolvedUri,t),o=ah(s,e),a=this.createCloneAttributes_(s,r.attributes),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,s=t.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((t=>{if(i.mediaGroups[t]&&i.mediaGroups[t][s])for(const e in i.mediaGroups[t])if(e===s){for(const s in i.mediaGroups[t][e])i.mediaGroups[t][e][s].playlists.forEach((t=>{const e=i.playlists[t.id],s=e.resolvedUri;delete i.playlists[e.id],delete i.playlists[s]}));delete i.mediaGroups[t][e]}})),e&&this.createClonedMediaGroups_(t)}addClonePathway(t,e={}){const i=this.main,s=i.playlists.length,n=this.createCloneURI_(e.resolvedUri,t),r=ah(t.ID,n),o=this.createCloneAttributes_(t.ID,e.attributes),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,i=t["BASE-ID"],s=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((n=>{if(s.mediaGroups[n]&&!s.mediaGroups[n][e])for(const r in s.mediaGroups[n])if(r===i){s.mediaGroups[n][e]={};for(const i in s.mediaGroups[n][r]){const o=s.mediaGroups[n][r][i];s.mediaGroups[n][e][i]=b({},o);const a=s.mediaGroups[n][e][i],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],l=hh(n,e,i),u=ah(e,l);if(h&&!s.playlists[u]){const e=this.createClonePlaylist_(h,u,t),i=e.resolvedUri;s.playlists[u]=e,s.playlists[i]=e}a.playlists[o]=this.createClonePlaylist_(r,u,t)}))}}}))}createClonePlaylist_(t,e,i,s){const n=this.createCloneURI_(t.resolvedUri,i),r={resolvedUri:n,uri:n,id:e};return t.segments&&(r.segments=[]),s&&(r.attributes=s),Na(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};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((s=>{e[s]&&(i[s]=t)})),i}getKeyIdSet(t){const e=new Set;if(!t||!t.contentProtection)return e;for(const i in t.contentProtection)t.contentProtection[i]&&t.contentProtection[i].attributes&&t.contentProtection[i].attributes.keyId&&e.add(t.contentProtection[i].attributes.keyId.toLowerCase());return e}}const Dh=function(t,e,i,s){const n="arraybuffer"===t.responseType?t.response:t.responseText;!e&&n&&(t.responseTime=Date.now(),t.roundTripTime=t.responseTime-t.requestTime,t.bytesReceived=n.byteLength||n.length,t.bandwidth||(t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3))),i.headers&&(t.responseHeaders=i.headers),e&&"ETIMEDOUT"===e.code&&(t.timedout=!0),e||t.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(e=new Error("XHR Failed with a response of: "+(t&&(n||t.responseText)))),s(e,t)},Ch=function(){const t=function t(e,i){e=Na({timeout:45e3},e);const s=t.beforeRequest||Sa.Vhs.xhr.beforeRequest,n=t._requestCallbackSet||Sa.Vhs.xhr._requestCallbackSet||new Set,r=t._responseCallbackSet||Sa.Vhs.xhr._responseCallbackSet;s&&"function"==typeof s&&(Sa.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(s));const o=!0===Sa.Vhs.xhr.original?Sa.xhr:Sa.Vhs.xhr,a=((t,e)=>{if(!t||!t.size)return;let i=e;return t.forEach((t=>{i=t(i)})),i})(n,e);n.delete(s);const h=o(a||e,(function(t,e){return((t,e,i,s)=>{t&&t.size&&t.forEach((t=>{t(e,i,s)}))})(r,h,t,e),Dh(h,t,e,i)})),l=h.abort;return h.abort=function(){return h.aborted=!0,l.apply(h,arguments)},h.uri=e.uri,h.requestType=e.requestType,h.requestTime=Date.now(),h};return t.original=!0,t},Nh=function(t){const e={};return t.byterange&&(e.Range=function(t){let e;const i=t.offset;return e="bigint"==typeof t.offset||"bigint"==typeof t.length?p.BigInt(t.offset)+p.BigInt(t.length)-p.BigInt(1):t.offset+t.length-1,"bytes="+i+"-"+e}(t.byterange)),e},Mh=function(t,e){return t.start(e)+"-"+t.end(e)},Oh=function(t,e){const i=t.toString(16);return"00".substring(0,2-i.length)+i+(e%2?" ":"")},Rh=function(t){return t>=32&&t<126?String.fromCharCode(t):"."},Ph=function(t){const e={};return Object.keys(t).forEach((i=>{const s=t[i];e[i]=bt(s)?{bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:s})),e},_h=function(t){const e=t.byterange||{length:1/0,offset:0};return[e.length,e.offset,t.resolvedUri].join(",")},Lh=function(t){return t.resolvedUri},Fh=t=>{const e=Array.prototype.slice.call(t),i=16;let s,n,r="";for(let t=0;t<e.length/i;t++)s=e.slice(t*i,t*i+i).map(Oh).join(""),n=e.slice(t*i,t*i+i).map(Rh).join(""),r+=s+" "+n+"\n";return r};var $h=Object.freeze({__proto__:null,createTransferableMessage:Ph,initSegmentId:_h,segmentKeyId:Lh,hexDump:Fh,tagDump:({bytes:t})=>Fh(t),textRanges:t=>{let e,i="";for(e=0;e<t.length;e++)i+=Mh(t,e)+" ";return i}});const Bh=({programTime:t,playlist:e,retryCount:i=2,seekTo:s,pauseAfterSeek:n=!0,tech:r,callback:o})=>{if(!o)throw new Error("seekToProgramTime: callback must be provided");if(void 0===t||!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(!(t=>{if(!t.segments||0===t.segments.length)return!1;for(let e=0;e<t.segments.length;e++)if(!t.segments[e].dateTimeObject)return!1;return!0})(e))return o({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const a=((t,e)=>{let i;try{i=new Date(t)}catch(t){return null}if(!e||!e.segments||0===e.segments.length)return null;let s=e.segments[0];if(i<new Date(s.dateTimeObject))return null;for(let t=0;t<e.segments.length-1&&(s=e.segments[t],!(i<new Date(e.segments[t+1].dateTimeObject)));t++);const n=e.segments[e.segments.length-1],r=n.dateTimeObject,o=n.videoTimingInfo?(a=n.videoTimingInfo).transmuxedPresentationEnd-a.transmuxedPresentationStart-a.transmuxerPrependedSeconds:n.duration+.25*n.duration;var a;return i>new Date(r.getTime()+1e3*o)?null:(i>new Date(r)&&(s=n),{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:rh.duration(e,e.mediaSequence+e.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"})})(t,e);if(!a)return o({message:`${t} was not found in the stream`});const h=a.segment,l=((t,e)=>{let i,s;try{i=new Date(t),s=new Date(e)}catch(t){}const n=i.getTime();return(s.getTime()-n)/1e3})(h.dateTimeObject,t);if("estimate"===a.type)return 0===i?o({message:`${t} is not buffered yet. Try again`}):(s(a.estimatedStart+l),void r.one("seeked",(()=>{Bh({programTime:t,playlist:e,retryCount:i-1,seekTo:s,pauseAfterSeek:n,tech:r,callback:o})})));const u=h.start+l;r.one("seeked",(()=>o(null,r.currentTime()))),n&&r.pause(),s(u)},Uh=(t,e)=>{if(4===t.readyState)return e()},{EventTarget:qh}=Sa,Vh=function(t,e){if(!kh(t,e))return!1;if(t.sidx&&e.sidx&&(t.sidx.offset!==e.sidx.offset||t.sidx.length!==e.sidx.length))return!1;if(!t.sidx&&e.sidx||t.sidx&&!e.sidx)return!1;if(t.segments&&!e.segments||!t.segments&&e.segments)return!1;if(!t.segments&&!e.segments)return!0;for(let i=0;i<t.segments.length;i++){const s=t.segments[i],n=e.segments[i];if(s.uri!==n.uri)return!1;if(!s.byterange&&!n.byterange)continue;const r=s.byterange,o=n.byterange;if(r&&!o||!r&&o)return!1;if(r.offset!==o.offset||r.length!==o.length)return!1}return!0},zh=(t,e,i,s)=>`placeholder-uri-${t}-${e}-${s.attributes.NAME||i}`,Hh=(t,e)=>{const i={};for(const r in t){const o=t[r].sidx;if(o){const t=se(o);if(!e[t])break;s=e[t].sidxInfo,n=o,(Boolean(!s.map&&!n.map)||Boolean(s.map&&n.map&&s.map.byterange.offset===n.map.byterange.offset&&s.map.byterange.length===n.map.byterange.length))&&s.uri===n.uri&&s.byterange.offset===n.byterange.offset&&s.byterange.length===n.byterange.length&&(i[t]=e[t])}}var s,n;return i};class Xh extends qh{constructor(t,e,i={},s){super(),this.isPaused_=!0,this.mainPlaylistLoader_=s||this,s||(this.isMain_=!0);const{withCredentials:n=!1}=i;if(this.vhs_=e,this.withCredentials=n,this.addMetadataToTextTrack=i.addMetadataToTextTrack,!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_=Ca("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=t,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=t}get isPaused(){return this.isPaused_}requestErrored_(t,e,i){return!this.request||(this.request=null,t?(this.error="object"!=typeof t||t instanceof Error?{status:e.status,message:"DASH request error at URL: "+e.uri,response:e.response,code:2,metadata:t.metadata}:t,i&&(this.state=i),this.trigger("error"),!0):void 0)}addSidxSegments_(t,e,i){const s=t.sidx&&se(t.sidx);if(!t.sidx||!s||this.mainPlaylistLoader_.sidxMapping_[s])return p.clearTimeout(this.mediaRequest_),void(this.mediaRequest_=p.setTimeout((()=>i(!1)),0));const n=Da(t.sidx.resolvedUri),r=(n,r)=>{if(this.requestErrored_(n,r,e))return;const o=this.mainPlaylistLoader_.sidxMapping_,{requestType:a}=r;let h;try{h=Le(jt(r.response).subarray(8))}catch(t){return t.metadata=fh({requestType:a,request:r,parseFailure:!0}),void this.requestErrored_(t,r,e)}return o[s]={sidxInfo:t.sidx,sidx:h},Kt(t,h,t.sidx.resolvedUri),i(!0)};this.request=((t,e,i,s)=>{let n,r=[],o=!1;const a=function(t,e,s,n){return e.abort(),o=!0,i(t,e,s,n)},h=function(t,e){if(o)return;if(t)return t.metadata=fh({requestType:s,request:e,error:t}),a(t,e,"",r);const i=e.responseText.substring(r&&r.byteLength||0,e.responseText.length);if(r=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];if((e=e.filter((function(t){return t&&(t.byteLength||t.length)&&"string"!=typeof t}))).length<=1)return jt(e[0]);var s=e.reduce((function(t,e){return t+(e.byteLength||e.length)}),0),n=new Uint8Array(s),r=0;return e.forEach((function(t){t=jt(t),n.set(t,r),r+=t.byteLength})),n}(r,kt(i,!0)),n=n||$e(r),r.length<10||n&&r.length<n+2)return Uh(e,(()=>a(t,e,"",r)));const h=ri(r);return"ts"===h&&r.length<188||!h&&r.length<376?Uh(e,(()=>a(t,e,"",r))):a(null,e,h,r)},l={uri:t,beforeSend(t){t.overrideMimeType("text/plain; charset=x-user-defined"),t.addEventListener("progress",(function({}){return Dh(t,null,{statusCode:t.status},h)}))}},u=e(l,(function(t,e){return Dh(u,t,e,h)}));return u})(n,this.vhs_.xhr,((e,i,s,o)=>{if(e)return r(e,i);if(!s||"mp4"!==s)return r({status:i.status,message:`Unsupported ${s||"unknown"} container type for sidx segment at URL: ${n}`,response:"",playlist:t,internal:!0,playlistExclusionDuration:1/0,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:Nh({byterange:t.sidx.byterange})},r)}),"dash-sidx")}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},p.clearTimeout(this.minimumUpdatePeriodTimeout_),p.clearTimeout(this.mediaRequest_),p.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const t=this.request;this.request=null,t.onreadystatechange=null,t.abort()}}media(t){if(!t)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);const e=this.state;if("string"==typeof t){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)return this.state="HAVE_METADATA",this.media_=t,void(i&&(this.trigger("mediachanging"),this.trigger("mediachange")));i&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(t,e,(()=>{this.haveMetadata({startingState:e,playlist:t})})))}haveMetadata({startingState:t,playlist:e}){this.state="HAVE_METADATA",this.loadedPlaylists_[e.id]=e,p.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(e.id),this.trigger("HAVE_MAIN_MANIFEST"===t?"loadedmetadata":"mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),p.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(p.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)}load(t){this.isPaused_=!1,p.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const e=this.media();t?this.mediaUpdateTimeout=p.setTimeout((()=>this.load()),e?e.targetDuration/2*1e3:5e3):this.started?e&&!e.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()}start(){if(this.started=!0,!this.isMain_)return p.clearTimeout(this.mediaRequest_),void(this.mediaRequest_=p.setTimeout((()=>this.haveMain_()),0));this.requestMain_((()=>{this.haveMain_(),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=fh({requestType:t,request:s,error:i})}if(this.requestErrored_(i,s))return void("HAVE_NOTHING"===this.state&&(this.started=!1));this.trigger({type:"manifestrequestcomplete",metadata:e});const n=s.responseText!==this.mainPlaylistLoader_.mainXml_;return this.mainPlaylistLoader_.mainXml_=s.responseText,this.mainLoaded_=s.responseHeaders&&s.responseHeaders.date?Date.parse(s.responseHeaders.date):Date.now(),this.mainPlaylistLoader_.srcUrl=Da(this.mainPlaylistLoader_.srcUrl,s),n?(this.handleMain_(),void this.syncClientServerClock_((()=>t(s,n)))):t(s,n)}))}syncClientServerClock_(t){const e=(t=>{const e=je(t,"UTCTiming")[0];if(!e)return null;const i=xe(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;default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return i})(Me(this.mainPlaylistLoader_.mainXml_));return null===e?(this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),t()):"DIRECT"===e.method?(this.mainPlaylistLoader_.clientOffset_=e.value-Date.now(),t()):void(this.request=this.vhs_.xhr({uri:Ia(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;return this.error.metadata=fh({requestType:e,request:s,error:i}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),t()}let n;n="HEAD"===e.method?s.responseHeaders&&s.responseHeaders.date?Date.parse(s.responseHeaders.date):this.mainLoaded_:Date.parse(s.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),t()})))}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){p.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const t=this.mainPlaylistLoader_.main,e={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};let i;this.trigger({type:"manifestparsestart",metadata:e});try{i=(({mainXml:t,srcUrl:e,clientOffset:i,sidxMapping:s,previousManifest:n})=>{const r=((t,e={})=>{const i=((t,e={})=>{const{manifestUri:i="",NOW:s=Date.now(),clientOffset:n=0,eventHandler:r=function(){}}=e,o=je(t,"Period");if(!o.length)throw new Error("INVALID_NUMBER_OF_PERIOD");const a=je(t,"Location"),h=xe(t),l=Ee([{baseUrl:i}],je(t,"BaseURL")),u=je(t,"ContentSteering");h.type=h.type||"static",h.sourceDuration=h.mediaPresentationDuration||0,h.NOW=s,h.clientOffset=n,a.length&&(h.locations=a.map(we));const c=[];return o.forEach(((t,e)=>{const i=xe(t),s=c[e-1];i.start=(({attributes:t,priorPeriodAttributes:e,mpdType:i})=>"number"==typeof t.start?t.start:e&&"number"==typeof e.start&&"number"==typeof e.duration?e.start+e.duration:e||"static"!==i?null:0)({attributes:i,priorPeriodAttributes:s?s.attributes:null,mpdType:h.type}),c.push({node:t,attributes:i})})),{locations:h.locations,contentSteeringInfo:Ne(u,r),representationInfo:zt(c.map(Ce(h,l))),eventStream:zt(c.map(De))}})(Me(t),e),s=i.representationInfo.map(be);return de({dashPlaylists:s,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:i.eventStream})})(t,{manifestUri:e,clientOffset:i,sidxMapping:s,previousManifest:n});return ch(r,e,zh),r})({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:Sa.Error.StreamingDashManifestParserError,error:t},this.trigger("error")}t&&(i=((t,e,i)=>{let s=!0,n=Na(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=se(r.sidx);i&&i[t]&&i[t].sidx&&Kt(r,i[t].sidx,r.sidx.resolvedUri)}const o=xh(n,r,Vh);o&&(n=o,s=!1)}return lh(e,((t,e,i,r)=>{if(t.playlists&&t.playlists.length){const o=t.playlists[0].id,a=xh(n,t.playlists[0],Vh);a&&(n=a,r in n.mediaGroups[e][i]||(n.mediaGroups[e][i][r]=t),n.mediaGroups[e][i][r].playlists[0]=n.playlists[o],s=!1)}})),((t,e)=>{lh(t,((i,s,n,r)=>{e.mediaGroups[s][n]&&r in e.mediaGroups[s][n]||delete t.mediaGroups[s][n][r]}))})(n,e),e.minimumUpdatePeriod!==t.minimumUpdatePeriod&&(s=!1),s?null:n})(t,i,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=i||t;const s=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(s&&s!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=s),(!t||i&&i.minimumUpdatePeriod!==t.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(i),i){const{duration:t,endList:s}=i,n=[];i.playlists.forEach((t=>{n.push({id:t.id,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS})})),e.parsedManifest={duration:t,isLive:!s,renditions:n},this.trigger({type:"manifestparsecomplete",metadata:e})}return Boolean(i)}updateMinimumUpdatePeriodTimeout_(){const t=this.mainPlaylistLoader_;t.createMupOnMedia_&&(t.off("loadedmetadata",t.createMupOnMedia_),t.createMupOnMedia_=null),t.minimumUpdatePeriodTimeout_&&(p.clearTimeout(t.minimumUpdatePeriodTimeout_),t.minimumUpdatePeriodTimeout_=null);let e=t.main&&t.main.minimumUpdatePeriod;0===e&&(t.media()?e=1e3*t.media().targetDuration:(t.createMupOnMedia_=t.updateMinimumUpdatePeriodTimeout_,t.one("loadedmetadata",t.createMupOnMedia_))),"number"!=typeof e||e<=0?e<0&&this.logger_(`found invalid minimumUpdatePeriod of ${e}, not setting a timeout`):this.createMUPTimeout_(e)}createMUPTimeout_(t){const e=this.mainPlaylistLoader_;e.minimumUpdatePeriodTimeout_=p.setTimeout((()=>{e.minimumUpdatePeriodTimeout_=null,e.trigger("minimumUpdatePeriod"),e.createMUPTimeout_(t)}),t)}refreshXml_(){this.requestMain_(((t,e)=>{e&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=((t,e)=>{let i=Hh(t.playlists,e);return lh(t,(t=>{t.playlists&&t.playlists.length&&(i=Na(i,Hh(t.playlists,e)))})),i})(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,(()=>{this.refreshMedia_(this.media().id)})))}))}refreshMedia_(t){if(!t)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const e=this.mainPlaylistLoader_.main.playlists,i=!this.media_||this.media_!==e[t];if(i?this.media_=e[t]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const t=()=>{this.media().endList||(this.mediaUpdateTimeout=p.setTimeout((()=>{this.trigger("mediaupdatetimeout"),t()}),Ah(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"];s&&e.add(s.replace(/-/g,"").toLowerCase())}return e}}}var Gh={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 Yh=function(t){return t.on=t.addEventListener,t.off=t.removeEventListener,t},Wh=function(t){return function(){const e=function(t){try{return URL.createObjectURL(new Blob([t],{type:"application/javascript"}))}catch(e){const i=new BlobBuilder;return i.append(t),URL.createObjectURL(i.getBlob())}}(t),i=Yh(new Worker(e));i.objURL=e;const s=i.terminate;return i.on=i.addEventListener,i.off=i.removeEventListener,i.terminate=function(){return URL.revokeObjectURL(e),s.call(this)},i}},Jh=function(t){return`var browserWorkerPolyFill = ${Yh.toString()};\nbrowserWorkerPolyFill(self);\n`+t},Kh=function(t){return t.toString().replace(/^function.+?{/,"").slice(0,-1)},Qh=Jh(Kh((function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=function(){this.init=function(){var t={};this.on=function(e,i){t[e]||(t[e]=[]),t[e]=t[e].concat(i)},this.off=function(e,i){var s;return!!t[e]&&(s=t[e].indexOf(i),t[e]=t[e].slice(),t[e].splice(s,1),s>-1)},this.trigger=function(e){var i,s,n,r;if(i=t[e])if(2===arguments.length)for(n=i.length,s=0;s<n;++s)i[s].call(this,arguments[1]);else{for(r=[],s=arguments.length,s=1;s<arguments.length;++s)r.push(arguments[s]);for(n=i.length,s=0;s<n;++s)i[s].apply(this,r)}},this.dispose=function(){t={}}}};e.prototype.pipe=function(t){return 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)})),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,s,n,r,o,a,h,l,u,c,d,f,p,v,m,g,y,b,j,w,T,S,k,x,A,E,I,D,C,N,M,O,R,P,_,L,F,$,B,U,q=e,V=Math.pow(2,32),z={getUint64:function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength);return i.getBigUint64?(e=i.getBigUint64(0))<Number.MAX_SAFE_INTEGER?Number(e):e:i.getUint32(0)*V+i.getUint32(4)},MAX_UINT32:V},H=z.MAX_UINT32;!function(){var t;if(S={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:[]},"undefined"!=typeof Uint8Array){for(t in S)S.hasOwnProperty(t)&&(S[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);k=new Uint8Array(["i".charCodeAt(0),"s".charCodeAt(0),"o".charCodeAt(0),"m".charCodeAt(0)]),A=new Uint8Array(["a".charCodeAt(0),"v".charCodeAt(0),"c".charCodeAt(0),"1".charCodeAt(0)]),x=new Uint8Array([0,0,0,1]),E=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]),I=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]),D={video:E,audio:I},M=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),N=new Uint8Array([0,0,0,0,0,0,0,0]),O=new Uint8Array([0,0,0,0,0,0,0,0]),R=O,P=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),_=O,C=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}}(),i=function(t){var e,i,s=[],n=0;for(e=1;e<arguments.length;e++)s.push(arguments[e]);for(e=s.length;e--;)n+=s[e].byteLength;for(i=new Uint8Array(n+8),new DataView(i.buffer,i.byteOffset,i.byteLength).setUint32(0,i.byteLength),i.set(t,4),e=0,n=8;e<s.length;e++)i.set(s[e],n),n+=s[e].byteLength;return i},s=function(){return i(S.dinf,i(S.dref,M))},n=function(t){return i(S.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]))},m=function(t){return i(S.hdlr,D[t])},v=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,255&t.duration,85,196,0,0]);return t.samplerate&&(e[12]=t.samplerate>>>24&255,e[13]=t.samplerate>>>16&255,e[14]=t.samplerate>>>8&255,e[15]=255&t.samplerate),i(S.mdhd,e)},p=function(t){return i(S.mdia,v(t),m(t.type),a(t))},o=function(t){return i(S.mfhd,new Uint8Array([0,0,0,0,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t]))},a=function(t){return i(S.minf,"video"===t.type?i(S.vmhd,C):i(S.smhd,N),s(),y(t))},h=function(t,e){for(var s=[],n=e.length;n--;)s[n]=j(e[n]);return i.apply(null,[S.moof,o(t)].concat(s))},l=function(t){for(var e=t.length,s=[];e--;)s[e]=d(t[e]);return i.apply(null,[S.moov,c(4294967295)].concat(s).concat(u(t)))},u=function(t){for(var e=t.length,s=[];e--;)s[e]=w(t[e]);return i.apply(null,[S.mvex].concat(s))},c=function(t){var e=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&t)>>24,(16711680&t)>>16,(65280&t)>>8,255&t,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 i(S.mvhd,e)},g=function(t){var e,s,n=t.samples||[],r=new Uint8Array(4+n.length);for(s=0;s<n.length;s++)r[s+4]=(e=n[s].flags).dependsOn<<4|e.isDependedOn<<2|e.hasRedundancy;return i(S.sdtp,r)},y=function(t){return i(S.stbl,b(t),i(S.stts,_),i(S.stsc,R),i(S.stsz,P),i(S.stco,O))},b=function(t){return i(S.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),"video"===t.type?L(t):F(t))},L=function(t){var e,s,n=t.sps||[],r=t.pps||[],o=[],a=[];for(e=0;e<n.length;e++)o.push((65280&n[e].byteLength)>>>8),o.push(255&n[e].byteLength),o=o.concat(Array.prototype.slice.call(n[e]));for(e=0;e<r.length;e++)a.push((65280&r[e].byteLength)>>>8),a.push(255&r[e].byteLength),a=a.concat(Array.prototype.slice.call(r[e]));if(s=[S.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,(65280&t.width)>>8,255&t.width,(65280&t.height)>>8,255&t.height,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]),i(S.avcC,new Uint8Array([1,t.profileIdc,t.profileCompatibility,t.levelIdc,255].concat([n.length],o,[r.length],a))),i(S.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],t.sarRatio){var h=t.sarRatio[0],l=t.sarRatio[1];s.push(i(S.pasp,new Uint8Array([(4278190080&h)>>24,(16711680&h)>>16,(65280&h)>>8,255&h,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])))}return i.apply(null,s)},F=function(t){return i(S.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&t.channelcount)>>8,255&t.channelcount,(65280&t.samplesize)>>8,255&t.samplesize,0,0,0,0,(65280&t.samplerate)>>8,255&t.samplerate,0,0]),n(t))},f=function(t){var e=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,0,(4278190080&t.duration)>>24,(16711680&t.duration)>>16,(65280&t.duration)>>8,255&t.duration,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,(65280&t.width)>>8,255&t.width,0,0,(65280&t.height)>>8,255&t.height,0,0]);return i(S.tkhd,e)},j=function(t){var e,s,n,r,o,a;return e=i(S.tfhd,new Uint8Array([0,0,0,58,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),o=Math.floor(t.baseMediaDecodeTime/H),a=Math.floor(t.baseMediaDecodeTime%H),s=i(S.tfdt,new Uint8Array([1,0,0,0,o>>>24&255,o>>>16&255,o>>>8&255,255&o,a>>>24&255,a>>>16&255,a>>>8&255,255&a])),"audio"===t.type?(n=T(t,92),i(S.traf,e,s,n)):(r=g(t),n=T(t,r.length+92),i(S.traf,e,s,n,r))},d=function(t){return t.duration=t.duration||4294967295,i(S.trak,f(t),p(t))},w=function(t){var e=new Uint8Array([0,0,0,0,(4278190080&t.id)>>24,(16711680&t.id)>>16,(65280&t.id)>>8,255&t.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==t.type&&(e[e.length-1]=0),i(S.trex,e)},U=function(t,e){var i=0,s=0,n=0,r=0;return t.length&&(void 0!==t[0].duration&&(i=1),void 0!==t[0].size&&(s=2),void 0!==t[0].flags&&(n=4),void 0!==t[0].compositionTimeOffset&&(r=8)),[0,0,i|s|n|r,1,(4278190080&t.length)>>>24,(16711680&t.length)>>>16,(65280&t.length)>>>8,255&t.length,(4278190080&e)>>>24,(16711680&e)>>>16,(65280&e)>>>8,255&e]},B=function(t,e){var s,n,r,o,a,h;for(r=U(o=t.samples||[],e+=20+16*o.length),(n=new Uint8Array(r.length+16*o.length)).set(r),s=r.length,h=0;h<o.length;h++)n[s++]=(4278190080&(a=o[h]).duration)>>>24,n[s++]=(16711680&a.duration)>>>16,n[s++]=(65280&a.duration)>>>8,n[s++]=255&a.duration,n[s++]=(4278190080&a.size)>>>24,n[s++]=(16711680&a.size)>>>16,n[s++]=(65280&a.size)>>>8,n[s++]=255&a.size,n[s++]=a.flags.isLeading<<2|a.flags.dependsOn,n[s++]=a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample,n[s++]=61440&a.flags.degradationPriority,n[s++]=15&a.flags.degradationPriority,n[s++]=(4278190080&a.compositionTimeOffset)>>>24,n[s++]=(16711680&a.compositionTimeOffset)>>>16,n[s++]=(65280&a.compositionTimeOffset)>>>8,n[s++]=255&a.compositionTimeOffset;return i(S.trun,n)},$=function(t,e){var s,n,r,o,a,h;for(r=U(o=t.samples||[],e+=20+8*o.length),(s=new Uint8Array(r.length+8*o.length)).set(r),n=r.length,h=0;h<o.length;h++)s[n++]=(4278190080&(a=o[h]).duration)>>>24,s[n++]=(16711680&a.duration)>>>16,s[n++]=(65280&a.duration)>>>8,s[n++]=255&a.duration,s[n++]=(4278190080&a.size)>>>24,s[n++]=(16711680&a.size)>>>16,s[n++]=(65280&a.size)>>>8,s[n++]=255&a.size;return i(S.trun,s)},T=function(t,e){return"audio"===t.type?$(t,e):B(t,e)};var X,G,Y,W,J,K,Q,Z,tt={ftyp:r=function(){return i(S.ftyp,k,x,k,A)},mdat:function(t){return i(S.mdat,t)},moof:h,moov:l,initSegment:function(t){var e,i=r(),s=l(t);return(e=new Uint8Array(i.byteLength+s.byteLength)).set(i),e.set(s,i.byteLength),e}},et=function(t,e){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=e,i.compositionTimeOffset=t.pts-t.dts,i.duration=t.duration,i.size=4*t.length,i.size+=t.byteLength,t.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},it={groupNalsIntoFrames:function(t){var e,i,s=[],n=[];for(n.byteLength=0,n.nalCount=0,n.duration=0,s.byteLength=0,e=0;e<t.length;e++)"access_unit_delimiter_rbsp"===(i=t[e]).nalUnitType?(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]).byteLength=i.data.byteLength,s.pts=i.pts,s.dts=i.dts):("slice_layer_without_partitioning_rbsp_idr"===i.nalUnitType&&(s.keyFrame=!0),s.duration=i.dts-s.dts,s.byteLength+=i.data.byteLength,s.push(i));return 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),n},groupFramesIntoGops:function(t){var e,i,s=[],n=[];for(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,e=0;e<t.length;e++)(i=t[e]).keyFrame?(s.length&&(n.push(s),n.byteLength+=s.byteLength,n.nalCount+=s.nalCount,n.duration+=s.duration),(s=[i]).nalCount=i.length,s.byteLength=i.byteLength,s.pts=i.pts,s.dts=i.dts,s.duration=i.duration):(s.duration+=i.duration,s.nalCount+=i.length,s.byteLength+=i.byteLength,s.push(i));return 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),n},extendFirstKeyFrame:function(t){var e;return!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),t},generateSampleTable:function(t,e){var i,s,n,r,o=e||0,a=[];for(i=0;i<t.length;i++)for(r=t[i],s=0;s<r.length;s++)o+=(n=et(r[s],o)).size,a.push(n);return a},concatenateNalData:function(t){var e,i,s,n,r,o,a=0,h=new Uint8Array(t.byteLength+4*t.nalCount),l=new DataView(h.buffer);for(e=0;e<t.length;e++)for(n=t[e],i=0;i<n.length;i++)for(r=n[i],s=0;s<r.length;s++)l.setUint32(a,(o=r[s]).data.byteLength),h.set(o.data,a+=4),a+=o.data.byteLength;return h},generateSampleTableForFrame:function(t,e){var i,s=[];return i=et(t,e||0),s.push(i),s},concatenateNalDataForFrame:function(t){var e,i,s=0,n=new Uint8Array(t.byteLength+4*t.length),r=new DataView(n.buffer);for(e=0;e<t.length;e++)r.setUint32(s,(i=t[e]).data.byteLength),n.set(i.data,s+=4),s+=i.data.byteLength;return n}},st=[33,16,5,32,164,27],nt=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],rt=function(t){for(var e=[];t--;)e.push(0);return e},ot=9e4;K=function(t,e){return G(J(t,e))},Q=function(t,e){return Y(W(t),e)},Z=function(t,e,i){return W(i?t:t-e)};var at={ONE_SECOND_IN_TS:ot,secondsToVideoTs:G=function(t){return t*ot},secondsToAudioTs:Y=function(t,e){return t*e},videoTsToSeconds:W=function(t){return t/ot},audioTsToSeconds:J=function(t,e){return t/e},audioTsToVideoTs:K,videoTsToAudioTs:Q,metadataTsToSeconds:Z},ht=at,lt={prefixWithSilence:function(t,e,i,s){var n,r,o,a,h,l=0,u=0,c=0;if(e.length&&(n=ht.audioTsToVideoTs(t.baseMediaDecodeTime,t.samplerate),r=Math.ceil(ht.ONE_SECOND_IN_TS/(t.samplerate/1024)),i&&s&&(l=n-Math.max(i,s),c=(u=Math.floor(l/r))*r),!(u<1||c>ht.ONE_SECOND_IN_TS/2))){for((o=function(){if(!X){var t={96e3:[st,[227,64],rt(154),[56]],88200:[st,[231],rt(170),[56]],64e3:[st,[248,192],rt(240),[56]],48e3:[st,[255,192],rt(268),[55,148,128],rt(54),[112]],44100:[st,[255,192],rt(268),[55,163,128],rt(84),[112]],32e3:[st,[255,192],rt(268),[55,234],rt(226),[112]],24e3:[st,[255,192],rt(268),[55,255,128],rt(268),[111,112],rt(126),[224]],16e3:[st,[255,192],rt(268),[55,255,128],rt(268),[111,255],rt(269),[223,108],rt(195),[1,192]],12e3:[nt,rt(268),[3,127,248],rt(268),[6,255,240],rt(268),[13,255,224],rt(268),[27,253,128],rt(259),[56]],11025:[nt,rt(268),[3,127,248],rt(268),[6,255,240],rt(268),[13,255,224],rt(268),[27,255,192],rt(268),[55,175,128],rt(108),[112]],8e3:[nt,rt(268),[3,121,16],rt(47),[7]]};e=t,X=Object.keys(e).reduce((function(t,i){return t[i]=new Uint8Array(e[i].reduce((function(t,e){return t.concat(e)}),[])),t}),{})}var e;return X}()[t.samplerate])||(o=e[0].data),a=0;a<u;a++)e.splice(0,0,{data:o,dts:(h=e[0]).dts-r,pts:h.pts-r});return t.baseMediaDecodeTime-=Math.floor(ht.videoTsToAudioTs(c,t.samplerate)),c}},trimAdtsFramesByEarliestDts:function(t,e,i){return e.minSegmentDts>=i?t:(e.minSegmentDts=1/0,t.filter((function(t){return t.dts>=i&&(e.minSegmentDts=Math.min(e.minSegmentDts,t.dts),e.minSegmentPts=e.minSegmentDts,!0)})))},generateSampleTable:function(t){var e,i=[];for(e=0;e<t.length;e++)i.push({size:t[e].data.byteLength,duration:1024});return i},concatenateFrameData:function(t){var e,i,s=0,n=new Uint8Array(function(t){var e,i=0;for(e=0;e<t.length;e++)i+=t[e].data.byteLength;return i}(t));for(e=0;e<t.length;e++)n.set((i=t[e]).data,s),s+=i.data.byteLength;return n}},ut=at.ONE_SECOND_IN_TS,ct={clearDtsInfo:function(t){delete t.minSegmentDts,delete t.maxSegmentDts,delete t.minSegmentPts,delete t.maxSegmentPts},calculateTrackBaseMediaDecodeTime:function(t,e){var i,s=t.minSegmentDts;return e||(s-=t.timelineStartInfo.dts),i=t.timelineStartInfo.baseMediaDecodeTime,i+=s,i=Math.max(0,i),"audio"===t.type&&(i*=t.samplerate/ut,i=Math.floor(i)),i},collectDtsInfo:function(t,e){"number"==typeof e.pts&&(void 0===t.timelineStartInfo.pts&&(t.timelineStartInfo.pts=e.pts),t.minSegmentPts=void 0===t.minSegmentPts?e.pts:Math.min(t.minSegmentPts,e.pts),t.maxSegmentPts=void 0===t.maxSegmentPts?e.pts:Math.max(t.maxSegmentPts,e.pts)),"number"==typeof e.dts&&(void 0===t.timelineStartInfo.dts&&(t.timelineStartInfo.dts=e.dts),t.minSegmentDts=void 0===t.minSegmentDts?e.dts:Math.min(t.minSegmentDts,e.dts),t.maxSegmentDts=void 0===t.maxSegmentDts?e.dts:Math.max(t.maxSegmentDts,e.dts))}},dt={parseSei:function(t){for(var e=0,i={payloadType:-1,payloadSize:0},s=0,n=0;e<t.byteLength&&128!==t[e];){for(;255===t[e];)s+=255,e++;for(s+=t[e++];255===t[e];)n+=255,e++;if(n+=t[e++],!i.payload&&4===s){if("GA94"===String.fromCharCode(t[e+3],t[e+4],t[e+5],t[e+6])){i.payloadType=s,i.payloadSize=n,i.payload=t.subarray(e,e+n);break}i.payload=void 0}e+=n,s=0,n=0}return i},parseUserData:function(t){return 181!==t.payload[0]||49!=(t.payload[1]<<8|t.payload[2])||"GA94"!==String.fromCharCode(t.payload[3],t.payload[4],t.payload[5],t.payload[6])||3!==t.payload[7]?null:t.payload.subarray(8,t.payload.length-1)},parseCaptionPackets:function(t,e){var i,s,n,r,o=[];if(!(64&e[0]))return o;for(s=31&e[0],i=0;i<s;i++)r={type:3&e[2+(n=3*i)],pts:t},4&e[n+2]&&(r.ccData=e[n+3]<<8|e[n+4],o.push(r));return o},discardEmulationPreventionBytes:function(t){for(var e,i,s=t.byteLength,n=[],r=1;r<s-2;)0===t[r]&&0===t[r+1]&&3===t[r+2]?(n.push(r+2),r+=2):r++;if(0===n.length)return t;e=s-n.length,i=new Uint8Array(e);var o=0;for(r=0;r<e;o++,r++)o===n[0]&&(o++,n.shift()),i[r]=t[o];return i},USER_DATA_REGISTERED_ITU_T_T35:4},ft=q,pt=dt,vt=function(t){t=t||{},vt.prototype.init.call(this),this.parse708captions_="boolean"!=typeof t.parse708captions||t.parse708captions,this.captionPackets_=[],this.ccStreams_=[new xt(0,0),new xt(0,1),new xt(1,0),new xt(1,1)],this.parse708captions_&&(this.cc708Stream_=new jt({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),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")))};vt.prototype=new ft,vt.prototype.push=function(t){var e,i,s;if("sei_rbsp"===t.nalUnitType&&(e=pt.parseSei(t.escapedRBSP)).payload&&e.payloadType===pt.USER_DATA_REGISTERED_ITU_T_T35&&(i=pt.parseUserData(e)))if(t.dts<this.latestDts_)this.ignoreNextEqualDts_=!0;else{if(t.dts===this.latestDts_&&this.ignoreNextEqualDts_)return this.numSameDts_--,void(this.numSameDts_||(this.ignoreNextEqualDts_=!1));s=pt.parseCaptionPackets(t.pts,i),this.captionPackets_=this.captionPackets_.concat(s),this.latestDts_!==t.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=t.dts}},vt.prototype.flushCCStreams=function(t){this.ccStreams_.forEach((function(e){return"flush"===t?e.flush():e.partialFlush()}),this)},vt.prototype.flushStream=function(t){this.captionPackets_.length?(this.captionPackets_.forEach((function(t,e){t.presortIndex=e})),this.captionPackets_.sort((function(t,e){return t.pts===e.pts?t.presortIndex-e.presortIndex:t.pts-e.pts})),this.captionPackets_.forEach((function(t){t.type<2?this.dispatchCea608Packet(t):this.dispatchCea708Packet(t)}),this),this.captionPackets_.length=0,this.flushCCStreams(t)):this.flushCCStreams(t)},vt.prototype.flush=function(){return this.flushStream("flush")},vt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},vt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach((function(t){t.reset()}))},vt.prototype.dispatchCea608Packet=function(t){this.setsTextOrXDSActive(t)?this.activeCea608Channel_[t.type]=null:this.setsChannel1Active(t)?this.activeCea608Channel_[t.type]=0:this.setsChannel2Active(t)&&(this.activeCea608Channel_[t.type]=1),null!==this.activeCea608Channel_[t.type]&&this.ccStreams_[(t.type<<1)+this.activeCea608Channel_[t.type]].push(t)},vt.prototype.setsChannel1Active=function(t){return 4096==(30720&t.ccData)},vt.prototype.setsChannel2Active=function(t){return 6144==(30720&t.ccData)},vt.prototype.setsTextOrXDSActive=function(t){return 256==(28928&t.ccData)||4138==(30974&t.ccData)||6186==(30974&t.ccData)},vt.prototype.dispatchCea708Packet=function(t){this.parse708captions_&&this.cc708Stream_.push(t)};var mt={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},gt=function(t){return 32<=t&&t<=127||160<=t&&t<=255},yt=function(t){this.windowNum=t,this.reset()};yt.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},yt.prototype.getText=function(){return this.rows.join("\n")},yt.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},yt.prototype.newLine=function(t){for(this.rows.length>=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(t),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},yt.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},yt.prototype.addText=function(t){this.rows[this.rowIdx]+=t},yt.prototype.backspace=function(){if(!this.isEmpty()){var t=this.rows[this.rowIdx];this.rows[this.rowIdx]=t.substr(0,t.length-1)}};var bt=function(t,e,i){this.serviceNum=t,this.text="",this.currentWindow=new yt(-1),this.windows=[],this.stream=i,"string"==typeof e&&this.createTextDecoder(e)};bt.prototype.init=function(t,e){this.startPts=t;for(var i=0;i<8;i++)this.windows[i]=new yt(i),"function"==typeof e&&(this.windows[i].beforeRowOverflow=e)},bt.prototype.setCurrentWindow=function(t){this.currentWindow=this.windows[t]},bt.prototype.createTextDecoder=function(t){if("undefined"==typeof TextDecoder)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 jt=function(t){t=t||{},jt.prototype.init.call(this);var e,i=this,s=t.captionServices||{},n={};Object.keys(s).forEach((t=>{e=s[t],/^SERVICE/.test(t)&&(n[t]=e.encoding)})),this.serviceEncodings=n,this.current708Packet=null,this.services={},this.push=function(t){3===t.type?(i.new708Packet(),i.add708Bytes(t)):(null===i.current708Packet&&i.new708Packet(),i.add708Bytes(t))}};jt.prototype=new ft,jt.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},jt.prototype.add708Bytes=function(t){var e=t.ccData,i=e>>>8,s=255&e;this.current708Packet.ptsVals.push(t.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(s)},jt.prototype.push708Packet=function(){var t=this.current708Packet,e=t.data,i=null,s=null,n=0,r=e[n++];for(t.seq=r>>6,t.sizeCode=63&r;n<e.length;n++)s=31&(r=e[n++]),7==(i=r>>5)&&s>0&&(i=r=e[n++]),this.pushServiceBlock(i,n,s),s>0&&(n+=s-1)},jt.prototype.pushServiceBlock=function(t,e,i){var s,n=e,r=this.current708Packet.data,o=this.services[t];for(o||(o=this.initService(t,n));n<e+i&&n<r.length;n++)gt(s=r[n])?n=this.handleText(n,o):24===s?n=this.multiByteCharacter(n,o):16===s?n=this.extendedCommands(n,o):128<=s&&s<=135?n=this.setCurrentWindow(n,o):152<=s&&s<=159?n=this.defineWindow(n,o):136===s?n=this.clearWindows(n,o):140===s?n=this.deleteWindows(n,o):137===s?n=this.displayWindows(n,o):138===s?n=this.hideWindows(n,o):139===s?n=this.toggleWindows(n,o):151===s?n=this.setWindowAttributes(n,o):144===s?n=this.setPenAttributes(n,o):145===s?n=this.setPenColor(n,o):146===s?n=this.setPenLocation(n,o):143===s?o=this.reset(n,o):8===s?o.currentWindow.backspace():12===s?o.currentWindow.clearText():13===s?o.currentWindow.pendingNewLine=!0:14===s?o.currentWindow.clearText():141===s&&n++},jt.prototype.extendedCommands=function(t,e){var i=this.current708Packet.data[++t];return gt(i)&&(t=this.handleText(t,e,{isExtended:!0})),t},jt.prototype.getPts=function(t){return this.current708Packet.ptsVals[Math.floor(t/2)]},jt.prototype.initService=function(t,e){var i,s,n=this;return(i="SERVICE"+t)in this.serviceEncodings&&(s=this.serviceEncodings[i]),this.services[t]=new bt(t,s,n),this.services[t].init(this.getPts(e),(function(e){n.flushDisplayed(e,n.services[t])})),this.services[t]},jt.prototype.handleText=function(t,e,i){var s,n,r,o,a=i&&i.isExtended,h=i&&i.isMultiByte,l=this.current708Packet.data,u=a?4096:0,c=l[t],d=e.currentWindow;if(h?(n=[c,l[t+1]],t++):n=[c],e.textDecoder_&&!a)s=e.textDecoder_.decode(new Uint8Array(n));else if(h){const t=n.map((t=>("0"+(255&t).toString(16)).slice(-2))).join("");s=String.fromCharCode(parseInt(t,16))}else o=mt[r=u|c]||r,s=4096&r&&r===o?"":String.fromCharCode(o);return d.pendingNewLine&&!d.isEmpty()&&d.newLine(this.getPts(t)),d.pendingNewLine=!1,d.addText(s),t},jt.prototype.multiByteCharacter=function(t,e){var i=this.current708Packet.data,s=i[t+2];return gt(i[t+1])&>(s)&&(t=this.handleText(++t,e,{isMultiByte:!0})),t},jt.prototype.setCurrentWindow=function(t,e){return e.setCurrentWindow(7&this.current708Packet.data[t]),t},jt.prototype.defineWindow=function(t,e){var i=this.current708Packet.data,s=i[t];e.setCurrentWindow(7&s);var n=e.currentWindow;return s=i[++t],n.visible=(32&s)>>5,n.rowLock=(16&s)>>4,n.columnLock=(8&s)>>3,n.priority=7&s,s=i[++t],n.relativePositioning=(128&s)>>7,n.anchorVertical=127&s,s=i[++t],n.anchorHorizontal=s,s=i[++t],n.anchorPoint=(240&s)>>4,n.rowCount=15&s,s=i[++t],n.columnCount=63&s,s=i[++t],n.windowStyle=(56&s)>>3,n.penStyle=7&s,n.virtualRowCount=n.rowCount+1,t},jt.prototype.setWindowAttributes=function(t,e){var i=this.current708Packet.data,s=i[t],n=e.currentWindow.winAttr;return s=i[++t],n.fillOpacity=(192&s)>>6,n.fillRed=(48&s)>>4,n.fillGreen=(12&s)>>2,n.fillBlue=3&s,s=i[++t],n.borderType=(192&s)>>6,n.borderRed=(48&s)>>4,n.borderGreen=(12&s)>>2,n.borderBlue=3&s,s=i[++t],n.borderType+=(128&s)>>5,n.wordWrap=(64&s)>>6,n.printDirection=(48&s)>>4,n.scrollDirection=(12&s)>>2,n.justify=3&s,s=i[++t],n.effectSpeed=(240&s)>>4,n.effectDirection=(12&s)>>2,n.displayEffect=3&s,t},jt.prototype.flushDisplayed=function(t,e){for(var i=[],s=0;s<8;s++)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},jt.prototype.pushCaption=function(t){""!==t.text&&(this.trigger("data",{startPts:t.startPts,endPts:t.endPts,text:t.text,stream:"cc708_"+t.serviceNum}),t.text="",t.startPts=t.endPts)},jt.prototype.displayWindows=function(t,e){var i=this.current708Packet.data[++t],s=this.getPts(t);this.flushDisplayed(s,e);for(var n=0;n<8;n++)i&1<<n&&(e.windows[n].visible=1);return t},jt.prototype.hideWindows=function(t,e){var i=this.current708Packet.data[++t],s=this.getPts(t);this.flushDisplayed(s,e);for(var n=0;n<8;n++)i&1<<n&&(e.windows[n].visible=0);return t},jt.prototype.toggleWindows=function(t,e){var i=this.current708Packet.data[++t],s=this.getPts(t);this.flushDisplayed(s,e);for(var n=0;n<8;n++)i&1<<n&&(e.windows[n].visible^=1);return t},jt.prototype.clearWindows=function(t,e){var i=this.current708Packet.data[++t],s=this.getPts(t);this.flushDisplayed(s,e);for(var n=0;n<8;n++)i&1<<n&&e.windows[n].clearText();return t},jt.prototype.deleteWindows=function(t,e){var i=this.current708Packet.data[++t],s=this.getPts(t);this.flushDisplayed(s,e);for(var n=0;n<8;n++)i&1<<n&&e.windows[n].reset();return t},jt.prototype.setPenAttributes=function(t,e){var i=this.current708Packet.data,s=i[t],n=e.currentWindow.penAttr;return s=i[++t],n.textTag=(240&s)>>4,n.offset=(12&s)>>2,n.penSize=3&s,s=i[++t],n.italics=(128&s)>>7,n.underline=(64&s)>>6,n.edgeType=(56&s)>>3,n.fontStyle=7&s,t},jt.prototype.setPenColor=function(t,e){var i=this.current708Packet.data,s=i[t],n=e.currentWindow.penColor;return s=i[++t],n.fgOpacity=(192&s)>>6,n.fgRed=(48&s)>>4,n.fgGreen=(12&s)>>2,n.fgBlue=3&s,s=i[++t],n.bgOpacity=(192&s)>>6,n.bgRed=(48&s)>>4,n.bgGreen=(12&s)>>2,n.bgBlue=3&s,s=i[++t],n.edgeRed=(48&s)>>4,n.edgeGreen=(12&s)>>2,n.edgeBlue=3&s,t},jt.prototype.setPenLocation=function(t,e){var i=this.current708Packet.data,s=i[t],n=e.currentWindow.penLoc;return e.currentWindow.pendingNewLine=!0,s=i[++t],n.row=15&s,s=i[++t],n.column=63&s,t},jt.prototype.reset=function(t,e){var i=this.getPts(t);return this.flushDisplayed(i,e),this.initService(e.serviceNum,t)};var wt={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},Tt=function(t){return null===t?"":(t=wt[t]||t,String.fromCharCode(t))},St=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],kt=function(){for(var t=[],e=15;e--;)t.push({text:"",indent:0,offset:0});return t},xt=function(t,e){xt.prototype.init.call(this),this.field_=t||0,this.dataChannel_=e||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(t){var e,i,s,n,r;if((e=32639&t.ccData)!==this.lastControlCode_){if(4096==(61440&e)?this.lastControlCode_=e:e!==this.PADDING_&&(this.lastControlCode_=null),s=e>>>8,n=255&e,e!==this.PADDING_)if(e===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(e===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(t.pts),this.flushDisplayed(t.pts),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_)"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(e===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(t.pts),this.displayed_=kt();else if(e===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=kt();else if(e===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(t.pts),this.displayed_=kt()),this.mode_="paintOn",this.startPts_=t.pts;else if(this.isSpecialCharacter(s,n))r=Tt((s=(3&s)<<8)|n),this[this.mode_](t.pts,r),this.column_++;else if(this.isExtCharacter(s,n))"popOn"===this.mode_?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),r=Tt((s=(3&s)<<8)|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_++,14&~n||this.addFormatting(t.pts,["i"]),1&~n||this.addFormatting(t.pts,["u"]);else if(this.isOffsetControlCode(s,n)){const t=3&n;this.nonDisplayed_[this.row_].offset=t,this.column_+=t}else if(this.isPAC(s,n)){var o=St.indexOf(7968&e);if("rollUp"===this.mode_&&(o-this.rollUpRows_+1<0&&(o=this.rollUpRows_-1),this.setRollUp(t.pts,o)),o!==this.row_&&o>=0&&o<=14&&(this.clearFormatting(t.pts),this.row_=o),1&n&&-1===this.formatting_.indexOf("u")&&this.addFormatting(t.pts,["u"]),!(16&~e)){const t=(14&e)>>1;this.column_=4*t,this.nonDisplayed_[this.row_].indent+=t}this.isColorPAC(n)&&(14&~n||this.addFormatting(t.pts,["i"]))}else this.isNormalChar(s)&&(0===n&&(n=null),r=Tt(s),r+=Tt(n),this[this.mode_](t.pts,r),this.column_+=r.length)}else this.lastControlCode_=null}};xt.prototype=new ft,xt.prototype.flushDisplayed=function(t){const e=t=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."})},i=[];this.displayed_.forEach(((t,s)=>{if(t&&t.text&&t.text.length){try{t.text=t.text.trim()}catch(t){e(s)}t.text.length&&i.push({text:t.text,line:s+1,position:10+Math.min(70,10*t.indent)+2.5*t.offset})}else null==t&&e(s)})),i.length&&this.trigger("data",{startPts:this.startPts_,endPts:t,content:i,stream:this.name_})},xt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=kt(),this.nonDisplayed_=kt(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},xt.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},xt.prototype.isSpecialCharacter=function(t,e){return t===this.EXT_&&e>=48&&e<=63},xt.prototype.isExtCharacter=function(t,e){return(t===this.EXT_+1||t===this.EXT_+2)&&e>=32&&e<=63},xt.prototype.isMidRowCode=function(t,e){return t===this.EXT_&&e>=32&&e<=47},xt.prototype.isOffsetControlCode=function(t,e){return t===this.OFFSET_&&e>=33&&e<=35},xt.prototype.isPAC=function(t,e){return t>=this.BASE_&&t<this.BASE_+8&&e>=64&&e<=127},xt.prototype.isColorPAC=function(t){return t>=64&&t<=79||t>=96&&t<=127},xt.prototype.isNormalChar=function(t){return t>=32&&t<=127},xt.prototype.setRollUp=function(t,e){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(t),this.nonDisplayed_=kt(),this.displayed_=kt()),void 0!==e&&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};void 0===e&&(e=this.row_),this.topRow_=e-this.rollUpRows_+1},xt.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)},xt.prototype.clearFormatting=function(t){if(this.formatting_.length){var e=this.formatting_.reverse().reduce((function(t,e){return t+"</"+e+">"}),"");this.formatting_=[],this[this.mode_](t,e)}},xt.prototype.popOn=function(t,e){var i=this.nonDisplayed_[this.row_].text;this.nonDisplayed_[this.row_].text=i+=e},xt.prototype.rollUp=function(t,e){var i=this.displayed_[this.row_].text;this.displayed_[this.row_].text=i+=e},xt.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<15;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}},xt.prototype.paintOn=function(t,e){var i=this.displayed_[this.row_].text;this.displayed_[this.row_].text=i+=e};var At={CaptionStream:vt,Cea608Stream:xt,Cea708Stream:jt},Et={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},It="shared",Dt=function(t,e){var i=1;for(t>e&&(i=-1);Math.abs(e-t)>4294967296;)t+=8589934592*i;return t},Ct=function(t){var e,i;Ct.prototype.init.call(this),this.type_=t||It,this.push=function(t){"metadata"!==t.type?this.type_!==It&&t.type!==this.type_||(void 0===i&&(i=t.dts),t.dts=Dt(t.dts,i),t.pts=Dt(t.pts,i),e=t.dts,this.trigger("data",t)):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")}};Ct.prototype=new q;var Nt,Mt={TimestampRolloverStream:Ct,handleRollover:Dt},Ot=(t,e,i)=>{if(!t)return-1;for(var s=i;s<t.length;s++)if(t[s]===e)return s;return-1},Rt=function(t,e,i){var s,n="";for(s=e;s<i;s++)n+="%"+("00"+t[s].toString(16)).slice(-2);return n},Pt=function(t,e,i){return decodeURIComponent(Rt(t,e,i))},_t=function(t,e,i){return unescape(Rt(t,e,i))},Lt=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},Ft={APIC:function(t){var e,i,s=1;3===t.data[0]&&((e=Ot(t.data,0,s))<0||(t.mimeType=_t(t.data,s,e),t.pictureType=t.data[s=e+1],s++,(i=Ot(t.data,0,s))<0||(t.description=Pt(t.data,s,i),s=i+1,"--\x3e"===t.mimeType?t.url=_t(t.data,s,t.data.length):t.pictureData=t.data.subarray(s,t.data.length))))},"T*":function(t){3===t.data[0]&&(t.value=Pt(t.data,1,t.data.length).replace(/\0*$/,""),t.values=t.value.split("\0"))},TXXX:function(t){var e;3===t.data[0]&&-1!==(e=Ot(t.data,0,1))&&(t.description=Pt(t.data,1,e),t.value=Pt(t.data,e+1,t.data.length).replace(/\0*$/,""),t.data=t.value)},"W*":function(t){t.url=_t(t.data,0,t.data.length).replace(/\0.*$/,"")},WXXX:function(t){var e;3===t.data[0]&&-1!==(e=Ot(t.data,0,1))&&(t.description=Pt(t.data,1,e),t.url=_t(t.data,e+1,t.data.length).replace(/\0.*$/,""))},PRIV:function(t){var e;for(e=0;e<t.data.length;e++)if(0===t.data[e]){t.owner=_t(t.data,0,e);break}t.privateData=t.data.subarray(e+1),t.data=t.privateData}},$t={parseId3Frames:function(t){var e,i=10,s=0,n=[];if(!(t.length<10||t[0]!=="I".charCodeAt(0)||t[1]!=="D".charCodeAt(0)||t[2]!=="3".charCodeAt(0))){s=Lt(t.subarray(6,10)),s+=10,64&t[5]&&(i+=4,i+=Lt(t.subarray(10,14)),s-=Lt(t.subarray(16,20)));do{if((e=Lt(t.subarray(i+4,i+8)))<1)break;var r={id:String.fromCharCode(t[i],t[i+1],t[i+2],t[i+3]),data:t.subarray(i+10,i+e+10)};r.key=r.id,Ft[r.id]?Ft[r.id](r):"T"===r.id[0]?Ft["T*"](r):"W"===r.id[0]&&Ft["W*"](r),n.push(r),i+=10,i+=e}while(i<s);return n}},parseSyncSafeInteger:Lt,frameParsers:Ft},Bt=Et,Ut=$t;(Nt=function(t){var e,i={descriptor:t&&t.descriptor},s=0,n=[],r=0;if(Nt.prototype.init.call(this),this.dispatchType=Bt.METADATA_STREAM_TYPE.toString(16),i.descriptor)for(e=0;e<i.descriptor.length;e++)this.dispatchType+=("00"+i.descriptor[e].toString(16)).slice(-2);this.push=function(t){var e,i,o,a,h;if("timed-metadata"===t.type)if(t.dataAlignmentIndicator&&(r=0,n.length=0),0===n.length&&(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"});else if(n.push(t),r+=t.data.byteLength,1===n.length&&(s=Ut.parseSyncSafeInteger(t.data.subarray(6,10)),s+=10),!(r<s)){for(e={data:new Uint8Array(s),frames:[],pts:n[0].pts,dts:n[0].dts},h=0;h<s;)e.data.set(n[0].data.subarray(0,s-h),h),h+=n[0].data.byteLength,r-=n[0].data.byteLength,n.shift();i=10,64&e.data[5]&&(i+=4,i+=Ut.parseSyncSafeInteger(e.data.subarray(10,14)),s-=Ut.parseSyncSafeInteger(e.data.subarray(16,20)));do{if((o=Ut.parseSyncSafeInteger(e.data.subarray(i+4,i+8)))<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if((a={id:String.fromCharCode(e.data[i],e.data[i+1],e.data[i+2],e.data[i+3]),data:e.data.subarray(i+10,i+o+10)}).key=a.id,Ut.frameParsers[a.id]?Ut.frameParsers[a.id](a):"T"===a.id[0]?Ut.frameParsers["T*"](a):"W"===a.id[0]&&Ut.frameParsers["W*"](a),"com.apple.streaming.transportStreamTimestamp"===a.owner){var l=a.data,u=(1&l[3])<<30|l[4]<<22|l[5]<<14|l[6]<<6|l[7]>>>2;u*=4,a.timeStamp=u+=3&l[7],void 0===e.pts&&void 0===e.dts&&(e.pts=a.timeStamp,e.dts=a.timeStamp),this.trigger("timestamp",a)}e.frames.push(a),i+=10,i+=o}while(i<s);this.trigger("data",e)}}}).prototype=new q;var qt,Vt,zt,Ht=Nt,Xt=q,Gt=At,Yt=Et,Wt=Mt.TimestampRolloverStream,Jt=188;(qt=function(){var t=new Uint8Array(Jt),e=0;qt.prototype.init.call(this),this.push=function(i){var s,n=0,r=Jt;for(e?((s=new Uint8Array(i.byteLength+e)).set(t.subarray(0,e)),s.set(i,e),e=0):s=i;r<s.byteLength;)71!==s[n]||71!==s[r]?(n++,r++):(this.trigger("data",s.subarray(n,r)),n+=Jt,r+=Jt);n<s.byteLength&&(t.set(s.subarray(n),0),e=s.byteLength-n)},this.flush=function(){e===Jt&&71===t[0]&&(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")}}).prototype=new Xt,(Vt=function(){var t,e,i,s;Vt.prototype.init.call(this),s=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,t=function(t,s){var n=0;s.payloadUnitStartIndicator&&(n+=t[n]+1),"pat"===s.type?e(t.subarray(n),s):i(t.subarray(n),s)},e=function(t,e){e.section_number=t[7],e.last_section_number=t[8],s.pmtPid=(31&t[10])<<8|t[11],e.pmtPid=s.pmtPid},i=function(t,e){var i,n;if(1&t[5]){for(s.programMapTable={video:null,audio:null,"timed-metadata":{}},i=3+((15&t[1])<<8|t[2])-4,n=12+((15&t[10])<<8|t[11]);n<i;){var r=t[n],o=(31&t[n+1])<<8|t[n+2];r===Yt.H264_STREAM_TYPE&&null===s.programMapTable.video?s.programMapTable.video=o:r===Yt.ADTS_STREAM_TYPE&&null===s.programMapTable.audio?s.programMapTable.audio=o:r===Yt.METADATA_STREAM_TYPE&&(s.programMapTable["timed-metadata"][o]=r),n+=5+((15&t[n+3])<<8|t[n+4])}e.programMapTable=s.programMapTable}},this.push=function(e){var i={},s=4;if(i.payloadUnitStartIndicator=!!(64&e[1]),i.pid=31&e[1],i.pid<<=8,i.pid|=e[2],(48&e[3])>>>4>1&&(s+=e[s]+1),0===i.pid)i.type="pat",t(e.subarray(s),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",t(e.subarray(s),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([e,s,i]):this.processPes_(e,s,i)},this.processPes_=function(t,e,i){i.streamType=i.pid===this.programMapTable.video?Yt.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?Yt.ADTS_STREAM_TYPE:this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=t.subarray(e),this.trigger("data",i)}}).prototype=new Xt,Vt.STREAM_TYPES={h264:27,adts:15},zt=function(){var t,e=this,i=!1,s={data:[],size:0},n={data:[],size:0},r={data:[],size:0},o=function(t,i,s){var n,r,o=new Uint8Array(t.size),a={type:i},h=0,l=0;if(t.data.length&&!(t.size<9)){for(a.trackId=t.data[0].pid,h=0;h<t.data.length;h++)o.set((r=t.data[h]).data,l),l+=r.data.byteLength;!function(t,e){var i;const s=t[0]<<16|t[1]<<8|t[2];e.data=new Uint8Array,1===s&&(e.packetLength=6+(t[4]<<8|t[5]),e.dataAlignmentIndicator=!!(4&t[6]),192&(i=t[7])&&(e.pts=(14&t[9])<<27|(255&t[10])<<20|(254&t[11])<<12|(255&t[12])<<5|(254&t[13])>>>3,e.pts*=4,e.pts+=(6&t[13])>>>1,e.dts=e.pts,64&i&&(e.dts=(14&t[14])<<27|(255&t[15])<<20|(254&t[16])<<12|(255&t[17])<<5|(254&t[18])>>>3,e.dts*=4,e.dts+=(6&t[18])>>>1)),e.data=t.subarray(9+t[8]))}(o,a),n="video"===i||a.packetLength<=t.size,(s||n)&&(t.size=0,t.data.length=0),n&&e.trigger("data",a)}};zt.prototype.init.call(this),this.push=function(a){({pat:function(){},pes:function(){var t,e;switch(a.streamType){case Yt.H264_STREAM_TYPE:t=s,e="video";break;case Yt.ADTS_STREAM_TYPE:t=n,e="audio";break;case Yt.METADATA_STREAM_TYPE:t=r,e="timed-metadata";break;default:return}a.payloadUnitStartIndicator&&o(t,e,!0),t.data.push(a),t.size+=a.data.byteLength},pmt:function(){var s={type:"metadata",tracks:[]};null!==(t=a.programMapTable).video&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.video,codec:"avc",type:"video"}),null!==t.audio&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.audio,codec:"adts",type:"audio"}),i=!0,e.trigger("data",s)}})[a.type]()},this.reset=function(){s.size=0,s.data.length=0,n.size=0,n.data.length=0,this.trigger("reset")},this.flushStreams_=function(){o(s,"video"),o(n,"audio"),o(r,"timed-metadata")},this.flush=function(){if(!i&&t){var s={type:"metadata",tracks:[]};null!==t.video&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.video,codec:"avc",type:"video"}),null!==t.audio&&s.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+t.audio,codec:"adts",type:"audio"}),e.trigger("data",s)}i=!1,this.flushStreams_(),this.trigger("done")}},zt.prototype=new Xt;var Kt={PAT_PID:0,MP2T_PACKET_LENGTH:Jt,TransportPacketStream:qt,TransportParseStream:Vt,ElementaryStream:zt,TimestampRolloverStream:Wt,CaptionStream:Gt.CaptionStream,Cea608Stream:Gt.Cea608Stream,Cea708Stream:Gt.Cea708Stream,MetadataStream:Ht};for(var Qt in Yt)Yt.hasOwnProperty(Qt)&&(Kt[Qt]=Yt[Qt]);var Zt,te=Kt,ee=at.ONE_SECOND_IN_TS,ie=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(Zt=function(t){var e,i=0;Zt.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,r,o,a,h,l=0;if(t||(i=0),"audio"===s.type){var u;for(e&&e.length?(o=e,(e=new Uint8Array(o.byteLength+s.data.byteLength)).set(o),e.set(s.data,o.byteLength)):e=s.data;l+7<e.length;)if(255===e[l]&&240==(246&e[l+1])){if("number"==typeof u&&(this.skipWarn_(u,l),u=null),r=2*(1&~e[l+1]),h=(a=1024*(1+(3&e[l+6])))*ee/ie[(60&e[l+2])>>>2],e.byteLength-l<(n=(3&e[l+3])<<11|e[l+4]<<3|(224&e[l+5])>>5))break;this.trigger("data",{pts:s.pts+i*h,dts:s.dts+i*h,sampleCount:a,audioobjecttype:1+(e[l+2]>>>6&3),channelcount:(1&e[l+2])<<2|(192&e[l+3])>>>6,samplerate:ie[(60&e[l+2])>>>2],samplingfrequencyindex:(60&e[l+2])>>>2,samplesize:16,data:e.subarray(l+7+r,l+n)}),i++,l+=n}else"number"!=typeof u&&(u=l),l++;"number"==typeof u&&(this.skipWarn_(u,l),u=null),e=e.subarray(l)}},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")}}).prototype=new q;var se,ne,re,oe=Zt,ae=q,he=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(0===o)throw new Error("no bytes available");r.set(t.subarray(n,n+o)),i=new DataView(r.buffer).getUint32(0),s=8*o,e-=o},this.skipBits=function(t){var n;s>t?(i<<=t,s-=t):(t-=s,t-=8*(n=Math.floor(t/8)),e-=n,this.loadWord(),i<<=t,s-=t)},this.readBits=function(t){var n=Math.min(s,t),r=i>>>32-n;return(s-=n)>0?i<<=n:e>0&&this.loadWord(),(n=t-n)>0?r<<n|this.readBits(n):r},this.skipLeadingZeros=function(){var t;for(t=0;t<s;++t)if(i&2147483648>>>t)return i<<=t,s-=t,t;return this.loadWord(),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();return 1&t?1+t>>>1:-1*(t>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};(ne=function(){var t,e,i=0;ne.prototype.init.call(this),this.push=function(s){var n;e?((n=new Uint8Array(e.byteLength+s.data.byteLength)).set(e),n.set(s.data,e.byteLength),e=n):e=s.data;for(var r=e.byteLength;i<r-3;i++)if(1===e[i+2]){t=i+5;break}for(;t<r;)switch(e[t]){case 0:if(0!==e[t-1]){t+=2;break}if(0!==e[t-2]){t++;break}i+3!==t-2&&this.trigger("data",e.subarray(i+3,t-2));do{t++}while(1!==e[t]&&t<r);i=t-2,t+=3;break;case 1:if(0!==e[t-1]||0!==e[t-2]){t+=3;break}this.trigger("data",e.subarray(i+3,t-2)),i=t-2,t+=3;break;default:t+=3}e=e.subarray(i),t-=i,i=0},this.reset=function(){e=null,i=0,this.trigger("reset")},this.flush=function(){e&&e.byteLength>3&&this.trigger("data",e.subarray(i+3)),e=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new ae,re={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},se=function(){var t,e,i,s,n,r,o,a=new ne;se.prototype.init.call(this),t=this,this.push=function(t){"video"===t.type&&(e=t.trackId,i=t.pts,s=t.dts,a.push(t))},a.on("data",(function(o){var a={trackId:e,pts:i,dts:s,data:o,nalUnitTypeCode:31&o[0]};switch(a.nalUnitTypeCode){case 5:a.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:a.nalUnitType="sei_rbsp",a.escapedRBSP=n(o.subarray(1));break;case 7:a.nalUnitType="seq_parameter_set_rbsp",a.escapedRBSP=n(o.subarray(1)),a.config=r(a.escapedRBSP);break;case 8:a.nalUnitType="pic_parameter_set_rbsp";break;case 9:a.nalUnitType="access_unit_delimiter_rbsp"}t.trigger("data",a)})),a.on("done",(function(){t.trigger("done")})),a.on("partialdone",(function(){t.trigger("partialdone")})),a.on("reset",(function(){t.trigger("reset")})),a.on("endedtimeline",(function(){t.trigger("endedtimeline")})),this.flush=function(){a.flush()},this.partialFlush=function(){a.partialFlush()},this.reset=function(){a.reset()},this.endTimeline=function(){a.endTimeline()},o=function(t,e){var i,s=8,n=8;for(i=0;i<t;i++)0!==n&&(n=(s+e.readExpGolomb()+256)%256),s=0===n?s:n},n=function(t){for(var e,i,s=t.byteLength,n=[],r=1;r<s-2;)0===t[r]&&0===t[r+1]&&3===t[r+2]?(n.push(r+2),r+=2):r++;if(0===n.length)return t;e=s-n.length,i=new Uint8Array(e);var o=0;for(r=0;r<e;o++,r++)o===n[0]&&(o++,n.shift()),i[r]=t[o];return i},r=function(t){var e,i,s,n,r,a,h,l,u,c,d,f,p=0,v=0,m=0,g=0,y=[1,1];if(i=(e=new he(t)).readUnsignedByte(),n=e.readUnsignedByte(),s=e.readUnsignedByte(),e.skipUnsignedExpGolomb(),re[i]&&(3===(r=e.readUnsignedExpGolomb())&&e.skipBits(1),e.skipUnsignedExpGolomb(),e.skipUnsignedExpGolomb(),e.skipBits(1),e.readBoolean()))for(d=3!==r?8:12,f=0;f<d;f++)e.readBoolean()&&o(f<6?16:64,e);if(e.skipUnsignedExpGolomb(),0===(a=e.readUnsignedExpGolomb()))e.readUnsignedExpGolomb();else if(1===a)for(e.skipBits(1),e.skipExpGolomb(),e.skipExpGolomb(),h=e.readUnsignedExpGolomb(),f=0;f<h;f++)e.skipExpGolomb();if(e.skipUnsignedExpGolomb(),e.skipBits(1),l=e.readUnsignedExpGolomb(),u=e.readUnsignedExpGolomb(),0===(c=e.readBits(1))&&e.skipBits(1),e.skipBits(1),e.readBoolean()&&(p=e.readUnsignedExpGolomb(),v=e.readUnsignedExpGolomb(),m=e.readUnsignedExpGolomb(),g=e.readUnsignedExpGolomb()),e.readBoolean()&&e.readBoolean())switch(e.readUnsignedByte()){case 1:y=[1,1];break;case 2:y=[12,11];break;case 3:y=[10,11];break;case 4:y=[16,11];break;case 5:y=[40,33];break;case 6:y=[24,11];break;case 7:y=[20,11];break;case 8:y=[32,11];break;case 9:y=[80,33];break;case 10:y=[18,11];break;case 11:y=[15,11];break;case 12:y=[64,33];break;case 13:y=[160,99];break;case 14:y=[4,3];break;case 15:y=[3,2];break;case 16:y=[2,1];break;case 255:y=[e.readUnsignedByte()<<8|e.readUnsignedByte(),e.readUnsignedByte()<<8|e.readUnsignedByte()]}return{profileIdc:i,levelIdc:s,profileCompatibility:n,width:16*(l+1)-2*p-2*v,height:(2-c)*(u+1)*16-2*m-2*g,sarRatio:y}}},se.prototype=new ae;var le,ue={H264Stream:se},ce=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],de=function(t,e){var i=t[e+6]<<21|t[e+7]<<14|t[e+8]<<7|t[e+9];return i=i>=0?i:0,(16&t[e+5])>>4?i+20:i+10},fe=function(t,e){return t.length-e<10||t[e]!=="I".charCodeAt(0)||t[e+1]!=="D".charCodeAt(0)||t[e+2]!=="3".charCodeAt(0)?e:(e+=de(t,e),fe(t,e))},pe=function(t){return t[0]<<21|t[1]<<14|t[2]<<7|t[3]},ve={isLikelyAacData:function(t){var e=fe(t,0);return t.length>=e+2&&!(255&~t[e])&&!(240&~t[e+1])&&16==(22&t[e+1])},parseId3TagSize:de,parseAdtsSize:function(t,e){return 6144&t[e+3]|t[e+4]<<3|(224&t[e+5])>>5},parseType:function(t,e){return t[e]==="I".charCodeAt(0)&&t[e+1]==="D".charCodeAt(0)&&t[e+2]==="3".charCodeAt(0)?"timed-metadata":!0&t[e]&&!(240&~t[e+1])?"audio":null},parseSampleRate:function(t){for(var e=0;e+5<t.length;){if(255===t[e]&&240==(246&t[e+1]))return ce[(60&t[e+2])>>>2];e++}return null},parseAacTimestamp:function(t){var e,i,s;e=10,64&t[5]&&(e+=4,e+=pe(t.subarray(10,14)));do{if((i=pe(t.subarray(e+4,e+8)))<1)return null;if("PRIV"===String.fromCharCode(t[e],t[e+1],t[e+2],t[e+3])){s=t.subarray(e+10,e+i+10);for(var n=0;n<s.byteLength;n++)if(0===s[n]){var r=unescape(function(t,e,i){var s,n="";for(s=0;s<i;s++)n+="%"+("00"+t[s].toString(16)).slice(-2);return n}(s,0,n));if("com.apple.streaming.transportStreamTimestamp"===r){var o=s.subarray(n+1),a=(1&o[3])<<30|o[4]<<22|o[5]<<14|o[6]<<6|o[7]>>>2;return(a*=4)+(3&o[7])}break}}e+=10,e+=i}while(e<t.byteLength);return null}},me=ve;(le=function(){var t=new Uint8Array,e=0;le.prototype.init.call(this),this.setTimestamp=function(t){e=t},this.push=function(i){var s,n,r,o=0,a=0;for(t.length?(r=t.length,(t=new Uint8Array(i.byteLength+r)).set(t.subarray(0,r)),t.set(i,r)):t=i;t.length-a>=3;)if(t[a]!=="I".charCodeAt(0)||t[a+1]!=="D".charCodeAt(0)||t[a+2]!=="3".charCodeAt(0))if(255&~t[a]||240&~t[a+1])a++;else{if(t.length-a<7)break;if(a+(o=me.parseAdtsSize(t,a))>t.length)break;n={type:"audio",data:t.subarray(a,a+o),pts:e,dts:e},this.trigger("data",n),a+=o}else{if(t.length-a<10)break;if(a+(o=me.parseId3TagSize(t,a))>t.length)break;s={type:"timed-metadata",data:t.subarray(a,a+o)},this.trigger("data",s),a+=o}t=t.length-a>0?t.subarray(a):new Uint8Array},this.reset=function(){t=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){t=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new q;var ge,ye,be,je,we=q,Te=tt,Se=it,ke=lt,xe=ct,Ae=te,Ee=at,Ie=oe,De=ue.H264Stream,Ce=le,Ne=ve.isLikelyAacData,Me=at.ONE_SECOND_IN_TS,Oe=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Re=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Pe=function(t,e){e.stream=t,this.trigger("log",e)},_e=function(t,e){for(var i=Object.keys(e),s=0;s<i.length;s++){var n=i[s];"headOfPipeline"!==n&&e[n].on&&e[n].on("log",Pe.bind(t,n))}},Le=function(t,e){var i;if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0},Fe=function(t,e,i,s,n,r){return{start:{dts:t,pts:t+(i-e)},end:{dts:t+(s-e),pts:t+(n-i)},prependedContentDuration:r,baseMediaDecodeTime:t}};ye=function(t,e){var i,s=[],n=0,r=0,o=1/0;i=(e=e||{}).firstSequenceNumber||0,ye.prototype.init.call(this),this.push=function(e){xe.collectDtsInfo(t,e),t&&Oe.forEach((function(i){t[i]=e[i]})),s.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,l,u,c,d,f;0!==s.length?(a=ke.trimAdtsFramesByEarliestDts(s,t,n),t.baseMediaDecodeTime=xe.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps),f=ke.prefixWithSilence(t,a,r,o),t.samples=ke.generateSampleTable(a),l=Te.mdat(ke.concatenateFrameData(a)),s=[],h=Te.moof(i,[t]),u=new Uint8Array(h.byteLength+l.byteLength),i++,u.set(h),u.set(l,h.byteLength),xe.clearDtsInfo(t),c=Math.ceil(1024*Me/t.samplerate),a.length&&(d=a.length*c,this.trigger("segmentTimingInfo",Fe(Ee.audioTsToVideoTs(t.baseMediaDecodeTime,t.samplerate),a[0].dts,a[0].pts,a[0].dts+d,a[0].pts+d,f||0)),this.trigger("timingInfo",{start:a[0].pts,end:a[0].pts+d})),this.trigger("data",{track:t,boxes:u}),this.trigger("done","AudioSegmentStream")):this.trigger("done","AudioSegmentStream")},this.reset=function(){xe.clearDtsInfo(t),s=[],this.trigger("reset")}},ye.prototype=new we,ge=function(t,e){var i,s,n,r=[],o=[];i=(e=e||{}).firstSequenceNumber||0,ge.prototype.init.call(this),delete t.minPTS,this.gopCache_=[],this.push=function(e){xe.collectDtsInfo(t,e),"seq_parameter_set_rbsp"!==e.nalUnitType||s||(s=e.config,t.sps=[e.data],Re.forEach((function(e){t[e]=s[e]}),this)),"pic_parameter_set_rbsp"!==e.nalUnitType||n||(n=e.data,t.pps=[e.data]),r.push(e)},this.flush=function(){for(var s,n,a,h,l,u,c,d,f=0;r.length&&"access_unit_delimiter_rbsp"!==r[0].nalUnitType;)r.shift();if(0===r.length)return this.resetStream_(),void this.trigger("done","VideoSegmentStream");if(s=Se.groupNalsIntoFrames(r),(a=Se.groupFramesIntoGops(s))[0][0].keyFrame||((n=this.getGopForFusion_(r[0],t))?(f=n.duration,a.unshift(n),a.byteLength+=n.byteLength,a.nalCount+=n.nalCount,a.pts=n.pts,a.dts=n.dts,a.duration+=n.duration):a=Se.extendFirstKeyFrame(a)),o.length){var p;if(!(p=e.alignGopsAtEnd?this.alignGopsAtEnd_(a):this.alignGopsAtStart_(a)))return this.gopCache_.unshift({gop:a.pop(),pps:t.pps,sps:t.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),r=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");xe.clearDtsInfo(t),a=p}xe.collectDtsInfo(t,a),t.samples=Se.generateSampleTable(a),l=Te.mdat(Se.concatenateNalData(a)),t.baseMediaDecodeTime=xe.calculateTrackBaseMediaDecodeTime(t,e.keepOriginalTimestamps),this.trigger("processedGopsInfo",a.map((function(t){return{pts:t.pts,dts:t.dts,byteLength:t.byteLength}}))),this.trigger("segmentTimingInfo",Fe(t.baseMediaDecodeTime,(c=a[0]).dts,c.pts,(d=a[a.length-1]).dts+d.duration,d.pts+d.duration,f)),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),r=[],this.trigger("baseMediaDecodeTime",t.baseMediaDecodeTime),this.trigger("timelineStartInfo",t.timelineStartInfo),h=Te.moof(i,[t]),u=new Uint8Array(h.byteLength+l.byteLength),i++,u.set(h),u.set(l,h.byteLength),this.trigger("data",{track:t,boxes:u}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),r=[],this.gopCache_.length=0,o.length=0,this.trigger("reset")},this.resetStream_=function(){xe.clearDtsInfo(t),s=void 0,n=void 0},this.getGopForFusion_=function(e){var i,s,n,r,o,a=1/0;for(o=0;o<this.gopCache_.length;o++)n=(r=this.gopCache_[o]).gop,t.pps&&Le(t.pps[0],r.pps[0])&&t.sps&&Le(t.sps[0],r.sps[0])&&(n.dts<t.timelineStartInfo.dts||(i=e.dts-n.dts-n.duration)>=-1e4&&i<=45e3&&(!s||a>i)&&(s=r,a=i));return s?s.gop:null},this.alignGopsAtStart_=function(t){var e,i,s,n,r,a,h,l;for(r=t.byteLength,a=t.nalCount,h=t.duration,e=i=0;e<o.length&&i<t.length&&(s=o[e]).pts!==(n=t[i]).pts;)n.pts>s.pts?e++:(i++,r-=n.byteLength,a-=n.nalCount,h-=n.duration);return 0===i?t:i===t.length?null:((l=t.slice(i)).byteLength=r,l.duration=h,l.nalCount=a,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(t){var e,i,s,n,r,a,h;for(e=o.length-1,i=t.length-1,r=null,a=!1;e>=0&&i>=0;){if((s=o[e]).pts===(n=t[i]).pts){a=!0;break}s.pts>n.pts?e--:(e===o.length-1&&(r=i),i--)}if(!a&&null===r)return null;if(0===(h=a?i:r))return t;var l=t.slice(h),u=l.reduce((function(t,e){return t.byteLength+=e.byteLength,t.duration+=e.duration,t.nalCount+=e.nalCount,t}),{byteLength:0,duration:0,nalCount:0});return l.byteLength=u.byteLength,l.duration=u.duration,l.nalCount=u.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(t){o=t}},ge.prototype=new we,je=function(t,e){this.numberOfTracks=0,this.metadataStream=e,this.remuxTracks=void 0===(t=t||{}).remux||!!t.remux,this.keepOriginalTimestamps="boolean"==typeof t.keepOriginalTimestamps&&t.keepOriginalTimestamps,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,je.prototype.init.call(this),this.push=function(t){return t.content||t.text?this.pendingCaptions.push(t):t.frames?this.pendingMetadata.push(t):(this.pendingTracks.push(t.track),this.pendingBytes+=t.boxes.byteLength,"video"===t.track.type&&(this.videoTrack=t.track,this.pendingBoxes.push(t.boxes)),void("audio"===t.track.type&&(this.audioTrack=t.track,this.pendingBoxes.unshift(t.boxes))))}},je.prototype=new we,je.prototype.flush=function(t){var e,i,s,n,r=0,o={captions:[],captionStreams:{},metadata:[],info:{}},a=0;if(this.pendingTracks.length<this.numberOfTracks){if("VideoSegmentStream"!==t&&"AudioSegmentStream"!==t)return;if(this.remuxTracks)return;if(0===this.pendingTracks.length)return this.emittedTracks++,void(this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(a=this.videoTrack.timelineStartInfo.pts,Re.forEach((function(t){o.info[t]=this.videoTrack[t]}),this)):this.audioTrack&&(a=this.audioTrack.timelineStartInfo.pts,Oe.forEach((function(t){o.info[t]=this.audioTrack[t]}),this)),this.videoTrack||this.audioTrack){for(o.type=1===this.pendingTracks.length?this.pendingTracks[0].type:"combined",this.emittedTracks+=this.pendingTracks.length,s=Te.initSegment(this.pendingTracks),o.initSegment=new Uint8Array(s.byteLength),o.initSegment.set(s),o.data=new Uint8Array(this.pendingBytes),n=0;n<this.pendingBoxes.length;n++)o.data.set(this.pendingBoxes[n],r),r+=this.pendingBoxes[n].byteLength;for(n=0;n<this.pendingCaptions.length;n++)(e=this.pendingCaptions[n]).startTime=Ee.metadataTsToSeconds(e.startPts,a,this.keepOriginalTimestamps),e.endTime=Ee.metadataTsToSeconds(e.endPts,a,this.keepOriginalTimestamps),o.captionStreams[e.stream]=!0,o.captions.push(e);for(n=0;n<this.pendingMetadata.length;n++)(i=this.pendingMetadata[n]).cueTime=Ee.metadataTsToSeconds(i.pts,a,this.keepOriginalTimestamps),o.metadata.push(i);for(o.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",o),n=0;n<o.captions.length;n++)this.trigger("caption",e=o.captions[n]);for(n=0;n<o.metadata.length;n++)this.trigger("id3Frame",i=o.metadata[n])}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},je.prototype.setRemux=function(t){this.remuxTracks=t},(be=function(t){var e,i,s=this,n=!0;be.prototype.init.call(this),this.baseMediaDecodeTime=(t=t||{}).baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var n={};this.transmuxPipeline_=n,n.type="aac",n.metadataStream=new Ae.MetadataStream,n.aacStream=new Ce,n.audioTimestampRolloverStream=new Ae.TimestampRolloverStream("audio"),n.timedMetadataTimestampRolloverStream=new Ae.TimestampRolloverStream("timed-metadata"),n.adtsStream=new Ie,n.coalesceStream=new je(t,n.metadataStream),n.headOfPipeline=n.aacStream,n.aacStream.pipe(n.audioTimestampRolloverStream).pipe(n.adtsStream),n.aacStream.pipe(n.timedMetadataTimestampRolloverStream).pipe(n.metadataStream).pipe(n.coalesceStream),n.metadataStream.on("timestamp",(function(t){n.aacStream.setTimestamp(t.timeStamp)})),n.aacStream.on("data",(function(r){"timed-metadata"!==r.type&&"audio"!==r.type||n.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:s.baseMediaDecodeTime},codec:"adts",type:"audio"},n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new ye(i,t),n.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream")),n.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo")),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream),s.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!e}))})),n.coalesceStream.on("data",this.trigger.bind(this,"data")),n.coalesceStream.on("done",this.trigger.bind(this,"done")),_e(this,n)},this.setupTsPipeline=function(){var n={};this.transmuxPipeline_=n,n.type="ts",n.metadataStream=new Ae.MetadataStream,n.packetStream=new Ae.TransportPacketStream,n.parseStream=new Ae.TransportParseStream,n.elementaryStream=new Ae.ElementaryStream,n.timestampRolloverStream=new Ae.TimestampRolloverStream,n.adtsStream=new Ie,n.h264Stream=new De,n.captionStream=new Ae.CaptionStream(t),n.coalesceStream=new je(t,n.metadataStream),n.headOfPipeline=n.packetStream,n.packetStream.pipe(n.parseStream).pipe(n.elementaryStream).pipe(n.timestampRolloverStream),n.timestampRolloverStream.pipe(n.h264Stream),n.timestampRolloverStream.pipe(n.adtsStream),n.timestampRolloverStream.pipe(n.metadataStream).pipe(n.coalesceStream),n.h264Stream.pipe(n.captionStream).pipe(n.coalesceStream),n.elementaryStream.on("data",(function(r){var o;if("metadata"===r.type){for(o=r.tracks.length;o--;)e||"video"!==r.tracks[o].type?i||"audio"!==r.tracks[o].type||((i=r.tracks[o]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime):(e=r.tracks[o]).timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime;e&&!n.videoSegmentStream&&(n.coalesceStream.numberOfTracks++,n.videoSegmentStream=new ge(e,t),n.videoSegmentStream.on("log",s.getLogTrigger_("videoSegmentStream")),n.videoSegmentStream.on("timelineStartInfo",(function(e){i&&!t.keepOriginalTimestamps&&(i.timelineStartInfo=e,n.audioSegmentStream.setEarliestDts(e.dts-s.baseMediaDecodeTime))})),n.videoSegmentStream.on("processedGopsInfo",s.trigger.bind(s,"gopInfo")),n.videoSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"videoSegmentTimingInfo")),n.videoSegmentStream.on("baseMediaDecodeTime",(function(t){i&&n.audioSegmentStream.setVideoBaseMediaDecodeTime(t)})),n.videoSegmentStream.on("timingInfo",s.trigger.bind(s,"videoTimingInfo")),n.h264Stream.pipe(n.videoSegmentStream).pipe(n.coalesceStream)),i&&!n.audioSegmentStream&&(n.coalesceStream.numberOfTracks++,n.audioSegmentStream=new ye(i,t),n.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream")),n.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo")),n.audioSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"audioSegmentTimingInfo")),n.adtsStream.pipe(n.audioSegmentStream).pipe(n.coalesceStream)),s.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!e})}})),n.coalesceStream.on("data",this.trigger.bind(this,"data")),n.coalesceStream.on("id3Frame",(function(t){t.dispatchType=n.metadataStream.dispatchType,s.trigger("id3Frame",t)})),n.coalesceStream.on("caption",this.trigger.bind(this,"caption")),n.coalesceStream.on("done",this.trigger.bind(this,"done")),_e(this,n)},this.setBaseMediaDecodeTime=function(s){var n=this.transmuxPipeline_;t.keepOriginalTimestamps||(this.baseMediaDecodeTime=s),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,xe.clearDtsInfo(i),n.audioTimestampRolloverStream&&n.audioTimestampRolloverStream.discontinuity()),e&&(n.videoSegmentStream&&(n.videoSegmentStream.gopCache_=[]),e.timelineStartInfo.dts=void 0,e.timelineStartInfo.pts=void 0,xe.clearDtsInfo(e),n.captionStream.reset()),n.timestampRolloverStream&&n.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(t){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(t)},this.setRemux=function(e){var i=this.transmuxPipeline_;t.remux=e,i&&i.coalesceStream&&i.coalesceStream.setRemux(e)},this.alignGopsWith=function(t){e&&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(n){var e=Ne(t);e&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():e||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),n=!1}this.transmuxPipeline_.headOfPipeline.push(t)},this.flush=function(){n=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new we;var $e,Be,Ue,qe,Ve,ze,He,Xe={Transmuxer:be},Ge=function(t){return t>>>0},Ye=function(t){var e="";return e+=String.fromCharCode(t[0]),e+=String.fromCharCode(t[1]),(e+=String.fromCharCode(t[2]))+String.fromCharCode(t[3])},We=Ge,Je=Ye,Ke=function(t,e){var i,s,n,r,o,a=[];if(!e.length)return null;for(i=0;i<t.byteLength;)s=We(t[i]<<24|t[i+1]<<16|t[i+2]<<8|t[i+3]),n=Je(t.subarray(i+4,i+8)),r=s>1?i+s:t.byteLength,n===e[0]&&(1===e.length?a.push(t.subarray(i+8,r)):(o=Ke(t.subarray(i+8,r),e.slice(1))).length&&(a=a.concat(o))),i=r;return a},Qe=Ke,Ze=Ge,ti=z.getUint64,ei=function(t){var e={version:t[0],flags:new Uint8Array(t.subarray(1,4))};return e.baseMediaDecodeTime=1===e.version?ti(t.subarray(4)):Ze(t[4]<<24|t[5]<<16|t[6]<<8|t[7]),e},ii=function(t){var e,i=new DataView(t.buffer,t.byteOffset,t.byteLength),s={version:t[0],flags:new Uint8Array(t.subarray(1,4)),trackId:i.getUint32(4)},n=1&s.flags[2],r=2&s.flags[2],o=8&s.flags[2],a=16&s.flags[2],h=32&s.flags[2],l=65536&s.flags[0],u=131072&s.flags[0];return e=8,n&&(e+=4,s.baseDataOffset=i.getUint32(12),e+=4),r&&(s.sampleDescriptionIndex=i.getUint32(e),e+=4),o&&(s.defaultSampleDuration=i.getUint32(e),e+=4),a&&(s.defaultSampleSize=i.getUint32(e),e+=4),h&&(s.defaultSampleFlags=i.getUint32(e)),l&&(s.durationIsEmpty=!0),!n&&u&&(s.baseDataOffsetIsMoof=!0),s},si=function(t){return{isLeading:(12&t[0])>>>2,dependsOn:3&t[0],isDependedOn:(192&t[1])>>>6,hasRedundancy:(48&t[1])>>>4,paddingValue:(14&t[1])>>>1,isNonSyncSample:1&t[1],degradationPriority:t[2]<<8|t[3]}},ni=function(t){var e,i={version:t[0],flags:new Uint8Array(t.subarray(1,4)),samples:[]},s=new DataView(t.buffer,t.byteOffset,t.byteLength),n=1&i.flags[2],r=4&i.flags[2],o=1&i.flags[1],a=2&i.flags[1],h=4&i.flags[1],l=8&i.flags[1],u=s.getUint32(4),c=8;for(n&&(i.dataOffset=s.getInt32(c),c+=4),r&&u&&(e={flags:si(t.subarray(c,c+4))},c+=4,o&&(e.duration=s.getUint32(c),c+=4),a&&(e.size=s.getUint32(c),c+=4),l&&(e.compositionTimeOffset=1===i.version?s.getInt32(c):s.getUint32(c),c+=4),i.samples.push(e),u--);u--;)e={},o&&(e.duration=s.getUint32(c),c+=4),a&&(e.size=s.getUint32(c),c+=4),h&&(e.flags=si(t.subarray(c,c+4)),c+=4),l&&(e.compositionTimeOffset=1===i.version?s.getInt32(c):s.getUint32(c),c+=4),i.samples.push(e);return i},ri={tfdt:ei,trun:ni},oi={parseTfdt:ri.tfdt,parseTrun:ri.trun},ai=function(t){for(var e=0,i=String.fromCharCode(t[e]),s="";"\0"!==i;)s+=i,e++,i=String.fromCharCode(t[e]);return s+i},hi=z.getUint64,li=function(t){return void 0!==t||null!==t},ui={parseEmsgBox:function(t){var e,i,s,n,r,o,a,h=4,l=t[0];if(0===l)h+=(e=ai(t.subarray(h))).length,h+=(i=ai(t.subarray(h))).length,s=(u=new DataView(t.buffer)).getUint32(h),r=u.getUint32(h+=4),o=u.getUint32(h+=4),a=u.getUint32(h+=4),h+=4;else if(1===l){var u;s=(u=new DataView(t.buffer)).getUint32(h),n=hi(t.subarray(h+=4)),o=u.getUint32(h+=8),a=u.getUint32(h+=4),h+=4,h+=(e=ai(t.subarray(h))).length,h+=(i=ai(t.subarray(h))).length}var c={scheme_id_uri:e,value:i,timescale:s||1,presentation_time:n,presentation_time_delta:r,event_duration:o,id:a,message_data:new Uint8Array(t.subarray(h,t.byteLength))};return function(t,e){var i="\0"!==e.scheme_id_uri,s=0===t&&li(e.presentation_time_delta)&&i,n=1===t&&li(e.presentation_time)&&i;return!(t>1)&&s||n}(l,c)?c:void 0},scaleTime:function(t,e,i,s){return t||0===t?t/e:s+i/e}},ci="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},di=Ge,fi=function(t){return("00"+t.toString(16)).slice(-2)},pi=Qe,vi=Ye,mi=ui,gi=ii,yi=ni,bi=ei,ji=z.getUint64,wi=ci,Ti=$t.parseId3Frames;$e=function(t){return pi(t,["moov","trak"]).reduce((function(t,e){var i,s,n,r;return(i=pi(e,["tkhd"])[0])?(n=di(i[s=0===i[0]?12:20]<<24|i[s+1]<<16|i[s+2]<<8|i[s+3]),(r=pi(e,["mdia","mdhd"])[0])?(t[n]=di(r[s=0===r[0]?12:20]<<24|r[s+1]<<16|r[s+2]<<8|r[s+3]),t):null):null}),{})},Be=function(t,e){var i=pi(e,["moof","traf"]).reduce((function(e,i){var s,n=pi(i,["tfhd"])[0],r=di(n[4]<<24|n[5]<<16|n[6]<<8|n[7]),o=t[r]||9e4,a=pi(i,["tfdt"])[0],h=new DataView(a.buffer,a.byteOffset,a.byteLength);let l;return"bigint"==typeof(s=1===a[0]?ji(a.subarray(4,12)):h.getUint32(4))?l=s/wi.BigInt(o):"number"!=typeof s||isNaN(s)||(l=s/o),l<Number.MAX_SAFE_INTEGER&&(l=Number(l)),l<e&&(e=l),e}),1/0);return"bigint"==typeof i||isFinite(i)?i:0},Ue=function(t,e){var i,s=pi(e,["moof","traf"]),n=0,r=0;if(s&&s.length){var o=pi(s[0],["tfhd"])[0],a=pi(s[0],["trun"])[0],h=pi(s[0],["tfdt"])[0];if(o&&(i=gi(o).trackId),h&&(n=bi(h).baseMediaDecodeTime),a){var l=yi(a);l.samples&&l.samples.length&&(r=l.samples[0].compositionTimeOffset||0)}}var u=t[i]||9e4;"bigint"==typeof n&&(r=wi.BigInt(r),u=wi.BigInt(u));var c=(n+r)/u;return"bigint"==typeof c&&c<Number.MAX_SAFE_INTEGER&&(c=Number(c)),c},qe=function(t){var e=pi(t,["moov","trak"]),i=[];return e.forEach((function(t){var e=pi(t,["mdia","hdlr"]),s=pi(t,["tkhd"]);e.forEach((function(t,e){var n,r,o,a=vi(t.subarray(8,12)),h=s[e];"vide"===a&&(r=(n=new DataView(h.buffer,h.byteOffset,h.byteLength)).getUint8(0),o=n.getUint32(0===r?12:20),i.push(o))}))})),i},ze=function(t){var e=0===t[0]?12:20;return di(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])},Ve=function(t){var e=pi(t,["moov","trak"]),i=[];return e.forEach((function(t){var e,s,n={},r=pi(t,["tkhd"])[0];r&&(s=(e=new DataView(r.buffer,r.byteOffset,r.byteLength)).getUint8(0),n.id=e.getUint32(0===s?12:20));var o=pi(t,["mdia","hdlr"])[0];if(o){var a=vi(o.subarray(8,12));n.type="vide"===a?"video":"soun"===a?"audio":a}var h=pi(t,["mdia","minf","stbl","stsd"])[0];if(h){var l=h.subarray(8);n.codec=vi(l.subarray(4,8));var u,c=pi(l,[n.codec])[0];c&&(/^[asm]vc[1-9]$/i.test(n.codec)?(u=c.subarray(78),"avcC"===vi(u.subarray(4,8))&&u.length>11?(n.codec+=".",n.codec+=fi(u[9]),n.codec+=fi(u[10]),n.codec+=fi(u[11])):n.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(n.codec)?(u=c.subarray(28),"esds"===vi(u.subarray(4,8))&&u.length>20&&0!==u[19]?(n.codec+="."+fi(u[19]),n.codec+="."+fi(u[20]>>>2&63).replace(/^0/,"")):n.codec="mp4a.40.2"):n.codec=n.codec.toLowerCase())}var d=pi(t,["mdia","mdhd"])[0];d&&(n.timescale=ze(d)),i.push(n)})),i},He=function(t,e=0){return pi(t,["emsg"]).map((t=>{var i=mi.parseEmsgBox(new Uint8Array(t)),s=Ti(i.message_data);return{cueTime:mi.scaleTime(i.presentation_time,i.timescale,i.presentation_time_delta,e),duration:mi.scaleTime(i.event_duration,i.timescale),frames:s}}))};var Si={findBox:pi,parseType:vi,timescale:$e,startTime:Be,compositionStartTime:Ue,videoTrackIds:qe,tracks:Ve,getTimescaleFromMediaHeader:ze,getEmsgID3:He};const{parseTrun:ki}=oi,{findBox:xi}=Si;var Ai=ci,Ei={getMdatTrafPairs:function(t){var e=xi(t,["moof","traf"]),i=xi(t,["mdat"]),s=[];return i.forEach((function(t,i){s.push({mdat:t,traf:e[i]})})),s},parseSamples:function(t,e,i){var s=e,n=i.defaultSampleDuration||0,r=i.defaultSampleSize||0,o=i.trackId,a=[];return t.forEach((function(t){var e=ki(t).samples;e.forEach((function(t){void 0===t.duration&&(t.duration=n),void 0===t.size&&(t.size=r),t.trackId=o,t.dts=s,void 0===t.compositionTimeOffset&&(t.compositionTimeOffset=0),"bigint"==typeof s?(t.pts=s+Ai.BigInt(t.compositionTimeOffset),s+=Ai.BigInt(t.duration)):(t.pts=s+t.compositionTimeOffset,s+=t.duration)})),a=a.concat(e)})),a}},Ii=dt.discardEmulationPreventionBytes,Di=At.CaptionStream,Ci=Qe,Ni=ei,Mi=ii,{getMdatTrafPairs:Oi,parseSamples:Ri}=Ei,Pi=function(t,e){for(var i=t,s=0;s<e.length;s++){var n=e[s];if(i<n.size)return n;i-=n.size}return null},_i=function(){var t,e,i,s,n,r,o=!1;this.isInitialized=function(){return o},this.init=function(e){t=new Di,o=!0,r=!!e&&e.isPartial,t.on("data",(function(t){t.startTime=t.startPts/s,t.endTime=t.endPts/s,n.captions.push(t),n.captionStreams[t.stream]=!0})),t.on("log",(function(t){n.logs.push(t)}))},this.isNewInit=function(t,e){return!(t&&0===t.length||e&&"object"==typeof e&&0===Object.keys(e).length||i===t[0]&&s===e[i])},this.parse=function(t,r,o){var a;if(!this.isInitialized())return null;if(!r||!o)return null;if(this.isNewInit(r,o))s=o[i=r[0]];else if(null===i||!s)return e.push(t),null;for(;e.length>0;){var h=e.shift();this.parse(h,r,o)}return a=function(t,e,i){if(null===e)return null;var s=function(t,e){var i={};return Oi(t).forEach((function(t){var s,n=t.mdat,r=t.traf,o=Ci(r,["tfhd"]),a=Mi(o[0]),h=a.trackId,l=Ci(r,["tfdt"]),u=l.length>0?Ni(l[0]).baseMediaDecodeTime:0,c=Ci(r,["trun"]);e===h&&c.length>0&&(s=function(t,e,i){var s,n,r,o,a=new DataView(t.buffer,t.byteOffset,t.byteLength),h={logs:[],seiNals:[]};for(n=0;n+4<t.length;n+=r)if(r=a.getUint32(n),n+=4,!(r<=0))switch(31&t[n]){case 6:var l=t.subarray(n+1,n+1+r),u=Pi(n,e);if(s={nalUnitType:"sei_rbsp",size:r,data:l,escapedRBSP:Ii(l),trackId:i},u)s.pts=u.pts,s.dts=u.dts,o=u;else{if(!o){h.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+n+" for trackId "+i+". See mux.js#223."});break}s.pts=o.pts,s.dts=o.dts}h.seiNals.push(s)}return h}(n,Ri(c,u,a),h),i[h]||(i[h]={seiNals:[],logs:[]}),i[h].seiNals=i[h].seiNals.concat(s.seiNals),i[h].logs=i[h].logs.concat(s.logs))})),i}(t,e)[e]||{};return{seiNals:s.seiNals,logs:s.logs,timescale:i}}(t,i,s),a&&a.logs&&(n.logs=n.logs.concat(a.logs)),null!==a&&a.seiNals?(this.pushNals(a.seiNals),this.flushStream(),n):n.logs.length?{logs:n.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(e){if(!this.isInitialized()||!e||0===e.length)return null;e.forEach((function(e){t.push(e)}))},this.flushStream=function(){if(!this.isInitialized())return null;r?t.partialFlush():t.flush()},this.clearParsedCaptions=function(){n.captions=[],n.captionStreams={},n.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;t.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){e=[],i=null,s=null,n?this.clearParsedCaptions():n={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()};const{parseTfdt:Li}=oi,Fi=Qe,{getTimescaleFromMediaHeader:$i}=Si,{parseSamples:Bi,getMdatTrafPairs:Ui}=Ei;var qi=function(){let t=9e4;this.init=function(e){const i=Fi(e,["moov","trak","mdia","mdhd"])[0];i&&(t=$i(i))},this.parseSegment=function(e){const i=[],s=Ui(e);let n=0;return s.forEach((function(e){const s=e.mdat,r=e.traf,o=Fi(r,["tfdt"])[0],a=Fi(r,["tfhd"])[0],h=Fi(r,["trun"]);if(o){const t=Li(o);n=t.baseMediaDecodeTime}if(h.length&&a){const e=Bi(h,n,a);let r=0;e.forEach((function(e){const n=new TextDecoder("utf-8"),o=s.slice(r,r+e.size);Fi(o,["vtte"])[0]||Fi(o,["vttc"]).forEach((function(s){const r=Fi(s,["payl"])[0],o=Fi(s,["sttg"])[0],a=e.pts/t,h=(e.pts+e.duration)/t;let l,u;if(r)try{l=n.decode(r)}catch(t){console.error(t)}if(o)try{u=n.decode(o)}catch(t){console.error(t)}e.duration&&l&&i.push({cueText:l,start:a,end:h,settings:u})})),r+=e.size}))}})),i}},Vi=Et,zi=function(t){var e=31&t[1];return(e<<=8)|t[2]},Hi=function(t){return!!(64&t[1])},Xi=function(t){var e=0;return(48&t[3])>>>4>1&&(e+=t[4]+1),e},Gi=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}},Yi=Et,Wi=Mt.handleRollover,Ji={};Ji.ts={parseType:function(t,e){var i=zi(t);return 0===i?"pat":i===e?"pmt":e?"pes":null},parsePat:function(t){var e=Hi(t),i=4+Xi(t);return e&&(i+=t[i]+1),(31&t[i+10])<<8|t[i+11]},parsePmt:function(t){var e={},i=Hi(t),s=4+Xi(t);if(i&&(s+=t[s]+1),1&t[s+5]){var n;n=3+((15&t[s+1])<<8|t[s+2])-4;for(var r=12+((15&t[s+10])<<8|t[s+11]);r<n;){var o=s+r;e[(31&t[o+1])<<8|t[o+2]]=t[o],r+=5+((15&t[o+3])<<8|t[o+4])}return e}},parsePayloadUnitStartIndicator:Hi,parsePesType:function(t,e){switch(e[zi(t)]){case Vi.H264_STREAM_TYPE:return"video";case Vi.ADTS_STREAM_TYPE:return"audio";case Vi.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},parsePesTime:function(t){if(!Hi(t))return null;var e=4+Xi(t);if(e>=t.byteLength)return null;var i,s=null;return 192&(i=t[e+7])&&((s={}).pts=(14&t[e+9])<<27|(255&t[e+10])<<20|(254&t[e+11])<<12|(255&t[e+12])<<5|(254&t[e+13])>>>3,s.pts*=4,s.pts+=(6&t[e+13])>>>1,s.dts=s.pts,64&i&&(s.dts=(14&t[e+14])<<27|(255&t[e+15])<<20|(254&t[e+16])<<12|(255&t[e+17])<<5|(254&t[e+18])>>>3,s.dts*=4,s.dts+=(6&t[e+18])>>>1)),s},videoPacketContainsKeyFrame:function(t){for(var e=4+Xi(t),i=t.subarray(e),s=0,n=0,r=!1;n<i.byteLength-3;n++)if(1===i[n+2]){s=n+5;break}for(;s<i.byteLength;)switch(i[s]){case 0:if(0!==i[s-1]){s+=2;break}if(0!==i[s-2]){s++;break}n+3!==s-2&&"slice_layer_without_partitioning_rbsp_idr"===Gi(31&i[n+3])&&(r=!0);do{s++}while(1!==i[s]&&s<i.length);n=s-2,s+=3;break;case 1:if(0!==i[s-1]||0!==i[s-2]){s+=3;break}"slice_layer_without_partitioning_rbsp_idr"===Gi(31&i[n+3])&&(r=!0),n=s-2,s+=3;break;default:s+=3}return i=i.subarray(n),s-=n,n=0,i&&i.byteLength>3&&"slice_layer_without_partitioning_rbsp_idr"===Gi(31&i[n+3])&&(r=!0),r}},Ji.aac=ve;var Ki=at.ONE_SECOND_IN_TS,Qi=188,Zi=71,ts=function(t,e,i){for(var s,n,r,o,a=0,h=Qi,l=!1;h<=t.byteLength;)if(t[a]!==Zi||t[h]!==Zi&&h!==t.byteLength)a++,h++;else{if(s=t.subarray(a,h),"pes"===Ji.ts.parseType(s,e.pid)&&(n=Ji.ts.parsePesType(s,e.table),r=Ji.ts.parsePayloadUnitStartIndicator(s),"audio"===n&&r&&(o=Ji.ts.parsePesTime(s))&&(o.type="audio",i.audio.push(o),l=!0)),l)break;a+=Qi,h+=Qi}for(a=(h=t.byteLength)-Qi,l=!1;a>=0;)if(t[a]!==Zi||t[h]!==Zi&&h!==t.byteLength)a--,h--;else{if(s=t.subarray(a,h),"pes"===Ji.ts.parseType(s,e.pid)&&(n=Ji.ts.parsePesType(s,e.table),r=Ji.ts.parsePayloadUnitStartIndicator(s),"audio"===n&&r&&(o=Ji.ts.parsePesTime(s))&&(o.type="audio",i.audio.push(o),l=!0)),l)break;a-=Qi,h-=Qi}},es=function(t,e,i){for(var s,n,r,o,a,h,l,u=0,c=Qi,d=!1,f={data:[],size:0};c<t.byteLength;)if(t[u]!==Zi||t[c]!==Zi)u++,c++;else{if(s=t.subarray(u,c),"pes"===Ji.ts.parseType(s,e.pid)&&(n=Ji.ts.parsePesType(s,e.table),r=Ji.ts.parsePayloadUnitStartIndicator(s),"video"===n&&(r&&!d&&(o=Ji.ts.parsePesTime(s))&&(o.type="video",i.video.push(o),d=!0),!i.firstKeyFrame))){if(r&&0!==f.size){for(a=new Uint8Array(f.size),h=0;f.data.length;)l=f.data.shift(),a.set(l,h),h+=l.byteLength;if(Ji.ts.videoPacketContainsKeyFrame(a)){var p=Ji.ts.parsePesTime(a);p?(i.firstKeyFrame=p,i.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}f.size=0}f.data.push(s),f.size+=s.byteLength}if(d&&i.firstKeyFrame)break;u+=Qi,c+=Qi}for(u=(c=t.byteLength)-Qi,d=!1;u>=0;)if(t[u]!==Zi||t[c]!==Zi)u--,c--;else{if(s=t.subarray(u,c),"pes"===Ji.ts.parseType(s,e.pid)&&(n=Ji.ts.parsePesType(s,e.table),r=Ji.ts.parsePayloadUnitStartIndicator(s),"video"===n&&r&&(o=Ji.ts.parsePesTime(s))&&(o.type="video",i.video.push(o),d=!0)),d)break;u-=Qi,c-=Qi}},is=function(t,e){var i;return i=Ji.aac.isLikelyAacData(t)?function(t){for(var e,i=!1,s=0,n=null,r=null,o=0,a=0;t.length-a>=3;){switch(Ji.aac.parseType(t,a)){case"timed-metadata":if(t.length-a<10){i=!0;break}if((o=Ji.aac.parseId3TagSize(t,a))>t.length){i=!0;break}null===r&&(e=t.subarray(a,a+o),r=Ji.aac.parseAacTimestamp(e)),a+=o;break;case"audio":if(t.length-a<7){i=!0;break}if((o=Ji.aac.parseAdtsSize(t,a))>t.length){i=!0;break}null===n&&(e=t.subarray(a,a+o),n=Ji.aac.parseSampleRate(e)),s++,a+=o;break;default:a++}if(i)return null}if(null===n||null===r)return null;var h=Ki/n;return{audio:[{type:"audio",dts:r,pts:r},{type:"audio",dts:r+1024*s*h,pts:r+1024*s*h}]}}(t):function(t){var e={pid:null,table:null},i={};for(var s in function(t,e){for(var i,s=0,n=Qi;n<t.byteLength;)if(t[s]!==Zi||t[n]!==Zi)s++,n++;else{switch(i=t.subarray(s,n),Ji.ts.parseType(i,e.pid)){case"pat":e.pid=Ji.ts.parsePat(i);break;case"pmt":var r=Ji.ts.parsePmt(i);e.table=e.table||{},Object.keys(r).forEach((function(t){e.table[t]=r[t]}))}s+=Qi,n+=Qi}}(t,e),e.table)if(e.table.hasOwnProperty(s))switch(e.table[s]){case Yi.H264_STREAM_TYPE:i.video=[],es(t,e,i),0===i.video.length&&delete i.video;break;case Yi.ADTS_STREAM_TYPE:i.audio=[],ts(t,e,i),0===i.audio.length&&delete i.audio}return i}(t),i&&(i.audio||i.video)?(function(t,e){if(t.audio&&t.audio.length){var i=e;(void 0===i||isNaN(i))&&(i=t.audio[0].dts),t.audio.forEach((function(t){t.dts=Wi(t.dts,i),t.pts=Wi(t.pts,i),t.dtsTime=t.dts/Ki,t.ptsTime=t.pts/Ki}))}if(t.video&&t.video.length){var s=e;if((void 0===s||isNaN(s))&&(s=t.video[0].dts),t.video.forEach((function(t){t.dts=Wi(t.dts,s),t.pts=Wi(t.pts,s),t.dtsTime=t.dts/Ki,t.ptsTime=t.pts/Ki})),t.firstKeyFrame){var n=t.firstKeyFrame;n.dts=Wi(n.dts,s),n.pts=Wi(n.pts,s),n.dtsTime=n.dts/Ki,n.ptsTime=n.pts/Ki}}}(i,e),i):null};class ss{constructor(t,e){this.options=e||{},this.self=t,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new Xe.Transmuxer(this.options),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(){t.postMessage({action:"done"})})),e.on("gopInfo",(function(e){t.postMessage({action:"gopInfo",gopInfo:e})})),e.on("videoSegmentTimingInfo",(function(e){const i={start:{decode:at.videoTsToSeconds(e.start.dts),presentation:at.videoTsToSeconds(e.start.pts)},end:{decode:at.videoTsToSeconds(e.end.dts),presentation:at.videoTsToSeconds(e.end.pts)},baseMediaDecodeTime:at.videoTsToSeconds(e.baseMediaDecodeTime)};e.prependedContentDuration&&(i.prependedContentDuration=at.videoTsToSeconds(e.prependedContentDuration)),t.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:i})})),e.on("audioSegmentTimingInfo",(function(e){const i={start:{decode:at.videoTsToSeconds(e.start.dts),presentation:at.videoTsToSeconds(e.start.pts)},end:{decode:at.videoTsToSeconds(e.end.dts),presentation:at.videoTsToSeconds(e.end.pts)},baseMediaDecodeTime:at.videoTsToSeconds(e.baseMediaDecodeTime)};e.prependedContentDuration&&(i.prependedContentDuration=at.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:at.videoTsToSeconds(e.start),end:at.videoTsToSeconds(e.end)}})})),e.on("videoTimingInfo",(function(e){t.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:at.videoTsToSeconds(e.start),end:at.videoTsToSeconds(e.end)}})})),e.on("log",(function(e){t.postMessage({action:"log",log:e})}))}(this.self,this.transmuxer)}pushMp4Captions(t){this.captionParser||(this.captionParser=new _i,this.captionParser.init());const e=new Uint8Array(t.data,t.byteOffset,t.byteLength),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])}initMp4WebVttParser(t){this.webVttParser||(this.webVttParser=new qi);const e=new Uint8Array(t.data,t.byteOffset,t.byteLength);this.webVttParser.init(e)}getMp4WebVttText(t){this.webVttParser||(this.webVttParser=new qi);const e=new Uint8Array(t.data,t.byteOffset,t.byteLength),i=this.webVttParser.parseSegment(e);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:i||[],data:e.buffer},[e.buffer])}probeMp4StartTime({timescales:t,data:e}){const i=Si.startTime(t,e);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:e},[e.buffer])}probeMp4Tracks({data:t}){const e=Si.tracks(t);this.self.postMessage({action:"probeMp4Tracks",tracks:e,data:t},[t.buffer])}probeEmsgID3({data:t,offset:e}){const i=Si.getEmsgID3(t,e);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:t},[t.buffer])}probeTs({data:t,baseStartTime:e}){const i="number"!=typeof e||isNaN(e)?void 0:e*at.ONE_SECOND_IN_TS,s=is(t,i);let n=null;s&&(n={hasVideo:s.video&&2===s.video.length||!1,hasAudio:s.audio&&2===s.audio.length||!1},n.hasVideo&&(n.videoStart=s.video[0].ptsTime),n.hasAudio&&(n.audioStart=s.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:n,data:t},[t.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){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){this.transmuxer.setBaseMediaDecodeTime(Math.round(at.secondsToVideoTs(t.timestampOffset||0)))}setAudioAppendStart(t){this.transmuxer.setAudioAppendStart(Math.ceil(at.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){"init"===t.data.action&&t.data.options?this.messageHandlers=new ss(self,t.data.options):(this.messageHandlers||(this.messageHandlers=new ss(self)),t.data&&t.data.action&&"init"!==t.data.action&&this.messageHandlers[t.data.action]&&this.messageHandlers[t.data.action](t.data))}})));var Zh=Wh(Qh);const tl=t=>{const{transmuxer:e,bytes:i,audioAppendStart:s,gopsToAlignWith:n,remux:r,onData:o,onTrackInfo:a,onAudioTimingInfo:h,onVideoTimingInfo:l,onVideoSegmentTimingInfo:u,onAudioSegmentTimingInfo:c,onId3:d,onCaptions:f,onDone:p,onEndedTimeline:v,onTransmuxerLog:m,isEndOfTimeline:g,segment:y,triggerSegmentEventFn:b}=t,j={buffer:[]};let w=g;if(e.onmessage=i=>{e.currentTransmux===t&&("data"===i.data.action&&((t,e,i)=>{const{type:s,initSegment:n,captions:r,captionStreams:o,metadata:a,videoFrameDtsTime:h,videoFramePtsTime:l}=t.data.segment;e.buffer.push({captions:r,captionStreams:o,metadata:a});const u=t.data.segment.boxes||{data:t.data.segment.data},c={type:s,data:new Uint8Array(u.data,u.data.byteOffset,u.data.byteLength),initSegment:new Uint8Array(n.data,n.byteOffset,n.byteLength)};void 0!==h&&(c.videoFrameDtsTime=h),void 0!==l&&(c.videoFramePtsTime=l),i(c)})(i,j,o),"trackinfo"===i.data.action&&a(i.data.trackInfo),"gopInfo"===i.data.action&&((t,e)=>{e.gopInfo=t.data.gopInfo})(i,j),"audioTimingInfo"===i.data.action&&h(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&l(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&u(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&c(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&d([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&f(i.data.caption),"endedtimeline"===i.data.action&&(w=!1,v()),"log"===i.data.action&&m(i.data.log),"transmuxed"===i.data.type&&(w||(e.onmessage=null,(({transmuxedData:t,callback:e})=>{t.buffer=[],e(t)})({transmuxedData:j,callback:p}),el(e))))},e.onerror=()=>{const t={message:"Received an error message from the transmuxer worker",metadata:{errorType:Sa.Error.StreamingFailedToTransmuxSegment,segmentInfo:Pl({segment:y})}};p(null,t)},s&&e.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(n)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:n}),void 0!==r&&e.postMessage({action:"setRemux",remux:r}),i.byteLength){const t=i instanceof ArrayBuffer?i:i.buffer,s=i instanceof ArrayBuffer?0:i.byteOffset;b({type:"segmenttransmuxingstart",segment:y}),e.postMessage({action:"push",data:t,byteOffset:s,byteLength:i.byteLength},[t])}g&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},el=t=>{t.currentTransmux=null,t.transmuxQueue.length&&(t.currentTransmux=t.transmuxQueue.shift(),"function"==typeof t.currentTransmux?t.currentTransmux():tl(t.currentTransmux))},il=(t,e)=>{t.postMessage({action:e}),el(t)};var sl=t=>{((t,e)=>{if(!e.currentTransmux)return e.currentTransmux=t,void il(e,t);e.transmuxQueue.push(il.bind(null,e,t))})("reset",t)};const nl=function(t){const e=t.transmuxer,i=t.endAction||t.action,s=t.callback,n=b({},t,{endAction:null,transmuxer:null,callback:null}),r=n=>{n.data.action===i&&(e.removeEventListener("message",r),n.data.data&&(n.data.data=new Uint8Array(n.data.data,t.byteOffset||0,t.byteLength||n.data.data.byteLength),t.data&&(t.data=n.data.data)),s(n.data))};if(e.addEventListener("message",r),t.data){const i=t.data instanceof ArrayBuffer;n.byteOffset=i?0:t.data.byteOffset,n.byteLength=t.data.byteLength,e.postMessage(n,[i?t.data:t.data.buffer])}else e.postMessage(n)},rl=-101,ol=-102,al="wvtt",hl=t=>{t.forEach((t=>{t.abort()}))},ll=(t,e)=>{const{requestType:i}=e,s=fh({requestType:i,request:e,error:t});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:rl,xhr:e,metadata:s}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:ol,xhr:e,metadata:s}:t?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:2,xhr:e,metadata:s}:"arraybuffer"===e.responseType&&0===e.response.byteLength?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:2,xhr:e,metadata:s}:null},ul=(t,e,i,s)=>(n,r)=>{const o=r.response,a=ll(n,r);if(a)return i(a,t);if(16!==o.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:2,xhr:r},t);const h=new DataView(o),l=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=l;return s({type:"segmentkeyloadcomplete",segment:t,keyInfo:{uri:r.uri}}),i(null,t)},cl=(t,e)=>{const i=ri(t.map.bytes);if("mp4"!==i){const s=i||"unknown";return e({internal:!0,message:`Found unsupported ${s} container for initialization segment at URL: ${t.map.resolvedUri||t.map.uri}`,code:2,metadata:{mediaType:s}})}nl({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||{},t.map.tracks[e.type]||(t.map.tracks[e.type]=e,"number"==typeof e.id&&e.timescale&&(t.map.timescales=t.map.timescales||{},t.map.timescales[e.id]=e.timescale),"text"===e.type&&((t,e)=>{e===al&&t.transmuxer.postMessage({action:"initMp4WebVttParser",data:t.map.bytes})})(t,e.codec))})),e(null))})},dl=({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:l,dataFn:u,doneFn:c,onTransmuxerLog:d,triggerSegmentEventFn:f})=>{const p=t.map&&t.map.tracks||{},v=Boolean(p.audio&&p.video);let m=s.bind(null,t,"audio","start");const g=s.bind(null,t,"audio","end");let y=s.bind(null,t,"video","start");const b=s.bind(null,t,"video","end");nl({action:"probeTs",transmuxer:t.transmuxer,data:e,baseStartTime:t.baseStartTime,callback:s=>{t.bytes=e=s.data;const p=s.result;p&&(i(t,{hasAudio:p.hasAudio,hasVideo:p.hasVideo,isMuxed:v}),i=null),(t=>{if(!t.transmuxer.currentTransmux)return t.transmuxer.currentTransmux=t,void tl(t);t.transmuxer.transmuxQueue.push(t)})({bytes:e,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:v,onData:e=>{e.type="combined"===e.type?"video":e.type,u(t,e)},onTrackInfo:e=>{i&&(v&&(e.isMuxed=!0),i(t,e))},onAudioTimingInfo:t=>{m&&void 0!==t.start&&(m(t.start),m=null),g&&void 0!==t.end&&g(t.end)},onVideoTimingInfo:t=>{y&&void 0!==t.start&&(y(t.start),y=null),b&&void 0!==t.end&&b(t.end)},onVideoSegmentTimingInfo:e=>{f({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:{pts:{start:e.start.presentation,end:e.end.presentation},dts:{start:e.start.decode,end:e.end.decode}}}),n(e)},onAudioSegmentTimingInfo:e=>{f({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:{pts:{start:e.start.pts,end:e.end.pts},dts:{start:e.start.dts,end:e.end.dts}}}),r(e)},onId3:(e,i)=>{o(t,e,i)},onCaptions:e=>{a(t,[e])},isEndOfTimeline:h,onEndedTimeline:()=>{l()},onTransmuxerLog:d,onDone:(e,i)=>{c&&(e.type="combined"===e.type?"video":e.type,f({type:"segmenttransmuxingcomplete",segment:t}),c(i,t,e))},segment:t,triggerSegmentEventFn:f})}})},fl=({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:l,dataFn:u,doneFn:c,onTransmuxerLog:d,triggerSegmentEventFn:f})=>{let p=new Uint8Array(e);if(function(t){return Ue(t,["moof"]).length>0}(p)){t.isFmp4=!0;const{tracks:n}=t.map;if(n.text&&(!n.audio||!n.video))return u(t,{data:p,type:"text"}),void((t,e,i)=>{e===al&&nl({action:"getMp4WebVttText",data:t.bytes,transmuxer:t.transmuxer,callback:({data:e,mp4VttCues:s})=>{t.bytes=e,i(null,t,{mp4VttCues:s})}})})(t,n.text.codec,c);const r={isFmp4:!0,hasVideo:!!n.video,hasAudio:!!n.audio};n.audio&&n.audio.codec&&"enca"!==n.audio.codec&&(r.audioCodec=n.audio.codec),n.video&&n.video.codec&&"encv"!==n.video.codec&&(r.videoCodec=n.video.codec),n.video&&n.audio&&(r.isMuxed=!0),i(t,r);const h=(e,i)=>{u(t,{data:p,type:r.hasAudio&&!r.isMuxed?"audio":"video"}),i&&i.length&&o(t,i),e&&e.length&&a(t,e),c(null,t,{})};nl({action:"probeMp4StartTime",timescales:t.map.timescales,data:p,transmuxer:t.transmuxer,callback:({data:i,startTime:o})=>{e=i.buffer,t.bytes=p=i,r.hasAudio&&!r.isMuxed&&s(t,"audio","start",o),r.hasVideo&&s(t,"video","start",o),nl({action:"probeEmsgID3",data:p,transmuxer:t.transmuxer,offset:o,callback:({emsgData:i,id3Frames:s})=>{e=i.buffer,t.bytes=p=i,n.video&&i.byteLength&&t.transmuxer?nl({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){d(Na(t,{stream:"mp4CaptionParser"}))})),h(i.captions,s)}}):h(void 0,s)}})}})}else if(t.transmuxer){if(void 0===t.container&&(t.container=ri(p)),"ts"!==t.container&&"aac"!==t.container)return i(t,{hasAudio:!1,hasVideo:!1}),void c(null,t,{});dl({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:l,dataFn:u,doneFn:c,onTransmuxerLog:d,triggerSegmentEventFn:f})}else c(null,t,{})},pl=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))}};let h;s.onerror=()=>{const t="An error occurred in the decryption worker",e=Pl({segment:n}),i={message:t,metadata:{error:new Error(t),errorType:Sa.Error.StreamingFailedToDecryptSegment,segmentInfo:e,keyInfo:{uri:n.key.resolvedUri||n.map.key.resolvedUri}}};r(i,n)},s.addEventListener("message",a),h=e.bytes.slice?e.bytes.slice():new Uint32Array(Array.prototype.slice.call(e.bytes)),s.postMessage(Ph({source:t,encrypted:i,key:h,iv:e.iv}),[i.buffer,h.buffer])},vl=({xhr:t,xhrOptions:e,decryptionWorker:i,segment:s,abortFn:n,progressFn:r,trackInfoFn:o,timingInfoFn:a,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:c,isEndOfTimeline:d,endedTimelineFn:f,dataFn:p,doneFn:v,onTransmuxerLog:m,triggerSegmentEventFn:g})=>{const y=[],b=(({activeXhrs:t,decryptionWorker:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:l,dataFn:u,doneFn:c,onTransmuxerLog:d,triggerSegmentEventFn:f})=>{let p=0,v=!1;return(m,g)=>{if(!v){if(m)return v=!0,hl(t),c(m,g);if(p+=1,p===t.length){const p=function(){if(g.encryptedBytes)return(({decryptionWorker:t,segment:e,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:l,dataFn:u,doneFn:c,onTransmuxerLog:d,triggerSegmentEventFn:f})=>{f({type:"segmentdecryptionstart"}),pl({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:t,segment:e,doneFn:c},(t=>{e.bytes=t,f({type:"segmentdecryptioncomplete",segment:e}),fl({segment:e,bytes:e.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:l,dataFn:u,doneFn:c,onTransmuxerLog:d,triggerSegmentEventFn:f})}))})({decryptionWorker:e,segment:g,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:l,dataFn:u,doneFn:c,onTransmuxerLog:d,triggerSegmentEventFn:f});fl({segment:g,bytes:g.bytes,trackInfoFn:i,timingInfoFn:s,videoSegmentTimingInfoFn:n,audioSegmentTimingInfoFn:r,id3Fn:o,captionsFn:a,isEndOfTimeline:h,endedTimelineFn:l,dataFn:u,doneFn:c,onTransmuxerLog:d,triggerSegmentEventFn:f})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return f({type:"segmentdecryptionstart",segment:g}),pl({decryptionWorker:e,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key,segment:g,doneFn:c},(e=>{g.map.bytes=e,f({type:"segmentdecryptioncomplete",segment:g}),cl(g,(e=>{if(e)return hl(t),c(e,g);p()}))}));p()}}}})({activeXhrs:y,decryptionWorker:i,trackInfoFn:o,timingInfoFn:a,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:c,isEndOfTimeline:d,endedTimelineFn:f,dataFn:p,doneFn:v,onTransmuxerLog:m,triggerSegmentEventFn:g});if(s.key&&!s.key.bytes){const i=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&i.push(s.map.key);const n=Na(e,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),r=ul(s,i,b,g);g({type:"segmentkeyloadstart",segment:s,keyInfo:{uri:s.key.resolvedUri}});const o=t(n,r);y.push(o)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){const i=Na(e,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),n=ul(s,[s.map.key],b,g);g({type:"segmentkeyloadstart",segment:s,keyInfo:{uri:s.map.key.resolvedUri}});const r=t(i,n);y.push(r)}const i=Na(e,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:Nh(s.map),requestType:"segment-media-initialization"}),n=(({segment:t,finishProcessingFn:e,triggerSegmentEventFn:i})=>(s,n)=>{const r=ll(s,n);if(r)return e(r,t);const o=new Uint8Array(n.response);if(i({type:"segmentloaded",segment:t}),t.map.key)return t.map.encryptedBytes=o,e(null,t);t.map.bytes=o,cl(t,(function(i){if(i)return i.xhr=n,i.status=n.status,e(i,t);e(null,t)}))})({segment:s,finishProcessingFn:b,triggerSegmentEventFn:g});g({type:"segmentloadstart",segment:s});const r=t(i,n);y.push(r)}const j=Na(e,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:Nh(s),requestType:"segment"}),w=(({segment:t,finishProcessingFn:e,responseType:i,triggerSegmentEventFn:s})=>(n,r)=>{const o=ll(n,r);if(o)return e(o,t);s({type:"segmentloaded",segment:t});const a="arraybuffer"!==i&&r.responseText?(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})(r.responseText.substring(t.lastReachedChar||0)):r.response;return t.stats=(t=>({bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0}))(r),t.key?t.encryptedBytes=new Uint8Array(a):t.bytes=new Uint8Array(a),e(null,t)})({segment:s,finishProcessingFn:b,responseType:j.responseType,triggerSegmentEventFn:g});g({type:"segmentloadstart",segment:s});const T=t(j,w);T.addEventListener("progress",(({segment:t,progressFn:e})=>i=>{if(!i.target.aborted)return t.stats=Na(t.stats,(t=>{const e=t.target,i={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return i.bytesReceived=t.loaded,i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3),i})(i)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),e(i,t)})({segment:s,progressFn:r,trackInfoFn:o,timingInfoFn:a,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:l,id3Fn:u,captionsFn:c,isEndOfTimeline:d,endedTimelineFn:f,dataFn:p})),y.push(T);const S={};return y.forEach((t=>{t.addEventListener("loadend",(({loadendState:t,abortFn:e})=>i=>{i.target.aborted&&e&&!t.calledAbortFn&&(e(),t.calledAbortFn=!0)})({loadendState:S,abortFn:n}))})),()=>hl(y)},ml=Ca("PlaylistSelector"),gl=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||""})},yl=function(t,e){if(!t)return"";const i=p.getComputedStyle(t);return i?i[e]:""},bl=function(t,e){const i=t.slice();t.sort((function(t,s){const n=e(t,s);return 0===n?i.indexOf(t)-i.indexOf(s):n}))},jl=function(t,e){let i,s;return t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),i=i||p.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(s=e.attributes.BANDWIDTH),s=s||p.Number.MAX_VALUE,i-s};let wl=function(t){const{main:e,bandwidth:i,playerWidth:s,playerHeight:n,playerObjectFit:r,limitRenditionByPlayerDimensions:o,playlistController:a}=t;if(!e)return;const h={bandwidth:i,width:s,height:n,limitRenditionByPlayerDimensions:o};let l=e.playlists;rh.isAudioOnly(e)&&(l=a.getAudioTrackPlaylists_(),h.audioOnly=!0);let u=l.map((t=>{let e;return e=t.attributes&&t.attributes.BANDWIDTH,e=e||p.Number.MAX_VALUE,{bandwidth:e,width:t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width,height:t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height,playlist:t}}));bl(u,((t,e)=>t.bandwidth-e.bandwidth)),u=u.filter((t=>!rh.isIncompatible(t.playlist)));let c=u.filter((t=>rh.isEnabled(t.playlist)));c.length||(c=u.filter((t=>!rh.isDisabled(t.playlist))));const d=c.filter((t=>t.bandwidth*Gh.BANDWIDTH_VARIANCE<i));let f=d[d.length-1];const v=d.filter((t=>t.bandwidth===f.bandwidth))[0];if(!1===o){const t=v||c[0]||u[0];if(t&&t.playlist){let e="sortedPlaylistReps";return v&&(e="bandwidthBestRep"),c[0]&&(e="enabledPlaylistReps"),ml(`choosing ${gl(t)} using ${e} with options`,h),t.playlist}return ml("could not choose a playlist with options",h),null}const m=d.filter((t=>t.width&&t.height));bl(m,((t,e)=>t.width-e.width));const g=m.filter((t=>t.width===s&&t.height===n));f=g[g.length-1];const y=g.filter((t=>t.bandwidth===f.bandwidth))[0];let b,j,w,T;if(y||(b=m.filter((t=>"cover"===r?t.width>s&&t.height>n:t.width>s||t.height>n)),j=b.filter((t=>t.width===b[0].width&&t.height===b[0].height)),f=j[j.length-1],w=j.filter((t=>t.bandwidth===f.bandwidth))[0]),a.leastPixelDiffSelector){const t=m.map((t=>(t.pixelDiff=Math.abs(t.width-s)+Math.abs(t.height-n),t)));bl(t,((t,e)=>t.pixelDiff===e.pixelDiff?e.bandwidth-t.bandwidth:t.pixelDiff-e.pixelDiff)),T=t[0]}const S=T||w||y||v||c[0]||u[0];if(S&&S.playlist){let t="sortedPlaylistReps";return T?t="leastPixelDiffRep":w?t="resolutionPlusOneRep":y?t="resolutionBestRep":v?t="bandwidthBestRep":c[0]&&(t="enabledPlaylistReps"),ml(`choosing ${gl(S)} using ${t} with options`,h),S.playlist}return ml("could not choose a playlist with options",h),null};const Tl=function(){let t=this.useDevicePixelRatio&&p.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(t=this.customPixelRatio),wl({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(yl(this.tech_.el(),"width"),10)*t,playerHeight:parseInt(yl(this.tech_.el(),"height"),10)*t,playerObjectFit:this.usePlayerObjectFit?yl(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})};function Sl(t){try{return new URL(t).pathname.split("/").slice(-2).join("/")}catch(t){return""}}const kl={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"},xl=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),Al=(t,e,i)=>{t.metadataTrack_||(t.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,Sa.browser.IS_ANY_SAFARI||(t.metadataTrack_.inBandMetadataTrackDispatchType=e))},El=function(t,e,i){let s,n;if(i&&i.cues)for(s=i.cues.length;s--;)n=i.cues[s],n.startTime>=t&&n.endTime<=e&&i.removeCue(n)},Il=t=>"number"==typeof t&&isFinite(t),Dl=1/60,Cl=t=>{const{startOfSegment:e,duration:i,segment:s,part:n,playlist:{mediaSequence:r,id:o,segments:a=[]},mediaIndex:h,partIndex:l,timeline:u}=t,c=a.length-1;let d="mediaIndex/partIndex increment";t.getMediaInfoForTime?d=`getMediaInfoForTime (${t.getMediaInfoForTime})`:t.isSyncRequest&&(d="getSyncSegmentCandidate (isSyncRequest)"),t.independent&&(d+=` with independent ${t.independent}`);const f="number"==typeof l,p=t.segment.uri?"segment":"pre-segment",v=f?Ha({preloadSegment:s})-1:0;return`${p} [${r+h}/${r+c}]`+(f?` part [${l}/${v}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(f?` part start/end [${n.start} => ${n.end}]`:"")+` startOfSegment [${e}]`+` duration [${i}]`+` timeline [${u}]`+` selected by [${d}]`+` playlist [${o}]`},Nl=t=>`${t}TimingInfo`,Ml=({timelineChangeController:t,currentTimeline:e,segmentTimeline:i,loaderType:s,audioDisabled:n})=>{if(e===i)return!1;if("audio"===s){const e=t.lastTimelineChange({type:"main"});return!e||e.to!==i}if("main"===s&&n){const e=t.pendingTimelineChange({type:"audio"});return!e||e.to!==i}return!1},Ol=t=>{const e=t.pendingSegment_;if(e&&Ml({timelineChangeController:t.timelineChangeController_,currentTimeline:t.currentTimeline_,segmentTimeline:e.timeline,loaderType:t.loaderType_,audioDisabled:t.audioDisabled_})&&(t=>{if(!t)return!1;const e=t.pendingTimelineChange({type:"audio"}),i=t.pendingTimelineChange({type:"main"}),s=e&&i;return!(!s||-1===e.from||-1===i.from||!s||e.to===i.to)})(t.timelineChangeController_)){if((t=>{const e=t.timelineChangeController_.pendingTimelineChange({type:"audio"}),i=t.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&i&&e.to<i.to})(t))return void t.timelineChangeController_.trigger("audioTimelineBehind");t.timelineChangeController_.trigger("fixBadTimelineChange")}},Rl=({segmentDuration:t,maxDuration:e})=>!!t&&Math.round(t)>e+Oa,Pl=({type:t,segment:e})=>{if(!e)return;const i=Boolean(e.key||e.map&&e.map.ke),s=Boolean(e.map&&!e.map.bytes);return{type:t||e.type,uri:e.resolvedUri||e.uri,start:void 0===e.startOfSegment?e.start:e.startOfSegment,duration:e.duration,isEncrypted:i,isMediaInitialization:s}};class _l extends Sa.EventTarget{constructor(t,e={}){if(super(),!t)throw new TypeError("Initialization settings are required");if("function"!=typeof t.currentTime)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_=!0,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_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=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",(()=>{this.isEndOfStream_()||(this.ended_=!1)})),this.fetchAtBuffer_=!1,this.logger_=Ca(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(t){t!==this.state_&&(this.logger_(`${this.state_} -> ${t}`),this.state_=t,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",(()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ol(this)})),this.sourceUpdater_.on("codecschange",(t=>{this.trigger(b({type:"codecschange"},t))})),"main"===this.loaderType_&&this.timelineChangeController_.on("pendingtimelinechange",(()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ol(this)})),"audio"===this.loaderType_&&this.timelineChangeController_.on("timelinechange",(t=>{this.trigger(b({type:"timelinechange"},t)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():Ol(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ol(this)}))}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return(t=>{const e=new Zh;e.currentTransmux=null,e.transmuxQueue=[];const i=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,i.call(e)),e.postMessage({action:"init",options:t}),e})({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&p.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(t){this.audioDisabled_=!t,t?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if("WAITING"!==this.state)return this.pendingSegment_&&(this.pendingSegment_=null),void this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,p.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(t){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==t:(this.state="READY",!0)}error(t){return void 0!==t&&(this.logger_("error occurred:",t),this.error_=t),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&sl(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const t=this.getMediaInfo_();if(!this.sourceUpdater_||!t)return Ma();if("main"===this.loaderType_){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=!1){if(!t)return null;const i=_h(t);let s=this.initSegments_[i];return e&&!s&&t.bytes&&(this.initSegments_[i]=s={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:t.bytes,tracks:t.tracks,timescales:t.timescales}),s||t}segmentKey(t,e=!1){if(!t)return null;const i=Lh(t);let s=this.keyCache_[i];this.cacheEncryptionKeys_&&e&&!s&&t.bytes&&(this.keyCache_[i]=s={resolvedUri:t.resolvedUri,bytes:t.bytes});const n={resolvedUri:(s||t).resolvedUri};return s&&(n.bytes=s.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(t,e={}){if(!t)return;if(this.playlist_&&this.playlist_.endList&&t.endList&&this.playlist_.uri===t.uri)return;const i=this.playlist_,s=this.pendingSegment_;this.playlist_=t,this.xhrOptions_=e,"INIT"===this.state&&(t.syncInfo={mediaSequence:t.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(t));let n=null;if(i&&(i.id?n=i.id:i.uri&&(n=i.uri)),this.logger_(`playlist update [${n} => ${t.id||t.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(t,this.currentTime_()),this.logger_(`Playlist update:\ncurrentTime: ${this.currentTime_()}\nbufferedEnd: ${Ba(this.buffered_())}\n`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==t.uri)return null!==this.mediaIndex&&(t.endList||"number"!=typeof t.partTargetDuration?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");const r=t.mediaSequence-i.mediaSequence;if(this.logger_(`live window shift [${r}]`),null!==this.mediaIndex)if(this.mediaIndex-=r,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}}s&&(s.mediaIndex-=r,s.mediaIndex<0?(s.mediaIndex=null,s.partIndex=null):(s.mediaIndex>=0&&(s.segment=t.segments[s.mediaIndex]),s.partIndex>=0&&s.segment.parts&&(s.part=s.segment.parts[s.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,t)}pause(){this.checkBufferTimeout_&&(p.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return null===this.checkBufferTimeout_}resetEverything(t){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,t),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&sl(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,"hls"===this.sourceType_&&!(this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4)&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(t,e,i=()=>{},s=!1){if(e===1/0&&(e=this.duration_()),e<=t)return void this.logger_("skipping remove because end ${end} is <= start ${start}");if(!this.sourceUpdater_||!this.getMediaInfo_())return void this.logger_("skipping remove because no source updater or starting media info");let n=1;const r=()=>{n--,0===n&&i()};!s&&this.audioDisabled_||(n++,this.sourceUpdater_.removeAudio(t,e,r)),(s||"main"===this.loaderType_)&&(this.gopBuffer_=((t,e,i,s)=>{const n=Math.ceil((e-s)*oi.ONE_SECOND_IN_TS),r=Math.ceil((i-s)*oi.ONE_SECOND_IN_TS),o=t.slice();let a=t.length;for(;a--&&!(t[a].pts<=r););if(-1===a)return o;let h=a+1;for(;h--&&!(t[h].pts<=n););return h=Math.max(h,0),o.splice(h,a-h+1),o})(this.gopBuffer_,t,e,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(t,e,r));for(const i in this.inbandTextTracks_)El(t,e,this.inbandTextTracks_[i]);El(t,e,this.segmentMetadataTrack_),r()}monitorBuffer_(){this.checkBufferTimeout_&&p.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=p.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&p.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=p.setTimeout(this.monitorBufferTick_.bind(this),500)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const t=this.chooseNextRequest_();if(!t)return;const e={segmentInfo:Pl({type:this.loaderType_,segment:t})};this.trigger({type:"segmentselected",metadata:e}),"number"==typeof t.timestampOffset&&(this.isPendingTimestampOffset_=!1,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!1;const s="number"==typeof t&&e.segments[t];return e.endList&&"open"===this.mediaSource_.readyState&&t+1===e.segments.length&&(!s||!s.parts||i+1===s.parts.length)}chooseNextRequest_(){const t=this.buffered_(),e=Ba(t)||0,i=Ua(t,this.currentTime_()),s=!this.hasPlayed_()&&i>=1,n=i>=this.goalBufferLength_(),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=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,n>i))return r}return 0===s.length?0:s[s.length-1]}(this.currentTimeline_,r,e),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(null!==this.mediaIndex){const t=r[this.mediaIndex],i="number"==typeof this.partIndex?this.partIndex:-1;o.startOfSegment=t.end?t.end:e,t.parts&&t.parts[i+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=i+1):o.mediaIndex=this.mediaIndex+1}else{let t,i,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),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const e=this.getSyncInfoFromMediaSequenceSync_(n);if(!e){const t="No sync info found while using media sequence sync";return this.error({message:t,metadata:{errorType:Sa.Error.StreamingFailedToSelectNextSegment,error:new Error(t)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),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=rh.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&&"number"==typeof o.partIndex&&a.parts&&a.parts[o.partIndex];if(!a||"number"==typeof o.partIndex&&!h)return null;if("number"!=typeof o.partIndex&&a.parts&&(o.partIndex=0,h=a.parts[0]),!i&&h&&!(this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments)&&!h.independent)if(0===o.partIndex){const t=r[o.mediaIndex-1],e=t.parts&&t.parts.length&&t.parts[t.parts.length-1];e&&e.independent&&(o.mediaIndex-=1,o.partIndex=t.parts.length-1,o.independent="previous segment")}else a.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");return o.mediaIndex>=r.length-1&&this.mediaSource_&&"ended"===this.mediaSource_.readyState&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(t){if(!this.mediaSequenceSync_)return null;const e=Math.max(t,this.mediaSequenceSync_.start);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);return s?(s.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),s):null}generateSegmentInfo_(t){const{independent:e,playlist:i,mediaIndex:s,startOfSegment:n,isSyncRequest:r,partIndex:o,forceTimestampOffset:a,getMediaInfoForTime:h}=t,l=i.segments[s],u="number"==typeof o&&l.parts[o],c={requestId:"segment-loader-"+Math.random(),uri:u&&u.resolvedUri||l.resolvedUri,mediaIndex:s,partIndex:u?o:null,isSyncRequest:r,startOfSegment:n,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:u&&u.duration||l.duration,segment:l,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:h,independent:e},d=void 0!==a?a:this.isPendingTimestampOffset_;c.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:d});const f=Ba(this.sourceUpdater_.audioBuffered());return"number"==typeof f&&(c.audioAppendStart=f-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(c.gopsToAlignWith=((t,e)=>{if(null==e||!t.length)return[];const i=Math.ceil((e-this.timeMapping_+3)*oi.ONE_SECOND_IN_TS);let s;for(s=0;s<t.length&&!(t[s].pts>i);s++);return t.slice(s)})(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset())),c}timestampOffsetForSegment_(t){return(({segmentTimeline:t,currentTimeline:e,startOfSegment:i,buffered:s,overrideCheck:n})=>n||t!==e?t<e?i:s.length?s.end(s.length-1):i:null)(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_(),i=t.bandwidth,s=this.pendingSegment_.duration,n=rh.estimateSegmentRequestTime(s,i,this.playlist_,t.bytesReceived),r=function(t,e,i=1){return((t.length?t.end(t.length-1):0)-e)/i}(this.buffered_(),e,this.vhs_.tech_.playbackRate())-1;if(n<=r)return;const o=function(t){const{main:e,currentTime:i,bandwidth:s,duration:n,segmentDuration:r,timeUntilRebuffer:o,currentTimeline:a,syncController:h}=t,l=e.playlists.filter((t=>!rh.isIncompatible(t)));let u=l.filter(rh.isEnabled);u.length||(u=l.filter((t=>!rh.isDisabled(t))));const c=u.filter(rh.hasAttribute.bind(null,"BANDWIDTH")).map((t=>{const e=h.getSyncPoint(t,n,a,i)?1:2;return{playlist:t,rebufferingImpact:rh.estimateSegmentRequestTime(r,s,t)*e-o}})),d=c.filter((t=>t.rebufferingImpact<=0));return bl(d,((t,e)=>jl(e.playlist,t.playlist))),d.length?d[0]:(bl(c,((t,e)=>t.rebufferingImpact-e.rebufferingImpact)),c[0]||null)}({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;let a=.5;r<=Oa&&(a=1),!o.playlist||o.playlist.uri===this.playlist_.uri||n-r-o.rebufferingImpact<a||(this.bandwidth=o.playlist.attributes.BANDWIDTH*Gh.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(t){this.logger_(`Aborting ${Cl(t)}`),this.mediaRequestsAborted+=1}handleProgress_(t,e){this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId)||this.trigger("progress")}handleTrackInfo_(t,e){const{hasAudio:i,hasVideo:s}=e,n={segmentInfo:Pl({type:this.loaderType_,segment:t}),trackInfo:{hasAudio:i,hasVideo:s}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:n}),this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||this.checkForIllegalMediaSwitch(e)||(function(t,e){if(!t&&!e||!t&&e||t&&!e)return!1;if(t===e)return!0;const i=Object.keys(t).sort(),s=Object.keys(e).sort();if(i.length!==s.length)return!1;for(let n=0;n<i.length;n++){const r=i[n];if(r!==s[n])return!1;if(t[r]!==e[r])return!1}return!0}(this.currentMediaInfo_,e=e||{})||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=e,this.currentMediaInfo_=e,this.logger_("trackinfo update",e),this.trigger("trackinfo")),this.checkForAbort_(t.requestId)||(this.pendingSegment_.trackInfo=e,this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ol(this)))}handleTimingInfo_(t,e,i,s){if(this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId))return;const n=this.pendingSegment_,r=Nl(e);n[r]=n[r]||{},n[r][i]=s,this.logger_(`timinginfo: ${e} - ${i} - ${s}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():Ol(this)}handleCaptions_(t,e){if(this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId))return;if(0===e.length)return void this.logger_("SegmentLoader received no captions from a caption event");if(!this.pendingSegment_.hasAppendedData_)return void this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,t,e));const i=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),s={};e.forEach((t=>{s[t.stream]=s[t.stream]||{startTime:1/0,captions:[],endTime:0};const e=s[t.stream];e.startTime=Math.min(e.startTime,t.startTime+i),e.endTime=Math.max(e.endTime,t.endTime+i),e.captions.push(t)})),Object.keys(s).forEach((t=>{const{startTime:e,endTime:n,captions:r}=s[t],o=this.inbandTextTracks_;this.logger_(`adding cues from ${e} -> ${n} for ${t}`),function(t,e,i){if(!t[i]){e.trigger({type:"usage",name:"vhs-608"});let s=i;/^cc708_/.test(i)&&(s="SERVICE"+i.split("_")[1]);const n=e.textTracks().getTrackById(s);if(n)t[i]=n;else{let n=i,r=i,o=!1;const a=(e.options_.vhs&&e.options_.vhs.captionServices||{})[s];a&&(n=a.label,r=a.language,o=a.default),t[i]=e.addRemoteTextTrack({kind:"captions",id:s,default:o,label:n,language:r},!1).track}}}(o,this.vhs_.tech_,t),El(e,n,o[t]),function({inbandTextTracks:t,captionArray:e,timestampOffset:i}){if(!e)return;const s=p.WebKitDataCue||p.VTTCue;e.forEach((e=>{const n=e.stream;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)})):t[n].addCue(new s(e.startTime+i,e.endTime+i,e.text))}))}({captionArray:r,inbandTextTracks:o,timestampOffset:i})})),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(t,e,i){this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId)||(this.pendingSegment_.hasAppendedData_?this.addMetadataToTextTrack(i,e,this.duration_()):this.metadataQueue_.id3.push(this.handleId3_.bind(this,t,e,i)))}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("audio"!==this.loaderType_)return!0;const t=this.pendingSegment_;return!(!t||this.getCurrentMediaInfo_()&&Ml({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:t.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}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!1;if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const t=this.pendingSegment_,e=this.getCurrentMediaInfo_();if(!t||!e)return!1;const{hasAudio:i,hasVideo:s,isMuxed:n}=e;return!(s&&!t.videoTimingInfo||i&&!this.audioDisabled_&&!n&&!t.audioTimingInfo||Ml({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:t.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(t,e){if(this.earlyAbortWhenNeeded_(t.stats),this.checkForAbort_(t.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_())return Ol(this),void this.callQueue_.push(this.handleData_.bind(this,t,e));const i=this.pendingSegment_;if(this.setTimeMapping_(i.timeline),this.updateMediaSecondsLoaded_(i.part||i.segment),"closed"!==this.mediaSource_.readyState){if(t.map&&(t.map=this.initSegmentForMap(t.map,!0),i.segment.map=t.map),t.key&&this.segmentKey(t.key,!0),i.isFmp4=t.isFmp4,i.timingInfo=i.timingInfo||{},i.isFmp4)this.trigger("fmp4"),i.timingInfo.start=i[Nl(e.type)].start;else{const t=this.getCurrentMediaInfo_(),e="main"===this.loaderType_&&t&&t.hasVideo;let s;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})}if(this.updateAppendInitSegmentStatus(i,e.type),this.updateSourceBufferTimestampOffset_(i),i.isSyncRequest){this.updateTimingInfoEnd_(i),this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:"main"===this.loaderType_});const t=this.chooseNextRequest_();if(t.mediaIndex!==i.mediaIndex||t.partIndex!==i.partIndex)return void this.logger_("sync segment was incorrect, not appending");this.logger_("sync segment was correct, appending")}i.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(i,e)}}updateAppendInitSegmentStatus(t,e){"main"!==this.loaderType_||"number"!=typeof t.timestampOffset||t.changedTimestampOffset||(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[e]!==t.playlist&&(this.appendInitSegment_[e]=!0)}getInitSegmentAndUpdateState_({type:t,initSegment:e,map:i,playlist:s}){if(i){const t=_h(i);if(this.activeInitSegmentId_===t)return null;e=this.initSegmentForMap(i,!0).bytes,this.activeInitSegmentId_=t}return e&&this.appendInitSegment_[t]?(this.playlistOfLastInitSegment_[t]=s,this.appendInitSegment_[t]=!1,this.activeInitSegmentId_=null,e):null}handleQuotaExceededError_({segmentInfo:t,type:e,bytes:i},s){const n=this.sourceUpdater_.audioBuffered(),r=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+$a(n).join(", ")),r.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+$a(r).join(", "));const o=n.length?n.start(0):0,a=n.length?n.end(n.length-1):0,h=r.length?r.start(0):0,l=r.length?r.end(r.length-1):0;if(a-o<=1&&l-h<=1)return this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${i.byteLength}, audio buffer: ${$a(n).join(", ")}, video buffer: ${$a(r).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:t,type:e,bytes:i}));const u=this.currentTime_()-1;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 1s"),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=p.setTimeout((()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()}),1e3)}),!0)}handleAppendError_({segmentInfo:t,type:e,bytes:i},s){s&&(22!==s.code?(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:Sa.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:t,type:e,bytes:i}))}appendToSourceBuffer_({segmentInfo:t,type:e,initSegment:i,data:s,bytes:n}){if(!n){const t=[s];let e=s.byteLength;i&&(t.unshift(i),e+=i.byteLength),n=(t=>{let e,i=0;return t.bytes&&(e=new Uint8Array(t.bytes),t.segments.forEach((t=>{e.set(t,i),i+=t.byteLength}))),e})({bytes:e,segments:t})}const r={segmentInfo:Pl({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,n=`${t}TimingInfo`;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("audio"===i&&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){if(this.state="WAITING",this.pendingSegment_=t,this.trimBackBuffer_(t),"number"==typeof t.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_())return Ol(this),void this.loadQueue_.push((()=>{const e=b({},t,{forceTimestampOffset:!0});b(t,this.generateSegmentInfo_(e)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(t)}));this.updateTransmuxerAndRequestSegment_(t)}updateTransmuxerAndRequestSegment_(t){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),i=this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex)||null!==this.mediaIndex&&t.timeline!==this.currentTimeline_&&t.timeline>0;this.logger_(`Requesting\n${Sl(t.uri)}\n${Cl(t)}`),e.map&&!e.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),t.abortRequests=vl({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:i,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_(`${Cl(t)} logged from transmuxer stream ${s} as a ${i}: ${e}`)},triggerSegmentEventFn:({type:t,segment:e,keyInfo:i,trackInfo:s,timingInfo:n})=>{const r={segmentInfo:Pl({segment:e})};i&&(r.keyInfo=i),s&&(r.trackInfo=s),n&&(r.timingInfo=n),this.trigger({type:t,metadata:r})}})}trimBackBuffer_(t){const e=((t,e,i)=>{let s=e-Gh.BACK_BUFFER_LENGTH;return t.length&&(s=Math.max(s,t.start(0))),Math.min(e-i,s)})(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);e>0&&this.remove(0,e)}createSimplifiedSegmentObj_(t){const e=t.segment,i=t.part,s={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:t.segment.key||t.segment.map&&t.segment.map.key,isMediaInitialization:t.segment.map&&!t.segment.map.bytes},n=t.playlist.segments[t.mediaIndex-1];if(n&&n.timeline===e.timeline&&(n.videoTimingInfo?s.baseStartTime=n.videoTimingInfo.transmuxedDecodeEnd:n.audioTimingInfo&&(s.baseStartTime=n.audioTimingInfo.transmuxedDecodeEnd)),e.key){const i=e.key.iv||new Uint32Array([0,0,0,t.mediaIndex+t.playlist.mediaSequence]);s.key=this.segmentKey(e.key),s.key.iv=i}return e.map&&(s.map=this.initSegmentForMap(e.map)),s}saveTransferStats_(t){this.mediaRequests+=1,t&&(this.mediaBytesTransferred+=t.bytesReceived,this.mediaTransferDuration+=t.roundTripTime)}saveBandwidthRelatedStats_(t,e){this.pendingSegment_.byteLength=e.bytesReceived,t<Dl?this.logger_(`Ignoring segment's bandwidth because its duration of ${t} is less than the min to record 0.016666666666666666`):(this.trigger({type:"bandwidthupdated",metadata:{bandwidthInfo:{from:this.bandwidth,to:e.bandwidth}}}),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)return void this.callQueue_.push(this.segmentRequestFinished_.bind(this,t,e,i));if(this.saveTransferStats_(e.stats),!this.pendingSegment_)return;if(e.requestId!==this.pendingSegment_.requestId)return;if(t){if(this.pendingSegment_=null,this.state="READY",t.code===ol)return;return this.pause(),t.code===rl?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(t),void this.trigger("error"))}const s=this.pendingSegment_;this.saveBandwidthRelatedStats_(s.duration,e.stats),s.endOfAllRequests=e.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=((t,e)=>{if(!e.length)return t;if(this.safeAppend_)return e.slice();const i=e[0].pts;let s=0;for(;s<t.length&&!(t[s].pts>=i);s++);return t.slice(0,s).concat(e)})(this.gopBuffer_,i.gopInfo)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(s)}setTimeMapping_(t){const e=this.syncController_.mappingForTimeline(t);null!==e&&(this.timeMapping_=e)}updateMediaSecondsLoaded_(t){this.mediaSecondsLoaded+="number"==typeof t.start&&"number"==typeof t.end?t.end-t.start:t.duration}shouldUpdateTransmuxerTimestampOffset_(t){return null!==t&&("main"===this.loaderType_&&t!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&t!==this.sourceUpdater_.audioTimestampOffset())}trueSegmentStart_({currentStart:t,playlist:e,mediaIndex:i,firstVideoFrameTimeForData:s,currentVideoTimestampOffset:n,useVideoTimingInfo:r,videoTimingInfo:o,audioTimingInfo:a}){if(void 0!==t)return t;if(!r)return a.start;const h=e.segments[i-1];return 0!==i&&h&&void 0!==h.start&&h.end===s+n?o.start:s}waitForAppendsToComplete_(t){const e=this.getCurrentMediaInfo_(t);if(!e)return this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),void this.trigger("error");const{hasAudio:i,hasVideo:s,isMuxed:n}=e,r="main"===this.loaderType_&&s,o=!this.audioDisabled_&&i&&!n;if(t.waitingOnAppends=0,!t.hasAppendedData_)return t.timingInfo||"number"!=typeof t.timestampOffset||(this.isPendingTimestampOffset_=!0),t.timingInfo={start:0},t.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(t),this.processMetadataQueue_()),void this.checkAppendsDone_(t);r&&t.waitingOnAppends++,o&&t.waitingOnAppends++,r&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,t)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,t))}checkAppendsDone_(t){this.checkForAbort_(t.requestId)||(t.waitingOnAppends--,0===t.waitingOnAppends&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(t){const e=((t,e,i)=>"main"===t&&e&&i?i.hasAudio||i.hasVideo?e.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null)(this.loaderType_,this.getCurrentMediaInfo_(),t);return!!e&&(this.error({message:e,playlistExclusionDuration:1/0}),this.trigger("error"),!0)}updateSourceBufferTimestampOffset_(t){if(null===t.timestampOffset||"number"!=typeof t.timingInfo.start||t.changedTimestampOffset||"main"!==this.loaderType_)return;let e=!1;t.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:t.segment.videoTimingInfo,audioTimingInfo:t.segment.audioTimingInfo,timingInfo:t.timingInfo}),t.changedTimestampOffset=!0,t.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(t.timestampOffset),e=!0),t.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(t.timestampOffset),e=!0),e&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:t,audioTimingInfo:e,timingInfo:i}){return this.useDtsForTimestampOffset_?t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:e&&"number"==typeof e.transmuxedDecodeStart?e.transmuxedDecodeStart:i.start:i.start}updateTimingInfoEnd_(t){t.timingInfo=t.timingInfo||{};const e=this.getMediaInfo_(),i="main"===this.loaderType_&&e&&e.hasVideo&&t.videoTimingInfo?t.videoTimingInfo:t.audioTimingInfo;i&&(t.timingInfo.end="number"==typeof i.end?i.end:i.start+t.duration)}handleAppendsDone_(){if(this.pendingSegment_){const t={segmentInfo:Pl({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:t})}if(!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());const t=this.pendingSegment_;t.part&&t.part.syncInfo?t.part.syncInfo.markAppended():t.segment.syncInfo&&t.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(t),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:"main"===this.loaderType_});const e=((t,e)=>{if("hls"!==e)return null;const i=(t=>{let e=0;return["video","audio"].forEach((function(i){const s=t[`${i}TimingInfo`];if(!s)return;const{start:n,end:r}=s;let o;"bigint"==typeof n||"bigint"==typeof r?o=p.BigInt(r)-p.BigInt(n):"number"==typeof n&&"number"==typeof r&&(o=r-n),void 0!==o&&o>e&&(e=o)})),"bigint"==typeof e&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e})({audioTimingInfo:t.audioTimingInfo,videoTimingInfo:t.videoTimingInfo});if(!i)return null;const s=t.playlist.targetDuration,n=Rl({segmentDuration:i,maxDuration:2*s}),r=Rl({segmentDuration:i,maxDuration:s});return n||r?{severity:n?"warn":"info",message:`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`}:null})(t,this.sourceType_);if(e&&("warn"===e.severity?Sa.log.warn(e.message):this.logger_(e.message)),this.recordThroughput_(t),this.pendingSegment_=null,this.state="READY",t.isSyncRequest&&(this.trigger("syncinfoupdate"),!t.hasAppendedData_))return void this.logger_(`Throwing away un-appended sync request ${Cl(t)}`);this.logger_(`Appended ${Cl(t)}`),this.addSegmentMetadataCue_(t),this.fetchAtBuffer_=!0,this.currentTimeline_!==t.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:t.timeline}),"main"!==this.loaderType_||this.audioDisabled_||this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:t.timeline})),this.currentTimeline_=t.timeline,this.trigger("syncinfoupdate");const i=t.segment,s=t.part,n=i.end&&this.currentTime_()-i.end>3*t.playlist.targetDuration,r=s&&s.end&&this.currentTime_()-s.end>3*t.playlist.partTargetDuration;if(n||r)return this.logger_(`bad ${n?"segment":"part"} ${Cl(t)}`),void this.resetEverything();null!==this.mediaIndex&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=t.mediaIndex,this.partIndex=t.partIndex,this.isEndOfStream_(t.mediaIndex,t.playlist,t.partIndex)&&this.endOfStream(),this.trigger("appended"),t.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(t){if(t.duration<Dl)return void this.logger_(`Ignoring segment's throughput because its duration of ${t.duration} is less than the min to record 0.016666666666666666`);const e=this.throughput.rate,i=Date.now()-t.endOfAllRequests+1,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,i=e.start,s=e.end;if(!Il(i)||!Il(s))return;El(i,s,this.segmentMetadataTrack_);const n={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},r=new(p.WebKitDataCue||p.VTTCue)(i,s,JSON.stringify(n));r.value=n,this.segmentMetadataTrack_.addCue(r)}}function Ll(){}const Fl=function(t){return"string"!=typeof t?t:t.replace(/./,(t=>t.toUpperCase()))},$l=["video","audio"],Bl=(t,e)=>{const i=e[`${t}Buffer`];return i&&i.updating||e.queuePending[t]},Ul=(t,e)=>{if(0===e.queue.length)return;let i=0,s=e.queue[i];if("mediaSource"!==s.type){if("mediaSource"!==t&&e.ready()&&"closed"!==e.mediaSource.readyState&&!Bl(t,e)){if(s.type!==t){if(i=((t,e)=>{for(let i=0;i<e.length;i++){const s=e[i];if("mediaSource"===s.type)return null;if(s.type===t)return i}return null})(t,e.queue),null===i)return;s=e.queue[i]}return e.queue.splice(i,1),e.queuePending[t]=s,s.action(t,e),s.doneFn?void 0:(e.queuePending[t]=null,void Ul(t,e))}}else e.updating()||"closed"===e.mediaSource.readyState||(e.queue.shift(),s.action(e),s.doneFn&&s.doneFn(),Ul("audio",e),Ul("video",e))},ql=(t,e)=>{const i=e[`${t}Buffer`],s=Fl(t);i&&(i.removeEventListener("updateend",e[`on${s}UpdateEnd_`]),i.removeEventListener("error",e[`on${s}Error_`]),e.codecs[t]=null,e[`${t}Buffer`]=null)},Vl=(t,e)=>t&&e&&-1!==Array.prototype.indexOf.call(t.sourceBuffers,e),zl=(t,e,i)=>(s,n)=>{const r=n[`${s}Buffer`];if(Vl(n.mediaSource,r)){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} `+(22===t.code?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${s}Buffer`),n.queuePending[s]=null,i(t)}}},Hl=(t,e)=>(i,s)=>{const n=s[`${i}Buffer`];if(Vl(s.mediaSource,n)){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`)}}},Xl=t=>(e,i)=>{const s=i[`${e}Buffer`];Vl(i.mediaSource,s)&&(i.logger_(`Setting ${e}timestampOffset to ${t}`),s.timestampOffset=t)},Gl=t=>()=>{t()},Yl=t=>e=>{if("open"===e.mediaSource.readyState){e.logger_(`Calling mediaSource endOfStream(${t||""})`);try{e.mediaSource.endOfStream(t)}catch(t){Sa.log.warn("Failed to call media source endOfStream",t)}}},Wl=t=>e=>{e.logger_(`Setting mediaSource duration to ${t}`);try{e.mediaSource.duration=t}catch(t){Sa.log.warn("Failed to set media source duration",t)}},Jl=(t,e)=>i=>{const s=Fl(t),n=dt(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},Kl=t=>e=>{const i=e[`${t}Buffer`];if(ql(t,e),Vl(e.mediaSource,i)){e.logger_(`Removing ${t}Buffer with codec ${e.codecs[t]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(i)}catch(e){Sa.log.warn(`Failed to removeSourceBuffer ${t}Buffer`,e)}}},Ql=t=>(e,i)=>{const s=i[`${e}Buffer`],n=dt(t);if(!Vl(i.mediaSource,s))return;const r=t.substring(0,t.indexOf(".")),o=i.codecs[e];if(o.substring(0,o.indexOf("."))===r)return;const a={codecsChangeInfo:{from:o,to:t}};i.trigger({type:"codecschange",metadata:a}),i.logger_(`changing ${e}Buffer codec from ${o} to ${t}`);try{s.changeType(n),i.codecs[e]=t}catch(t){a.errorType=Sa.Error.StreamingCodecsChangeError,a.error=t,t.metadata=a,i.error_=t,i.trigger("error"),Sa.log.warn(`Failed to changeType on ${e}Buffer`,t)}},Zl=({type:t,sourceUpdater:e,action:i,doneFn:s,name:n})=>{e.queue.push({type:t,action:i,doneFn:s,name:n}),Ul(t,e)},tu=(t,e)=>()=>{const i=function(t){if(0===t.length)return"Buffered Ranges are empty";let e="Buffered Ranges: \n";for(let i=0;i<t.length;i++){const s=t.start(i),n=t.end(i);e+=`${s} --\x3e ${n}. Duration (${n-s})\n`}return e}(e[`${t}Buffered`]());if(e.logger_(`received "updateend" event for ${t} Source Buffer: `,i),e.queuePending[t]){const i=e.queuePending[t].doneFn;e.queuePending[t]=null,i&&i(e[`${t}Error_`])}Ul(t,e)};class eu extends Sa.EventTarget{constructor(t){super(),this.mediaSource=t,this.sourceopenListener_=()=>Ul("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Ca("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=tu("video",this),this.onAudioUpdateEnd_=tu("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(t){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(t),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(t,e){Zl({type:"mediaSource",sourceUpdater:this,action:Jl(t,e),name:"addSourceBuffer"})}abort(t){Zl({type:t,sourceUpdater:this,action:(t,e)=>{if("open"!==e.mediaSource.readyState)return;const i=e[`${t}Buffer`];if(Vl(e.mediaSource,i)){e.logger_(`calling abort on ${t}Buffer`);try{i.abort()}catch(e){Sa.log.warn(`Failed to abort on ${t}Buffer`,e)}}},name:"abort"})}removeSourceBuffer(t){this.canRemoveSourceBuffer()?Zl({type:"mediaSource",sourceUpdater:this,action:Kl(t),name:"removeSourceBuffer"}):Sa.log.error("removeSourceBuffer is not supported!")}canRemoveSourceBuffer(){return!Sa.browser.IS_FIREFOX&&p.MediaSource&&p.MediaSource.prototype&&"function"==typeof p.MediaSource.prototype.removeSourceBuffer}static canChangeType(){return p.SourceBuffer&&p.SourceBuffer.prototype&&"function"==typeof p.SourceBuffer.prototype.changeType}canChangeType(){return this.constructor.canChangeType()}changeType(t,e){this.canChangeType()?Zl({type:t,sourceUpdater:this,action:Ql(e),name:"changeType"}):Sa.log.error("changeType is not supported!")}addOrChangeSourceBuffers(t){if(!t||"object"!=typeof t||0===Object.keys(t).length)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);this.canChangeType()&&this.changeType(e,i)}))}appendBuffer(t,e){const{segmentInfo:i,type:s,bytes:n}=t;if(this.processedAppend_=!0,"audio"===s&&this.videoBuffer&&!this.videoAppendQueued_)return this.delayedAudioAppendQueue_.push([t,e]),void this.logger_(`delayed audio append of ${n.length} until video append`);if(Zl({type:s,sourceUpdater:this,action:zl(n,i||{mediaIndex:-1},e),doneFn:e,name:"appendBuffer"}),"video"===s){if(this.videoAppendQueued_=!0,!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(){return Vl(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Ma()}videoBuffered(){return Vl(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Ma()}buffered(){const t=Vl(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,e=Vl(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return e&&!t?this.audioBuffered():t&&!e?this.videoBuffered():function(t,e){let i=null,s=null,n=0;const r=[],o=[];if(!(t&&t.length&&e&&e.length))return Ma();let a=t.length;for(;a--;)r.push({time:t.start(a),type:"start"}),r.push({time:t.end(a),type:"end"});for(a=e.length;a--;)r.push({time:e.start(a),type:"start"}),r.push({time:e.end(a),type:"end"});for(r.sort((function(t,e){return t.time-e.time})),a=0;a<r.length;a++)"start"===r[a].type?(n++,2===n&&(i=r[a].time)):"end"===r[a].type&&(n--,1===n&&(s=r[a].time)),null!==i&&null!==s&&(o.push([i,s]),i=null,s=null);return Ma(o)}(this.audioBuffered(),this.videoBuffered())}setDuration(t,e=Ll){Zl({type:"mediaSource",sourceUpdater:this,action:Wl(t),name:"duration",doneFn:e})}endOfStream(t=null,e=Ll){"string"!=typeof t&&(t=void 0),Zl({type:"mediaSource",sourceUpdater:this,action:Yl(t),name:"endOfStream",doneFn:e})}removeAudio(t,e,i=Ll){this.audioBuffered().length&&0!==this.audioBuffered().end(0)?Zl({type:"audio",sourceUpdater:this,action:Hl(t,e),doneFn:i,name:"remove"}):i()}removeVideo(t,e,i=Ll){this.videoBuffered().length&&0!==this.videoBuffered().end(0)?Zl({type:"video",sourceUpdater:this,action:Hl(t,e),doneFn:i,name:"remove"}):i()}updating(){return!(!Bl("audio",this)&&!Bl("video",this))}audioTimestampOffset(t){return void 0!==t&&this.audioBuffer&&this.audioTimestampOffset_!==t&&(Zl({type:"audio",sourceUpdater:this,action:Xl(t),name:"timestampOffset"}),this.audioTimestampOffset_=t),this.audioTimestampOffset_}videoTimestampOffset(t){return void 0!==t&&this.videoBuffer&&this.videoTimestampOffset_!==t&&(Zl({type:"video",sourceUpdater:this,action:Xl(t),name:"timestampOffset"}),this.videoTimestampOffset_=t),this.videoTimestampOffset_}audioQueueCallback(t){this.audioBuffer&&Zl({type:"audio",sourceUpdater:this,action:Gl(t),name:"callback"})}videoQueueCallback(t){this.videoBuffer&&Zl({type:"video",sourceUpdater:this,action:Gl(t),name:"callback"})}dispose(){this.trigger("dispose"),$l.forEach((t=>{this.abort(t),this.canRemoveSourceBuffer()?this.removeSourceBuffer(t):this[`${t}QueueCallback`]((()=>ql(t,this)))})),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const iu=t=>decodeURIComponent(escape(String.fromCharCode.apply(null,t))),su=new Uint8Array("\n\n".split("").map((t=>t.charCodeAt(0))));class nu extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class ru extends _l{constructor(t,e={}){super(t,e),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=t.featuresNativeTextTracks,this.loadVttJs=t.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Ma();const t=this.subtitlesTrack_.cues;return Ma([[t[0].startTime,t[t.length-1].startTime]])}initSegmentForMap(t,e=!1){if(!t)return null;const i=_h(t);let s=this.initSegments_[i];if(e&&!s&&t.bytes){const e=new Uint8Array(su.byteLength+t.bytes.byteLength);e.set(t.bytes),e.set(su,t.bytes.byteLength),this.initSegments_[i]=s={resolvedUri:t.resolvedUri,byterange:t.byterange,bytes:e}}return s||t}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(t){return void 0===t||(this.subtitlesTrack_=t,"INIT"===this.state&&this.couldBeginLoading_()&&this.init_()),this.subtitlesTrack_}remove(t,e){El(t,e,this.subtitlesTrack_)}fillBuffer_(){const t=this.chooseNextRequest_();if(t){if(null===this.syncController_.timestampOffsetForTimeline(t.timeline))return this.syncController_.one("timestampoffset",(()=>{this.state="READY",this.paused()||this.monitorBuffer_()})),void(this.state="WAITING_ON_TIMELINE");this.loadSegment_(t)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(t){for(;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_)return void(this.state="READY");if(this.saveTransferStats_(e.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(t)return t.code===rl&&this.handleTimeout_(),t.code===ol?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(t);const s=this.pendingSegment_,n=i.mp4VttCues&&i.mp4VttCues.length;n&&(s.mp4VttCues=i.mp4VttCues),this.saveBandwidthRelatedStats_(s.duration,e.stats),e.key&&this.segmentKey(e.key,!0),this.state="APPENDING",this.trigger("appending");const r=s.segment;if(r.map&&(r.map.bytes=e.map.bytes),s.bytes=e.bytes,"function"!=typeof p.WebVTT&&"function"==typeof this.loadVttJs)return this.state="WAITING_ON_VTTJS",void this.loadVttJs().then((()=>this.segmentRequestFinished_(t,e,i)),(()=>this.stopForError({message:"Error loading vtt.js"})));r.requested=!0;try{this.parseVTTCues_(s)}catch(t){return void this.stopForError({message:t.message,metadata:{errorType:Sa.Error.StreamingVttParserError,error:t}})}if(n||this.updateTimeMapping_(s,this.syncController_.timelines[s.timeline],this.playlist_),s.timingInfo=s.cues.length?{start:s.cues[0].startTime,end:s.cues[s.cues.length-1].endTime}:{start:s.startOfSegment,end:s.startOfSegment+s.duration},s.isSyncRequest)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");s.byteLength=s.bytes.byteLength,this.mediaSecondsLoaded+=r.duration,s.cues.forEach((t=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new p.VTTCue(t.startTime,t.endTime,t.text):t)})),function(t){const e=t.cues;if(!e)return;const i={};for(let s=e.length-1;s>=0;s--){const n=e[s],r=`${n.startTime}-${n.endTime}-${n.text}`;i[r]?t.removeCue(n):i[r]=n}}(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(t,e){t&&"vtt"===t.type&&e&&"text"===e.type&&super.handleData_(t,e)}updateTimingInfoEnd_(){}parseMp4VttCues_(t){const e=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();t.mp4VttCues.forEach((i=>{const s=new p.VTTCue(i.start+e,i.end+e,i.cueText);i.settings&&i.settings.split(" ").forEach((t=>{const e=t.split(":"),i=e[1];s[e[0]]=isNaN(i)?i:Number(i)})),t.cues.push(s)}))}parseVTTCues_(t){let e,i=!1;if("function"!=typeof p.WebVTT)throw new nu;if(t.cues=[],t.timestampmap={MPEGTS:0,LOCAL:0},t.mp4VttCues)return void this.parseMp4VttCues_(t);"function"==typeof p.TextDecoder?e=new p.TextDecoder("utf8"):(e=p.WebVTT.StringDecoder(),i=!0);const s=new p.WebVTT.Parser(p,p.vttjs,e);if(s.oncue=t.cues.push.bind(t.cues),s.ontimestampmap=e=>{t.timestampmap=e},s.onparsingerror=t=>{Sa.log.warn("Error encountered when parsing cues: "+t.message)},t.segment.map){let e=t.segment.map.bytes;i&&(e=iu(e)),s.parse(e)}let n=t.bytes;i&&(n=iu(n)),s.parse(n),s.flush()}updateTimeMapping_(t,e,i){const s=t.segment;if(!e)return;if(!t.cues.length)return void(s.empty=!0);const{MPEGTS:n,LOCAL:r}=t.timestampmap,o=n/oi.ONE_SECOND_IN_TS-r+e.mapping;t.cues.forEach((t=>{const i=t.endTime-t.startTime,s=this.handleRollover_(t.startTime+o,e.time);t.startTime=Math.max(s,0),t.endTime=Math.max(s+i,0)})),i.syncInfo||(i.syncInfo={mediaSequence:i.mediaSequence+t.mediaIndex,time:Math.min(t.cues[0].startTime,t.cues[t.cues.length-1].startTime-s.duration)})}handleRollover_(t,e){if(null===e)return t;let i=t*oi.ONE_SECOND_IN_TS;const s=e*oi.ONE_SECOND_IN_TS;let n;for(n=s<i?-8589934592:8589934592;Math.abs(i-s)>4294967296;)i+=n;return i/oi.ONE_SECOND_IN_TS}}const ou=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};class au{constructor({start:t,end:e,segmentIndex:i,partIndex:s=null,appended:n=!1}){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_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class hu{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 lu{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach((t=>t.resetAppendStatus()))}update(t,e){const{mediaSequence:i,segments:s}=t;if(this.isReliable_=this.isReliablePlaylist_(i,s),this.isReliable_)return this.updateStorage_(s,i,this.calculateBaseTime_(i,s,e))}getSyncInfoForTime(t){for(const{segmentSyncInfo:e,partsSyncInfo:i}of this.storage_.values())if(i.length){for(const e of i)if(e.isInRange(t))return e}else 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",r=i,o=e;this.start_=r,t.forEach(((t,e)=>{const i=this.storage_.get(o),a=r,h=a+t.duration,l=Boolean(i&&i.segmentSyncInfo&&i.segmentSyncInfo.isAppended),u=new au({start:a,end:h,appended:l,segmentIndex:e});t.syncInfo=u;let c=r;const d=(t.parts||[]).map(((t,s)=>{const r=c,a=c+t.duration,h=Boolean(i&&i.partsSyncInfo&&i.partsSyncInfo[s]&&i.partsSyncInfo[s].isAppended),l=new au({start:r,end:a,appended:h,segmentIndex:e,partIndex:s});return c=a,n+=`Media Sequence: ${o}.${s} | Range: ${r} --\x3e ${a} | Appended: ${h}\n`,t.syncInfo=l,l}));s.set(o,new hu(u,d)),n+=`${Sl(t.resolvedUri)} | Media Sequence: ${o} | Range: ${a} --\x3e ${h} | Appended: ${l}\n`,o++,r=h})),this.end_=r,this.storage_=s,this.diagnostics_=n}calculateBaseTime_(t,e,i){if(!this.storage_.size)return 0;if(this.storage_.has(t))return this.storage_.get(t).segmentSyncInfo.start;const s=Math.min(...this.storage_.keys());if(t<s){const i=s-t;let n=this.storage_.get(s).segmentSyncInfo.start;for(let t=0;t<i;t++)n-=e[t].duration;return n}return i}isReliablePlaylist_(t,e){return null!=t&&Array.isArray(e)&&e.length}}class uu extends lu{constructor(t){super(),this.parent_=t}calculateBaseTime_(t,e,i){if(!this.storage_.size){const e=this.parent_.getSyncInfoForMediaSequence(t);return e?e.segmentSyncInfo.start:0}return super.calculateBaseTime_(t,e,i)}}const cu=[{name:"VOD",run:(t,e,i)=>i!==1/0?{time:0,segmentIndex:0,partIndex:null}: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);return a?{time:a.start,partIndex:a.partIndex,segmentIndex:a.segmentIndex}:null}},{name:"ProgramDateTime",run:(t,e,i,s,n)=>{if(!Object.keys(t.timelineToDatetimeMappings).length)return null;let r=null,o=null;const a=Va(e);n=n||0;for(let i=0;i<a.length;i++){const s=a[e.endList||0===n?i:a.length-(i+1)],h=s.segment,l=t.timelineToDatetimeMappings[h.timeline];if(!l||!h.dateTimeObject)continue;let u=h.dateTimeObject.getTime()/1e3+l;if(h.parts&&"number"==typeof s.partIndex)for(let t=0;t<s.partIndex;t++)u+=h.parts[t].duration;const c=Math.abs(n-u);if(null!==o&&(0===c||o<c))break;o=c,r={time:u,segmentIndex:s.segmentIndex,partIndex:s.partIndex}}return r}},{name:"Segment",run:(t,e,i,s,n)=>{let r=null,o=null;n=n||0;const a=Va(e);for(let t=0;t<a.length;t++){const i=a[e.endList||0===n?t:a.length-(t+1)],h=i.segment,l=i.part&&i.part.start||h&&h.start;if(h.timeline===s&&void 0!==l){const t=Math.abs(n-l);if(null!==o&&o<t)break;(!r||null===o||o>=t)&&(o=t,r={time:l,segmentIndex:i.segmentIndex,partIndex:i.partIndex})}}return r}},{name:"Discontinuity",run:(t,e,i,s,n)=>{let r=null;if(n=n||0,e.discontinuityStarts&&e.discontinuityStarts.length){let i=null;for(let s=0;s<e.discontinuityStarts.length;s++){const o=e.discontinuityStarts[s],a=t.discontinuities[e.discontinuitySequence+s+1];if(a){const t=Math.abs(n-a.time);if(null!==i&&i<t)break;(!r||null===i||i>=t)&&(i=t,r={time:a.time,segmentIndex:o,partIndex:null})}}}return r}},{name:"Playlist",run:(t,e)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class du extends Sa.EventTarget{constructor(t={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const e=new lu,i=new uu(e),s=new uu(e);this.mediaSequenceStorage_={main:e,audio:i,vtt:s},this.logger_=Ca("SyncController")}getMediaSequenceSync(t){return this.mediaSequenceStorage_[t]||null}getSyncPoint(t,e,i,s,n){if(e!==1/0)return cu.find((({name:t})=>"VOD"===t)).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,{segmentIndex:r,time:o}=i;if(r<0)continue;const a=o,h=a+t.segments[r].duration;if(this.logger_(`Strategy: ${n}. Current time: ${s}. selected segment: ${r}. Time: [${a} -> ${h}]}`),s>=a&&s<h)return this.logger_("Found sync point with exact match: ",i),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});return s.segmentIndex>0&&(s.time*=-1),Math.abs(s.time+Wa({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:s.segmentIndex,endIndex:0}))}runStrategies_(t,e,i,s,n){const r=[];for(let o=0;o<cu.length;o++){const a=cu[o],h=a.run(this,t,e,i,s,n);h&&(h.strategy=a.name,r.push({strategy:a.name,syncPoint:h}))}return r}selectSyncPoint_(t,e){let i=t[0].syncPoint,s=Math.abs(t[0].syncPoint[e.key]-e.value),n=t[0].strategy;for(let r=1;r<t.length;r++){const o=Math.abs(t[r].syncPoint[e.key]-e.value);o<s&&(s=o,i=t[r].syncPoint,n=t[r].strategy)}return this.logger_(`syncPoint for [${e.key}: ${e.value}] chosen with strategy [${n}]: [time:${i.time}, segmentIndex:${i.segmentIndex}`+("number"==typeof i.partIndex?`,partIndex:${i.partIndex}`:"")+"]"),i}saveExpiredSegmentInfo(t,e){const i=e.mediaSequence-t.mediaSequence;if(i>86400)Sa.log.warn(`Not saving expired segment info. Media sequence gap ${i} is too large.`);else for(let s=i-1;s>=0;s--){const i=t.segments[s];if(i&&void 0!==i.start){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){if(this.timelineToDatetimeMappings={},t.segments&&t.segments.length&&t.segments[0].dateTimeObject){const e=t.segments[0],i=e.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[e.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:t,shouldSaveTimelineMapping:e}){const i=this.calculateSegmentTimeMapping_(t,t.timingInfo,e),s=t.segment;i&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:s.start}));const n=s.dateTimeObject;s.discontinuity&&e&&n&&(this.timelineToDatetimeMappings[s.timeline]=-n.getTime()/1e3)}timestampOffsetForTimeline(t){return void 0===this.timelines[t]?null:this.timelines[t].time}mappingForTimeline(t){return void 0===this.timelines[t]?null:this.timelines[t].mapping}calculateSegmentTimeMapping_(t,e,i){const s=t.segment,n=t.part;let r,o,a=this.timelines[t.timeline];if("number"==typeof t.timestampOffset)a={time:t.startOfSegment,mapping:t.startOfSegment-e.start},i&&(this.timelines[t.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${t.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),r=t.startOfSegment,o=e.end+a.mapping;else{if(!a)return!1;r=e.start+a.mapping,o=e.end+a.mapping}return n&&(n.start=r,n.end=o),(!s.start||r<s.start)&&(s.start=r),s.end=o,!0}saveDiscontinuitySyncInfo_(t){const e=t.playlist,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],r=e.discontinuitySequence+s+1,o=n-t.mediaIndex,a=Math.abs(o);if(!this.discontinuities[r]||this.discontinuities[r].accuracy>a){let s;s=o<0?i.start-Wa({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:t.mediaIndex,endIndex:n}):i.end+Wa({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 fu extends Sa.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(t){this.pendingTimelineChanges_[t]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:t,from:e,to:i}){return"number"==typeof e&&"number"==typeof i&&(this.pendingTimelineChanges_[t]={type:t,from:e,to:i},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]}lastTimelineChange({type:t,from:e,to:i}){return"number"==typeof e&&"number"==typeof i&&(this.lastTimelineChanges_[t]={type:t,from:e,to:i},delete this.pendingTimelineChanges_[t],this.trigger({type:"timelinechange",metadata:{timelineChangeInfo:{from:e,to:i}}})),this.lastTimelineChanges_[t]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const pu=Jh(Kh((function(){var t=function(){function t(){this.listeners={}}var e=t.prototype;return e.on=function(t,e){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(e)},e.off=function(t,e){if(!this.listeners[t])return!1;var i=this.listeners[t].indexOf(e);return this.listeners[t]=this.listeners[t].slice(0),this.listeners[t].splice(i,1),i>-1},e.trigger=function(t){var e=this.listeners[t];if(e)if(2===arguments.length)for(var i=e.length,s=0;s<i;++s)e[s].call(this,arguments[1]);else for(var n=Array.prototype.slice.call(arguments,1),r=e.length,o=0;o<r;++o)e[o].apply(this,n)},e.dispose=function(){this.listeners={}},e.pipe=function(t){this.on("data",(function(e){t.push(e)}))},t}();
|
|
16
|
+
/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */let e=null;class i{constructor(t){let i,s,n;e||(e=function(){const t=[[[],[],[],[],[]],[[],[],[],[],[]]],e=t[0],i=t[1],s=e[4],n=i[4];let r,o,a;const h=[],l=[];let u,c,d,f,p,v;for(r=0;r<256;r++)l[(h[r]=r<<1^283*(r>>7))^r]=r;for(o=a=0;!s[o];o^=u||1,a=l[a]||1)for(f=a^a<<1^a<<2^a<<3^a<<4,f=f>>8^255&f^99,s[o]=f,n[f]=o,d=h[c=h[u=h[o]]],v=16843009*d^65537*c^257*u^16843008*o,p=257*h[f]^16843008*f,r=0;r<4;r++)e[r][o]=p=p<<24^p>>>8,i[r][f]=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}()),this._tables=[[e[0][0].slice(),e[0][1].slice(),e[0][2].slice(),e[0][3].slice(),e[0][4].slice()],[e[1][0].slice(),e[1][1].slice(),e[1][2].slice(),e[1][3].slice(),e[1][4].slice()]];const r=this._tables[0][4],o=this._tables[1],a=t.length;let h=1;if(4!==a&&6!==a&&8!==a)throw new Error("Invalid aes key size");const l=t.slice(0),u=[];for(this._key=[l,u],i=a;i<4*a+28;i++)n=l[i-1],(i%a==0||8===a&&i%a==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],i%a==0&&(n=n<<8^n>>>24^h<<24,h=h<<1^283*(h>>7))),l[i]=l[i-a]^n;for(s=0;i;s++,i--)n=l[3&s?i:i-4],u[s]=i<=4||s<4?n:o[0][r[n>>>24]]^o[1][r[n>>16&255]]^o[2][r[n>>8&255]]^o[3][r[255&n]]}decrypt(t,e,i,s,n,r){const o=this._key[1];let a,h,l,u=t^o[0],c=s^o[1],d=i^o[2],f=e^o[3];const p=o.length/4-2;let v,m=4;const g=this._tables[1],y=g[0],b=g[1],j=g[2],w=g[3],T=g[4];for(v=0;v<p;v++)a=y[u>>>24]^b[c>>16&255]^j[d>>8&255]^w[255&f]^o[m],h=y[c>>>24]^b[d>>16&255]^j[f>>8&255]^w[255&u]^o[m+1],l=y[d>>>24]^b[f>>16&255]^j[u>>8&255]^w[255&c]^o[m+2],f=y[f>>>24]^b[u>>16&255]^j[c>>8&255]^w[255&d]^o[m+3],m+=4,u=a,c=h,d=l;for(v=0;v<4;v++)n[(3&-v)+r]=T[u>>>24]<<24^T[c>>16&255]<<16^T[d>>8&255]<<8^T[255&f]^o[m++],a=u,u=c,c=d,d=f,f=a}}class s extends t{constructor(){super(t),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.timeout_=this.jobs.length?setTimeout(this.processJob_.bind(this),this.delay):null}push(t){this.jobs.push(t),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const n=function(t){return t<<24|(65280&t)<<8|(16711680&t)>>8|t>>>24};class r{constructor(t,e,i,o){const a=r.STEP,h=new Int32Array(t.buffer),l=new Uint8Array(t.byteLength);let u=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(h.subarray(u,u+a),e,i,l)),u=a;u<h.length;u+=a)i=new Uint32Array([n(h[u-4]),n(h[u-3]),n(h[u-2]),n(h[u-1])]),this.asyncStream_.push(this.decryptChunk_(h.subarray(u,u+a),e,i,l));this.asyncStream_.push((function(){var t;
|
|
17
|
+
/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */o(null,(t=l).subarray(0,t.byteLength-t[t.byteLength-1]))}))}static get STEP(){return 32e3}decryptChunk_(t,e,s,r){return function(){const o=function(t,e,s){const r=new Int32Array(t.buffer,t.byteOffset,t.byteLength>>2),o=new i(Array.prototype.slice.call(e)),a=new Uint8Array(t.byteLength),h=new Int32Array(a.buffer);let l,u,c,d,f,p,v,m,g;for(l=s[0],u=s[1],c=s[2],d=s[3],g=0;g<r.length;g+=4)f=n(r[g]),p=n(r[g+1]),v=n(r[g+2]),m=n(r[g+3]),o.decrypt(f,p,v,m,h,g),h[g]=n(h[g]^l),h[g+1]=n(h[g+1]^u),h[g+2]=n(h[g+2]^c),h[g+3]=n(h[g+3]^d),l=f,u=p,c=v,d=m;return a}(t,e,s);r.set(o,t.byteOffset)}}}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a=("undefined"!=typeof window?window:void 0!==o?o:"undefined"!=typeof self?self:{}).BigInt||Number;a("0x1"),a("0x100"),a("0x10000"),a("0x1000000"),a("0x100000000"),a("0x10000000000"),a("0x1000000000000"),a("0x100000000000000"),a("0x10000000000000000");self.onmessage=function(t){const e=t.data,i=new Uint8Array(e.encrypted.bytes,e.encrypted.byteOffset,e.encrypted.byteLength),s=new Uint32Array(e.key.bytes,e.key.byteOffset,e.key.byteLength/4),n=new Uint32Array(e.iv.bytes,e.iv.byteOffset,e.iv.byteLength/4);new r(i,s,n,(function(t,i){self.postMessage(function(t){const e={};return Object.keys(t).forEach((i=>{const s=t[i];var n;n=s,e[i]=("function"===ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer)?{bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:s})),e}({source:e.source,decrypted:i}),[i.buffer])}))}})));var vu=Wh(pu);const mu=t=>{let e=t.default?"main":"alternative";return t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},gu=(t,e)=>{t.abort(),t.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},yu=(t,e)=>{e.activePlaylistLoader=t,t.load()},bu={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:i},excludePlaylist:s}=e,n=i.activeTrack(),r=i.activeGroup(),o=(r.filter((t=>t.default))[0]||r[0]).id,a=i.tracks[o];if(n!==a){Sa.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()}else s({error:{message:"Problem encountered loading the default audio track."}})},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:i}}=e;Sa.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const s=i.activeTrack();s&&(s.mode="disabled"),i.onTrackChanged()}},ju={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),(!s.paused()||t.endList&&"none"!==s.preload())&&r.load()})),e.on("loadedplaylist",(()=>{r.playlist(e.media(),n),s.paused()||r.load()})),e.on("error",bu[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()),(!s.paused()||t.endList&&"none"!==s.preload())&&r.load()})),e.on("loadedplaylist",(()=>{r.playlist(e.media(),n),s.paused()||r.load()})),e.on("error",bu[t](t,i))}},wu={AUDIO:(t,e)=>{const{vhs:i,sourceType:s,segmentLoaders:{[t]:n},requestOptions:r,main:{mediaGroups:o},mediaTypes:{[t]:{groups:a,tracks:h,logger_:l}},mainPlaylistLoader:u}=e,c=nh(u.main);o[t]&&0!==Object.keys(o[t]).length||(o[t]={main:{default:{default:!0}}},c&&(o[t].main.default.playlists=u.main.playlists));for(const n in o[t]){a[n]||(a[n]=[]);for(const d in o[t][n]){let f,p=o[t][n][d];if(c?(l(`AUDIO group '${n}' label '${d}' is a main playlist`),p.isMainPlaylist=!0,f=null):f="vhs-json"===s&&p.playlists?new Ih(p.playlists[0],i,r):p.resolvedUri?new Ih(p.resolvedUri,i,r):p.playlists&&"dash"===s?new Xh(p.playlists[0],i,r,u):null,p=Na({id:d,playlistLoader:f},p),ju[t](t,p.playlistLoader,e),a[n].push(p),void 0===h[d]){const t=new Sa.AudioTrack({id:d,kind:mu(p),enabled:!1,language:p.language,default:p.default,label:d});h[d]=t}}}n.on("error",bu[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:l}},mainPlaylistLoader:u}=e;for(const r in a[t]){h[r]||(h[r]=[]);for(const c in a[t][r]){if(!s.options_.useForcedSubtitles&&a[t][r][c].forced)continue;let d,f=a[t][r][c];if("hls"===n)d=new Ih(f.resolvedUri,s,o);else if("dash"===n){if(!f.playlists.filter((t=>t.excludeUntil!==1/0)).length)return;d=new Xh(f.playlists[0],s,o,u)}else"vhs-json"===n&&(d=new Ih(f.playlists?f.playlists[0]:f.resolvedUri,s,o));if(f=Na({id:c,playlistLoader:d},f),ju[t](t,f.playlistLoader,e),h[r].push(f),void 0===l[c]){const t=i.addRemoteTextTrack({id:c,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:c},!1).track;l[c]=t}}}r.on("error",bu[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]){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 l={label:o,language:a.language,instreamId:a.instreamId,default:a.default&&a.autoselect};if(h[l.instreamId]&&(l=Na(l,h[l.instreamId])),void 0===l.default&&delete l.default,n[e].push(Na({id:o},a)),void 0===r[o]){const t=i.addRemoteTextTrack({id:l.instreamId,kind:"captions",default:l.default,language:l.language,label:l.label},!1).track;r[o]=t}}}}},Tu=(t,e)=>{for(let i=0;i<t.length;i++){if(ih(e,t[i]))return!0;if(t[i].playlists&&Tu(t[i].playlists,e))return!0}return!1},Su={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("showing"===i[t].mode||"hidden"===i[t].mode)return i[t];return null}};class ku{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(t){1===t&&(this.version_=t)}set ttl(t){this.ttl_=t||300}set reloadUri(t){t&&(this.reloadUri_=Ia(this.reloadUri_,t))}set priority(t){t&&t.length&&(this.priority_=t)}set pathwayClones(t){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 xu extends Sa.EventTarget{constructor(t,e){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new ku,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_=Ca("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)return this.logger_(`steering manifest URL is ${i}, cannot request steering manifest.`),void this.trigger("error");i.startsWith("data:")?this.decodeDataUriManifest_(i.substring(i.indexOf(",")+1)):(this.steeringManifest.reloadUri=Ia(t,i),this.defaultPathway=e.pathwayId||e.defaultServiceLocation,this.queryBeforeStart=e.queryBeforeStart,this.proxyServerUrl_=e.proxyServerURL,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)return this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),void this.dispose();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(410===e.status)return this.logger_(`manifest request 410 ${t}.`),this.logger_(`There will be no more content steering requests to ${i} this session.`),void this.excludedSteeringManifestURLs.add(i);if(429===e.status){const i=e.responseHeaders["retry-after"];return this.logger_(`manifest request 429 ${t}.`),this.logger_(`content steering will retry in ${i} seconds.`),void this.startTTLTimeout_(parseInt(i,10))}return this.logger_(`manifest failed to load ${t}.`),void this.startTTLTimeout_()}let n;this.trigger({type:"contentsteeringloadcomplete",metadata:s});try{n=JSON.parse(this.request_.responseText)}catch(t){this.trigger({type:"error",metadata:{errorType:Sa.Error.StreamingContentSteeringParserError,error:t}})}this.assignSteeringProperties_(n),this.trigger({type:"contentsteeringparsed",metadata:{contentSteeringInfo:s.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}}}),this.startTTLTimeout_()}))}setProxyServerUrl_(t){const e=new p.URL(t),i=new p.URL(this.proxyServerUrl_);return i.searchParams.set("url",encodeURI(e.toString())),this.setSteeringParams_(i.toString())}decodeDataUriManifest_(t){const e=JSON.parse(p.atob(t));this.assignSteeringProperties_(e)}setSteeringParams_(t){const e=new p.URL(t),i=this.getPathway(),s=this.getBandwidth_();return i&&e.searchParams.set(`_${this.manifestType_}_pathway`,i),s&&e.searchParams.set(`_${this.manifestType_}_throughput`,s),e.toString()}assignSteeringProperties_(t){if(this.steeringManifest.version=t.VERSION,!this.steeringManifest.version)return this.logger_(`manifest version is ${t.VERSION}, which is not supported.`),void this.trigger("error");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,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]})(this.steeringManifest.priority);this.currentPathway!==e&&(this.currentPathway=e,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);return e(i)?null:i}startTTLTimeout_(t=this.steeringManifest.ttl){this.ttlTimeout_=p.setTimeout((()=>{this.requestSteeringManifest()}),1e3*t)}clearTTLTimeout_(){p.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new ku}addAvailablePathway(t){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&&(Ia(t,e.serverURL)!==this.steeringManifest.reloadUri||e.defaultServiceLocation!==this.defaultPathway||e.queryBeforeStart!==this.queryBeforeStart||e.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}let Au;const Eu=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],Iu=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]};class Du extends Sa.EventTarget{constructor(t){super(),this.fastQualityChange_=(t=>{let e=null;return(...i)=>{clearTimeout(e),e=setTimeout((()=>{t.apply(null,i)}),100)}})(this.fastQualityChange_.bind(this));const{src:e,withCredentials:i,tech:s,bandwidth:n,externVhs:r,useCueTags:o,playlistExclusionDuration:a,enableLowInitialPlaylist:h,sourceType:l,cacheEncryptionKeys:u,bufferBasedABR:c,leastPixelDiffSelector:d,captionServices:f,experimentalUseMMS:v}=t;if(!e)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:m}=t;null==m&&(m=1/0),Au=r,this.bufferBasedABR=Boolean(c),this.leastPixelDiffSelector=Boolean(d),this.withCredentials=i,this.tech_=s,this.vhs_=s.vhs,this.player_=t.player_,this.sourceType_=l,this.useCueTags_=o,this.playlistExclusionDuration=a,this.maxPlaylistRetries=m,this.enableLowInitialPlaylist=h,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:i,maxPlaylistRetries:m,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=(()=>{const t={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Ll,activeTrack:Ll,getActiveGroup:Ll,onGroupChanged:Ll,onTrackChanged:Ll,lastTrack_:null,logger_:Ca(`MediaGroups[${e}]`)}})),t})(),v&&p.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new p.ManagedMediaSource,this.usingManagedMediaSource_=!0,Sa.log("Using ManagedMediaSource")):p.MediaSource&&(this.mediaSource=new p.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=Ma(),this.hasPlayed_=!1,this.syncController_=new du(t),this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new vu,this.sourceUpdater_=new eu(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new fu,this.keyStatusMap_=new Map;const g={vhs:this.vhs_,parse708captions:t.parse708captions,useDtsForTimestampOffset:t.useDtsForTimestampOffset,captionServices:f,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:u,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:t.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_="dash"===this.sourceType_?new Xh(e,this.vhs_,Na(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ih(e,this.vhs_,Na(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new _l(Na(g,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),t),this.audioSegmentLoader_=new _l(Na(g,{loaderType:"audio"}),t),this.subtitleSegmentLoader_=new ru(Na(g,{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),this.contentSteeringController_=new xu(this.vhs_.xhr,(()=>this.mainSegmentLoader_.bandwidth)),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",(()=>this.startABRTimer_())),this.tech_.on("pause",(()=>this.stopABRTimer_())),this.tech_.on("play",(()=>this.startABRTimer_()))),Eu.forEach((t=>{this[t+"_"]=Iu.bind(this,t)})),this.logger_=Ca("pc"),this.triggeredFmp4Usage=!1,"none"===this.tech_.preload()?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const y="none"===this.tech_.preload()?"play":"loadstart";this.tech_.one(y,(()=>{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_(),e=this.audioAppendsToLoadedData_();return-1===t||-1===e?-1:t+e}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(t="abr"){const e=this.selectPlaylist();e&&this.shouldSwitchToMedia_(e)&&this.switchMedia_(e,t)}switchMedia_(t,e,i){const s=this.media(),n=s&&(s.id||s.uri),r=t&&(t.id||t.uri);n&&n!==r&&(this.logger_(`switch media ${n} -> ${r} from ${e}`),this.trigger({type:"renditionselected",metadata:{renditionInfo:{id:r,bandwidth:t.attributes.BANDWIDTH,resolution:t.attributes.RESOLUTION,codecs:t.attributes.CODECS},cause:e}}),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],i=e?e.activeGroup():null,s=this.contentSteeringController_.getPathway();if(i&&s){const e=(i.length?i[0].playlists:i.playlists).filter((t=>t.attributes.serviceLocation===s));e.length&&this.mediaTypes_[t].activePlaylistLoader.media(e[0])}}))}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=p.setInterval((()=>this.checkABR_()),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(p.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const t=this.main(),e=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO)return e;const i=t.mediaGroups.AUDIO,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];s.attributes&&s.attributes.AUDIO&&s.attributes.AUDIO===e&&r.push(s)}}return r.length?r:e}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",(()=>{const t=this.mainPlaylistLoader_.media(),e=1.5*t.targetDuration*1e3;this.requestOptions_.timeout=eh(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?0:e,t.endList&&"none"!==this.tech_.preload()&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),(t=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach((e=>{wu[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=((t,e)=>i=>{const{mainPlaylistLoader:s,mediaTypes:{[t]:{groups:n}}}=e,r=s.media();if(!r)return null;let o=null;r.attributes[t]&&(o=n[r.attributes[t]]);const a=Object.keys(n);if(!o)if("AUDIO"===t&&a.length>1&&nh(e.main))for(let t=0;t<a.length;t++){const e=n[a[t]];if(Tu(e,r)){o=e;break}}else n.main?o=n.main:1===a.length&&(o=n[a[0]]);return void 0===i?o:null!==i&&o&&o.filter((t=>t.id===i.id))[0]||null})(i,t),e[i].activeTrack=Su[i](i,t),e[i].onGroupChanged=((t,e)=>()=>{const{segmentLoaders:{[t]:i,main:s},mediaTypes:{[t]:n}}=e,r=n.activeTrack(),o=n.getActiveGroup(),a=n.activePlaylistLoader,h=n.lastGroup_;o&&h&&o.id===h.id||(n.lastGroup_=o,n.lastTrack_=r,gu(i,n),o&&!o.isMainPlaylist&&(o.playlistLoader?(i.resyncLoader(),yu(o.playlistLoader,n)):a&&s.resetEverything()))})(i,t),e[i].onGroupChanging=((t,e)=>()=>{const{segmentLoaders:{[t]:i},mediaTypes:{[t]:s}}=e;s.lastGroup_=null,i.abort(),i.pause()})(i,t),e[i].onTrackChanged=((t,e)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[t]:s,main:n},mediaTypes:{[t]:r}}=e,o=r.activeTrack(),a=r.getActiveGroup(),h=r.activePlaylistLoader,l=r.lastTrack_;if((!l||!o||l.id!==o.id)&&(r.lastGroup_=a,r.lastTrack_=o,gu(s,r),a)){if(a.isMainPlaylist){if(!o||!l||o.id===l.id)return;const t=e.vhs.playlistController_,s=t.selectPlaylist();if(t.media()===s)return;return r.logger_(`track change. Switching main audio from ${l.id} to ${o.id}`),i.pause(),n.resetEverything(),void t.fastQualityChange_(s)}if("AUDIO"===t){if(!a.playlistLoader)return n.setAudio(!0),void n.resetEverything();s.setAudio(!0),n.setAudio(!1)}h!==a.playlistLoader?(s.track&&s.track(o),s.resetEverything(),yu(a.playlistLoader,r)):yu(a.playlistLoader,r)}})(i,t),e[i].getActiveGroup=((t,{mediaTypes:e})=>()=>{const i=e[t].activeTrack();return i?e[t].activeGroup(i):null})(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=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),r.setAudio(!0)):o.setAudio(!0)}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])})({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",(()=>{this.trigger("selectedinitialmedia")}))})),this.mainPlaylistLoader_.on("loadedplaylist",(()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){let e;if(this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_(),this.enableLowInitialPlaylist&&(e=this.selectInitialPlaylist()),e||(e=this.selectPlaylist()),!e||!this.shouldSwitchToMedia_(e))return;if(this.initialMedia_=e,this.switchMedia_(this.initialMedia_,"initial"),"vhs-json"!==this.sourceType_||!this.initialMedia_.segments)return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)})),this.mainPlaylistLoader_.on("error",(()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})})),this.mainPlaylistLoader_.on("mediachanging",(()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()})),this.mainPlaylistLoader_.on("mediachange",(()=>{const t=this.mainPlaylistLoader_.media(),e=1.5*t.targetDuration*1e3;this.requestOptions_.timeout=eh(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?0:e,"dash"===this.sourceType_&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})})),this.mainPlaylistLoader_.on("playlistunchanged",(()=>{const t=this.mainPlaylistLoader_.media();"playlist-unchanged"!==t.lastExcludeReason_&&this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))})),this.mainPlaylistLoader_.on("renditiondisabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})})),this.mainPlaylistLoader_.on("renditionenabled",(()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})})),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach((t=>{this.mainPlaylistLoader_.on(t,(t=>{this.player_.trigger(b({},t))}))}))}handleUpdatedMediaPlaylist(t){this.useCueTags_&&this.updateAdCues_(t),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!t.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(t,e){const i=t.mediaGroups||{};let s=!0;const n=Object.keys(i.AUDIO);for(const t in i.AUDIO)for(const e in i.AUDIO[t])i.AUDIO[t][e].uri||(s=!1);s&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(i.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Au.Playlist.isAes(e)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(i.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(t){const e=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),s=this.bufferLowWaterLine(),n=this.bufferHighWaterLine();return function({currentPlaylist:t,buffered:e,currentTime:i,nextPlaylist:s,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:o,bufferBasedABR:a,log:h}){if(!s)return Sa.log.warn("We received no playlist to switch to. Please check your stream."),!1;const l=`allowing switch ${t&&t.id||"null"} -> ${s.id}`;if(!t)return h(`${l} as current playlist is not set`),!0;if(s.id===t.id)return!1;const u=Boolean(_a(e,i).length);if(!t.endList)return u||"number"!=typeof t.partTargetDuration?(h(`${l} as current playlist is live`),!0):(h(`not ${l} as current playlist is live llhls, but currentTime isn't in buffered.`),!1);const c=Ua(e,i),d=a?Gh.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Gh.MAX_BUFFER_LOW_WATER_LINE;if(o<d)return h(`${l} as duration < max low water line (${o} < ${d})`),!0;const f=s.attributes.BANDWIDTH,p=t.attributes.BANDWIDTH;if(f<p&&(!a||c<r)){let t=`${l} as next bandwidth < current bandwidth (${f} < ${p})`;return a&&(t+=` and forwardBuffer < bufferHighWaterLine (${c} < ${r})`),h(t),!0}if((!a||f>p)&&c>=n){let t=`${l} as forwardBuffer >= bufferLowWaterLine (${c} >= ${n})`;return a&&(t+=` and next bandwidth > current bandwidth (${f} > ${p})`),h(t),!0}return h(`not ${l} as no switching criteria met`),!1}({buffered:this.tech_.buffered(),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",(()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()})),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.timelineChangeController_.on("audioTimelineBehind",(()=>{const t=this.audioSegmentLoader_.pendingSegment_;t&&t.segment&&t.segment.syncInfo&&this.tech_.setCurrentTime(t.segment.syncInfo.end+.01)})),this.timelineChangeController_.on("fixBadTimelineChange",(()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()})),this.mainSegmentLoader_.on("earlyabort",(()=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:10}))}));const t=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const t=this.getCodecsOrExclude_();t&&this.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",(()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("fmp4",(()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)})),this.audioSegmentLoader_.on("ended",(()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()})),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach((t=>{this.mainSegmentLoader_.on(t,(t=>{this.player_.trigger(b({},t))})),this.audioSegmentLoader_.on(t,(t=>{this.player_.trigger(b({},t))})),this.subtitleSegmentLoader_.on(t,(t=>{this.player_.trigger(b({},t))}))}))}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(t=this.selectPlaylist()){t&&t===this.mainPlaylistLoader_.media()?this.logger_("skipping fastQualityChange because new media is same as old"):(this.switchMedia_(t,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0)}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const t=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()<t.start(0)?this.tech_.setCurrentTime(t.end(t.length-1)):void 0}setupFirstPlay(){const t=this.mainPlaylistLoader_.media();if(!t||this.tech_.paused()||this.hasPlayed_)return!1;if(!t.endList||t.start){const e=this.seekable();if(!e.length)return!1;const i=e.end(0);let s=i;if(t.start){const n=t.start.timeOffset;if(n<0){const r=Au.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,t);s=Math.max(Math.min(i+r+n,i),e.start(0))}else s=Math.min(i,n)}this.trigger("firstplay"),this.tech_.setCurrentTime(s)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const t=this.tech_.play();void 0!==t&&"function"==typeof t.then&&t.then(null,(()=>{}))}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)===1/0?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_();t=!e||e.hasVideo?t&&this.audioSegmentLoader_.ended_:this.audioSegmentLoader_.ended_}t&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(t){if(!this.seekable().length)return!1;const e=this.syncController_.getExpiredTime(t,this.duration());if(null===e)return!1;const i=Au.Playlist.playlistEnd(t,e),s=this.tech_.currentTime(),n=this.tech_.buffered();if(!n.length)return i-s<=Ra;const r=n.end(n.length-1);return r-s<=Ra&&i-r<=Ra}excludePlaylist({playlistToExclude:t=this.mainPlaylistLoader_.media(),error:e={},playlistExclusionDuration:i}){if(t=t||this.mainPlaylistLoader_.media(),i=i||e.playlistExclusionDuration||this.playlistExclusionDuration,!t)return this.error=e,void("open"!==this.mediaSource.readyState?this.trigger("error"):this.sourceUpdater_.endOfStream("network"));t.playlistErrors_++;const s=this.mainPlaylistLoader_.main.playlists,n=s.filter(Za),r=1===n.length&&n[0]===t;if(1===s.length&&i!==1/0)return Sa.log.warn(`Problem encountered with playlist ${t.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(r);if(r){if(this.main().contentSteering){const e=this.pathwayAttribute_(t),i=1e3*this.contentSteeringController_.steeringManifest.ttl;return this.contentSteeringController_.excludePathway(e),this.excludeThenChangePathway_(),void setTimeout((()=>{this.contentSteeringController_.addAvailablePathway(e)}),i)}let e=!1;s.forEach((i=>{if(i===t)return;const s=i.excludeUntil;void 0!==s&&s!==1/0&&(e=!0,delete i.excludeUntil)})),e&&(Sa.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;o=t.playlistErrors_>this.maxPlaylistRetries?1/0:Date.now()+1e3*i,t.excludeUntil=o,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)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");(e.internal?this.logger_:Sa.log.warn)(`${e.internal?"Internal problem":"Problem"} encountered with playlist ${t.id}.${e.message?" "+e.message:""} Switching to playlist ${a.id}.`),a.attributes.AUDIO!==t.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),a.attributes.SUBTITLES!==t.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const h=a.targetDuration/2*1e3||5e3,l="number"==typeof a.lastRequest&&Date.now()-a.lastRequest<=h;return this.switchMedia_(a,"exclude",r||l)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(t,e){const i=[],s="all"===t;(s||"main"===t)&&i.push(this.mainPlaylistLoader_);const n=[];(s||"audio"===t)&&n.push("AUDIO"),(s||"subtitle"===t)&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach((t=>{const e=this.mediaTypes_[t]&&this.mediaTypes_[t].activePlaylistLoader;e&&i.push(e)})),["main","audio","subtitle"].forEach((e=>{const s=this[`${e}SegmentLoader_`];!s||t!==e&&"all"!==t||i.push(s)})),i.forEach((t=>e.forEach((e=>{"function"==typeof t[e]&&t[e]()}))))}setCurrentTime(t){const e=_a(this.tech_.buffered(),t);return this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media()&&this.mainPlaylistLoader_.media().segments?e&&e.length?t:(this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),void this.load()):0}duration(){if(!this.mainPlaylistLoader_)return 0;const t=this.mainPlaylistLoader_.media();return t?t.endList?this.mediaSource?this.mediaSource.duration:Au.Playlist.duration(t):1/0:0}seekable(){return this.seekable_}getSeekableRange_(t,e){const i=t.media();if(!i)return null;const s=this.syncController_.getMediaSequenceSync(e);if(s&&s.isReliable){const t=s.start,e=s.end;if(!isFinite(t)||!isFinite(e))return null;const n=Au.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i);return Ma([[t,Math.max(t,e-n)]])}const n=this.syncController_.getExpiredTime(i,this.duration());if(null===n)return null;const r=Au.Playlist.seekable(i,n,Au.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,i));return r.length?r:null}computeFinalSeekable_(t,e){if(!e)return t;const i=t.start(0),s=t.end(0),n=e.start(0),r=e.end(0);return n>s||i>r?t:Ma([[Math.max(i,n),Math.min(s,r)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const t=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!t)return;let e;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(e=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!e))return;const i=this.seekable_;this.seekable_=this.computeFinalSeekable_(t,e),this.seekable_&&(i&&i.length&&this.seekable_.length&&i.start(0)===this.seekable_.start(0)&&i.end(0)===this.seekable_.end(0)||(this.logger_(`seekable updated [${Fa(this.seekable_)}]`),this.trigger({type:"seekablerangeschanged",metadata:{seekableRanges:this.seekable_}}),this.tech_.trigger("seekablechanged")))}updateDuration(t){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),"open"!==this.mediaSource.readyState)return this.updateDuration_=this.updateDuration.bind(this,t),void this.mediaSource.addEventListener("sourceopen",this.updateDuration_);if(t){const t=this.seekable();if(!t.length)return;return void((isNaN(this.mediaSource.duration)||this.mediaSource.duration<t.end(t.length-1))&&this.sourceUpdater_.setDuration(t.end(t.length-1)))}const e=this.tech_.buffered();let i=Au.Playlist.duration(this.mainPlaylistLoader_.media());e.length>0&&(i=Math.max(i,e.end(e.length-1))),this.mediaSource.duration!==i&&this.sourceUpdater_.setDuration(i)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach((t=>{const e=this.mediaTypes_[t].groups;for(const t in e)e[t].forEach((t=>{t.playlistLoader&&t.playlistLoader.dispose()}))})),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const t=!!this.mediaTypes_.AUDIO.activePlaylistLoader,e=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!t||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!e||!i)}getCodecsOrExclude_(){const t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},e=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();t.video=t.main;const i=bh(this.main(),e),s={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(s.video=i.video||t.main.videoCodec||"avc1.4d400d"),t.main.isMuxed&&(s.video+=`,${i.audio||t.main.audioCodec||vt}`),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||n)&&(s.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||vt,t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),!s.audio&&!s.video)return void this.excludePlaylist({playlistToExclude:e,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});const r=(t,e)=>t?ft(e,this.usingManagedMediaSource_):pt(e),o={};let a;if(["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]),"audio"===e&&(a=i)}})),n&&a&&e.attributes.AUDIO){const t=e.attributes.AUDIO;this.main().playlists.forEach((i=>{(i.attributes&&i.attributes.AUDIO)===t&&i!==e&&(i.excludeUntil=1/0)})),this.logger_(`excluding audio group ${t} as ${a} does not support codec(s): "${s.audio}"`)}if(!Object.keys(o).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const t=[];if(["video","audio"].forEach((e=>{const i=(ut(this.sourceUpdater_.codecs[e]||"")[0]||{}).type,n=(ut(s[e]||"")[0]||{}).type;i&&n&&i.toLowerCase()!==n.toLowerCase()&&t.push(`"${this.sourceUpdater_.codecs[e]}" -> "${s[e]}"`)})),t.length)return void this.excludePlaylist({playlistToExclude:e,error:{message:`Codec switching not supported: ${t.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0})}return s}{const t=Object.keys(o).reduce(((t,e)=>(t&&(t+=", "),t+`${e} does not support codec(s): "${o[e].join(",")}"`)),"")+".";this.excludePlaylist({playlistToExclude:e,error:{internal:!0,message:t},playlistExclusionDuration:1/0})}}tryToCreateSourceBuffers_(){if("open"!==this.mediaSource.readyState||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,e=[];Object.keys(t).forEach((i=>{const s=t[i];if(-1!==e.indexOf(s.id))return;e.push(s.id);const n=bh(this.main,s),r=[];!n.audio||pt(n.audio)||ft(n.audio,this.usingManagedMediaSource_)||r.push(`audio codec ${n.audio}`),!n.video||pt(n.video)||ft(n.video,this.usingManagedMediaSource_)||r.push(`video codec ${n.video}`),n.text&&"stpp.ttml.im1t"===n.text&&r.push(`text codec ${n.text}`),r.length&&(s.excludeUntil=1/0,this.logger_(`excluding ${s.id} for unsupported: ${r.join(", ")}`))}))}excludeIncompatibleVariants_(t){const e=[],i=this.main().playlists,s=gh(ut(t)),n=yh(s),r=s.video&&ut(s.video)[0]||null,o=s.audio&&ut(s.audio)[0]||null;Object.keys(i).forEach((t=>{const s=i[t];if(-1!==e.indexOf(s.id)||s.excludeUntil===1/0)return;e.push(s.id);const a=[],h=bh(this.mainPlaylistLoader_.main,s),l=yh(h);if(h.audio||h.video){if(l!==n&&a.push(`codec count "${l}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const t=h.video&&ut(h.video)[0]||null,e=h.audio&&ut(h.audio)[0]||null;t&&r&&t.type.toLowerCase()!==r.type.toLowerCase()&&a.push(`video codec "${t.type}" !== "${r.type}"`),e&&o&&e.type.toLowerCase()!==o.type.toLowerCase()&&a.push(`audio codec "${e.type}" !== "${o.type}"`)}a.length&&(s.excludeUntil=1/0,this.logger_(`excluding ${s.id}: ${a.join(" && ")}`))}}))}updateAdCues_(t){let e=0;const i=this.seekable();i.length&&(e=i.start(0)),function(t,e,i=0){if(!t.segments)return;let s,n=i;for(let i=0;i<t.segments.length;i++){const r=t.segments[i];if(s||(s=ou(e,n+r.duration/2)),s){if("cueIn"in r){s.endTime=n,s.adEndTime=n,n+=r.duration,s=null;continue}if(n<s.endTime){n+=r.duration;continue}s.endTime+=r.duration}else if("cueOut"in r&&(s=new p.VTTCue(n,n+r.duration,r.cueOut),s.adStartTime=n,s.adEndTime=n+parseFloat(r.cueOut),e.addCue(s)),"cueOutCont"in r){const[t,i]=r.cueOutCont.split("/").map(parseFloat);s=new p.VTTCue(n,n+r.duration,""),s.adStartTime=n-t,s.adEndTime=s.adStartTime+i,e.addCue(s)}n+=r.duration}}(t,this.cueTagsTrack_,e)}goalBufferLength(){const t=this.tech_.currentTime(),e=Gh.GOAL_BUFFER_LENGTH,i=Gh.GOAL_BUFFER_LENGTH_RATE,s=Math.max(e,Gh.MAX_GOAL_BUFFER_LENGTH);return Math.min(e+t*i,s)}bufferLowWaterLine(){const t=this.tech_.currentTime(),e=Gh.BUFFER_LOW_WATER_LINE,i=Gh.BUFFER_LOW_WATER_LINE_RATE,s=Math.max(e,Gh.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(e,Gh.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(e+t*i,this.bufferBasedABR?n:s)}bufferHighWaterLine(){return Gh.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(t){Al(this.inbandTextTracks_,"com.apple.streaming",this.tech_),(({inbandTextTracks:t,dateRanges:e})=>{const i=t.metadataTrack_;if(!i)return;const s=p.WebKitDataCue||p.VTTCue;e.forEach((t=>{for(const e of Object.keys(t)){if(xl.has(e))continue;const n=new s(t.startTime,t.endTime,"");n.id=t.id,n.type="com.apple.quicktime.HLS",n.value={key:kl[e],data:t[e]},"scte35Out"!==e&&"scte35In"!==e||(n.value.data=new Uint8Array(n.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(n)}t.processDateRange()}))})({inbandTextTracks:this.inbandTextTracks_,dateRanges:t})}addMetadataToTextTrack(t,e,i){const s=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Al(this.inbandTextTracks_,t,this.tech_),(({inbandTextTracks:t,metadataArray:e,timestampOffset:i,videoDuration:s})=>{if(!e)return;const n=p.WebKitDataCue||p.VTTCue,r=t.metadataTrack_;if(!r)return;if(e.forEach((t=>{const e=t.cueTime+i;!("number"!=typeof e||p.isNaN(e)||e<0)&&e<1/0&&t.frames&&t.frames.length&&t.frames.forEach((t=>{const i=new n(e,e,t.value||t.url||t.data||"");i.frame=t,i.value=t,function(t){Object.defineProperties(t.frame,{id:{get:()=>(Sa.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key)},value:{get:()=>(Sa.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data)},privateData:{get:()=>(Sa.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data)}})}(i),r.addCue(i)}))})),!r.cues||!r.cues.length)return;const o=r.cues,a=[];for(let t=0;t<o.length;t++)o[t]&&a.push(o[t]);const h=a.reduce(((t,e)=>{const i=t[e.startTime]||[];return i.push(e),t[e.startTime]=i,t}),{}),l=Object.keys(h).sort(((t,e)=>Number(t)-Number(e)));l.forEach(((t,e)=>{const i=h[t],n=isFinite(s)?s:t,r=Number(l[e+1])||n;i.forEach((t=>{t.endTime=r}))}))})({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){for(const e of t.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(e));this.contentSteeringController_.assignTagProperties(t.uri,t.contentSteering),this.contentSteeringController_.queryBeforeStart?this.contentSteeringController_.requestSteeringManifest(!0):this.tech_.one("canplay",(()=>{this.contentSteeringController_.requestSteeringManifest()}))}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach((t=>{this.contentSteeringController_.on(t,(t=>{this.trigger(b({},t))}))})),"dash"===this.sourceType_&&this.mainPlaylistLoader_.on("loadedplaylist",(()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const e=this.contentSteeringController_.getAvailablePathways(),i=[];for(const s of t.playlists){const t=s.attributes.serviceLocation;if(t&&(i.push(t),!e.has(t)))return!0}return!(i.length||!e.size)})())&&this.resetContentSteeringController_()}))}excludeThenChangePathway_(){const t=this.contentSteeringController_.getPathway();if(!t)return;this.handlePathwayClones_();const e=this.main().playlists,i=new Set;let s=!1;Object.keys(e).forEach((n=>{const r=e[n],o=this.pathwayAttribute_(r),a=o&&t!==o;r.excludeUntil===1/0&&"content-steering"===r.lastExcludeReason_&&!a&&(delete r.excludeUntil,delete r.lastExcludeReason_,s=!0);const h=!r.excludeUntil&&r.excludeUntil!==1/0;!i.has(r.id)&&a&&h&&(i.add(r.id),r.excludeUntil=1/0,r.lastExcludeReason_="content-steering",this.logger_(`excluding ${r.id} for ${r.lastExcludeReason_}`))})),"DASH"===this.contentSteeringController_.manifestType_&&Object.keys(this.mediaTypes_).forEach((e=>{const i=this.mediaTypes_[e];if(i.activePlaylistLoader){const e=i.activePlaylistLoader.media_;e&&e.attributes.serviceLocation!==t&&(s=!0)}})),s&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,e=this.contentSteeringController_.currentPathwayClones,i=this.contentSteeringController_.nextPathwayClones;if(e&&e.size||i&&i.size){for(const[t,s]of e.entries())i.get(t)||(this.mainPlaylistLoader_.updateOrDeleteClone(s),this.contentSteeringController_.excludePathway(t));for(const[s,n]of i.entries()){const i=e.get(s);i?this.equalPathwayClones_(i,n)||(this.mainPlaylistLoader_.updateOrDeleteClone(n,!0),this.contentSteeringController_.addAvailablePathway(s)):(t.filter((t=>t.attributes["PATHWAY-ID"]===n["BASE-ID"])).forEach((t=>{this.mainPlaylistLoader_.addClonePathway(n,t)})),this.contentSteeringController_.addAvailablePathway(s))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...i])))}}equalPathwayClones_(t,e){if(t["BASE-ID"]!==e["BASE-ID"]||t.ID!==e.ID||t["URI-REPLACEMENT"].HOST!==e["URI-REPLACEMENT"].HOST)return!1;const i=t["URI-REPLACEMENT"].PARAMS,s=e["URI-REPLACEMENT"].PARAMS;for(const t in i)if(i[t]!==s[t])return!1;for(const t in s)if(i[t]!==s[t])return!1;return!0}changeSegmentPathway_(){const t=this.selectPlaylist();this.pauseLoading(),"DASH"===this.contentSteeringController_.manifestType_&&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);s&&s.size&&s.forEach((s=>{const n="usable",r=this.keyStatusMap_.has(s)&&this.keyStatusMap_.get(s)===n;r?r&&i.lastExcludeReason_===e&&i.excludeUntil===1/0&&(delete i.excludeUntil,delete i.lastExcludeReason_,this.logger_(`enabling playlist ${i.id} because key ID ${s} is ${n}`)):(i.excludeUntil!==1/0&&i.lastExcludeReason_!==e&&(i.excludeUntil=1/0,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++)}))})),t>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach((t=>{t&&t.attributes&&t.attributes.RESOLUTION&&t.attributes.RESOLUTION.height<720&&t.excludeUntil===1/0&&t.lastExcludeReason_===e&&(delete t.excludeUntil,Sa.log.warn(`enabling non-HD playlist ${t.id} because all playlists were excluded due to ${e} key IDs`))}))}addKeyStatus_(t,e){const i=("string"==typeof t?t:(t=>{const e=new Uint8Array(t);return Array.from(e).map((t=>t.toString(16).padStart(2,"0"))).join("")})(t)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${e}' with key ID ${i} added to the keyStatusMap`),this.keyStatusMap_.set(i,e)}updatePlaylistByKeyStatus(t,e){this.addKeyStatus_(t,e),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_()}}class Cu{constructor(t,e,i){const{playlistController_:s}=t,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"]}var r,o,a;this.codecs=bh(s.main(),e),this.playlist=e,this.id=i,this.enabled=(r=t.playlists,o=e.id,a=n,t=>{const e=r.main.playlists[o],i=Qa(e),s=Za(e);if(void 0===t)return s;t?delete e.disabled:e.disabled=!0;const n={renditionInfo:{id:o,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:"fast-quality"};return t===s||i||(t?(a(e),r.trigger({type:"renditionenabled",metadata:n})):r.trigger({type:"renditiondisabled",metadata:n})),t})}}const Nu=["seeking","seeked","pause","playing","error"];class Mu extends Sa.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_=Ca("PlaybackWatcher"),this.logger_("initialize");const e=()=>this.monitorCurrentTime_(),i=()=>this.monitorCurrentTime_(),s=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),r=this.playlistController_,o=["main","subtitle","audio"],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_=()=>{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(Nu,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(Nu,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)})),this.checkCurrentTimeTimeout_&&p.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&p.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=p.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(t){const e=this.playlistController_[`${t}SegmentLoader_`];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_,i=e[`${t}SegmentLoader_`],s=i.buffered_(),n=function(t,e){if(t===e)return!1;if(!t&&e||!e&&t)return!0;if(t.length!==e.length)return!0;for(let i=0;i<t.length;i++)if(t.start(i)!==e.start(i)||t.end(i)!==e.end(i))return!0;return!1}(this[`${t}Buffered_`],s);if(this[`${t}Buffered_`]=s,n)return e.trigger({type:"bufferedrangeschanged",metadata:{bufferedRanges:s}}),void this.resetSegmentDownloads_(t);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:$a(s)}),this[`${t}StalledDownloads_`]<10||(this.logger_(`${t} loader stalled download exclusion`),this.resetSegmentDownloads_(t),this.tech_.trigger({type:"usage",name:`vhs-${t}-download-exclusion`}),"subtitle"!==t&&e.excludePlaylist({error:{message:`Excessive ${t} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const t=this.tech_.currentTime(),e=this.tech_.buffered();if(this.lastRecordedTime===t&&(!e.length||t+Ra>=e.end(e.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&t===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):t===this.lastRecordedTime?this.consecutiveUpdates++:(this.playedRanges_.push(Ma([this.lastRecordedTime,t])),this.playlistController_.trigger({type:"playedrangeschanged",metadata:{playedRanges:this.playedRanges_}}),this.consecutiveUpdates=0,this.lastRecordedTime=t)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),e=this.tech_.currentTime();let i;if(this.afterSeekableWindow_(t,e,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(i=t.end(t.length-1)),this.beforeSeekableWindow_(t,e)){const e=t.start(0);i=e+(e===t.end(0)?0:Ra)}if(void 0!==i)return this.logger_(`Trying to seek outside of seekable at time ${e} with seekable range ${Fa(t)}. Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0;const s=this.playlistController_.sourceUpdater_,n=this.tech_.buffered(),r=s.audioBuffer?s.audioBuffered():null,o=s.videoBuffer?s.videoBuffered():null,a=this.media(),h=a.partTargetDuration?a.partTargetDuration:2*(a.targetDuration-Oa),l=[r,o];for(let t=0;t<l.length;t++)if(l[t]&&Ua(l[t],e)<h)return!1;const u=La(n,e);return 0!==u.length&&(i=u.start(0)+Ra,this.logger_(`Buffered region starts (${u.start(0)}) just beyond seek point (${e}). Seeking to ${i}.`),this.tech_.setCurrentTime(i),!0)}waiting_(){if(this.techWaiting_())return;const t=this.tech_.currentTime(),e=this.tech_.buffered(),i=_a(e,t);return 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.`),void this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"})):void 0}techWaiting_(){const t=this.seekable(),e=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(t,e)){const i=t.end(t.length-1);return 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"}),!0}const i=this.tech_.vhs.playlistController_.sourceUpdater_,s=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:e}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const n=La(s,e);return n.length>0&&(this.logger_(`Stopped at ${e} and seeking to ${n.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(e),!0)}afterSeekableWindow_(t,e,i,s=!1){if(!t.length)return!1;let n=t.end(t.length-1)+Ra;return!i.endList&&("number"==typeof i.partTargetDuration||s)&&(n=t.end(t.length-1)+3*i.targetDuration),e>n}beforeSeekableWindow_(t,e){return!!(t.length&&t.start(0)>0&&e<t.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:t,audioBuffered:e,currentTime:i}){if(!t)return;let s;if(t.length&&e.length){const n=_a(t,i-3),r=_a(t,i),o=_a(e,i);o.length&&!r.length&&n.length&&(s={start:n.end(0),end:o.end(0)})}else La(t,i).length||(s=this.gapFromVideoUnderflow_(t,i));return!!s&&(this.logger_(`Encountered a gap in video from ${s.start} to ${s.end}. Seeking to current time ${i}`),!0)}skipTheGap_(t){const e=this.tech_.buffered(),i=this.tech_.currentTime(),s=La(e,i);if(this.resetTimeUpdate_(),0===s.length||i!==t)return;this.logger_("skipTheGap_:","currentTime:",i,"scheduled currentTime:",t,"nextRange start:",s.start(0)),this.tech_.setCurrentTime(s.start(0)+Oa);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=function(t){if(t.length<2)return Ma();const e=[];for(let i=1;i<t.length;i++){const s=t.end(i-1),n=t.start(i);e.push([s,n])}return Ma(e)}(t);for(let t=0;t<i.length;t++){const s=i.start(t),n=i.end(t);if(e-s<4&&e-s>2)return{start:s,end:n}}return null}}const Ou={errorInterval:30,getSource(t){return t(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Ru=function(t,e){let i=0,s=0;const n=Na(Ou,e);t.ready((()=>{t.trigger({type:"usage",name:"vhs-error-reload-initialized"})}));const r=function(){s&&t.currentTime(s)},o=function(e){null!=e&&(s=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",r),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.play())},a=function(){if(Date.now()-i<1e3*n.errorInterval)t.trigger({type:"usage",name:"vhs-error-reload-canceled"});else{if(n.getSource&&"function"==typeof n.getSource)return i=Date.now(),n.getSource.call(t,o);Sa.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")}},h=function(){t.off("loadedmetadata",r),t.off("error",a),t.off("dispose",h)};t.on("error",a),t.on("dispose",h),t.reloadSourceOnError=function(e){h(),Ru(t,e)}};var Pu="3.17.5";const _u={PlaylistLoader:Ih,Playlist:rh,utils:$h,STANDARD_PLAYLIST_SELECTOR:Tl,INITIAL_PLAYLIST_SELECTOR:function(){const t=this.playlists.main.playlists.filter(rh.isEnabled);return bl(t,((t,e)=>jl(t,e))),t.filter((t=>!!bh(this.playlists.main,t).video))[0]||null},lastBandwidthSelector:Tl,movingAverageBandwidthSelector:function(t){let e=-1,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&&p.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),e<0&&(e=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(e=t*this.systemBandwidth+(1-t)*e,i=this.systemBandwidth),wl({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(yl(this.tech_.el(),"width"),10)*s,playerHeight:parseInt(yl(this.tech_.el(),"height"),10)*s,playerObjectFit:this.usePlayerObjectFit?yl(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},comparePlaylistBandwidth:jl,comparePlaylistResolution:function(t,e){let i,s;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),i=i||p.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(s=e.attributes.RESOLUTION.width),s=s||p.Number.MAX_VALUE,i===s&&t.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?t.attributes.BANDWIDTH-e.attributes.BANDWIDTH:i-s},xhr:Ch()};Object.keys(Gh).forEach((t=>{Object.defineProperty(_u,t,{get:()=>(Sa.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`),Gh[t]),set(e){Sa.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`),"number"!=typeof e||e<0?Sa.log.warn(`value of Vhs.${t} must be greater than or equal to 0`):Gh[t]=e}})}));const Lu="videojs-vhs",Fu=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"})};_u.canPlaySource=function(){return Sa.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const $u=()=>{if(!p.localStorage)return null;const t=p.localStorage.getItem(Lu);if(!t)return null;try{return JSON.parse(t)}catch(t){return null}},Bu=(t,e)=>{t._requestCallbackSet||(t._requestCallbackSet=new Set),t._requestCallbackSet.add(e)},Uu=(t,e)=>{t._responseCallbackSet||(t._responseCallbackSet=new Set),t._responseCallbackSet.add(e)},qu=(t,e)=>{t._requestCallbackSet&&(t._requestCallbackSet.delete(e),t._requestCallbackSet.size||delete t._requestCallbackSet)},Vu=(t,e)=>{t._responseCallbackSet&&(t._responseCallbackSet.delete(e),t._responseCallbackSet.size||delete t._responseCallbackSet)};_u.supportsNativeHls=function(){if(!g||!g.createElement)return!1;const t=g.createElement("video");return!!Sa.getTech("Html5").isSupported()&&["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some((function(e){return/maybe|probably/i.test(t.canPlayType(e))}))}(),_u.supportsNativeDash=!!(g&&g.createElement&&Sa.getTech("Html5").isSupported())&&/maybe|probably/i.test(g.createElement("video").canPlayType("application/dash+xml")),_u.supportsTypeNatively=t=>"hls"===t?_u.supportsNativeHls:"dash"===t&&_u.supportsNativeDash,_u.isSupported=function(){return Sa.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},_u.xhr.onRequest=function(t){Bu(_u.xhr,t)},_u.xhr.onResponse=function(t){Uu(_u.xhr,t)},_u.xhr.offRequest=function(t){qu(_u.xhr,t)},_u.xhr.offResponse=function(t){Vu(_u.xhr,t)};const zu=Sa.getComponent("Component");class Hu extends zu{constructor(t,e,i){if(super(e,i.vhs),"number"==typeof i.initialBandwidth&&(this.options_.bandwidth=i.initialBandwidth),this.logger_=Ca("VhsHandler"),e.options_&&e.options_.playerId){const t=Sa.getPlayer(e.options_.playerId);this.player_=t}if(this.tech_=e,this.source_=t,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&e.overrideNativeAudioTracks&&e.overrideNativeVideoTracks)e.overrideNativeAudioTracks(!0),e.overrideNativeVideoTracks(!0);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(g,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],(()=>{const t=g.fullscreenElement||g.webkitFullscreenElement||g.mozFullScreenElement||g.msFullscreenElement;t&&t.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()})),this.on(this.tech_,"seeking",(function(){this.ignoreNextSeekingEvent_?this.ignoreNextSeekingEvent_=!1:this.setCurrentTime(this.tech_.currentTime())})),this.on(this.tech_,"error",(function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()})),this.on(this.tech_,"play",this.play)}setOptions_(t={}){if(this.options_=Na(this.options_,t),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=!1!==this.options_.limitRenditionByPlayerDimensions,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=void 0!==this.source_.useBandwidthFromLocalStorage?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=void 0===this.options_.useNetworkInformationApi||this.options_.useNetworkInformationApi,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=!1!==this.options_.llhls,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,"number"!=typeof this.options_.playlistExclusionDuration&&(this.options_.playlistExclusionDuration=60),"number"!=typeof this.options_.bandwidth&&this.options_.useBandwidthFromLocalStorage){const t=$u();t&&t.bandwidth&&(this.options_.bandwidth=t.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),t&&t.throughput&&(this.options_.throughput=t.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}"number"!=typeof this.options_.bandwidth&&(this.options_.bandwidth=Gh.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Gh.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach((t=>{void 0!==this.source_[t]&&(this.options_[t]=this.source_[t])})),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const e=this.options_.customPixelRatio;"number"==typeof e&&e>=0&&(this.customPixelRatio=e)}setOptions(t={}){this.setOptions_(t)}src(t,e){if(!t)return;var i;this.setOptions_(),this.options_.src=0===(i=this.source_.src).toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")?JSON.parse(i.substring(i.indexOf(",")+1)):i,this.options_.tech=this.tech_,this.options_.externVhs=_u,this.options_.sourceType=yt(e),this.options_.seekTo=t=>{this.tech_.setCurrentTime(t)},this.options_.player_=this.player_,this.playlistController_=new Du(this.options_);const s=Na({liveRangeSafeTimeDelta:Ra},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new Mu(s),this.attachStreamingEventListeners_(),this.playlistController_.on("error",(()=>{const t=Sa.players[this.tech_.options_.playerId];let e=this.playlistController_.error;"object"!=typeof e||e.code?"string"==typeof e&&(e={message:e,code:3}):e.code=3,t.error(e)}));const n=this.options_.bufferBasedABR?_u.movingAverageBandwidthSelector(.55):_u.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):n.bind(this),this.playlistController_.selectInitialPlaylist=_u.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=p.navigator.connection||p.navigator.mozConnection||p.navigator.webkitConnection,i=1e7;if(this.options_.useNetworkInformationApi&&e){const s=1e3*e.downlink*1e3;t=s>=i&&t>=i?Math.max(t,s):s}return t},set(t){this.playlistController_.mainSegmentLoader_.bandwidth=t,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){let t;return t=this.throughput>0?1/this.throughput:0,Math.floor(1/(1/(this.bandwidth||1)+t))},set(){Sa.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>$a(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>$a(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",(()=>{this.options_.useBandwidthFromLocalStorage&&(t=>{if(!p.localStorage)return!1;let e=$u();e=e?Na(e,t):t;try{p.localStorage.setItem(Lu,JSON.stringify(e))}catch(t){return!1}})({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})})),this.playlistController_.on("selectedinitialmedia",(()=>{var t;(t=this).representations=()=>{const e=t.playlistController_.main(),i=nh(e)?t.playlistController_.getAudioTrackPlaylists_():e.playlists;return i?i.filter((t=>!Qa(t))).map((e=>new Cu(t,e,e.id))):[]}})),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",(()=>{this.setupEme_()})),this.on(this.playlistController_,"progress",(function(){this.tech_.trigger("progress")})),this.on(this.playlistController_,"firstplay",(function(){this.ignoreNextSeekingEvent_=!0})),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=p.URL.createObjectURL(this.playlistController_.mediaSource),(Sa.browser.IS_ANY_SAFARI||Sa.browser.IS_IOS)&&this.options_.overrideNative&&"hls"===this.options_.sourceType&&"function"==typeof this.tech_.addSourceElement?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const t=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),(({player:t,sourceKeySystems:e,audioMedia:i,mainPlaylists:s})=>{if(!t.eme.initializeMediaKeys)return Promise.resolve();const n=(a=i?s.concat([i]):s,h=Object.keys(e),a.reduce(((t,e)=>{if(!e.contentProtection)return t;const i=h.reduce(((t,i)=>{const s=e.contentProtection[i];return s&&s.pssh&&(t[i]={pssh:s.pssh}),t}),{});return Object.keys(i).length&&t.push(i),t}),[])),r=[],o=[];var a,h;return n.forEach((e=>{o.push(new Promise((e=>{t.tech_.one("keysessioncreated",e)}))),r.push(new Promise(((i,s)=>{t.eme.initializeMediaKeys({keySystems:e},(t=>{t?s(t):i()}))})))})),Promise.race([Promise.all(r),Promise.race(o)])})({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,e=(({player:t,sourceKeySystems:e,media:i,audioMedia:s})=>{const n=((t,e,i)=>{if(!t)return t;let s={};e&&e.attributes&&e.attributes.CODECS&&(s=gh(ut(e.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(s.audio=i.attributes.CODECS);const n=dt(s.video),r=dt(s.audio),o={};for(const i in t)o[i]={},r&&(o[i].audioContentType=r),n&&(o[i].videoContentType=n),e.contentProtection&&e.contentProtection[i]&&e.contentProtection[i].pssh&&(o[i].pssh=e.contentProtection[i].pssh),"string"==typeof t[i]&&(o[i].url=t[i]);return Na(t,o)})(e,i,s);return!(!n||(t.currentSource().keySystems=n,n&&!t.eme&&(Sa.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1)))})({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_),e?this.createKeySessions_():this.playlistController_.sourceUpdater_.initializedEme()}setupQualityLevels_(){const t=Sa.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.playlistController_.on("selectedinitialmedia",(()=>{!function(t,e){e.representations().forEach((e=>{t.addQualityLevel(e)})),Fu(t,e.playlists)}(this.qualityLevels_,this)})),this.playlists.on("mediachange",(()=>{Fu(this.qualityLevels_,this.playlists)})))}static version(){return{"@videojs/http-streaming":Pu,"mux.js":"7.1.0","mpd-parser":"1.4.0","m3u8-parser":"7.2.0","aes-decrypter":"4.0.2"}}version(){return this.constructor.version()}canChangeType(){return eu.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(t){this.playlistController_.setCurrentTime(t)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&p.URL.revokeObjectURL&&(p.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(t,e){return(({playlist:t,time:e,callback:i})=>{if(!i)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===e)return i({message:"getProgramTime: playlist and time must be provided"});const s=((t,e)=>{if(!e||!e.segments||0===e.segments.length)return null;let i,s=0;for(let n=0;n<e.segments.length&&(i=e.segments[n],s=i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationEnd:s+i.duration,!(t<=s));n++);const n=e.segments[e.segments.length-1];if(n.videoTimingInfo&&n.videoTimingInfo.transmuxedPresentationEnd<t)return null;if(t>s){if(t>s+.25*n.duration)return null;i=n}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:s-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}})(e,t);if(!s)return i({message:"valid programTime was not found"});if("estimate"===s.type)return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});const n={mediaSeconds:e},r=((t,e)=>{if(!e.dateTimeObject)return null;const i=t-(e.videoTimingInfo.transmuxedPresentationStart+e.videoTimingInfo.transmuxerPrependedSeconds);return new Date(e.dateTimeObject.getTime()+1e3*i)})(e,s.segment);return r&&(n.programDateTime=r.toISOString()),i(null,n)})({playlist:this.playlistController_.media(),time:t,callback:e})}seekToProgramTime(t,e,i=!0,s=2){return Bh({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=>{Bu(this.xhr,t)},this.xhr.onResponse=t=>{Uu(this.xhr,t)},this.xhr.offRequest=t=>{qu(this.xhr,t)},this.xhr.offResponse=t=>{Vu(this.xhr,t)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach((t=>{this.playlistController_.on(t,(t=>{this.player_.trigger(b({},t))}))})),["gapjumped","playedrangeschanged"].forEach((t=>{this.playbackWatcher_.on(t,(t=>{this.player_.trigger(b({},t))}))}))}}const Xu={name:"videojs-http-streaming",VERSION:Pu,canHandleSource(t,e={}){const i=Na(Sa.options,e);return!(!i.vhs.experimentalUseMMS&&!ft("avc1.4d400d,mp4a.40.2",!1))&&Xu.canPlayType(t.type,i)},handleSource(t,e,i={}){const s=Na(Sa.options,i);return e.vhs=new Hu(t,e,s),e.vhs.xhr=Ch(),e.vhs.setupXhrHooks_(),e.vhs.src(t.src,t.type),e.vhs},canPlayType(t,e){const i=yt(t);if(!i)return"";const s=Xu.getOverrideNative(e);return!_u.supportsTypeNatively(i)||s?"maybe":""},getOverrideNative(t={}){const{vhs:e={}}=t,i=!(Sa.browser.IS_ANY_SAFARI||Sa.browser.IS_IOS),{overrideNative:s=i}=e;return s}};ft("avc1.4d400d,mp4a.40.2",!0)&&Sa.getTech("Html5").registerSourceHandler(Xu,0),Sa.VhsHandler=Hu,Sa.VhsSourceHandler=Xu,Sa.Vhs=_u,Sa.use||Sa.registerComponent("Vhs",_u),Sa.options.vhs=Sa.options.vhs||{},Sa.getPlugin&&Sa.getPlugin("reloadSourceOnError")||Sa.registerPlugin("reloadSourceOnError",(function(t){Ru(this,t)}));var Gu,Yu=u(Object.freeze({__proto__:null,default:Sa}));Gu||(Gu=1,function(t){var e,i,s,n,r,o,a,h,l=t.browser.IS_IOS||t.browser.IS_NATIVE_ANDROID,u=t.getTech("Tech");class c extends u{constructor(t,e){super(t,e),this.setPoster(t.poster),this.setSrc(this.options_.source,!0),this.setTimeout(function(){this.el_&&(this.el_.parentNode.className+=" vjs-youtube",l&&(this.el_.parentNode.className+=" vjs-youtube-mobile"),c.isApiReady?this.initYTPlayer():c.apiReadyQueue.push(this))}.bind(this))}dispose(){if(this.ytPlayer)this.ytPlayer.stopVideo&&this.ytPlayer.stopVideo(),this.ytPlayer.destroy&&this.ytPlayer.destroy();else{var t=c.apiReadyQueue.indexOf(this);-1!==t&&c.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_),u.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 e=document.createElement("div");if(e.appendChild(t),!l&&!this.options_.ytControls){var i=document.createElement("div");i.setAttribute("class","vjs-iframe-blocker"),i.setAttribute("style","position:absolute;top:0;left:0;width:100%;height:100%"),i.onclick=function(){this.pause()}.bind(this),e.appendChild(i)}return e}initYTPlayer(){var t={controls:0,modestbranding:1,rel:0,showinfo:0,loop:this.options_.loop?1:0};if(void 0!==this.options_.autohide&&(t.autohide=this.options_.autohide),void 0!==this.options_.cc_load_policy&&(t.cc_load_policy=this.options_.cc_load_policy),void 0!==this.options_.ytControls&&(t.controls=this.options_.ytControls),void 0!==this.options_.disablekb&&(t.disablekb=this.options_.disablekb),void 0!==this.options_.color&&(t.color=this.options_.color),t.controls?void 0!==this.options_.fs&&(t.fs=this.options_.fs):t.fs=0,-1!==this.options_.source.src.indexOf("end=")){var e=this.options_.source.src.match(/end=([0-9]*)/);this.options_.end=parseInt(e[1])}if(void 0!==this.options_.end&&(t.end=this.options_.end),void 0!==this.options_.hl?t.hl=this.options_.hl:void 0!==this.options_.language&&(t.hl=this.options_.language.substr(0,2)),void 0!==this.options_.iv_load_policy&&(t.iv_load_policy=this.options_.iv_load_policy),void 0!==this.options_.list?t.list=this.options_.list:this.url&&void 0!==this.url.listId&&(t.list=this.url.listId),void 0!==this.options_.listType&&(t.listType=this.options_.listType),void 0!==this.options_.modestbranding&&(t.modestbranding=this.options_.modestbranding),void 0!==this.options_.playlist&&(t.playlist=this.options_.playlist),void 0!==this.options_.playsinline&&(t.playsinline=this.options_.playsinline),void 0!==this.options_.rel&&(t.rel=this.options_.rel),void 0!==this.options_.showinfo&&(t.showinfo=this.options_.showinfo),-1!==this.options_.source.src.indexOf("start=")){var i=this.options_.source.src.match(/start=([0-9]*)/);this.options_.start=parseInt(i[1])}if(void 0!==this.options_.start&&(t.start=this.options_.start),void 0!==this.options_.theme&&(t.theme=this.options_.theme),void 0!==this.options_.customVars){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)}};void 0!==this.options_.enablePrivacyEnhancedMode&&this.options_.enablePrivacyEnhancedMode&&(n.host="https://www.youtube-nocookie.com"),this.ytPlayer=new YT.Player(this.options_.techId,n)}onPlayerReady(){this.options_.muted&&this.ytPlayer.mute(),this.ytPlayer.getAvailablePlaybackRates().length>1&&(this.featuresPlaybackRate=!0),this.playerReady_=!0,this.triggerReady(),this.playOnReady?this.play():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)switch(this.lastState=e,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"),this.isSeeking&&this.onSeeked();break;case YT.PlayerState.PAUSED:this.trigger("canplay"),this.isSeeking?this.onSeeked():this.trigger("pause");break;case YT.PlayerState.BUFFERING:this.player_.trigger("timeupdate"),this.player_.trigger("waiting")}}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};this.options_.start&&(e.startSeconds=this.options_.start),this.options_.end&&(e.endSeconds=this.options_.end),this.ytPlayer.loadVideoById(e)}cueVideoById_(t){var e={videoId:t};this.options_.start&&(e.startSeconds=this.options_.start),this.options_.end&&(e.endSeconds=this.options_.end),this.ytPlayer.cueVideoById(e)}src(t){return t&&this.setSrc({src:t}),this.source}poster(){return l?null:this.poster_}setPoster(t){this.poster_=t}setSrc(t){t&&t.src&&(delete this.errorNumber,this.source=t,this.url=c.parseUrl(t.src),this.options_.poster||this.url.videoId&&(this.poster_="https://img.youtube.com/vi/"+this.url.videoId+"/0.jpg",this.trigger("posterchange"),this.checkHighResPoster()),this.options_.autoplay&&!l?this.isReady_?this.play():this.playOnReady=!0:this.activeVideoId!==this.url.videoId&&(this.isReady_?(this.cueVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId):this.cueOnReady=!0))}autoplay(){return this.options_.autoplay}setAutoplay(t){this.options_.autoplay=t}loop(){return this.options_.loop}setLoop(t){this.options_.loop=t}play(){this.url&&this.url.videoId&&(this.wasPausedBeforeSeek=!1,this.isReady_?(this.url.listId&&(this.activeList===this.url.listId?this.ytPlayer.playVideo():(this.ytPlayer.loadPlaylist(this.url.listId),this.activeList=this.url.listId)),this.activeVideoId===this.url.videoId?this.ytPlayer.playVideo():(this.loadVideoById_(this.url.videoId),this.activeVideoId=this.url.videoId)):(this.trigger("waiting"),this.playOnReady=!0))}pause(){this.ytPlayer&&this.ytPlayer.pauseVideo()}paused(){return!this.ytPlayer||this.lastState!==YT.PlayerState.PLAYING&&this.lastState!==YT.PlayerState.BUFFERING}currentTime(){return this.ytPlayer?this.ytPlayer.getCurrentTime():0}setCurrentTime(t){this.lastState===YT.PlayerState.PAUSED&&(this.timeBeforeSeek=this.currentTime()),this.isSeeking||(this.wasPausedBeforeSeek=this.paused()),this.ytPlayer.seekTo(t,!0),this.trigger("timeupdate"),this.trigger("seeking"),this.isSeeking=!0,this.lastState===YT.PlayerState.PAUSED&&this.timeBeforeSeek!==t&&(clearInterval(this.checkSeekedInPauseInterval),this.checkSeekedInPauseInterval=setInterval(function(){this.lastState===YT.PlayerState.PAUSED&&this.isSeeking?this.currentTime()!==this.timeBeforeSeek&&(this.trigger("timeupdate"),this.onSeeked()):clearInterval(this.checkSeekedInPauseInterval)}.bind(this),250))}seeking(){return this.isSeeking}seekable(){return this.ytPlayer?t.createTimeRange(0,this.ytPlayer.getDuration()):t.createTimeRange()}onSeeked(){clearInterval(this.checkSeekedInPauseInterval),this.isSeeking=!1,this.wasPausedBeforeSeek&&this.pause(),this.trigger("seeked")}playbackRate(){return this.ytPlayer?this.ytPlayer.getPlaybackRate():1}setPlaybackRate(t){this.ytPlayer&&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}volume(){return this.ytPlayer?this.ytPlayer.getVolume()/100:1}setVolume(t){this.ytPlayer&&this.ytPlayer.setVolume(100*t)}muted(){return!!this.ytPlayer&&this.ytPlayer.isMuted()}setMuted(t){this.ytPlayer&&(this.muted(!0),t?this.ytPlayer.mute():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){}}}c.isSupported=function(){return!0},c.canPlaySource=function(t){return c.canPlayType(t.type)},c.canPlayType=function(t){return"video/youtube"===t},c.parseUrl=function(t){var e={videoId:null},i=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return i&&11===i[2].length&&(e.videoId=i[2]),(i=t.match(/[?&]list=([^#\&\?]+)/))&&i[1]&&(e.listId=i[1]),e},c.apiReadyQueue=[],"undefined"!=typeof document&&(n="https://www.youtube.com/iframe_api",r=function(){YT.ready((function(){c.isApiReady=!0;for(var t=0;t<c.apiReadyQueue.length;++t)c.apiReadyQueue[t].initYTPlayer()}))},o=!1,a=document.createElement("script"),(h=document.getElementsByTagName("script")[0])&&(h.parentNode.insertBefore(a,h),a.onload=function(){o||(o=!0,r())},a.onreadystatechange=function(){o||"complete"!==this.readyState&&"loaded"!==this.readyState||(o=!0,r())},a.src=n),e=".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; }",i=document.head||document.getElementsByTagName("head")[0],(s=document.createElement("style")).type="text/css",s.styleSheet?s.styleSheet.cssText=e:s.appendChild(document.createTextNode(e)),i.appendChild(s)),void 0!==t.registerTech?t.registerTech("Youtube",c):t.registerComponent("Youtube",c)}(Yu.default||Yu));const Wu=class extends n{constructor(e){super(),t(this,e)}player;videoElement;get hostElement(){return e(this)}method="youtube";autoplay=!1;autoplayMute=!0;src="";width=16;height=9;type="video/mp4";playButtonAriaLabel="Play";controls=!0;preload="metadata";fitContainer="false";isLoaded=!1;hasPoster=!1;isPlayed=!1;computedVideoConfig(){let t={};return t={fill:"true"===r(this.fitContainer),fluid:"false"===r(this.fitContainer),autoplay:!0===this.autoplay&&(this.autoplayMute?"muted":"any"),techOrder:["youtube"],src:this.src,sources:[{type:"video/youtube",src:this.src}],youtube:{showinfo:0,rel:0,modestbranding:1}},t}initVideo(){this.isLoaded=!0}componentDidLoad(){this.player=Sa(this.videoElement)}onOverlayClosed(t){this.player&&t.detail?.contains(this.hostElement)&&this.player.pause()}onClickHandler(t){if(t.preventDefault(),!this.isLoaded)return!1;this.initVideo(),this.isPlayed=!0,this.player.play(),"html5"===this.method&&this.videoElement.play()}render(){const t=!this.autoplay&&(this.hasPoster&&!this.isPlayed||!this.isPlayed);return i(s,{key:"4c90605e4eea0ffc7bd3c817bc58dcc740760aa8",class:this.classes},this.hasPoster&&!this.isLoaded&&i("div",{key:"6a20fdef2bc92fe72d5211993b402285b6c3c1ba",class:"content-video__poster"},i("slot",{key:"e4306c1d6fae468589d16e2048d4e6d2334db20c",name:"poster"})),t&&i("button",{key:"b3b3dd8ecaf97b1abc1f3fa9e51672bdbab64bf0",class:"content-video__play","aria-label":this.playButtonAriaLabel,onClick:t=>this.onClickHandler(t)},i("slot",{key:"9ebe189330dd780a16cc0f72cf4620673f1b1bff",name:"playButton"})),i("div",{key:"b436e58238661b1474ea0f93573d49eb915946e2",class:"content-video__content"},(!this.hasPoster||this.isLoaded)&&i("video",{key:"d1b42be66d25675f365f83861e77b550bf6cc1e7",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())},i("slot",{key:"db02bc15e5a478deb0fb840fc2b8c17bdb0bb8a2",name:"no-js-message"}),i("slot",{key:"cf18a70c5c5307f4f4700f1a0cff807894c1a288",name:"content"}),i("slot",{key:"a5a253fa0832e990417a7007c6999ee893894609"}))))}};Wu.style=(()=>'.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:rgb(114.9141509434,132.7028301887,159.3858490566);background-color:rgba(114.9141509434,132.7028301887,159.3858490566,.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:rgb(114.9141509434,132.7028301887,159.3858490566);background-color:rgba(114.9141509434,132.7028301887,159.3858490566,.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,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .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(114.9141509434,132.7028301887,159.3858490566,.5)}.video-js .vjs-load-progress div{background:rgba(114.9141509434,132.7028301887,159.3858490566,.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,.video-js.vjs-scrubbing.vjs-touch-enabled .vjs-progress-control .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-scrubbing.vjs-touch-enabled .vjs-progress-control .vjs-mouse-display{display:block}.video-js.vjs-touch-enabled:not(.vjs-scrubbing) .vjs-progress-control .vjs-mouse-display,.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:rgb(114.9141509434,132.7028301887,159.3858490566);background-color:rgba(114.9141509434,132.7028301887,159.3858490566,.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}.vjs-normalise-time-controls:not(.vjs-live) .vjs-time-control{display:flex}.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}@supports not (inset:10px){.video-js .vjs-text-track-display>div{top:0;right:0;bottom:0;left:0}}.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:rgb(114.9141509434,132.7028301887,159.3858490566)}20%{border-top-color:rgb(114.9141509434,132.7028301887,159.3858490566)}35%{border-top-color:#fff}60%{border-top-color:rgb(114.9141509434,132.7028301887,159.3858490566)}100%{border-top-color:rgb(114.9141509434,132.7028301887,159.3858490566)}}.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-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before,.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%,rgb(114.9141509434,132.7028301887,159.3858490566) 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%,rgb(114.9141509434,132.7028301887,159.3858490566) 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}";export{Wu as content_video}
|