(function(t,i){if(typeof define==="function"&&define.amd){define("bc",[],function(){var e=i.apply(this,arguments);t.videojs.log.warn("DEPRECATION: Using the default named RequireJS module in the Brightcove Player is deprecated. See: https://support.brightcove.com/requirejs-and-brightcove-player#Future_implementation");return e})}else if(typeof exports==="object"){module.exports=i()}else{t.bc=i(t)}})(this,function(e){var t='.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,d09GRgABAAAAABUgAAsAAAAAItAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV33Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADwwAABdk9R/WHmhlYWQAABGcAAAAKwAAADYn8kSnaGhlYQAAEcgAAAAdAAAAJA+RCL1obXR4AAAR6AAAABMAAAC8Q44AAGxvY2EAABH8AAAAYAAAAGB7SIHGbWF4cAAAElwAAAAfAAAAIAFAAI9uYW1lAAASfAAAASUAAAIK1cf1oHBvc3QAABOkAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7xDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADbZCycAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1gUV5auc6urCmxEGrq6VRD6ATQP5dHPKK8GRIyoKApoEBUDAiGzGmdUfKNRM4qLZrUZdGKcGN/GZJKd0SyOWTbfbmZ2NxqzM5IxRtNZd78vwYlJdtREoO7sudVNq6PmmxmKqrqPU+eee173P80Bh39Cu9DOEY4DHZBK3i20D/QRLcfxbE5sEVtwLpZzclw4ibFIkSCJUcZ4MBpMnnzwuKNsGWBL5i3qy6kO2dVpvUpKbkAP9fq62rdeGJ+TM/7C1nbIutfuWrWk5ci4zMxxR1qW/N+9JsmCGXj9VKWhFx/6tr/nz78INDm2C9yPF/fDcxLuyKxLBZ1ZBz2QTi+RSkiH5RrDQJ/GgGQadX9m0YSURs7GpSG905Zsk41uj14yul1OtieZ7QUk5GRG/YiS7PYYPSAZNRed9sq3+bOpz00rKb7pe/ZEZvbALxZAHT3AFoH8GXP3rt67QFn40kt8W13FjLTDb48c+fSi5/7h0P4dL5yz7DPtbmgmYxfQA9RL2+EOfTcvdp+1vmuBpvOll1As1S6ak0IvJzC7sKWJFtJgBd2uWcg+0Zyg7dzQfhcjXRgXGZRf5/a4A58IDU777Nl252AUk4m2ByRRjqTNqIDCEJeAnU3iCFwrkrNwXEzg4yFevBwypzxkcX+AIfk3VEKl3XmWbT8788SzvpvFJaiOezL6QyuSr9VNf97csNu0z3LuhR0wATUxZAfVBwVOy+nQFhxYdWaXlXe4HC4zWGWzzsrLDtmhI9pOWOHv7PTT7XybH1Z0+v2d5Abd3kmG+TsH23CS/KwTxx/JkzEwx6jcQOUc42LLwHJ/J93uZ9ygh3HuZGwqsY9dWDHQ58dxNqyqKRQTYdxwTubiOSs3FiMDkq0WSZQgCT0GBDOg2lxOAd1FlPVGs4AKBAcYHHaP2wPkHaivmLF5zYqnIZrvcHx5gN4k/6tchNW1DtdgNL2KrxEkS/kfnIHoVnp1VjmjpTf5r0lTzLj0mdS28tX+XGorU364eMPmnWVl8J36nlKGw3CZhjEiuMw8h8mKvhGD+4/lElBWjAhLJMg6fTw4zPZ8cOmcGQBm2Qxml1nAm13CpYGq1JKUlJJUzQn1PTAO0mgv6VMMpA/DuRfSWEu4lDIxdbAtdWIKvnn2Vk766CWfz9fpY0sH/UpdP50rfszaVpdVRmvIejEdLMk45s4Bu0EWHjeOySmFyZSiMahvZdNSn29peoI/YexYfKQTLeurTXXwEVLeSfInTWHkkMaeUx7sBvOCSTSj3AlcKjfueyS36tCrXDlgRtF0etFq9jhc1kfKuBT/OwMr0F4UUTTh1AN0g20+H/ScPcsIEsYu9d/zN5PmjprPtNwI1ZZcDK6iC97Mcjp2y2aX36f+QbpGHrgRuHlXJ+Zf6PFRL2uQSp8vxHeF2IoRb8Rd2rhMzsNxSRmEuKK4JFnkojhMcx6jzqHzGMGFcW+MhBj0bhf6cowN+45I4LHvwT6fteu7M42wGRI/pxcg6/MZdEvt1U1XaulHFXuLmqov/MukvRVL35/b3ODM1+4aPjtzeK7zmUkV2h3DN54HaQ9GzJvxHRb6Ks2gB81fwqraT+A7GvZJrRLRofU6G0urNL+zFw3v0FaVDFxsKEZW56F31r6ip6vOL+FCObBPuIMRiXld9RaMdLzRIOGhPey2T9vA/35DmZPK9IWaT9d/WgOGMieYqJ/dzjLIhZU118gbysxrNUGefxD6UO/hyNNllpFTOIbx32kSFQctnweV5PxTMHLjRqiAN+fQE9gL+Xy5WB6MOS4GJJuYbDUHhcKDhHGRbLzOpjsjdM1+iwAZLGeieehACX2hhI7SjK/ZUTNrvVje31TxJiFBGYViWFkCn9PMeX9fS6qVbzfCj4fOCTzDnuWy2c4xA7mdNkA3RS9FH2VeqzdCBlixxbzXjvkHU1I8BOYFb1pZvPIHSSIj4svT8xpzcxtXN+ZKyjdDvbz08niiF3PqV9Tn5NST8vg48MTaY8E5xqSSIsWoWHo+LtAzxdH/GDUyp37CBEYfso04F/NlMTcDJUTpECLY0HFGQHImE8xsEUdgnrQlixIvGhJA1BvxpDHGxEMBYFeNOHcBJlSjwe2JcSfbBEsGOPPBHg/6SBBOCsLLw0SpUxod0Z1bFMfLkbQ3UiZxEyd0Dx8t+SRBu18Q9msFbI4e3p1THEfkSEh7kEJ5orR10qTWDvbgPWn5aWvCYyOAjwgXyjJi34uMjo58L25cmRAeQZWI2PA1QQLsPESAH8WGFwZZ4SPoR73BHPzIPMJj9AreBzKUmrH4todT18ANvi1oc3YGjUT/0j+ExUwq8PI9BLaCQIpvewwYu2evAG/Vo/5avPdY7o+BemLLXw3y+AdkzP9bpIxB1wm5EYq8fesHbPEPtm6HrHvtx4jcGPR8fDDpkZBefIjB46QnlUNRltv4Z/pO/J6dxEjhYAtmoMeq+GozvUVvNYOW3m6GCIhoprcfr97B8AcIQYsfD8ljUvGNjvkrpj0ETA48ZMIxCeqsRIsQALE0gi2GB+glSOfbOjW3GSBM9yPq8/rpJXrJDz0BPxV6xdN4uiCGDQed3WhgFkBUZEFsmeyyBpzXrm7UGTBZG8Lh5aubFufk5eUsbrrFGr7McYdbltxa0nKYqRKbQjvikXYkTGM0f2xuyM3Ly21oXnWfvf6I1BmZwfh7EWWIYsg2nHhsDhOnczhJcmI6eBAmy3jZ3RiJmKQR/JA99FcwsfaVbNDDyi1rL9NPj9hfo61wjM6BjzOLijLpeTgk/pL+ip6tfYWupzeOgPny2tcUu9J/9mhxJlgyi985NFRbvCVewXUNXLJaW0RxZqtRYtnfYdcYomXQWdnJHQA3jiEEkeTQWcWxdDP9IvvVWvo2TK553XEMEq+s69/QDU1Q7p0zxwsm9qS379whr8NI2PJqLUyGyfNeX3eFfnJU2U+uHR9cVV1IqgurqwuV44XVp0h2qN55X5XJwtk59yP0IZuHrqBOBIuIYhkcoT6Kx79Pu2HS/IPZIMOqLWs/pteOOk4NPgEb6QAIdAPsyZk5Mwd+wVaHMexJv719W7xCu2l37UG6lvYdBcvHa08p89741zd63phTRGqL5ggo6SlvdbWXzCqsPq78NnSu7wnKy2HNZbVoRCI7UJEOyRj+sPE002tOOY7Qa5fXboFWkLNeqYUSZRocp9XwSUZxcQZ9Hw6LV2pOoVmvHQEDbGIENEG5i6bLgMSM4n8+FNLTtAds99DaWEvgcf4o5SyYe9x+kF6/tGoTPAdRmS/XQIEy//QxKC2oqioAI3tS5auvxCtzT6y6RK8fhChYcwCJaMJhxc0vqSxQ/qmgsrKAlBZUHlauheTpvd9uj5DnLzJct6qfq5fXbYHVIGcfrIVJihbaVLu1wW7Vbs8zK0A8e9Jvb91S9cVMjPrazD6gpfeZTXzYbCFMcppVRsGMpp55OWgx1/3JeAxW1Y7AORgM/m3rWrsdLkQVmEVSU16cX/e7uvkvpqRiQsG06XJ0t64Tf+l0nG1dt025gyOIZlvq5u9KSU1N2TW/rsWnnMRPyTDkctbhvIcNvYIXWyLzdwYLoYesUbaQG4iK2cWO2gdpeUYLqDD0MUTOPhDIGnZEs58yArR86FznuWEsU4YDi2x26dA4klkn8Qa6vhk2QUfX4Jxm/ngX9r7ogn1dmlmwqZmuhxtdg9XN/DEcUgqb+9hMyNansfaQET2mcROCmGEMVqxm5u+h6kN2MOwgqykV2wH9yQG9DvVFU38Pogaf4FVuE62KI/oJ02RDdWW2w5dqQwU/8+N1q1DlvsL863u61KLE7x/o8w0VJQM/Y/SQ3unIrqxueEa1BqT5VFNsO7p39/UC771a77RowpaKe9nvJQIT1Pog5LGx8XblBKmCNGTf3xMogAQvPnz9PYKX/08sVDTG1OKUlOLUgS/UaZtm1NAaYTsl7i9ZQ+L6O4Rl0OGa577LuWvc+C+x96/vYh0lLBuM+7XwI/dTLtdT7v4d6rRTWDnku0IBrqFnZ5bVIqKP8lasJlithWnaLhTsr8qFJBulF/70p4undou36HeTJ5+jv1fCybeQ8nH3+Xv6aENczmOFlab+hqMDg1rLOt12A+tiUFrYDwQ6c3RUJp601nzegTNX6WlYAI2zSUV945F6zU56ZmZVQaWspWcIADxJ9GmljQUnL2p2Dpr5T8H+5KJFu+vqBq8qvyHRzStLHPEO5SPYCV9nZe0yZT2RcH0oHvegSzNEJ0oGWU8iQWM12dgPEugngVceGIwZgPFp0BiT1a0a3R5Rcot7ihfA1J/20v96jX7zmTX9s583H0kwx6WnLd09cXrR9LGroOa9sHNbdyz8wcKk5lqhaVFJZNwmqtw884MXNdvJujpBa3xzuSaZH9sxa06Z7x+HJSduPbdYHv/DgmEhfbehvlmGN7JUkcG78GDM12CeyFFTPNqVeNxC1gzjz+c2nVo63Xxs8rKJWXoBJM0tmEbfGm4qzpoOH3xpzQfyxLzW1gnE9NHo6tol1eMEic4ZVPrjnVi0kqAe2sQ2bgqupScaq8WGlUWgWHI51SKJl/UYT6zccNsCSkBtiVZLsiefuFSDYT3Fi8Zk7EUnmjTRYtsFeuDDJS05MW79M3mr3mla+d8dzac31KTPmBYfFiYSUef48PhPjm9ryZsSGZZkdNvzq0Y9rdNcwDq5Dg5C3QW+7UN64IKptvS3tvHbvu5c9pv1Exau21rc9LIpwpQwUjTq8576yeVDz5+4WZ1nXT43wV60rPLJbDp/UksNrP3iQ2SA63Pst058gOYDbhRnRUw8l/sRt4HbxPzO4WYpInCpuVgSbVh6JXuwnnJngKTTCwaPWmG5Xbhpm1U0Yt3FyBGpGYemPM77p2TD904JjgJ2QFpFLeYpGx8X15Qx1Zk31p5ki9ZLUuXE0lmuJlcakJMVLeFS1iIvrB8drY0aloilakqCZwzwRORtxlgwxS4IThggJd4TDxoiaAIT80fFPGrCPPru+puFn504P/ybr4ihA/6dKASLshEJic7xE8tmzu3KzA7TABBe8y5fNbWo3ilQn/SuFKM16b2l5bOeayqfGhYmhIulU+fVNDdWVv4NMzX10MBHyPR5uhWUu8D9P1VnIMt4nGNgZGBgAOJ/1bf64vltvjJwszOAwAOlmqvINEc/WJyDgQlEAQA+dgnjAHicY2BkYGBnAAGOPgaG//85+hkYGVCBPgBGJwNkAAAAeJxjYGBgYB/EmKMPtxwAhg4B0gAAAAAAAA4AaAB+AMwA4AECAUIBbAGYAe4CLgKKAtAC/ANiA4wDqAPgBDAEsATaBQgFWgXABggGLgZwBqwG9gdOB4oH0ggqCHAIhgicCMgJJAlWCYgJrAnyCkAKdgrkC7J4nGNgZGBg0GdoZmBnAAEmIOYCQgaG/2A+AwAaqwHQAHicXZBNaoNAGIZfE5PQCKFQ2lUps2oXBfOzzAESyDKBQJdGR2NQR3QSSE/QE/QEPUUPUHqsvsrXjTMw83zPvPMNCuAWP3DQDAejdm1GjzwS7pMmwi75XngAD4/CQ/oX4TFe4Qt7uMMbOzjuDc0EmXCP/C7cJ38Iu+RP4QEe8CU8pP8WHmOPX2EPz87TPo202ey2OjlnQSXV/6arOjWFmvszMWtd6CqwOlKHq6ovycLaWMWVydXKFFZnmVFlZU46tP7R2nI5ncbi/dDkfDtFBA2DDXbYkhKc+V0Bqs5Zt9JM1HQGBRTm/EezTmZNKtpcAMs9Yu6AK9caF76zoLWIWcfMGOSkVduvSWechqZsz040Ib2PY3urxBJTzriT95lipz+TN1fmAAAAeJxtkXlT2zAQxf1C4thJAwRajt4HRy8VMwwfSJHXsQZZcnUQ+PYoTtwpM+wf2t9brWZ2n5JBsol58nJcYYAdDDFCijEy5JhgileYYRd72MccBzjEa7zBEY5xglO8xTu8xwd8xCd8xhd8xTec4RwXuMR3/MBP/MJvMPzBFYpk2Cr+OF0fTEgrFI1aHhxN740KDbEmeJpsWZlVj40s+45aLuv9KijlhCXSjLQnu/d/4UH6sWul1mRzFxZeekUuE7z10mg3qMtM1FGQddPSrLQyvJR6OaukItYXDp6pCJrmz0umqkau5pZ2hFmm7m+ImG5W2t0kZoJXUtPhVnYTbbdOBdeCVGqpJe7XKTqSbRK7zbdwXfR0U+SVsStuS3Y76em6+Ic3xYiHUppc04Nn0lMzay3dSxNcp8auDlWlaCi48yetFD7Y9USsx87G45cuop1ZxQUtjLnL4j53FO0a+5X08UXqQ7NQNo92R0XOz7sxWEnxN2TneJI8Acttu4Q=) format("woff");font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder,.vjs-icon-play{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.vjs-icon-play:before{content:"\\f101"}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:"\\f102"}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.vjs-icon-pause{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.vjs-icon-pause:before{content:"\\f103"}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.vjs-icon-volume-mute{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.vjs-icon-volume-mute:before{content:"\\f104"}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.vjs-icon-volume-low{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.vjs-icon-volume-low:before{content:"\\f105"}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.vjs-icon-volume-mid{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.vjs-icon-volume-mid:before{content:"\\f106"}.video-js .vjs-mute-control .vjs-icon-placeholder,.vjs-icon-volume-high{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-mute-control .vjs-icon-placeholder:before,.vjs-icon-volume-high:before{content:"\\f107"}.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-enter:before{content:"\\f108"}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-icon-fullscreen-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-icon-fullscreen-exit:before{content:"\\f109"}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:"\\f10a"}.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-subtitles{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-subtitles:before{content:"\\f10b"}.video-js .vjs-captions-button .vjs-icon-placeholder,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.vjs-icon-captions{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-captions-button .vjs-icon-placeholder:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.vjs-icon-captions:before{content:"\\f10c"}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:"\\f10d"}.video-js .vjs-chapters-button .vjs-icon-placeholder,.vjs-icon-chapters{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.vjs-icon-chapters:before{content:"\\f10e"}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:"\\f10f"}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:"\\f110"}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:"\\f111"}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:"\\f112"}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:"\\f113"}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:"\\f114"}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:"\\f115"}.video-js .vjs-play-progress,.video-js .vjs-volume-level,.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-progress:before,.video-js .vjs-volume-level:before,.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before{content:"\\f116"}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:"\\f117"}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:"\\f118"}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.vjs-icon-cancel{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.vjs-icon-cancel:before{content:"\\f119"}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:"\\f11a"}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.vjs-icon-replay{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.vjs-icon-replay:before{content:"\\f11b"}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder,.vjs-icon-replay-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before,.vjs-icon-replay-5:before{content:"\\f11c"}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder,.vjs-icon-replay-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before,.vjs-icon-replay-10:before{content:"\\f11d"}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder,.vjs-icon-replay-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before,.vjs-icon-replay-30:before{content:"\\f11e"}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder,.vjs-icon-forward-5{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before,.vjs-icon-forward-5:before{content:"\\f11f"}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder,.vjs-icon-forward-10{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before,.vjs-icon-forward-10:before{content:"\\f120"}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder,.vjs-icon-forward-30{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before,.vjs-icon-forward-30:before{content:"\\f121"}.video-js .vjs-audio-button .vjs-icon-placeholder,.vjs-icon-audio{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-audio-button .vjs-icon-placeholder:before,.vjs-icon-audio:before{content:"\\f122"}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:"\\f123"}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:"\\f124"}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:"\\f125"}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:"\\f126"}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-enter{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-enter:before{content:"\\f127"}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-icon-picture-in-picture-exit{font-family:VideoJS;font-weight:400;font-style:normal}.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-icon-picture-in-picture-exit:before{content:"\\f128"}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:"\\f129"}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:"\\f12a"}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:"\\f12b"}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:"\\f12c"}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:"\\f12d"}.video-js .vjs-descriptions-button .vjs-icon-placeholder,.vjs-icon-audio-description{font-family:VideoJS;font-weight:400;font-style:normal}.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.vjs-icon-audio-description:before{content:"\\f12e"}.video-js{display:inline-block;vertical-align:top;box-sizing:border-box;color:#fff;background-color:#000;position:relative;padding:0;font-size:10px;line-height:1;font-weight:400;font-style:normal;font-family:Arial,Helvetica,sans-serif;word-break:initial}.video-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"]{outline:0}.video-js *,.video-js :after,.video-js :before{box-sizing:inherit}.video-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.video-js.vjs-1-1,.video-js.vjs-16-9,.video-js.vjs-4-3,.video-js.vjs-9-16,.video-js.vjs-fluid{width:100%;max-width:100%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.video-js.vjs-fluid:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech{display:none}body.vjs-full-window,body.vjs-pip-window{padding:0;margin:0;height:100%}.vjs-full-window .video-js.vjs-fullscreen,body.vjs-pip-window .video-js{position:fixed;overflow:hidden;z-index:1000;left:0;top:0;bottom:0;right:0}.video-js.vjs-fullscreen:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:rgba(0,0,0,.7);padding:.5em;text-align:center;width:100%}.vjs-layout-small.vjs-pip-container .vjs-pip-text,.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text{bottom:0;font-size:1.4em}.vjs-hidden{display:none!important}.vjs-disabled{opacity:.5;cursor:default}.video-js .vjs-offscreen{height:1px;left:-9999px;position:absolute;top:0;width:1px}.vjs-lock-showing{display:block!important;opacity:1!important;visibility:visible!important}.vjs-no-js{padding:20px;color:#fff;background-color:#000;font-size:18px;font-family:Arial,Helvetica,sans-serif;text-align:center;width:300px;height:150px;margin:0 auto}.vjs-no-js a,.vjs-no-js a:visited{color:#66a8cc}.video-js .vjs-big-play-button{font-size:3em;line-height:1.5em;height:1.63332em;width:3em;display:block;position:absolute;top:50%;left:50%;padding:0;margin-top:-.81666em;margin-left:-1.5em;cursor:pointer;opacity:1;border:.06666em solid #fff;background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;transition:all .4s}.vjs-big-play-button .vjs-svg-icon{width:1em;height:1em;position:absolute;top:50%;left:50%;line-height:1;transform:translate(-50%,-50%)}.video-js .vjs-big-play-button:focus,.video-js:hover .vjs-big-play-button{border-color:#fff;background-color:#73859f;background-color:rgba(115,133,159,.5);transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-error .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause .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}.vjs-control .vjs-button{width:100%;height:100%}.video-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog{background:rgba(0,0,0,.8);background:linear-gradient(180deg,rgba(0,0,0,.8),rgba(255,255,255,0));overflow:auto}.video-js .vjs-modal-dialog>*{box-sizing:border-box}.vjs-modal-dialog .vjs-modal-dialog-content{font-size:1.2em;line-height:1.5;padding:20px 24px;z-index:1}.vjs-menu-button{cursor:pointer}.vjs-menu-button.vjs-disabled{cursor:default}.vjs-workinghover .vjs-menu-button.vjs-disabled:hover .vjs-menu{display:none}.vjs-menu .vjs-menu-content{display:block;padding:0;margin:0;font-family:Arial,Helvetica,sans-serif;overflow:auto}.vjs-menu .vjs-menu-content>*{box-sizing:border-box}.vjs-scrubbing .vjs-control.vjs-menu-button:hover .vjs-menu{display:none}.vjs-menu li{display:flex;justify-content:center;list-style:none;margin:0;padding:.2em 0;line-height:1.4em;font-size:1.2em;text-align:center;text-transform:lowercase}.js-focus-visible .vjs-menu li.vjs-menu-item:hover,.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:rgba(115,133,159,.5)}.js-focus-visible .vjs-menu li.vjs-selected:hover,.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon,.vjs-menu li.vjs-selected .vjs-svg-icon,.vjs-menu li.vjs-selected:focus .vjs-svg-icon,.vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.js-focus-visible .vjs-menu :not(.vjs-selected):focus:not(.focus-visible),.video-js .vjs-menu :not(.vjs-selected):focus:not(:focus-visible){background:0 0}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em 0;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0;margin-bottom:1.5em;border-top-color:rgba(43,51,63,.7)}.vjs-pip-window .vjs-menu-button-popup .vjs-menu{left:unset;right:1em}.vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);position:absolute;width:100%;bottom:1.5em;max-height:15em}.vjs-layout-tiny .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:5em}.vjs-layout-small .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:10em}.vjs-layout-medium .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:14em}.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-menu-button-popup .vjs-menu.vjs-lock-showing,.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu{display:block}.video-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline.vjs-slider-active,.video-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline:hover{width:12em}.vjs-menu-button-inline .vjs-menu{opacity:0;height:100%;width:auto;position:absolute;left:4em;top:0;padding:0;margin:0;transition:all .4s}.vjs-menu-button-inline.vjs-slider-active .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline:hover .vjs-menu{display:block;opacity:1}.vjs-menu-button-inline .vjs-menu-content{width:auto;height:100%;margin:0;overflow:hidden}.video-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:rgba(43,51,63,.7)}.vjs-audio-only-mode .vjs-control-bar,.vjs-has-started .vjs-control-bar{display:flex;visibility:visible;opacity:1;transition:visibility .1s,opacity .1s}.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{visibility:visible;opacity:0;pointer-events:none;transition:visibility 1s,opacity 1s}.vjs-controls-disabled .vjs-control-bar,.vjs-error .vjs-control-bar,.vjs-using-native-controls .vjs-control-bar{display:none!important}.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control{position:relative;text-align:center;margin:0;padding:0;height:100%;width:4em;flex:none}.video-js .vjs-control.vjs-visible-text{width:auto;padding-left:1em;padding-right:1em}.vjs-button>.vjs-icon-placeholder:before{font-size:1.8em;line-height:1.67}.vjs-button>.vjs-icon-placeholder{display:block}.vjs-button>.vjs-svg-icon{display:inline-block}.video-js .vjs-control:focus,.video-js .vjs-control:focus:before,.video-js .vjs-control:hover:before{text-shadow:0 0 1em #fff}.video-js :not(.vjs-visible-text)>.vjs-control-text{border:0;clip:rect(0 0 0 0);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.video-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control{cursor:pointer;flex:auto;display:flex;align-items:center;min-width:4em;touch-action:none}.video-js .vjs-progress-control.disabled{cursor:default}.vjs-live .vjs-progress-control{display:none}.vjs-liveui .vjs-progress-control{display:flex;align-items:center}.video-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.video-js .vjs-progress-holder .vjs-play-progress{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before{font-size:.9em;position:absolute;right:-.5em;line-height:.35em;z-index:1}.vjs-svg-icons-enabled .vjs-play-progress:before{content:none!important}.vjs-play-progress .vjs-svg-icon{position:absolute;top:-.35em;right:-.4em;width:.9em;height:.9em;pointer-events:none;line-height:.15em;z-index:1}.video-js .vjs-load-progress{background:rgba(115,133,159,.5)}.video-js .vjs-load-progress div{background:rgba(115,133,159,.75)}.video-js .vjs-time-tooltip{background-color:#fff;background-color:rgba(255,255,255,.8);border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display{display:none;position:absolute;width:1px;height:100%;background-color:#000;z-index:1}.video-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display{visibility:hidden;opacity:0;transition:visibility 1s,opacity 1s}.vjs-mouse-display .vjs-time-tooltip{color:#fff;background-color:#000;background-color:rgba(0,0,0,.8)}.video-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em 0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:rgba(115,133,159,.5)}.video-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus{text-shadow:0 0 1em #fff;box-shadow:0 0 1em #fff}.video-js .vjs-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%;-o-object-fit:contain;object-fit:contain}.video-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js.vjs-liveui .vjs-live-control,.video-js:not(.vjs-live) .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control{align-items:center;cursor:pointer;flex:none;display:inline-flex;height:100%;padding-left:.5em;padding-right:.5em;font-size:1em;line-height:3em;width:auto;min-width:4em}.video-js.vjs-live:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control{display:none}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge{cursor:auto}.vjs-seek-to-live-control .vjs-icon-placeholder{margin-right:.5em;color:#888}.vjs-svg-icons-enabled .vjs-seek-to-live-control{line-height:0}.vjs-seek-to-live-control .vjs-svg-icon{width:1em;height:1em;pointer-events:none;fill:#888}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-icon-placeholder{color:red}.vjs-seek-to-live-control.vjs-control.vjs-at-live-edge .vjs-svg-icon{fill:red}.video-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.video-js .vjs-current-time,.video-js .vjs-duration,.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider{display:none}.vjs-time-divider{display:none;line-height:3em}.video-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder{flex:none}.vjs-text-track-display{position:absolute;bottom:3em;left:0;right:0;top:0;pointer-events:none}.vjs-error .vjs-text-track-display{display:none}.video-js.vjs-controls-disabled .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track{font-size:1.4em;text-align:center;margin-bottom:.1em}.vjs-subtitles{color:#fff}.vjs-captions{color:#fc6}.vjs-tt-cue{display:block}video::-webkit-media-text-track-display{transform:translateY(-3em)}.video-js.vjs-controls-disabled video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-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-error .vjs-error-display:before{color:#fff;content:"X";font-family:Arial,Helvetica,sans-serif;font-size:4em;left:0;line-height:1;margin-top:-.5em;position:absolute;text-shadow:.05em .05em .1em #000;text-align:center;top:50%;vertical-align:middle;width:100%}.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:block;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;margin:-.6em;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before{animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-seeking .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:before{border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:after{border-top-color:#fff;animation-delay:.44s}@keyframes vjs-spinner-show{to{visibility:visible}}@keyframes vjs-spinner-spin{100%{transform:rotate(360deg)}}@keyframes vjs-spinner-fade{0%{border-top-color:#73859f}20%{border-top-color:#73859f}35%{border-top-color:#fff}60%{border-top-color:#73859f}100%{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button{display:none}.vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-svg-icon{width:1.5em;height:1.5em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder{vertical-align:middle;display:inline-block;margin-bottom:-.1em}.video-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"\\f10c";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-description-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-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-error .vjs-text-track-settings{display:none}.vjs-text-track-settings .vjs-modal-dialog-content{display:table}.vjs-text-track-settings .vjs-track-settings-colors,.vjs-text-track-settings .vjs-track-settings-controls,.vjs-text-track-settings .vjs-track-settings-font{display:table-cell}.vjs-text-track-settings .vjs-track-settings-controls{text-align:right;vertical-align:bottom}@supports (display:grid){.vjs-text-track-settings .vjs-modal-dialog-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr;padding:20px 24px 0 24px}.vjs-track-settings-controls .vjs-default-button{margin-bottom:20px}.vjs-text-track-settings .vjs-track-settings-controls{grid-column:1/-1}.vjs-layout-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-x-small .vjs-text-track-settings .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-text-track-settings select{font-size:inherit}.vjs-track-setting>select{margin-right:1em;margin-bottom:.5em}.vjs-text-track-settings fieldset{margin:10px;border:none}.vjs-text-track-settings fieldset span{display:inline-block;padding:0 .6em .8em}.vjs-text-track-settings fieldset span>select{max-width:7.3em}.vjs-text-track-settings legend{color:#fff;font-weight:700;font-size:1.2em}.vjs-text-track-settings .vjs-label{margin:0 .5em .5em 0}.vjs-track-settings-controls button:active,.vjs-track-settings-controls button:focus{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f 100%)}.vjs-track-settings-controls button:hover{color:rgba(43,51,63,.75)}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f 100%);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:rgba(0,0,0,.9);background:linear-gradient(180deg,rgba(0,0,0,.9) 0,rgba(0,0,0,.7) 60%,rgba(0,0,0,0) 100%);font-size:1.2em;line-height:1.5;transition:opacity .1s;padding:.666em 1.333em 4em;pointer-events:none;position:absolute;top:0;width:100%}.vjs-error .vjs-title-bar{display:none}.vjs-title-bar-description,.vjs-title-bar-title{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vjs-title-bar-title{font-weight:700;margin-bottom:.333em}.vjs-playing.vjs-user-inactive .vjs-title-bar{opacity:0;transition:opacity 1s}.video-js .vjs-skip-forward-5{cursor:pointer}.video-js .vjs-skip-forward-10{cursor:pointer}.video-js .vjs-skip-forward-30{cursor:pointer}.video-js .vjs-skip-backward-5{cursor:pointer}.video-js .vjs-skip-backward-10{cursor:pointer}.video-js .vjs-skip-backward-30{cursor:pointer}@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}',i='.bc-player-B1rbgR51m_default *,.bc-player-B1rbgR51m_default :after,.bc-player-B1rbgR51m_default :before{box-sizing:inherit;font-size:inherit;color:inherit;line-height:inherit}.bc-player-B1rbgR51m_default{width:300px;height:150px;font-size:14px;overflow:hidden}.bc-player-B1rbgR51m_default.vjs-fluid.vjs-16-9:not(.vjs-audio-only-mode),.bc-player-B1rbgR51m_default.vjs-fluid:not(.vjs-audio-only-mode){padding-top:56.25%}.bc-player-B1rbgR51m_default.vjs-fluid.vjs-4-3:not(.vjs-audio-only-mode){padding-top:75%}.bc-player-B1rbgR51m_default.vjs-fill:not(.vjs-audio-only-mode){width:100%;height:100%}.bc-iframe,.bc-iframe body,.bc-player-B1rbgR51m_default,.bc-player-B1rbgR51m_default .vjs-poster{background-color:#151b17}.bc-iframe,.bc-iframe .bc-player-B1rbgR51m_default,.bc-iframe body{margin:0;width:100%;height:100%;overflow:hidden}.bc-player-B1rbgR51m_default.vjs-fullscreen,.bc-player-B1rbgR51m_default.vjs-fullscreen .vjs-tech{width:100%!important;height:100%!important}.bc-player-B1rbgR51m_default .vjs-track-setting select{color:#000;background-color:#fff}.bc-player-B1rbgR51m_default .vjs-audio-button .vjs-menu-item,.bc-player-B1rbgR51m_default .vjs-chapters-button .vjs-menu-item,.bc-player-B1rbgR51m_default .vjs-descriptions-button .vjs-menu-item,.bc-player-B1rbgR51m_default .vjs-subs-caps-button .vjs-menu-item{text-transform:none}.bc-player-B1rbgR51m_default.vjs-waiting-for-autoplay .vjs-big-play-button{opacity:0}.bc-player-B1rbgR51m_default .vjs-progress-control .vjs-mouse-display{z-index:2}/*! @name @brightcove/player-core @version 2.1.1 @license UNLICENSED */.vjs-download-button{cursor:pointer}.vjs-download-button.has-icon-downloading{cursor:wait}.vjs-download-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-download-button.has-icon-file-download .vjs-icon-placeholder:before{content:"\\f110"}.vjs-download-button.has-icon-downloading .vjs-icon-placeholder:before{content:"\\f10f"}.vjs-download-button.has-icon-file-download-off .vjs-icon-placeholder:before{content:"\\f112"}.vjs-modal-dialog.vjs-player-info-modal{background:rgba(0,0,0,.9)}.vjs-modal-dialog.vjs-player-info-modal .vjs-modal-dialog-content{overflow:auto;display:grid;grid-template-columns:1fr 1fr;grid-gap:1em}@media screen and (max-width:640px){.vjs-modal-dialog.vjs-player-info-modal .vjs-modal-dialog-content{grid-template-columns:1fr}}.vjs-modal-dialog.vjs-player-info-modal h2{font-size:1.1667em;margin:0 0 .4286em}.vjs-modal-dialog.vjs-player-info-modal table{border-bottom:1px solid #333;border-collapse:collapse;border-top:1px solid #333;margin-bottom:1.5em;width:100%}.vjs-modal-dialog.vjs-player-info-modal table.vjs-two td,.vjs-modal-dialog.vjs-player-info-modal table.vjs-two th{width:50%}.vjs-modal-dialog.vjs-player-info-modal table.vjs-three td,.vjs-modal-dialog.vjs-player-info-modal table.vjs-three th{width:33.333%}.vjs-modal-dialog.vjs-player-info-modal th{font-weight:400;text-align:left}.vjs-modal-dialog.vjs-player-info-modal td{border-bottom:1px solid #333;opacity:.5}.vjs-modal-dialog.vjs-player-info-modal tr:last-child td{border-bottom:0}.vjs-modal-dialog.vjs-player-info-modal tr:hover td{opacity:1}/*! @name videojs-contextmenu-ui @version 7.0.0 @license Apache-2.0 */.vjs-contextmenu-ui-menu{position:absolute}.vjs-contextmenu-ui-menu .vjs-menu-content{background-color:#2b333f;background-color:rgba(43,51,63,.7);border-radius:.3em;padding:.25em}.vjs-contextmenu-ui-menu .vjs-menu-item{border-radius:.3em;cursor:pointer;margin:0 0 1px;padding:.5em 1em;font-size:1em;line-height:1.2;text-transform:none}.vjs-contextmenu-ui-menu .vjs-menu-item:active,.vjs-contextmenu-ui-menu .vjs-menu-item:hover{background-color:rgba(0,0,0,.5);text-shadow:0 0 1em #fff}/*! @name videojs-errors @version 6.0.0 @license Apache-2.0 */.vjs-error-display{color:#fff;display:none;font-family:Helvetica,Arial,sans serif;font-size:16px;line-height:1.428}.vjs-error .vjs-error-display{display:block;position:absolute;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.5)}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:14px}.vjs-errors-dialog{text-align:left;border:1px #999 solid;overflow:hidden;position:absolute;top:2%;bottom:2%;left:5%;right:5%;padding-left:1%;padding-right:1%;background:rgba(24,24,24,.8)}.vjs-errors-details{margin-top:15px}.vjs-errors-message{border:1px #999 solid;background-color:#2c2c2c;overflow:auto;margin-top:15px;padding:15px}.vjs-errors-ok-button-container{display:block;position:absolute;bottom:15px;left:15px;right:15px;text-align:center}.vjs-errors-ok-button,.vjs-errors-timeout-button-container button{display:block;height:36px;background-color:#000;border:1px #999 solid;border-radius:5px;color:#999;font-size:14px;cursor:pointer}.vjs-errors-ok-button{margin:0 auto;width:80px}.vjs-errors-ok-button:hover,.vjs-errors-timeout-button-container button:hover{border:1px #fff solid;color:#ccc}.vjs-errors-timeout-button-container{display:flex;flex-direction:row;justify-content:center;gap:10px;position:absolute;bottom:15px;left:15px;right:15px;text-align:center}.vjs-errors-timeout-button-container button{width:120px}.vjs-errors-content-container{overflow:auto;position:absolute;padding-bottom:15px;top:0;left:15px;right:15px;bottom:61px}.vjs-errors-headline{font-size:14px;font-weight:700;padding-right:3em}.vjs-errors-dialog .vjs-control.vjs-close-button{width:3em;height:3em;top:0}.vjs-errors-flashmessage{float:right;font-size:9px;font-style:italic}.vjs-xs.vjs-error-display{font-size:14px;background-color:#000}.vjs-xs.vjs-error-display .vjs-errors-details,.vjs-xs.vjs-error-display .vjs-errors-message{display:none}.vjs-xs .vjs-errors-content-container{top:0}.vjs-xs .vjs-errors-headline{font-size:16px;font-weight:700}.vjs-xs .vjs-errors-dialog{border:0;top:0;bottom:0;left:0;right:0}.vjs-xs.vjs-errors-flashmessage{display:none}@media (max-width:600px),(max-height:250px){.vjs-error-display{font-size:14px;background-color:#000}.vjs-error-display .vjs-errors-details,.vjs-error-display .vjs-errors-message,.vjs-errors-flashmessage{display:none}.vjs-error-display .vjs-errors-content-container{top:15px}.vjs-error-display .vjs-errors-headline{font-size:16px;font-weight:700}.vjs-error-display .vjs-errors-dialog{border:0;top:0;bottom:0;left:0;right:0}}.vjs-errors-ref-id{color:rgba(255,255,255,.5);font-size:.75em;margin:.5em 0 0}.bc-player-B1rbgR51m_default .vjs-control-bar{background-color:rgba(0,0,0,.6);color:#fff}.bc-player-B1rbgR51m_default .vjs-control{color:inherit}.bc-player-B1rbgR51m_default .vjs-mouse-display:after,.bc-player-B1rbgR51m_default .vjs-play-progress:after{border-radius:0}.bc-player-B1rbgR51m_default .vjs-menu-button-inline:hover,.bc-player-B1rbgR51m_default.vjs-no-flex .vjs-menu-button-inline{width:8.35em}.bc-player-B1rbgR51m_default .vjs-control:focus:before,.bc-player-B1rbgR51m_default .vjs-control:hover:before{text-shadow:0 0 1em #fff,0 0 1em #fff,0 0 1em #fff}.bc-player-B1rbgR51m_default .vjs-spacer{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-flex:1 1 auto;-moz-box-flex:1 1 auto;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto}.bc-player-B1rbgR51m_default .vjs-time-control{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-flex:0 1 auto;-moz-box-flex:0 1 auto;-webkit-flex:0 1 auto;-ms-flex:0 1 auto;flex:0 1 auto;width:auto}.bc-player-B1rbgR51m_default .vjs-time-control.vjs-time-divider{width:14px}.bc-player-B1rbgR51m_default .vjs-time-control.vjs-time-divider div{width:100%;text-align:center}.bc-player-B1rbgR51m_default .vjs-time-control.vjs-current-time{margin-left:1em}.bc-player-B1rbgR51m_default .vjs-time-control .vjs-current-time-display,.bc-player-B1rbgR51m_default .vjs-time-control .vjs-duration-display{width:100%}.bc-player-B1rbgR51m_default .vjs-time-control .vjs-current-time-display{text-align:right}.bc-player-B1rbgR51m_default .vjs-time-control .vjs-duration-display{text-align:left}.bc-player-B1rbgR51m_default .vjs-remaining-time{display:none}.bc-player-B1rbgR51m_default.vjs-no-flex .vjs-time-control.vjs-remaining-time{display:none}.bc-player-B1rbgR51m_default.vjs-no-flex .vjs-time-control{display:table-cell;width:4em}.bc-player-B1rbgR51m_default .vjs-play-progress,.bc-player-B1rbgR51m_default .vjs-volume-level{background-color:#08088c}.bc-player-B1rbgR51m_default.vjs-ad-playing .vjs-play-progress,.bc-player-B1rbgR51m_default.vjs-ad-playing .vjs-volume-level{background-color:#ffe400}.bc-player-B1rbgR51m_default .vjs-play-progress:before,.bc-player-B1rbgR51m_default .vjs-volume-level:before{display:none}.bc-player-B1rbgR51m_default .vjs-volume-level:after{display:none}.bc-player-B1rbgR51m_default .vjs-progress-control{position:absolute;left:0;right:0;width:100%;height:1.5em;top:-1.5em}.bc-player-B1rbgR51m_default .vjs-progress-control .vjs-load-progress,.bc-player-B1rbgR51m_default .vjs-progress-control .vjs-play-progress,.bc-player-B1rbgR51m_default .vjs-progress-control .vjs-progress-holder{height:100%}.bc-player-B1rbgR51m_default .vjs-progress-control .vjs-progress-holder{margin:0}.bc-player-B1rbgR51m_default .vjs-progress-control:hover{height:1.5em;top:-1.5em}.bc-player-B1rbgR51m_default .vjs-control-bar:not(.vjs-focus-within){-webkit-transition:-webkit-transform .1s ease 0s;-moz-transition:-moz-transform .1s ease 0s;-ms-transition:-ms-transform .1s ease 0s;-o-transition:-o-transform .1s ease 0s;transition:transform .1s ease 0s}.bc-player-B1rbgR51m_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-control-bar,.bc-player-B1rbgR51m_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible),.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar:not(.vjs-focus-within):not(.vjs-control-bar-visible){visibility:visible;opacity:1;-webkit-backface-visibility:hidden;-webkit-transform:translateY(3em);-moz-transform:translateY(3em);-ms-transform:translateY(3em);-o-transform:translateY(3em);transform:translateY(3em);-webkit-transition:-webkit-transform 1s ease 0s;-moz-transition:-moz-transform 1s ease 0s;-ms-transition:-ms-transform 1s ease 0s;-o-transition:-o-transform 1s ease 0s;transition:transform 1s ease 0s}.bc-player-B1rbgR51m_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-B1rbgR51m_default.vjs-has-started.vjs-playing.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active:not(.vjs-audio-only-mode) .vjs-progress-control,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive:not(.vjs-audio-only-mode) .vjs-progress-control{height:.3em;top:-.3em;pointer-events:none;-webkit-transition:height 1s,top 1s;-moz-transition:height 1s,top 1s;-ms-transition:height 1s,top 1s;-o-transition:height 1s,top 1s;transition:height 1s,top 1s}.bc-player-B1rbgR51m_default.vjs-has-started.vjs-playing.vjs-user-inactive.vjs-fullscreen .vjs-progress-control,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active.vjs-fullscreen .vjs-progress-control,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive.vjs-fullscreen .vjs-progress-control,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active.vjs-fullscreen .vjs-progress-control,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive.vjs-fullscreen .vjs-progress-control{opacity:0;-webkit-transition:opacity 1s;-moz-transition:opacity 1s;-ms-transition:opacity 1s;-o-transition:opacity 1s;transition:opacity 1s}.bc-player-B1rbgR51m_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-menu,.bc-player-B1rbgR51m_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-volume-vertical,.bc-player-B1rbgR51m_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-menu,.bc-player-B1rbgR51m_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-volume-vertical,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-menu,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-volume-vertical,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-menu,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-volume-vertical,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-menu,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-volume-vertical,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-menu,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-volume-vertical{opacity:0;-webkit-transition:opacity 1s;-moz-transition:opacity 1s;-ms-transition:opacity 1s;-o-transition:opacity 1s;transition:opacity 1s}.bc-player-B1rbgR51m_default.vjs-has-started.vjs-paused.vjs-ad-playing.vjs-user-inactive .vjs-control-bar-visible .vjs-menu-item,.bc-player-B1rbgR51m_default.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar-visible .vjs-menu,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-active .vjs-control-bar-visible .vjs-menu,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-paused.vjs-user-inactive .vjs-control-bar-visible .vjs-menu,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-active .vjs-control-bar-visible .vjs-menu,.bc-player-B1rbgR51m_default.vjs-hide-controls.vjs-has-started.vjs-playing.vjs-user-inactive .vjs-control-bar-visible .vjs-menu{opacity:1}.bc-player-B1rbgR51m_default.vjs-live .vjs-live-control{margin-left:1em}.bc-player-B1rbgR51m_default.vjs-live .vjs-time-control.vjs-current-time,.bc-player-B1rbgR51m_default.vjs-live .vjs-time-control.vjs-duration,.bc-player-B1rbgR51m_default.vjs-live .vjs-time-control.vjs-time-divider{display:none}.bc-player-B1rbgR51m_default .vjs-big-play-button{top:50%;left:50%;margin-left:-1em;margin-top:-1em;width:2em;height:2em;line-height:2em;border:none;border-radius:50%;font-size:3.5em;background-color:rgba(0,0,0,.45);color:#fff;-webkit-transition:border-color .4s,outline .4s,background-color .4s;-moz-transition:border-color .4s,outline .4s,background-color .4s;-ms-transition:border-color .4s,outline .4s,background-color .4s;-o-transition:border-color .4s,outline .4s,background-color .4s;transition:border-color .4s,outline .4s,background-color .4s}.bc-player-B1rbgR51m_default .vjs-big-play-button:active,.bc-player-B1rbgR51m_default .vjs-big-play-button:focus,.bc-player-B1rbgR51m_default:active .vjs-big-play-button,.bc-player-B1rbgR51m_default:hover .vjs-big-play-button{background-color:#08088c}.bc-player-B1rbgR51m_default .vjs-menu-button-popup .vjs-menu{left:-3em}.bc-player-B1rbgR51m_default .vjs-menu-button-popup .vjs-menu .vjs-menu-content{background-color:transparent;width:12em;left:-1.5em;padding-bottom:.5em}.bc-player-B1rbgR51m_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item,.bc-player-B1rbgR51m_default .vjs-menu-button-popup .vjs-menu .vjs-menu-title{background-color:#151b17;margin:.3em 0;padding:.5em;border-radius:.3em}.bc-player-B1rbgR51m_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item.vjs-selected{background-color:#08088c;color:#fff}.bc-player-B1rbgR51m_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:active,.bc-player-B1rbgR51m_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:focus,.bc-player-B1rbgR51m_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:hover{text-shadow:0 0 1em #fff,0 0 1em #fff,0 0 1em #fff;color:#fff}.bc-player-B1rbgR51m_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item:focus:not(.vjs-selected){background-color:#151b17}.bc-player-B1rbgR51m_default.vjs-ad-playing .vjs-mouse-display,.bc-player-B1rbgR51m_default.vjs-ad-playing .vjs-mouse-display:after{display:none}.bc-player-B1rbgR51m_default.vjs-ad-playing.vjs-ad-playing .vjs-progress-control:after{pointer-events:auto;width:100%;height:100%;position:absolute;left:0;bottom:0;content:" ";user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none}.bc-player-B1rbgR51m_default.vjs-ad-playing .vjs-picture-in-picture-control{display:none}.bc-player-B1rbgR51m_default.vjs-no-flex .vjs-spacer{display:table-cell}.bc-player-B1rbgR51m_default.vjs-no-flex .vjs-time-control{display:table-cell;width:4em}.bc-player-B1rbgR51m_default.vjs-no-flex .vjs-remaining-time{display:none}.vjs-mouse.bc-player-B1rbgR51m_default .vjs-control-bar{font-size:10px}.vjs-mouse.bc-player-B1rbgR51m_default .vjs-progress-control{height:.5em;top:-.5em}.vjs-mouse.bc-player-B1rbgR51m_default .vjs-progress-control:hover{height:1.5em;top:-1.5em}.bc-player-B1rbgR51m_default select{width:inherit}.bc-player-B1rbgR51m_default.video-js:not(.vjs-fullscreen).vjs-layout-tiny .vjs-progress-control,.bc-player-B1rbgR51m_default.video-js:not(.vjs-fullscreen).vjs-layout-x-small.vjs-liveui .vjs-progress-control{display:block}.bc-player-B1rbgR51m_default .vjs-title-bar{line-height:1.5;padding-top:1em}.bc-player-B1rbgR51m_default.video-js.vjs-play-button-hover-glow .vjs-big-play-button:active,.bc-player-B1rbgR51m_default.video-js.vjs-play-button-hover-glow .vjs-big-play-button:focus,.bc-player-B1rbgR51m_default.video-js.vjs-play-button-hover-glow:active .vjs-big-play-button,.bc-player-B1rbgR51m_default.video-js.vjs-play-button-hover-glow:hover .vjs-big-play-button{box-shadow:0 0 15px 3px #fff;background-color:rgba(0,0,0,.45)}.bc-player-B1rbgR51m_default.video-js.vjs-play-button-hover-darken .vjs-big-play-button:active,.bc-player-B1rbgR51m_default.video-js.vjs-play-button-hover-darken .vjs-big-play-button:focus,.bc-player-B1rbgR51m_default.video-js.vjs-play-button-hover-darken:active .vjs-big-play-button,.bc-player-B1rbgR51m_default.video-js.vjs-play-button-hover-darken:hover .vjs-big-play-button{background-color:rgba(0,0,0,.85)}.bc-player-B1rbgR51m_default.vjs-play-button-shape-square .vjs-big-play-button{border-radius:11px;height:2em;width:2em;margin-left:-1em;margin-top:-1em}.bc-player-B1rbgR51m_default.vjs-play-button-shape-rectangle .vjs-big-play-button{border-radius:21px;height:2em;width:3em;margin-left:-1.5em;margin-top:-1em}.bc-player-B1rbgR51m_default.vjs-play-button-position-top-left .vjs-big-play-button{margin:0;left:17px;top:17px}.bc-player-B1rbgR51m_default.vjs-play-button-position-top-right .vjs-big-play-button{margin:0;right:17px;left:auto;top:17px}.bc-player-B1rbgR51m_default .vjs-big-play-button,.bc-player-B1rbgR51m_default .vjs-big-play-state.vjs-play-control.vjs-control,.bc-player-B1rbgR51m_default .vjs-control-bar{background-color:rgba(0,0,0,.45)}.bc-player-B1rbgR51m_default .vjs-big-play-button,.bc-player-B1rbgR51m_default .vjs-big-play-state,.bc-player-B1rbgR51m_default .vjs-control-bar{color:#fff}.bc-iframe .vjs-playlist-sidebar .vjs-playlist-show-hide button:hover,.bc-player-B1rbgR51m_default .vjs-big-play-button:active,.bc-player-B1rbgR51m_default .vjs-big-play-button:focus,.bc-player-B1rbgR51m_default .vjs-menu-button-popup .vjs-menu .vjs-menu-item.vjs-selected,.bc-player-B1rbgR51m_default .vjs-play-progress,.bc-player-B1rbgR51m_default .vjs-volume-level,.bc-player-B1rbgR51m_default:active .vjs-big-play-button,.bc-player-B1rbgR51m_default:hover .vjs-big-play-button{background-color:#ed6f00}.bc-player-B1rbgR51m_default.vjs-audio-mode.vjs-has-started.vjs-focus-within.video-js.video-js.video-js .vjs-control-bar,.bc-player-B1rbgR51m_default.vjs-audio-mode.vjs-has-started.vjs-user-active.video-js.video-js.video-js .vjs-control-bar:not(.vjs-focus-within),.bc-player-B1rbgR51m_default.vjs-audio-mode.vjs-has-started.vjs-user-inactive.video-js.video-js.video-js .vjs-control-bar{opacity:1;visibility:visible;transform:none}.bc-player-B1rbgR51m_default.vjs-audio-only-mode .vjs-poster{display:none}.bc-player-B1rbgR51m_default.vjs-audio-only-mode .vjs-progress-control{height:1.5em;top:-1.5em}.vjs-bumper-video .vjs-play-progress.vjs-play-progress-resetting{transition:width 0s linear}.vjs-bumper-video .vjs-dock-text{display:none}.vjs-ad-playing.vjs-ad-playing .vjs-progress-control{pointer-events:none}.vjs-ad-playing.vjs-ad-playing .vjs-play-progress{background-color:#ffe400}.vjs-ad-loading .vjs-loading-spinner{display:block;visibility:visible}.vjs-ad-playing .vjs-captions-button{display:none}.vjs-ad-playing .vjs-audio-button{display:none}.vjs-ad-loading .vjs-loading-spinner:after,.vjs-ad-loading .vjs-loading-spinner:before{-webkit-animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite;animation:vjs-spinner-spin 1.1s cubic-bezier(.6,.2,0,.8) infinite,vjs-spinner-fade 1.1s linear infinite}.vjs-ad-loading .vjs-loading-spinner:before{border-top-color:#fff}.vjs-ad-loading .vjs-loading-spinner:after{border-top-color:#fff;-webkit-animation-delay:.44s;animation-delay:.44s}.vjs-ad-content-resuming .vjs-big-play-button,.vjs-ad-content-resuming .vjs-poster,.vjs-ad-loading .vjs-big-play-button,.vjs-ad-loading .vjs-poster{display:none}.vjs-ima3-ad-container{bottom:0;left:0;position:absolute;right:0;top:0;pointer-events:none}.vjs-ima3-html5 .vjs-ima3-ad-container>*,.vjs-ima3-html5 .vjs-ima3-ad-container>* iframe{width:100%!important;height:100%!important}.vjs-ima3-ad-background{width:100%;height:100%;background-color:rgba(0,0,0,0);position:absolute;top:0;left:0}.vjs-ad-playing .vjs-ima3-ad-background{background-color:#000}.vjs-ad-playing .vjs-ima3-ad-container,.vjs-ima3-overlay .vjs-ima3-ad-container{left:0}.vjs-mouse.vjs-ima3-html5.vjs-ad-playing .vjs-ima3-ad-container,.vjs-mouse.vjs-ima3-html5.vjs-ima3-overlay .vjs-ima3-ad-container{cursor:pointer;pointer-events:auto}.vjs-user-active.vjs-ad-playing.vjs-ima3-html5 .vjs-ima3-ad-container,.vjs-user-active.vjs-ima3-overlay.vjs-ima3-html5 .vjs-ima3-ad-container{cursor:pointer;pointer-events:auto}.vjs-ima3-html5.vjs-using-native-controls.vjs-ima3-paused.vjs-ima3-paused .vjs-ima3-ad-container{pointer-events:none}.vjs-ad-controls.vjs-ad-playing.vjs-controls-disabled .vjs-ad-control-bar.vjs-ad-control-bar,.vjs-ad-controls.vjs-ad-playing.vjs-using-native-controls .vjs-ad-control-bar.vjs-ad-control-bar{display:none}.vjs-ad-controls.vjs-ad-playing.vjs-user-active:not(.not-hover) .vjs-control-bar.vjs-ad-control-bar,.vjs-ad-controls.vjs-ad-playing.vjs-user-active:not(.vjs-hide-controls) .vjs-control-bar.vjs-ad-control-bar,.vjs-controls-enabled.vjs-ad-controls.vjs-ima3-overlay.vjs-user-active:not(.not-hover) .vjs-control-bar,.vjs-controls-enabled.vjs-ad-controls.vjs-ima3-overlay.vjs-user-active:not(.vjs-hide-controls) .vjs-control-bar{-ms-transform:none;-ms-transition:none;transform:none;transition:none}.vjs-ad-playing .vjs-dock-shelf,.vjs-ad-playing .vjs-dock-text{display:none}.vjs-ad-controls.vjs-ad-playing.vjs-vpaid-playing.vjs-vpaid-controls-disabled .vjs-control-bar.vjs-ad-control-bar{display:none}.vjs-ad-loading .vjs-overlay,.vjs-ad-playing .vjs-overlay{display:none}.vjs-ad-controls.vjs-ad-playing .vjs-control-bar.vjs-ad-control-bar{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.vjs-ad-controls.vjs-ad-playing.vjs-no-flex .vjs-control-bar.vjs-ad-control-bar{display:table}.vjs-mouse .vjs-control-bar.vjs-ad-control-bar .vjs-progress-control:hover{height:.5em;top:-.5em}.vjs-mouse .vjs-control-bar.vjs-ad-control-bar .vjs-progress-control:hover .vjs-mouse-display,.vjs-mouse .vjs-control-bar.vjs-ad-control-bar .vjs-progress-control:hover .vjs-mouse-display:after,.vjs-mouse .vjs-progress-control:hover .vjs-play-progress:after{display:none}.vjs-ima3-html5.vjs-ad-loading .vjs-tech{opacity:0}.vjs-ima3-autoplay.vjs-ima3-not-playing-yet .vjs-poster,.vjs-ima3-autoplay.vjs-ima3-not-playing-yet .vjs-tech{opacity:0}.vjs-ima3-html5.vjs-ad-playing .vjs-ad-control-bar .vjs-play-progress{transition:width 1s linear}.vjs-ima3-html5.vjs-ad-playing .vjs-ad-control-bar .vjs-play-progress.vjs-play-progress-resetting{transition:width 0s linear}.vjs-silverlight-hide-controls .vjs-big-play-button,.vjs-silverlight-hide-controls .vjs-control-bar,.vjs-silverlight-hide-controls .vjs-dock-shelf,.vjs-silverlight-hide-controls .vjs-dock-text,.vjs-silverlight-hide-controls .vjs-poster{display:none!important}.vjs-ad-playing .vjs-current-time-display::before{content:\'Anzeige\';padding-right:20px}.bc-player-30JkqcdSGs_default .vjs-icon-play:before,.bc-player-B1rbgR51m_default .vjs-icon-play:before{line-height:136px}.vjs-ad-playing.vjs-ad-playing .vjs-play-progress{background-color:#ee7000}',n="bc-style-B1rbgR51m-default",s,r="bc-style-vjs",a,o,l,d,u,c=document.querySelector("head"),h=c.firstChild,f=function(e,t){var i=document.createElement("style");i.type="text/css";i.appendChild(document.createTextNode(e));if(t){c.insertBefore(i,t)}else{c.appendChild(i)}return i};l=function e(t){return Boolean(t.IE_VERSION)};try{o=function(tv,iv){var i=undefined;var e=tv.define;var t=tv.videojs;tv.VIDEOJS_NO_DYNAMIC_STYLE=true;var n=function(){"use strict";var ev=typeof globalThis!=="undefined"?globalThis:typeof tv!=="undefined"?tv:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var P={exports:{}};(function(i,e){(function(e,t){i.exports=t()})(ev,function(){var N="8.6.0";const M={};const U=function(e,t){M[e]=M[e]||[];if(t){M[e]=M[e].concat(t)}return M[e]};const B=function(e,t){U(e,t)};const F=function(e,t){const i=U(e).indexOf(t);if(i<=-1){return false}M[e]=M[e].slice();M[e].splice(i,1);return true};const q=function(n,e){U(n,[].concat(e).map(t=>{const i=(...e)=>{F(n,i);return t(...e)};return i}))};const V={prefixed:true};const H=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]];const $=H[0];let z;for(let e=0;e(e,t,i)=>{const n=d.levels[t];const s=new RegExp(`^(${n})$`);let r=l;if(e!=="log"){i.unshift(e.toUpperCase()+":")}if(u){r=`%c${l}`;i.unshift(u)}i.unshift(r+":");if(c){c.push([].concat(i));const o=c.length-1e3;c.splice(0,o>0?o:0)}if(!tv.console){return}let a=tv.console[e];if(!a&&e==="debug"){a=tv.console.info||tv.console.log}if(!a||!n||!s.test(e)){return}a[Array.isArray(i)?"apply":"call"](tv.console,i)};function W(a,o=":",l=""){let t="info";let i;const n=function(...e){i("log",t,e)};i=G(a,n,l);n.createLogger=(e,t,i)=>{const n=t!==undefined?t:o;const s=i!==undefined?i:l;const r=`${a} ${n} ${e}`;return W(r,n,s)};n.createNewLogger=(e,t,i)=>{return W(e,t,i)};n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:t};n.level=e=>{if(typeof e==="string"){if(!n.levels.hasOwnProperty(e)){throw new Error(`"${e}" in not a valid log level`)}t=e}return t};n.history=()=>c?[].concat(c):[];n.history.filter=t=>{return(c||[]).filter(e=>{return new RegExp(`.*${t}.*`).test(e[0])})};n.history.clear=()=>{if(c){c.length=0}};n.history.disable=()=>{if(c!==null){c.length=0;c=null}};n.history.enable=()=>{if(c===null){c=[]}};n.error=(...e)=>i("error",t,e);n.warn=(...e)=>i("warn",t,e);n.debug=(...e)=>i("debug",t,e);return n}const h=W("VIDEOJS");const K=h.createLogger;const X=Object.prototype.toString;const Y=function(e){return Z(e)?Object.keys(e):[]};function Q(t,i){Y(t).forEach(e=>i(t[e],e))}function J(i,n,e=0){return Y(i).reduce((e,t)=>n(e,i[t],t),e)}function Z(e){return!!e&&typeof e==="object"}function ee(e){return Z(e)&&X.call(e)==="[object Object]"&&e.constructor===Object}function f(...e){const i={};e.forEach(e=>{if(!e){return}Q(e,(e,t)=>{if(!ee(e)){i[t]=e;return}if(!ee(i[t])){i[t]={}}i[t]=f(i[t],e)})});return i}function te(e={}){const t=[];for(const i in e){if(e.hasOwnProperty(i)){const n=e[i];t.push(n)}}return t}function ie(t,i,n,e=true){const s=e=>Object.defineProperty(t,i,{value:e,enumerable:true,writable:true});const r={configurable:true,enumerable:true,get(){const e=n();s(e);return e}};if(e){r.set=s}return Object.defineProperty(t,i,r)}var ne=Object.freeze({__proto__:null,each:Q,reduce:J,isObject:Z,isPlain:ee,merge:f,values:te,defineLazyProperty:ie});let se=false;let re=null;let ae=false;let oe;let le=false;let de=false;let ue=false;let ce=false;let he=null;let fe=null;let pe=null;let me=false;let ge=false;let ve=false;let ye=false;const be=Boolean(Ie()&&("ontouchstart"in tv||tv.navigator.maxTouchPoints||tv.DocumentTouch&&tv.document instanceof tv.DocumentTouch));const _e=tv.navigator&&tv.navigator.userAgentData;if(_e){ae=_e.platform==="Android";de=Boolean(_e.brands.find(e=>e.brand==="Microsoft Edge"));ue=Boolean(_e.brands.find(e=>e.brand==="Chromium"));ce=!de&&ue;he=fe=(_e.brands.find(e=>e.brand==="Chromium")||{}).version||null;ge=_e.platform==="Windows"}if(!ue){const L=tv.navigator&&tv.navigator.userAgent||"";se=/iPod/i.test(L);re=function(){const e=L.match(/OS (\d+)_/i);if(e&&e[1]){return e[1]}return null}();ae=/Android/i.test(L);oe=function(){const e=L.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e){return null}const t=e[1]&&parseFloat(e[1]);const i=e[2]&&parseFloat(e[2]);if(t&&i){return parseFloat(e[1]+"."+e[2])}else if(t){return t}return null}();le=/Firefox/i.test(L);de=/Edg/i.test(L);ue=/Chrome/i.test(L)||/CriOS/i.test(L);ce=!de&&ue;he=fe=function(){const e=L.match(/(Chrome|CriOS)\/(\d+)/);if(e&&e[2]){return parseFloat(e[2])}return null}();pe=function(){const e=/MSIE\s(\d+)\.\d/.exec(L);let t=e&&parseFloat(e[1]);if(!t&&/Trident\/7.0/i.test(L)&&/rv:11.0/.test(L)){t=11}return t}();me=/Safari/i.test(L)&&!ce&&!ae&&!de;ge=/Windows/i.test(L);ve=/iPad/i.test(L)||me&&be&&!/iPhone/i.test(L);ye=/iPhone/i.test(L)&&!ve}const p=ye||ve||se;const Te=(me||p)&&!ce;var Se=Object.freeze({__proto__:null,get IS_IPOD(){return se},get IOS_VERSION(){return re},get IS_ANDROID(){return ae},get ANDROID_VERSION(){return oe},get IS_FIREFOX(){return le},get IS_EDGE(){return de},get IS_CHROMIUM(){return ue},get IS_CHROME(){return ce},get CHROMIUM_VERSION(){return he},get CHROME_VERSION(){return fe},get IE_VERSION(){return pe},get IS_SAFARI(){return me},get IS_WINDOWS(){return ge},get IS_IPAD(){return ve},get IS_IPHONE(){return ye},TOUCH_ENABLED:be,IS_IOS:p,IS_ANY_SAFARI:Te});function Ee(e){return typeof e==="string"&&Boolean(e.trim())}function we(e){if(e.indexOf(" ")>=0){throw new Error("class has illegal whitespace characters")}}function Ie(){return iv===tv.document}function ke(e){return Z(e)&&e.nodeType===1}function Ce(){try{return tv.parent!==tv.self}catch(e){return true}}function Ae(n){return function(e,t){if(!Ee(e)){return iv[n](null)}if(Ee(t)){t=iv.querySelector(t)}const i=ke(t)?t:iv;return i[n]&&i[n](e)}}function l(e="div",i={},t={},n){const s=iv.createElement(e);Object.getOwnPropertyNames(i).forEach(function(e){const t=i[e];if(e==="textContent"){je(s,t)}else if(s[e]!==t||e==="tabIndex"){s[e]=t}});Object.getOwnPropertyNames(t).forEach(function(e){s.setAttribute(e,t[e])});if(n){Ke(s,n)}return s}function je(e,t){if(typeof e.textContent==="undefined"){e.innerText=t}else{e.textContent=t}return e}function xe(e,t){if(t.firstChild){t.insertBefore(e,t.firstChild)}else{t.appendChild(e)}}function De(e,t){we(t);return e.classList.contains(t)}function Re(e,...t){e.classList.add(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[]));return e}function Oe(e,...t){if(!e){h.warn("removeClass was called with an element that doesn't exist");return null}e.classList.remove(...t.reduce((e,t)=>e.concat(t.split(/\s+/)),[]));return e}function Pe(t,e,i){if(typeof i==="function"){i=i(t,e)}if(typeof i!=="boolean"){i=undefined}e.split(/\s+/).forEach(e=>t.classList.toggle(e,i));return t}function Le(i,n){Object.getOwnPropertyNames(n).forEach(function(e){const t=n[e];if(t===null||typeof t==="undefined"||t===false){i.removeAttribute(e)}else{i.setAttribute(e,t===true?"":t)}})}function Ne(e){const i={};const n=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(e&&e.attributes&&e.attributes.length>0){const s=e.attributes;for(let t=s.length-1;t>=0;t--){const r=s[t].name;let e=s[t].value;if(n.includes(r)){e=e!==null?true:false}i[r]=e}}return i}function Me(e,t){return e.getAttribute(t)}function Ue(e,t,i){e.setAttribute(t,i)}function Be(e,t){e.removeAttribute(t)}function Fe(){iv.body.focus();iv.onselectstart=function(){return false}}function qe(){iv.onselectstart=function(){return true}}function Ve(e){if(e&&e.getBoundingClientRect&&e.parentNode){const t=e.getBoundingClientRect();const i={};["bottom","height","left","right","top","width"].forEach(e=>{if(t[e]!==undefined){i[e]=t[e]}});if(!i.height){i.height=parseFloat(Ze(e,"height"))}if(!i.width){i.width=parseFloat(Ze(e,"width"))}return i}}function He(e){if(!e||e&&!e.offsetParent){return{left:0,top:0,width:0,height:0}}const t=e.offsetWidth;const i=e.offsetHeight;let n=0;let s=0;while(e.offsetParent&&e!==iv[V.fullscreenElement]){n+=e.offsetLeft;s+=e.offsetTop;e=e.offsetParent}return{left:n,top:s,width:t,height:i}}function $e(t,e){const i={x:0,y:0};if(p){let e=t;while(e&&e.nodeName.toLowerCase()!=="html"){const t=Ze(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]}e=e.parentNode}}const n={};const s=He(e.target);const r=He(t);const a=r.width;const o=r.height;let l=e.offsetY-(r.top-s.top);let d=e.offsetX-(r.left-s.left);if(e.changedTouches){d=e.changedTouches[0].pageX-r.left;l=e.changedTouches[0].pageY+r.top;if(p){d-=i.x;l-=i.y}}n.y=1-Math.max(0,Math.min(1,l/o));n.x=Math.max(0,Math.min(1,d/a));return n}function ze(e){return Z(e)&&e.nodeType===3}function Ge(e){while(e.firstChild){e.removeChild(e.firstChild)}return e}function We(e){if(typeof e==="function"){e=e()}return(Array.isArray(e)?e:[e]).map(e=>{if(typeof e==="function"){e=e()}if(ke(e)||ze(e)){return e}if(typeof e==="string"&&/\S/.test(e)){return iv.createTextNode(e)}}).filter(e=>e)}function Ke(t,e){We(e).forEach(e=>t.appendChild(e));return t}function Xe(e,t){return Ke(Ge(e),t)}function Ye(e){if(e.button===undefined&&e.buttons===undefined){return true}if(e.button===0&&e.buttons===undefined){return true}if(e.type==="mouseup"&&e.button===0&&e.buttons===0){return true}if(e.button!==0||e.buttons!==1){return false}return true}const Qe=Ae("querySelector");const Je=Ae("querySelectorAll");function Ze(t,i){if(!t||!i){return""}if(typeof tv.getComputedStyle==="function"){let e;try{e=tv.getComputedStyle(t)}catch(e){return""}return e?e.getPropertyValue(i)||e[i]:""}return""}function et(s){[...iv.styleSheets].forEach(t=>{try{const e=[...t.cssRules].map(e=>e.cssText).join("");const i=iv.createElement("style");i.textContent=e;s.document.head.appendChild(i)}catch(e){const n=iv.createElement("link");n.rel="stylesheet";n.type=t.type;n.media=t.media.mediaText;n.href=t.href;s.document.head.appendChild(n)}})}var tt=Object.freeze({__proto__:null,isReal:Ie,isEl:ke,isInFrame:Ce,createEl:l,textContent:je,prependTo:xe,hasClass:De,addClass:Re,removeClass:Oe,toggleClass:Pe,setAttributes:Le,getAttributes:Ne,getAttribute:Me,setAttribute:Ue,removeAttribute:Be,blockTextSelection:Fe,unblockTextSelection:qe,getBoundingClientRect:Ve,findPosition:He,getPointerPosition:$e,isTextNode:ze,emptyEl:Ge,normalizeContent:We,appendContent:Ke,insertContent:Xe,isSingleLeftClick:Ye,$:Qe,$$:Je,computedStyle:Ze,copyStyleSheetsToWindow:et});let it=false;let nt;const st=function(){if(nt.options.autoSetup===false){return}const e=Array.prototype.slice.call(iv.getElementsByTagName("video"));const t=Array.prototype.slice.call(iv.getElementsByTagName("audio"));const i=Array.prototype.slice.call(iv.getElementsByTagName("video-js"));const n=e.concat(t,i);if(n&&n.length>0){for(let e=0,t=n.length;e-1){e={passive:true}}r.addEventListener(t,a.dispatcher,e)}else if(r.attachEvent){r.attachEvent("on"+t,a.dispatcher)}}}function d(e,t,i){if(!o.has(e)){return}const n=o.get(e);if(!n.handlers){return}if(Array.isArray(t)){return ft(d,e,t,i)}const s=function(e,t){n.handlers[t]=[];ht(e,t)};if(t===undefined){for(const a in n.handlers){if(Object.prototype.hasOwnProperty.call(n.handlers||{},a)){s(e,a)}}return}const r=n.handlers[t];if(!r){return}if(!i){s(e,t);return}if(i.guid){for(let e=0;e=n){i(...e);s=t}};return e};const It=function(n,s,r,a=tv){let o;const e=()=>{a.clearTimeout(o);o=null};const t=function(){const e=this;const t=arguments;let i=function(){o=null;i=null;if(!r){n.apply(e,t)}};if(!o&&r){n.apply(e,t)}a.clearTimeout(o);o=a.setTimeout(i,s)};t.cancel=e;return t};var kt=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Et,bind_:u,throttle:wt,debounce:It});let Ct;class At{on(e,t){const i=this.addEventListener;this.addEventListener=()=>{};yt(this,e,t);this.addEventListener=i}off(e,t){d(this,e,t)}one(e,t){const i=this.addEventListener;this.addEventListener=()=>{};_t(this,e,t);this.addEventListener=i}any(e,t){const i=this.addEventListener;this.addEventListener=()=>{};Tt(this,e,t);this.addEventListener=i}trigger(e){const t=e.type||e;if(typeof e==="string"){e={type:t}}e=pt(e);if(this.allowedEvents_[t]&&this["on"+t]){this["on"+t](e)}bt(this,e)}queueTrigger(e){if(!Ct){Ct=new Map}const t=e.type||e;let i=Ct.get(this);if(!i){i=new Map;Ct.set(this,i)}const n=i.get(t);i.delete(t);tv.clearTimeout(n);const s=tv.setTimeout(()=>{i.delete(t);if(i.size===0){i=null;Ct.delete(this)}this.trigger(e)},0);i.set(t,s)}}At.prototype.allowedEvents_={};At.prototype.addEventListener=At.prototype.on;At.prototype.removeEventListener=At.prototype.off;At.prototype.dispatchEvent=At.prototype.trigger;const jt=e=>{if(typeof e.name==="function"){return e.name()}if(typeof e.name==="string"){return e.name}if(e.name_){return e.name_}if(e.constructor&&e.constructor.name){return e.constructor.name}return typeof e};const xt=t=>t instanceof At||!!t.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof t[e]==="function");const Dt=(e,t)=>{if(xt(e)){t()}else{if(!e.eventedCallbacks){e.eventedCallbacks=[]}e.eventedCallbacks.push(t)}};const Rt=e=>typeof e==="string"&&/\S/.test(e)||Array.isArray(e)&&!!e.length;const Ot=(e,t,i)=>{if(!e||!e.nodeName&&!xt(e)){throw new Error(`Invalid target for ${jt(t)}#${i}; must be a DOM node or evented object.`)}};const Pt=(e,t,i)=>{if(!Rt(e)){throw new Error(`Invalid event type for ${jt(t)}#${i}; must be a non-empty string or array.`)}};const Lt=(e,t,i)=>{if(typeof e!=="function"){throw new Error(`Invalid listener for ${jt(t)}#${i}; must be a function.`)}};const Nt=(e,t,i)=>{const n=t.length<3||t[0]===e||t[0]===e.eventBusEl_;let s;let r;let a;if(n){s=e.eventBusEl_;if(t.length>=3){t.shift()}[r,a]=t}else{[s,r,a]=t}Ot(s,e,i);Pt(r,e,i);Lt(a,e,i);a=u(e,a);return{isTargetingSelf:n,target:s,type:r,listener:a}};const Mt=(e,t,i,n)=>{Ot(e,e,t);if(e.nodeName){St[t](e,i,n)}else{e[t](i,n)}};const Ut={on(...e){const{isTargetingSelf:t,target:i,type:n,listener:s}=Nt(this,e,"on");Mt(i,"on",n,s);if(!t){const r=()=>this.off(i,n,s);r.guid=s.guid;const a=()=>this.off("dispose",r);a.guid=s.guid;Mt(this,"on","dispose",r);Mt(i,"on","dispose",a)}},one(...e){const{isTargetingSelf:t,target:i,type:n,listener:s}=Nt(this,e,"one");if(t){Mt(i,"one",n,s)}else{const r=(...e)=>{this.off(i,n,r);s.apply(null,e)};r.guid=s.guid;Mt(i,"one",n,r)}},any(...e){const{isTargetingSelf:t,target:i,type:n,listener:s}=Nt(this,e,"any");if(t){Mt(i,"any",n,s)}else{const r=(...e)=>{this.off(i,n,r);s.apply(null,e)};r.guid=s.guid;Mt(i,"any",n,r)}},off(e,t,i){if(!e||Rt(e)){d(this.eventBusEl_,e,t)}else{const n=e;const s=t;Ot(n,this,"off");Pt(s,this,"off");Lt(i,this,"off");i=u(this,i);this.off("dispose",i);if(n.nodeName){d(n,s,i);d(n,"dispose",i)}else if(xt(n)){n.off(s,i);n.off("dispose",i)}}},trigger(e,t){Ot(this.eventBusEl_,this,"trigger");const i=e&&typeof e!=="string"?e.type:e;if(!Rt(i)){throw new Error(`Invalid event type for ${jt(this)}#trigger; `+"must be a non-empty string or object with a type key that has a non-empty value.")}return bt(this.eventBusEl_,e,t)}};function Bt(e,t={}){const{eventBusKey:i}=t;if(i){if(!e[i].nodeName){throw new Error(`The eventBusKey "${i}" does not refer to an element.`)}e.eventBusEl_=e[i]}else{e.eventBusEl_=l("span",{className:"vjs-event-bus"})}Object.assign(e,Ut);if(e.eventedCallbacks){e.eventedCallbacks.forEach(e=>{e()})}e.on("dispose",()=>{e.off();[e,e.el_,e.eventBusEl_].forEach(function(e){if(e&&o.has(e)){o.delete(e)}});tv.setTimeout(()=>{e.eventBusEl_=null},0)});return e}const Ft={state:{},setState(e){if(typeof e==="function"){e=e()}let i;Q(e,(e,t)=>{if(this.state[t]!==e){i=i||{};i[t]={from:this.state[t],to:e}}this.state[t]=e});if(i&&xt(this)){this.trigger({changes:i,type:"statechanged"})}return i}};function qt(e,t){Object.assign(e,Ft);e.state=Object.assign({},e.state,t);if(typeof e.handleStateChanged==="function"&&xt(e)){e.on("statechanged",e.handleStateChanged)}return e}const Vt=function(e){if(typeof e!=="string"){return e}return e.replace(/./,e=>e.toLowerCase())};const m=function(e){if(typeof e!=="string"){return e}return e.replace(/./,e=>e.toUpperCase())};const Ht=function(e,t){return m(e)===m(t)};var $t=Object.freeze({__proto__:null,toLowerCase:Vt,toTitleCase:m,titleCaseEquals:Ht});var zt=typeof globalThis!=="undefined"?globalThis:typeof tv!=="undefined"?tv:typeof ev!=="undefined"?ev:typeof self!=="undefined"?self:{};function Gt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function Wt(e,t){return t={exports:{}},e(t,t.exports),t.exports}var a=Wt(function(e,t){function i(e){if(e&&"object"===typeof e){var t=e.which||e.keyCode||e.charCode;if(t)e=t}if("number"===typeof e)return s[e];var i=String(e);var n=r[i.toLowerCase()];if(n)return n;var n=a[i.toLowerCase()];if(n)return n;if(i.length===1)return i.charCodeAt(0);return undefined}i.isEventKey=function e(t,i){if(t&&"object"===typeof t){var n=t.which||t.keyCode||t.charCode;if(n===null||n===undefined){return false}if(typeof i==="string"){var s=r[i.toLowerCase()];if(s){return s===n}var s=a[i.toLowerCase()];if(s){return s===n}}else if(typeof i==="number"){return i===n}return false}};t=e.exports=i;var r=t.code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222};var a=t.aliases={windows:91,"\u21e7":16,"\u2325":18,"\u2303":17,"\u2318":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(n=97;n<123;n++)r[String.fromCharCode(n)]=n-32;for(var n=48;n<58;n++)r[n-48]=n;for(n=1;n<13;n++)r["f"+n]=n+111;for(n=0;n<10;n++)r["numpad "+n]=n+96;var s=t.names=t.title={};for(n in r)s[r[n]]=n;for(var o in a){r[o]=a[o]}});a.code;a.codes;a.aliases;a.names;a.title;class g{constructor(e,t,i){if(!e&&this.play){this.player_=e=this}else{this.player_=e}this.isDisposed_=false;this.parentComponent_=null;this.options_=f({},this.options_);t=this.options_=f(this.options_,t);this.id_=t.id||t.el&&t.el.id;if(!this.id_){const n=e&&e.id&&e.id()||"no_player";this.id_=`${n}_component_${ct()}`}this.name_=t.name||null;if(t.el){this.el_=t.el}else if(t.createEl!==false){this.el_=this.createEl()}if(t.className&&this.el_){t.className.split(" ").forEach(e=>this.addClass(e))}["on","off","one","any","trigger"].forEach(e=>{this[e]=undefined});if(t.evented!==false){Bt(this,{eventBusKey:this.el_?"el_":null});this.handleLanguagechange=this.handleLanguagechange.bind(this);this.on(this.player_,"languagechange",this.handleLanguagechange)}qt(this,this.constructor.defaultState);this.children_=[];this.childIndex_={};this.childNameIndex_={};this.setTimeoutIds_=new Set;this.setIntervalIds_=new Set;this.rafIds_=new Set;this.namedRafs_=new Map;this.clearingTimersOnDispose_=false;if(t.initChildren!==false){this.initChildren()}this.ready(i);if(t.reportTouchActivity!==false){this.enableTouchActivity()}}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e,t){}dispose(e={}){if(this.isDisposed_){return}if(this.readyQueue_){this.readyQueue_.length=0}this.trigger({type:"dispose",bubbles:false});this.isDisposed_=true;if(this.children_){for(let e=this.children_.length-1;e>=0;e--){if(this.children_[e].dispose){this.children_[e].dispose()}}}this.children_=null;this.childIndex_=null;this.childNameIndex_=null;this.parentComponent_=null;if(this.el_){if(this.el_.parentNode){if(e.restoreEl){this.el_.parentNode.replaceChild(e.restoreEl,this.el_)}else{this.el_.parentNode.removeChild(this.el_)}}this.el_=null}this.player_=null}isDisposed(){return Boolean(this.isDisposed_)}player(){return this.player_}options(e){if(!e){return this.options_}this.options_=f(this.options_,e);return this.options_}el(){return this.el_}createEl(e,t,i){return l(e,t,i)}localize(e,s,t=e){const i=this.player_.language&&this.player_.language();const n=this.player_.languages&&this.player_.languages();const r=n&&n[i];const a=i&&i.split("-")[0];const o=n&&n[a];let l=t;if(r&&r[e]){l=r[e]}else if(o&&o[e]){l=o[e]}if(s){l=l.replace(/\{(\d+)\}/g,function(e,t){const i=s[t-1];let n=i;if(typeof i==="undefined"){n=e}return n})}return l}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(!e){return}return this.childNameIndex_[e]}getDescendant(...t){t=t.reduce((e,t)=>e.concat(t),[]);let i=this;for(let e=0;e=0;e--){if(this.children_[e]===t){i=true;this.children_.splice(e,1);break}}if(!i){return}t.parentComponent_=null;this.childIndex_[t.id()]=null;this.childNameIndex_[m(t.name())]=null;this.childNameIndex_[Vt(t.name())]=null;const e=t.el();if(e&&e.parentNode===this.contentEl()){this.contentEl().removeChild(t.el())}}initChildren(){const n=this.options_.children;if(n){const s=this.options_;const t=e=>{const t=e.name;let i=e.opts;if(s[t]!==undefined){i=s[t]}if(i===false){return}if(i===true){i={}}i.playerOptions=this.options_.playerOptions;const n=this.addChild(t,i);if(n){this[t]=n}};let e;const i=g.getComponent("Tech");if(Array.isArray(n)){e=n}else{e=Object.keys(n)}e.concat(Object.keys(this.options_).filter(function(t){return!e.some(function(e){if(typeof e==="string"){return t===e}return t===e.name})})).map(e=>{let t;let i;if(typeof e==="string"){t=e;i=n[t]||this.options_[t]||{}}else{t=e.name;i=e}return{name:t,opts:i}}).filter(e=>{const t=g.getComponent(e.opts.componentClass||m(e.name));return t&&!i.isTech(t)}).forEach(t)}}buildCSSClass(){return""}ready(e,t=false){if(!e){return}if(!this.isReady_){this.readyQueue_=this.readyQueue_||[];this.readyQueue_.push(e);return}if(t){e.call(this)}else{this.setTimeout(e,1)}}triggerReady(){this.isReady_=true;this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[];if(e&&e.length>0){e.forEach(function(e){e.call(this)},this)}this.trigger("ready")},1)}$(e,t){return Qe(e,t||this.contentEl())}$$(e,t){return Je(e,t||this.contentEl())}hasClass(e){return De(this.el_,e)}addClass(...e){Re(this.el_,...e)}removeClass(...e){Oe(this.el_,...e)}toggleClass(e,t){Pe(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return Me(this.el_,e)}setAttribute(e,t){Ue(this.el_,e,t)}removeAttribute(e){Be(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,true);this.height(t)}dimension(e,t,i){if(t!==undefined){if(t===null||t!==t){t=0}if((""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1){this.el_.style[e]=t}else if(t==="auto"){this.el_.style[e]=""}else{this.el_.style[e]=t+"px"}if(!i){this.trigger("componentresize")}return}if(!this.el_){return 0}const n=this.el_.style[e];const s=n.indexOf("px");if(s!==-1){return parseInt(n.slice(0,s),10)}return parseInt(this.el_["offset"+m(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height"){throw new Error("currentDimension only accepts width or height value")}t=Ze(this.el_,e);t=parseFloat(t);if(t===0||isNaN(t)){const i=`offset${m(e)}`;t=this.el_[i]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){if(this.player_){if(!a.isEventKey(e,"Tab")){e.stopPropagation()}this.player_.handleKeyDown(e)}}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let i=0;let s=null;const r=10;const n=200;let a;this.on("touchstart",function(e){if(e.touches.length===1){s={pageX:e.touches[0].pageX,pageY:e.touches[0].pageY};i=tv.performance.now();a=true}});this.on("touchmove",function(e){if(e.touches.length>1){a=false}else if(s){const t=e.touches[0].pageX-s.pageX;const i=e.touches[0].pageY-s.pageY;const n=Math.sqrt(t*t+i*i);if(n>r){a=false}}});const e=function(){a=false};this.on("touchleave",e);this.on("touchcancel",e);this.on("touchend",function(e){s=null;if(a===true){const t=tv.performance.now()-i;if(t{if(this.setTimeoutIds_.has(i)){this.setTimeoutIds_.delete(i)}e()},t);this.setTimeoutIds_.add(i);return i}clearTimeout(e){if(this.setTimeoutIds_.has(e)){this.setTimeoutIds_.delete(e);tv.clearTimeout(e)}return e}setInterval(e,t){e=u(this,e);this.clearTimersOnDispose_();const i=tv.setInterval(e,t);this.setIntervalIds_.add(i);return i}clearInterval(e){if(this.setIntervalIds_.has(e)){this.setIntervalIds_.delete(e);tv.clearInterval(e)}return e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;e=u(this,e);t=tv.requestAnimationFrame(()=>{if(this.rafIds_.has(t)){this.rafIds_.delete(t)}e()});this.rafIds_.add(t);return t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e)){return}this.clearTimersOnDispose_();t=u(this,t);const i=this.requestAnimationFrame(()=>{t();if(this.namedRafs_.has(e)){this.namedRafs_.delete(e)}});this.namedRafs_.set(e,i);return e}cancelNamedAnimationFrame(e){if(!this.namedRafs_.has(e)){return}this.cancelAnimationFrame(this.namedRafs_.get(e));this.namedRafs_.delete(e)}cancelAnimationFrame(e){if(this.rafIds_.has(e)){this.rafIds_.delete(e);tv.cancelAnimationFrame(e)}return e}clearTimersOnDispose_(){if(this.clearingTimersOnDispose_){return}this.clearingTimersOnDispose_=true;this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,i])=>{this[e].forEach((e,t)=>this[i](t))});this.clearingTimersOnDispose_=false})}static registerComponent(t,e){if(typeof t!=="string"||!t){throw new Error(`Illegal component name, "${t}"; must be a non-empty string.`)}const i=g.getComponent("Tech");const n=i&&i.isTech(e);const s=g===e||g.prototype.isPrototypeOf(e.prototype);if(n||!s){let e;if(n){e="techs must be registered using Tech.registerTech()"}else{e="must be a Component subclass"}throw new Error(`Illegal component, "${t}"; ${e}.`)}t=m(t);if(!g.components_){g.components_={}}const r=g.getComponent("Player");if(t==="Player"&&r&&r.players){const a=r.players;const o=Object.keys(a);if(a&&o.length>0&&o.map(e=>a[e]).every(Boolean)){throw new Error("Can not register Player component after player has been created.")}}g.components_[t]=e;g.components_[Vt(t)]=e;return e}static getComponent(e){if(!e||!g.components_){return}return g.components_[e]}}g.registerComponent("Component",g);function Kt(e,t,i){if(typeof t!=="number"||t<0||t>i){throw new Error(`Failed to execute '${e}' on 'TimeRanges': The index provided (${t}) is non-numeric or out of bounds (0-${i}).`)}}function Xt(e,t,i,n){Kt(e,n,i.length-1);return i[n][t]}function Yt(e){let t;if(e===undefined||e.length===0){t={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}}else{t={length:e.length,start:Xt.bind(null,"start",0,e),end:Xt.bind(null,"end",1,e)}}if(tv.Symbol&&tv.Symbol.iterator){t[tv.Symbol.iterator]=()=>(e||[]).values()}return t}function Qt(e,t){if(Array.isArray(e)){return Yt(e)}else if(e===undefined||t===undefined){return Yt()}return Yt([[e,t]])}const Jt=function(e,t){e=e<0?0:e;let i=Math.floor(e%60);let n=Math.floor(e/60%60);let s=Math.floor(e/3600);const r=Math.floor(t/60%60);const a=Math.floor(t/3600);if(isNaN(e)||e===Infinity){s=n=i="-"}s=s>0||a>0?s+":":"";n=((s||r>=10)&&n<10?"0"+n:n)+":";i=i<10?"0"+i:i;return s+n+i};let Zt=Jt;function ei(e){Zt=e}function ti(){Zt=Jt}function ii(e,t=e){return Zt(e,t)}var ni=Object.freeze({__proto__:null,createTimeRanges:Qt,createTimeRange:Qt,setFormatTime:ei,resetFormatTime:ti,formatTime:ii});function si(t,i){let n=0;let s;let r;if(!i){return 0}if(!t||!t.length){t=Qt(0,0)}for(let e=0;ei){r=i}n+=r-s}return n/i}function t(e){if(e instanceof t){return e}if(typeof e==="number"){this.code=e}else if(typeof e==="string"){this.message=e}else if(Z(e)){if(typeof e.code==="number"){this.code=e.code}Object.assign(this,e)}if(!this.message){this.message=t.defaultMessages[this.code]||""}}t.prototype.code=0;t.prototype.message="";t.prototype.status=null;t.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];t.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(let e=0;e{})}}const di=function(n){const e=["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((e,t,i)=>{if(n[t]){e[t]=n[t]}return e},{cues:n.cues&&Array.prototype.map.call(n.cues,function(e){return{startTime:e.startTime,endTime:e.endTime,text:e.text,id:e.id}})});return e};const ui=function(e){const t=e.$$("track");const i=Array.prototype.map.call(t,e=>e.track);const n=Array.prototype.map.call(t,function(e){const t=di(e.track);if(e.src){t.src=e.src}return t});return n.concat(Array.prototype.filter.call(e.textTracks(),function(e){return i.indexOf(e)===-1}).map(di))};const ci=function(e,i){e.forEach(function(e){const t=i.addRemoteTextTrack(e).track;if(!e.src&&e.cues){e.cues.forEach(e=>t.addCue(e))}});return i.textTracks()};var hi={textTracksToJson:ui,jsonToTextTracks:ci,trackToJson_:di};const fi="vjs-modal-dialog";class pi extends g{constructor(e,t){super(e,t);this.handleKeyDown_=e=>this.handleKeyDown(e);this.close_=e=>this.close(e);this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=false;this.closeable(!this.options_.uncloseable);this.content(this.options_.content);this.contentEl_=l("div",{className:`${fi}-content`},{role:"document"});this.descEl_=l("p",{className:`${fi}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")});je(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"})}dispose(){this.contentEl_=null;this.descEl_=null;this.previouslyActiveEl_=null;super.dispose()}buildCSSClass(){return`${fi} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");if(this.closeable()){e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")}return e}open(){if(!this.opened_){const e=this.player();this.trigger("beforemodalopen");this.opened_=true;if(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_){this.fill()}this.wasPlaying_=!e.paused();if(this.options_.pauseOnOpen&&this.wasPlaying_){e.pause()}this.on("keydown",this.handleKeyDown_);this.hadControls_=e.controls();e.controls(false);this.show();this.conditionalFocus_();this.el().setAttribute("aria-hidden","false");this.trigger("modalopen");this.hasBeenOpened_=true}}opened(e){if(typeof e==="boolean"){this[e?"open":"close"]()}return this.opened_}close(){if(!this.opened_){return}const e=this.player();this.trigger("beforemodalclose");this.opened_=false;if(this.wasPlaying_&&this.options_.pauseOnOpen){e.play()}this.off("keydown",this.handleKeyDown_);if(this.hadControls_){e.controls(true)}this.hide();this.el().setAttribute("aria-hidden","true");this.trigger("modalclose");this.conditionalBlur_();if(this.options_.temporary){this.dispose()}}closeable(t){if(typeof t==="boolean"){const i=this.closeable_=!!t;let e=this.getChild("closeButton");if(i&&!e){const n=this.contentEl_;this.contentEl_=this.el_;e=this.addChild("closeButton",{controlText:"Close Modal Dialog"});this.contentEl_=n;this.on(e,"close",this.close_)}if(!i&&e){this.off(e,"close",this.close_);this.removeChild(e);e.dispose()}}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl();const i=t.parentNode;const n=t.nextSibling;this.trigger("beforemodalfill");this.hasBeenFilled_=true;i.removeChild(t);this.empty();Xe(t,e);this.trigger("modalfill");if(n){i.insertBefore(t,n)}else{i.appendChild(t)}const s=this.getChild("closeButton");if(s){i.appendChild(s.el_)}}empty(){this.trigger("beforemodalempty");Ge(this.contentEl());this.trigger("modalempty")}content(e){if(typeof e!=="undefined"){this.content_=e}return this.content_}conditionalFocus_(){const e=iv.activeElement;const t=this.player_.el_;this.previouslyActiveEl_=null;if(t.contains(e)||t===e){this.previouslyActiveEl_=e;this.focus()}}conditionalBlur_(){if(this.previouslyActiveEl_){this.previouslyActiveEl_.focus();this.previouslyActiveEl_=null}}handleKeyDown(e){e.stopPropagation();if(a.isEventKey(e,"Escape")&&this.closeable()){e.preventDefault();this.close();return}if(!a.isEventKey(e,"Tab")){return}const t=this.focusableEls_();const i=this.el_.querySelector(":focus");let n;for(let e=0;e{return(e instanceof tv.HTMLAnchorElement||e instanceof tv.HTMLAreaElement)&&e.hasAttribute("href")||(e instanceof tv.HTMLInputElement||e instanceof tv.HTMLSelectElement||e instanceof tv.HTMLTextAreaElement||e instanceof tv.HTMLButtonElement)&&!e.hasAttribute("disabled")||e instanceof tv.HTMLIFrameElement||e instanceof tv.HTMLObjectElement||e instanceof tv.HTMLEmbedElement||e.hasAttribute("tabindex")&&e.getAttribute("tabindex")!==-1||e.hasAttribute("contenteditable")})}}pi.prototype.options_={pauseOnOpen:true,temporary:true};g.registerComponent("ModalDialog",pi);class mi extends At{constructor(t=[]){super();this.tracks_=[];Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let e=0;e{this.trigger({track:e,type:"labelchange",target:this})};if(xt(e)){e.addEventListener("labelchange",e.labelchange_)}}removeTrack(i){let n;for(let e=0,t=this.length;e=0;e--){if(t[e].enabled){gi(t,t[e]);break}}super(t);this.changing_=false}addTrack(e){if(e.enabled){gi(this,e)}super.addTrack(e);if(!e.addEventListener){return}e.enabledChange_=()=>{if(this.changing_){return}this.changing_=true;gi(this,e);this.changing_=false;this.trigger("change")};e.addEventListener("enabledchange",e.enabledChange_)}removeTrack(e){super.removeTrack(e);if(e.removeEventListener&&e.enabledChange_){e.removeEventListener("enabledchange",e.enabledChange_);e.enabledChange_=null}}}const yi=function(t,i){for(let e=0;e=0;e--){if(t[e].selected){yi(t,t[e]);break}}super(t);this.changing_=false;Object.defineProperty(this,"selectedIndex",{get(){for(let e=0;e{if(this.changing_){return}this.changing_=true;yi(this,e);this.changing_=false;this.trigger("change")};e.addEventListener("selectedchange",e.selectedChange_)}removeTrack(e){super.removeTrack(e);if(e.removeEventListener&&e.selectedChange_){e.removeEventListener("selectedchange",e.selectedChange_);e.selectedChange_=null}}}class _i extends mi{addTrack(e){super.addTrack(e);if(!this.queueChange_){this.queueChange_=()=>this.queueTrigger("change")}if(!this.triggerSelectedlanguagechange){this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")}e.addEventListener("modechange",this.queueChange_);const t=["metadata","chapters"];if(t.indexOf(e.kind)===-1){e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}}removeTrack(e){super.removeTrack(e);if(e.removeEventListener){if(this.queueChange_){e.removeEventListener("modechange",this.queueChange_)}if(this.selectedlanguagechange_){e.removeEventListener("modechange",this.triggerSelectedlanguagechange_)}}}}class Ti{constructor(i=[]){this.trackElements_=[];Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let e=0,t=i.length;e=400&&t.statusCode<=599){var n=i;if(a){if(Pi.TextDecoder){var s=qi(t.headers&&t.headers["content-type"]);try{n=new TextDecoder(s).decode(i)}catch(e){}}else{n=String.fromCharCode.apply(null,new Uint8Array(i))}}r({cause:n});return}r(null,i)}};function qi(e){if(e===void 0){e=""}return e.toLowerCase().split(";").reduce(function(e,t){var i=t.split("="),n=i[0],s=i[1];if(n.trim()==="charset"){return s.trim()}return e},"utf-8")}var Vi=Fi;Xi.httpHandler=Vi;var Hi=function e(t){var s={};if(!t){return s}t.trim().split("\n").forEach(function(e){var t=e.indexOf(":");var i=e.slice(0,t).trim().toLowerCase();var n=e.slice(t+1).trim();if(typeof s[i]==="undefined"){s[i]=n}else if(Array.isArray(s[i])){s[i].push(n)}else{s[i]=[s[i],n]}});return s};var $i=Xi;var zi=Xi;Xi.XMLHttpRequest=Pi.XMLHttpRequest||Ji;Xi.XDomainRequest="withCredentials"in new Xi.XMLHttpRequest?Xi.XMLHttpRequest:Pi.XDomainRequest;Gi(["get","put","post","patch","head","delete"],function(n){Xi[n==="delete"?"del":n]=function(e,t,i){t=Ki(e,t,i);t.method=n.toUpperCase();return Yi(t)}});function Gi(e,t){for(var i=0;i0){g=setTimeout(function(){if(d)return;d=true;o.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT";t(e)},s.timeout)}if(o.setRequestHeader){for(l in f){if(f.hasOwnProperty(l)){o.setRequestHeader(l,f[l])}}}else if(s.headers&&!Wi(s.headers)){throw new Error("Headers cannot be set on an XDomainRequest object")}if("responseType"in s){o.responseType=s.responseType}if("beforeSend"in s&&typeof s.beforeSend==="function"){s.beforeSend(o)}o.send(h||null);return o}function Qi(e){try{if(e.responseType==="document"){return e.responseXML}var t=e.responseXML&&e.responseXML.documentElement.nodeName==="parsererror";if(e.responseType===""&&!t){return e.responseXML}}catch(e){}return null}function Ji(){}$i.default=zi;const Zi=function(e,t){const i=new tv.WebVTT.Parser(tv,tv.vttjs,tv.WebVTT.StringDecoder());const n=[];i.oncue=function(e){t.addCue(e)};i.onparsingerror=function(e){n.push(e)};i.onflush=function(){t.trigger({type:"loadeddata",target:t})};i.parse(e);if(n.length>0){if(tv.console&&tv.console.groupCollapsed){tv.console.groupCollapsed(`Text Track parsing errors for ${t.src}`)}n.forEach(e=>h.error(e));if(tv.console&&tv.console.groupEnd){tv.console.groupEnd()}}i.flush()};const en=function(e,n){const t={uri:e};const i=Di(e);if(i){t.cors=i}const s=n.tech_.crossOrigin()==="use-credentials";if(s){t.withCredentials=s}$i(t,u(this,function(e,t,i){if(e){return h.error(e,t)}n.loaded_=true;if(typeof tv.WebVTT!=="function"){if(n.tech_){n.tech_.any(["vttjsloaded","vttjserror"],e=>{if(e.type==="vttjserror"){h.error(`vttjs failed to load, stopping trying to process ${n.src}`);return}return Zi(i,n)})}}else{Zi(i,n)}}))};class tn extends Ci{constructor(e={}){if(!e.tech){throw new Error("A tech was not provided.")}const t=f(e,{kind:Ii[e.kind]||"subtitles",language:e.language||e.srclang||""});let i=ki[t.mode]||"disabled";const n=t.default;if(t.kind==="metadata"||t.kind==="chapters"){i="hidden"}super(t);this.tech_=t.tech;this.cues_=[];this.activeCues_=[];this.preload_=this.tech_.preloadTextTracks!==false;const s=new Si(this.cues_);const r=new Si(this.activeCues_);let a=false;this.timeupdateHandler=u(this,function(e={}){if(this.tech_.isDisposed()){return}if(!this.tech_.isReady_){if(e.type!=="timeupdate"){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)}return}this.activeCues=this.activeCues;if(a){this.trigger("cuechange");a=false}if(e.type!=="timeupdate"){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)}});const o=()=>{this.stopTracking()};this.tech_.one("dispose",o);if(i!=="disabled"){this.startTracking()}Object.defineProperties(this,{default:{get(){return n},set(){}},mode:{get(){return i},set(e){if(!ki[e]){return}if(i===e){return}i=e;if(!this.preload_&&i!=="disabled"&&this.cues.length===0){en(this.src,this)}this.stopTracking();if(i!=="disabled"){this.startTracking()}this.trigger("modechange")}},cues:{get(){if(!this.loaded_){return null}return s},set(){}},activeCues:{get(){if(!this.loaded_){return null}if(this.cues.length===0){return r}const i=this.tech_.currentTime();const n=[];for(let e=0,t=this.cues.length;e=i){n.push(s)}}a=false;if(n.length!==this.activeCues_.length){a=true}else{for(let e=0;e{t=rn.LOADED;this.trigger({type:"load",target:this})})}}rn.prototype.allowedEvents_={load:"load"};rn.NONE=0;rn.LOADING=1;rn.LOADED=2;rn.ERROR=3;const an={audio:{ListClass:vi,TrackClass:nn,capitalName:"Audio"},video:{ListClass:bi,TrackClass:sn,capitalName:"Video"},text:{ListClass:_i,TrackClass:tn,capitalName:"Text"}};Object.keys(an).forEach(function(e){an[e].getterName=`${e}Tracks`;an[e].privateName=`${e}Tracks_`});const on={remoteText:{ListClass:_i,TrackClass:tn,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:Ti,TrackClass:rn,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}};const v=Object.assign({},an,on);on.names=Object.keys(on);an.names=Object.keys(an);v.names=[].concat(on.names).concat(an.names);var ln={};var dn=typeof zt!=="undefined"?zt:typeof tv!=="undefined"?tv:{};var un;if(typeof iv!=="undefined"){un=iv}else{un=dn["__GLOBAL_DOCUMENT_CACHE@4"];if(!un){un=dn["__GLOBAL_DOCUMENT_CACHE@4"]=ln}}var cn=un;var hn=Object.create||function(){function t(){}return function(e){if(arguments.length!==1){throw new Error("Object.create shim only accepts one parameter.")}t.prototype=e;return new t}}();function fn(e,t){this.name="ParsingError";this.code=e.code;this.message=t||e.message}fn.prototype=hn(Error.prototype);fn.prototype.constructor=fn;fn.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function pn(e){function t(e,t,i,n){return(e|0)*3600+(t|0)*60+(i|0)+(n|0)/1e3}var i=e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);if(!i){return null}if(i[3]){return t(i[1],i[2],i[3].replace(":",""),i[4])}else if(i[1]>59){return t(i[1],i[2],0,i[4])}else{return t(0,i[1],i[2],i[4])}}function mn(){this.values=hn(null)}mn.prototype={set:function(e,t){if(!this.get(e)&&t!==""){this.values[e]=t}},get:function(e,t,i){if(i){return this.has(e)?this.values[e]:t[i]}return this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n=0&&t<=100){this.set(e,t);return true}}return false}};function gn(e,t,i,n){var s=n?e.split(n):[e];for(var r in s){if(typeof s[r]!=="string"){continue}var a=s[r].split(i);if(a.length!==2){continue}var o=a[0].trim();var l=a[1].trim();t(o,l)}}function vn(t,e,a){var i=t;function n(){var e=pn(t);if(e===null){throw new fn(fn.Errors.BadTimeStamp,"Malformed timestamp: "+i)}t=t.replace(/^[^\sa-zA-Z-]+/,"");return e}function s(e,t){var r=new mn;gn(e,function(e,t){switch(e){case"region":for(var i=a.length-1;i>=0;i--){if(a[i].id===t){r.set(e,a[i].region);break}}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":var n=t.split(","),s=n[0];r.integer(e,s);r.percent(e,s)?r.set("snapToLines",false):null;r.alt(e,s,["auto"]);if(n.length===2){r.alt("lineAlign",n[1],["start","center","end"])}break;case"position":n=t.split(",");r.percent(e,n[0]);if(n.length===2){r.alt("positionAlign",n[1],["start","center","end"])}break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start","center","end","left","right"]);break}},/:/,/\s/);t.region=r.get("region",null);t.vertical=r.get("vertical","");try{t.line=r.get("line","auto")}catch(e){}t.lineAlign=r.get("lineAlign","start");t.snapToLines=r.get("snapToLines",true);t.size=r.get("size",100);try{t.align=r.get("align","center")}catch(e){t.align=r.get("align","middle")}try{t.position=r.get("position","auto")}catch(e){t.position=r.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=r.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}function r(){t=t.replace(/^\s+/,"")}r();e.startTime=n();r();if(t.substr(0,3)!=="--\x3e"){throw new fn(fn.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+i)}t=t.substr(3);r();e.endTime=n();r();s(t,e)}var yn=cn.createElement&&cn.createElement("textarea");var bn={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"};var _n={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"};var Tn={v:"title",lang:"lang"};var Sn={rt:"ruby"};function En(r,i){function e(){if(!i){return null}function e(e){i=i.substr(e.length);return e}var t=i.match(/^([^<]*)(<[^>]*>?)?/);return e(t[1]?t[1]:t[2])}function t(e){yn.innerHTML=e;e=yn.textContent;yn.textContent="";return e}function n(e,t){return!Sn[t.localName]||Sn[t.localName]===e.localName}function s(e,t){var i=bn[e];if(!i){return null}var n=r.document.createElement(i);var s=Tn[e];if(s&&t){n[s]=t.trim()}return n}var a=r.document.createElement("div"),o=a,l,d=[];while((l=e())!==null){if(l[0]==="<"){if(l[1]==="/"){if(d.length&&d[d.length-1]===l.substr(2).replace(">","")){d.pop();o=o.parentNode}continue}var u=pn(l.substr(1,l.length-2));var c;if(u){c=r.document.createProcessingInstruction("timestamp",u);o.appendChild(c);continue}var h=l.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!h){continue}c=s(h[1],h[3]);if(!c){continue}if(!n(o,c)){continue}if(h[2]){var f=h[2].split(".");f.forEach(function(e){var t=/^bg_/.test(e);var i=t?e.slice(3):e;if(_n.hasOwnProperty(i)){var n=t?"background-color":"color";var s=_n[i];c.style[n]=s}});c.className=f.join(" ")}d.push(h[1]);o.appendChild(c);o=c;continue}o.appendChild(r.document.createTextNode(t(l)))}return a}var wn=[[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 In(e){for(var t=0;t=i[0]&&e<=i[1]){return true}}return false}function kn(e){var t=[],i="",n;if(!e||!e.childNodes){return"ltr"}function s(e,t){for(var i=t.childNodes.length-1;i>=0;i--){e.push(t.childNodes[i])}}function r(e){if(!e||!e.length){return null}var t=e.pop(),i=t.textContent||t.innerText;if(i){var n=i.match(/^.*(\n|\r)/);if(n){e.length=0;return n[0]}return i}if(t.tagName==="ruby"){return r(e)}if(t.childNodes){s(e,t);return r(e)}}s(t,e);while(i=r(t)){for(var a=0;a=0&&e.line<=100)){return e.line}if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement){return-1}var t=e.track,i=t.textTrackList,n=0;for(var s=0;se.left&&this.tope.top};y.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right};y.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}};y.prototype.intersectPercentage=function(e){var t=Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left)),i=Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top)),n=t*i;return n/(this.height*this.width)};y.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}};y.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0;var i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0;var n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e;var s={left:e.left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i};return s};function xn(e,t,o,l){function i(e,t){var i,n=new y(e),s=1;for(var r=0;ra){i=new y(e);s=a}e=new y(n)}return i||n}var n=new y(t),s=t.cue,r=Cn(s),a=[];if(s.snapToLines){var d;switch(s.vertical){case"":a=["+y","-y"];d="height";break;case"rl":a=["+x","-x"];d="width";break;case"lr":a=["-x","+x"];d="width";break}var u=n.lineHeight,c=u*Math.round(r),h=o[d]+u,f=a[0];if(Math.abs(c)>h){c=c<0?-1:1;c*=Math.ceil(h/u)*u}if(r<0){c+=s.vertical===""?o.height:o.width;a=a.reverse()}n.move(f,c)}else{var p=n.lineHeight/o.height*100;switch(s.lineAlign){case"center":r-=p/2;break;case"end":r-=p;break}switch(s.vertical){case"":t.applyStyles({top:t.formatStyle(r,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(r,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(r,"%")});break}a=["+y","-x","+x","-y"];n=new y(t)}var m=i(n,a);t.move(m.toCSSCompatValues(o))}function Dn(){}Dn.StringDecoder=function(){return{decode:function(e){if(!e){return""}if(typeof e!=="string"){throw new Error("Error - expected string data.")}return decodeURIComponent(encodeURIComponent(e))}}};Dn.convertCueToDOMTree=function(e,t){if(!e||!t){return null}return En(e,t)};var Rn=.05;var On="sans-serif";var Pn="1.5%";Dn.processCues=function(n,s,e){if(!n||!s||!e){return null}while(e.firstChild){e.removeChild(e.firstChild)}var r=n.document.createElement("div");r.style.position="absolute";r.style.left="0";r.style.right="0";r.style.top="0";r.style.bottom="0";r.style.margin=Pn;e.appendChild(r);function t(e){for(var t=0;t100){throw new Error("Position must be between 0 and 100.")}f=e;this.hasBeenReset=true}},positionAlign:{enumerable:true,get:function(){return p},set:function(e){var t=Fn(e);if(!t){console.warn("positionAlign: an invalid or illegal string was specified.")}else{p=t;this.hasBeenReset=true}}},size:{enumerable:true,get:function(){return m},set:function(e){if(e<0||e>100){throw new Error("Size must be between 0 and 100.")}m=e;this.hasBeenReset=true}},align:{enumerable:true,get:function(){return g},set:function(e){var t=Fn(e);if(!t){throw new SyntaxError("align: an invalid or illegal alignment string was specified.")}g=t;this.hasBeenReset=true}}});this.displayState=undefined}qn.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(tv,this.text)};var Vn=qn;var Hn={"":true,up:true};function $n(e){if(typeof e!=="string"){return false}var t=Hn[e.toLowerCase()];return t?e.toLowerCase():false}function zn(e){return typeof e==="number"&&e>=0&&e<=100}function Gn(){var t=100;var i=3;var n=0;var s=100;var r=0;var a=100;var o="";Object.defineProperties(this,{width:{enumerable:true,get:function(){return t},set:function(e){if(!zn(e)){throw new Error("Width must be between 0 and 100.")}t=e}},lines:{enumerable:true,get:function(){return i},set:function(e){if(typeof e!=="number"){throw new TypeError("Lines must be set to a number.")}i=e}},regionAnchorY:{enumerable:true,get:function(){return s},set:function(e){if(!zn(e)){throw new Error("RegionAnchorX must be between 0 and 100.")}s=e}},regionAnchorX:{enumerable:true,get:function(){return n},set:function(e){if(!zn(e)){throw new Error("RegionAnchorY must be between 0 and 100.")}n=e}},viewportAnchorY:{enumerable:true,get:function(){return a},set:function(e){if(!zn(e)){throw new Error("ViewportAnchorY must be between 0 and 100.")}a=e}},viewportAnchorX:{enumerable:true,get:function(){return r},set:function(e){if(!zn(e)){throw new Error("ViewportAnchorX must be between 0 and 100.")}r=e}},scroll:{enumerable:true,get:function(){return o},set:function(e){var t=$n(e);if(t===false){console.warn("Scroll: an invalid or illegal string was specified.")}else{o=t}}}})}var Wn=Gn;var Kn=Wt(function(e){var t=e.exports={WebVTT:Ln,VTTCue:Vn,VTTRegion:Wn};Pi.vttjs=t;Pi.WebVTT=t.WebVTT;var i=t.VTTCue;var n=t.VTTRegion;var s=Pi.VTTCue;var r=Pi.VTTRegion;t.shim=function(){Pi.VTTCue=i;Pi.VTTRegion=n};t.restore=function(){Pi.VTTCue=s;Pi.VTTRegion=r};if(!Pi.VTTCue){t.shim()}});Kn.WebVTT;Kn.VTTCue;Kn.VTTRegion;function Xn(e,t,i,n,s={}){const r=e.textTracks();s.kind=t;if(i){s.label=i}if(n){s.language=n}s.tech=e;const a=new v.text.TrackClass(s);r.addTrack(a);return a}class b extends g{constructor(i={},e=function(){}){i.reportTouchActivity=false;super(null,i,e);this.onDurationChange_=e=>this.onDurationChange(e);this.trackProgress_=e=>this.trackProgress(e);this.trackCurrentTime_=e=>this.trackCurrentTime(e);this.stopTrackingCurrentTime_=e=>this.stopTrackingCurrentTime(e);this.disposeSourceHandler_=e=>this.disposeSourceHandler(e);this.queuedHanders_=new Set;this.hasStarted_=false;this.on("playing",function(){this.hasStarted_=true});this.on("loadstart",function(){this.hasStarted_=false});v.names.forEach(e=>{const t=v[e];if(i&&i[t.getterName]){this[t.privateName]=i[t.getterName]}});if(!this.featuresProgressEvents){this.manualProgressOn()}if(!this.featuresTimeupdateEvents){this.manualTimeUpdatesOn()}["Text","Audio","Video"].forEach(e=>{if(i[`native${e}Tracks`]===false){this[`featuresNative${e}Tracks`]=false}});if(i.nativeCaptions===false||i.nativeTextTracks===false){this.featuresNativeTextTracks=false}else if(i.nativeCaptions===true||i.nativeTextTracks===true){this.featuresNativeTextTracks=true}if(!this.featuresNativeTextTracks){this.emulateTextTracks()}this.preloadTextTracks=i.preloadTextTracks!==false;this.autoRemoteTextTracks_=new v.text.ListClass;this.initTrackListeners();if(!i.nativeControlsForTouch){this.emitTapEvents()}if(this.constructor){this.name_=this.constructor.name||"Unknown Tech"}}triggerSourceset(e){if(!this.isReady_){this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1))}this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_);this.manualProgress=true;this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=false;this.stopTrackingProgress();this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress();this.progressInterval=this.setInterval(u(this,function(){const e=this.bufferedPercent();if(this.bufferedPercent_!==e){this.trigger("progress")}this.bufferedPercent_=e;if(e===1){this.stopTrackingProgress()}}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return Qt(0,0)}bufferedPercent(){return si(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=true;this.on("play",this.trackCurrentTime_);this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=false;this.stopTrackingCurrentTime();this.off("play",this.trackCurrentTime_);this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){if(this.currentTimeInterval){this.stopTrackingCurrentTime()}this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval);this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}dispose(){this.clearTracks(an.names);if(this.manualProgress){this.manualProgressOff()}if(this.manualTimeUpdates){this.manualTimeUpdatesOff()}super.dispose()}clearTracks(e){e=[].concat(e);e.forEach(e=>{const t=this[`${e}Tracks`]()||[];let i=t.length;while(i--){const n=t[i];if(e==="text"){this.removeRemoteTextTrack(n)}t.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;while(t--){const i=e[t];this.removeRemoteTextTrack(i)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){if(e!==undefined){this.error_=new t(e);this.trigger("error")}return this.error_}played(){if(this.hasStarted_){return Qt(0,0)}return Qt()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){if(this.manualTimeUpdates){this.trigger({type:"timeupdate",target:this,manuallyTriggered:true})}}initTrackListeners(){an.names.forEach(e=>{const t=an[e];const i=()=>{this.trigger(`${e}trackchange`)};const n=this[t.getterName]();n.addEventListener("removetrack",i);n.addEventListener("addtrack",i);this.on("dispose",()=>{n.removeEventListener("removetrack",i);n.removeEventListener("addtrack",i)})})}addWebVttScript_(){if(tv.WebVTT){return}if(iv.body.contains(this.el())){if(!this.options_["vtt.js"]&&ee(Kn)&&Object.keys(Kn).length>0){this.trigger("vttjsloaded");return}const e=iv.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js";e.onload=()=>{this.trigger("vttjsloaded")};e.onerror=()=>{this.trigger("vttjserror")};this.on("dispose",()=>{e.onload=null;e.onerror=null});tv.WebVTT=true;this.el().parentNode.appendChild(e)}else{this.ready(this.addWebVttScript_)}}emulateTextTracks(){const i=this.textTracks();const e=this.remoteTextTracks();const n=e=>i.addTrack(e.track);const s=e=>i.removeTrack(e.track);e.on("addtrack",n);e.on("removetrack",s);this.addWebVttScript_();const r=()=>this.trigger("texttrackchange");const a=()=>{r();for(let e=0;ethis.autoRemoteTextTracks_.addTrack(i.track))}return i}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t);this.remoteTextTracks().removeTrack(e);this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return true}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=ct();if(!this.isReady_||this.paused()){this.queuedHanders_.add(t);this.one("playing",()=>{if(this.queuedHanders_.has(t)){this.queuedHanders_.delete(t);e()}})}else{this.requestNamedAnimationFrame(t,e)}return t}cancelVideoFrameCallback(e){if(this.queuedHanders_.has(e)){this.queuedHanders_.delete(e)}else{this.cancelNamedAnimationFrame(e)}}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return b.canPlayType(e.type)}static isTech(e){return e.prototype instanceof b||e instanceof b||e===b}static registerTech(e,t){if(!b.techs_){b.techs_={}}if(!b.isTech(t)){throw new Error(`Tech ${e} must be a Tech`)}if(!b.canPlayType){throw new Error("Techs must have a static canPlayType method on them")}if(!b.canPlaySource){throw new Error("Techs must have a static canPlaySource method on them")}e=m(e);b.techs_[e]=t;b.techs_[Vt(e)]=t;if(e!=="Tech"){b.defaultTechOrder_.push(e)}return t}static getTech(e){if(!e){return}if(b.techs_&&b.techs_[e]){return b.techs_[e]}e=m(e);if(tv&&tv.videojs&&tv.videojs[e]){h.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`);return tv.videojs[e]}}}v.names.forEach(function(e){const t=v[e];b.prototype[t.getterName]=function(){this[t.privateName]=this[t.privateName]||new t.ListClass;return this[t.privateName]}});b.prototype.featuresVolumeControl=true;b.prototype.featuresMuteControl=true;b.prototype.featuresFullscreenResize=false;b.prototype.featuresPlaybackRate=false;b.prototype.featuresProgressEvents=false;b.prototype.featuresSourceset=false;b.prototype.featuresTimeupdateEvents=false;b.prototype.featuresNativeTextTracks=false;b.prototype.featuresVideoFrameCallback=false;b.withSourceHandlers=function(r){r.registerSourceHandler=function(e,t){let i=r.sourceHandlers;if(!i){i=r.sourceHandlers=[]}if(t===undefined){t=i.length}i.splice(t,0,e)};r.canPlayType=function(t){const i=r.sourceHandlers||[];let n;for(let e=0;ehs(t,Yn[t.type],i,e),1)}function ts(e,t){e.forEach(e=>e.setTech&&e.setTech(t))}function is(e,t,i){return e.reduceRight(ls(i),t[i]())}function ns(e,t,i,n){return t[i](e.reduce(ls(i),n))}function ss(e,t,i,n=null){const s="call"+m(i);const r=e.reduce(ls(s),n);const a=r===Jn;const o=a?null:t[i](r);ds(e,i,o,a);return o}const rs={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1};const as={setCurrentTime:1,setMuted:1,setVolume:1};const os={play:1,pause:1};function ls(i){return(e,t)=>{if(e===Jn){return Jn}if(t[i]){return t[i](e)}return e}}function ds(t,i,n,s){for(let e=t.length-1;e>=0;e--){const r=t[e];if(r[i]){r[i](s,n)}}}function us(e){Qn[e.id()]=null}function cs(e,t){const i=Qn[e.id()];let n=null;if(i===undefined||i===null){n=t(e);Qn[e.id()]=[[t,n]];return n}for(let e=0;e{if(!t){return""}if(e.cache_.source.src===t&&e.cache_.source.type){return e.cache_.source.type}const i=e.cache_.sources.filter(e=>e.src===t);if(i.length){return i[0].type}const n=e.$$("source");for(let e=0;ethis.handleMouseOver(e);this.handleMouseOut_=e=>this.handleMouseOut(e);this.handleClick_=e=>this.handleClick(e);this.handleKeyDown_=e=>this.handleKeyDown(e);this.emitTapEvents();this.enable()}createEl(e="div",t={},i={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t);if(e==="button"){h.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`)}i=Object.assign({role:"button"},i);this.tabIndex_=t.tabIndex;const n=l(e,t,i);if(!this.player_.options_.experimentalSvgIcons){n.appendChild(l("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}))}this.createControlTextEl(n);return n}dispose(){this.controlTextEl_=null;super.dispose()}createControlTextEl(e){this.controlTextEl_=l("span",{className:"vjs-control-text"},{"aria-live":"polite"});if(e){e.appendChild(this.controlTextEl_)}this.controlText(this.controlText_,e);return this.controlTextEl_}controlText(e,t=this.el()){if(e===undefined){return this.controlText_||"Need Text"}const i=this.localize(e);this.controlText_=e;je(this.controlTextEl_,i);if(!this.nonIconControl&&!this.player_.options_.noUITitleAttributes){t.setAttribute("title",i)}}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){if(!this.enabled_){this.enabled_=true;this.removeClass("vjs-disabled");this.el_.setAttribute("aria-disabled","false");if(typeof this.tabIndex_!=="undefined"){this.el_.setAttribute("tabIndex",this.tabIndex_)}this.on(["tap","click"],this.handleClick_);this.on("keydown",this.handleKeyDown_)}}disable(){this.enabled_=false;this.addClass("vjs-disabled");this.el_.setAttribute("aria-disabled","true");if(typeof this.tabIndex_!=="undefined"){this.el_.removeAttribute("tabIndex")}this.off("mouseover",this.handleMouseOver_);this.off("mouseout",this.handleMouseOut_);this.off(["tap","click"],this.handleClick_);this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){if(this.options_.clickHandler){this.options_.clickHandler.call(this,arguments)}}handleKeyDown(e){if(a.isEventKey(e,"Space")||a.isEventKey(e,"Enter")){e.preventDefault();e.stopPropagation();this.trigger("click")}else{super.handleKeyDown(e)}}}g.registerComponent("ClickableComponent",_s);class Ts extends _s{constructor(e,t){super(e,t);this.update();this.update_=e=>this.update(e);e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_);super.dispose()}createEl(){return l("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e==="undefined"){if(this.$("img")){return this.$("img").crossOrigin}else if(this.player_.tech_&&this.player_.tech_.isReady_){return this.player_.crossOrigin()}return this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null}if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}if(this.$("img")){this.$("img").crossOrigin=e}return}update(e){const t=this.player().poster();this.setSrc(t);if(t){this.show()}else{this.hide()}}setSrc(e){if(!e){this.el_.textContent="";return}if(!this.$("img")){this.el_.appendChild(l("picture",{className:"vjs-poster",tabIndex:-1},{},l("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""})))}this.$("img").src=e}handleClick(e){if(!this.player_.controls()){return}if(this.player_.tech(true)){this.player_.tech(true).focus()}if(this.player_.paused()){li(this.player_.play())}else{this.player_.pause()}}}Ts.prototype.crossorigin=Ts.prototype.crossOrigin;g.registerComponent("PosterImage",Ts);const Ss="#222";const Es="#ccc";const ws={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 Is(e,t){let i;if(e.length===4){i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]}else if(e.length===7){i=e.slice(1)}else{throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.")}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function ks(e,t,i){try{e.style[t]=i}catch(e){return}}function Cs(e){return e?`${e}px`:""}class As extends g{constructor(n,e,t){super(n,e,t);const i=e=>this.updateDisplay(e);const s=e=>{this.updateDisplayOverlay();this.updateDisplay(e)};n.on("loadstart",e=>this.toggleDisplay(e));n.on("texttrackchange",i);n.on("loadedmetadata",e=>{this.updateDisplayOverlay();this.preselectTrack(e)});n.ready(u(this,function(){if(n.tech_&&n.tech_.featuresNativeTextTracks){this.hide();return}n.on("fullscreenchange",s);n.on("playerresize",s);const e=tv.screen.orientation||tv;const t=tv.screen.orientation?"change":"orientationchange";e.addEventListener(t,s);n.on("dispose",()=>e.removeEventListener(t,s));const i=this.options_.playerOptions.tracks||[];for(let e=0;e.1){if(i>n){s=Math.round((e-t*n)/2)}else{r=Math.round((t-e/n)/2)}}ks(this.el_,"insetInline",Cs(s));ks(this.el_,"insetBlock",Cs(r))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues();const i=e.activeCues;let n=i.length;while(n--){const s=i[n];if(!s){continue}const r=s.displayState;if(t.color){r.firstChild.style.color=t.color}if(t.textOpacity){ks(r.firstChild,"color",Is(t.color||"#fff",t.textOpacity))}if(t.backgroundColor){r.firstChild.style.backgroundColor=t.backgroundColor}if(t.backgroundOpacity){ks(r.firstChild,"backgroundColor",Is(t.backgroundColor||"#000",t.backgroundOpacity))}if(t.windowColor){if(t.windowOpacity){ks(r,"backgroundColor",Is(t.windowColor,t.windowOpacity))}else{r.style.backgroundColor=t.windowColor}}if(t.edgeStyle){if(t.edgeStyle==="dropshadow"){r.firstChild.style.textShadow=`2px 2px 3px ${Ss}, 2px 2px 4px ${Ss}, 2px 2px 5px ${Ss}`}else if(t.edgeStyle==="raised"){r.firstChild.style.textShadow=`1px 1px ${Ss}, 2px 2px ${Ss}, 3px 3px ${Ss}`}else if(t.edgeStyle==="depressed"){r.firstChild.style.textShadow=`1px 1px ${Es}, 0 1px ${Es}, -1px -1px ${Ss}, 0 -1px ${Ss}`}else if(t.edgeStyle==="uniform"){r.firstChild.style.textShadow=`0 0 4px ${Ss}, 0 0 4px ${Ss}, 0 0 4px ${Ss}, 0 0 4px ${Ss}`}}if(t.fontPercent&&t.fontPercent!==1){const a=tv.parseFloat(r.style.fontSize);r.style.fontSize=a*t.fontPercent+"px";r.style.height="auto";r.style.top="auto"}if(t.fontFamily&&t.fontFamily!=="default"){if(t.fontFamily==="small-caps"){r.firstChild.style.fontVariant="small-caps"}else{r.firstChild.style.fontFamily=ws[t.fontFamily]}}}}updateForTrack(i){if(!Array.isArray(i)){i=[i]}if(typeof tv.WebVTT!=="function"||i.every(e=>{return!e.activeCues})){return}const t=[];for(let e=0;ethis.handleMouseDown(e))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&e.clientX&&e.clientY){li(t);if(this.player_.tech(true)){this.player_.tech(true).focus()}return}const i=this.player_.getChild("controlBar");const n=i&&i.getChild("playToggle");if(!n){this.player_.tech(true).focus();return}const s=()=>n.focus();if(oi(t)){t.then(s,()=>{})}else{this.setTimeout(s,1)}}handleKeyDown(e){this.mouseused_=false;super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=true}}Ds.prototype.controlText_="Play Video";g.registerComponent("BigPlayButton",Ds);class Rs extends xs{constructor(e,t){super(e,t);this.setIcon("cancel");this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:false})}handleKeyDown(e){if(a.isEventKey(e,"Esc")){e.preventDefault();e.stopPropagation();this.trigger("click")}else{super.handleKeyDown(e)}}}g.registerComponent("CloseButton",Rs);class Os extends xs{constructor(e,t={}){super(e,t);t.replay=t.replay===undefined||t.replay;this.setIcon("play");this.on(e,"play",e=>this.handlePlay(e));this.on(e,"pause",e=>this.handlePause(e));if(t.replay){this.on(e,"ended",e=>this.handleEnded(e))}}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){if(this.player_.paused()){li(this.player_.play())}else{this.player_.pause()}}handleSeeked(e){this.removeClass("vjs-ended");if(this.player_.paused()){this.handlePause(e)}else{this.handlePlay(e)}}handlePlay(e){this.removeClass("vjs-ended","vjs-paused");this.addClass("vjs-playing");this.setIcon("pause");this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing");this.addClass("vjs-paused");this.setIcon("play");this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing");this.addClass("vjs-ended");this.setIcon("replay");this.controlText("Replay");this.one(this.player_,"seeked",e=>this.handleSeeked(e))}}Os.prototype.controlText_="Play";g.registerComponent("PlayToggle",Os);class Ps extends g{constructor(e,t){super(e,t);this.on(e,["timeupdate","ended"],e=>this.updateContent(e));this.updateTextNode_()}createEl(){const e=this.buildCSSClass();const t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`});const i=l("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)}\u00a0`},{role:"presentation"});t.appendChild(i);this.contentEl_=l("span",{className:`${e}-display`},{role:"presentation"});t.appendChild(this.contentEl_);return t}dispose(){this.contentEl_=null;this.textNode_=null;super.dispose()}updateTextNode_(e=0){e=ii(e);if(this.formattedTime_===e){return}this.formattedTime_=e;this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_){return}let e=this.textNode_;if(e&&this.contentEl_.firstChild!==e){e=null;h.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_=iv.createTextNode(this.formattedTime_);if(!this.textNode_){return}if(e){this.contentEl_.replaceChild(this.textNode_,e)}else{this.contentEl_.appendChild(this.textNode_)}})}updateContent(e){}}Ps.prototype.labelText_="Time";Ps.prototype.controlText_="Time";g.registerComponent("TimeDisplay",Ps);class Ls extends Ps{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;if(this.player_.ended()){t=this.player_.duration()}else{t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}this.updateTextNode_(t)}}Ls.prototype.labelText_="Current Time";Ls.prototype.controlText_="Current Time";g.registerComponent("CurrentTimeDisplay",Ls);class Ns extends Ps{constructor(e,t){super(e,t);const i=e=>this.updateContent(e);this.on(e,"durationchange",i);this.on(e,"loadstart",i);this.on(e,"loadedmetadata",i)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}Ns.prototype.labelText_="Duration";Ns.prototype.controlText_="Duration";g.registerComponent("DurationDisplay",Ns);class Ms extends g{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":true});const t=super.createEl("div");const i=super.createEl("span",{textContent:"/"});t.appendChild(i);e.appendChild(t);return e}}g.registerComponent("TimeDivider",Ms);class Us extends Ps{constructor(e,t){super(e,t);this.on(e,"durationchange",e=>this.updateContent(e))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();if(this.options_.displayNegative!==false){e.insertBefore(l("span",{},{"aria-hidden":true},"-"),this.contentEl_)}return e}updateContent(e){if(typeof this.player_.duration()!=="number"){return}let t;if(this.player_.ended()){t=0}else if(this.player_.remainingTimeDisplay){t=this.player_.remainingTimeDisplay()}else{t=this.player_.remainingTime()}this.updateTextNode_(t)}}Us.prototype.labelText_="Remaining Time";Us.prototype.controlText_="Remaining Time";g.registerComponent("RemainingTimeDisplay",Us);class Bs extends g{constructor(e,t){super(e,t);this.updateShowing();this.on(this.player(),"durationchange",e=>this.updateShowing(e))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});this.contentEl_=l("div",{className:"vjs-live-display"},{"aria-live":"off"});this.contentEl_.appendChild(l("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")}\u00a0`}));this.contentEl_.appendChild(iv.createTextNode(this.localize("LIVE")));e.appendChild(this.contentEl_);return e}dispose(){this.contentEl_=null;super.dispose()}updateShowing(e){if(this.player().duration()===Infinity){this.show()}else{this.hide()}}}g.registerComponent("LiveDisplay",Bs);class Fs extends xs{constructor(e,t){super(e,t);this.updateLiveEdgeStatus();if(this.player_.liveTracker){this.updateLiveEdgeStatusHandler_=e=>this.updateLiveEdgeStatus(e);this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_)}}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});this.setIcon("circle",e);this.textEl_=l("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"});e.appendChild(this.textEl_);return e}updateLiveEdgeStatus(){if(!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()){this.setAttribute("aria-disabled",true);this.addClass("vjs-at-live-edge");this.controlText("Seek to live, currently playing live")}else{this.setAttribute("aria-disabled",false);this.removeClass("vjs-at-live-edge");this.controlText("Seek to live, currently behind live")}}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){if(this.player_.liveTracker){this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_)}this.textEl_=null;super.dispose()}}Fs.prototype.controlText_="Seek to live, currently playing live";g.registerComponent("SeekToLive",Fs);function qs(e,t,i){e=Number(e);return Math.min(i,Math.max(t,isNaN(e)?t:e))}var Vs=Object.freeze({__proto__:null,clamp:qs});class Hs extends g{constructor(e,t){super(e,t);this.handleMouseDown_=e=>this.handleMouseDown(e);this.handleMouseUp_=e=>this.handleMouseUp(e);this.handleKeyDown_=e=>this.handleKeyDown(e);this.handleClick_=e=>this.handleClick(e);this.handleMouseMove_=e=>this.handleMouseMove(e);this.update_=e=>this.update(e);this.bar=this.getChild(this.options_.barName);this.vertical(!!this.options_.vertical);this.enable()}enabled(){return this.enabled_}enable(){if(this.enabled()){return}this.on("mousedown",this.handleMouseDown_);this.on("touchstart",this.handleMouseDown_);this.on("keydown",this.handleKeyDown_);this.on("click",this.handleClick_);this.on(this.player_,"controlsvisible",this.update);if(this.playerEvent){this.on(this.player_,this.playerEvent,this.update)}this.removeClass("disabled");this.setAttribute("tabindex",0);this.enabled_=true}disable(){if(!this.enabled()){return}const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_);this.off("touchstart",this.handleMouseDown_);this.off("keydown",this.handleKeyDown_);this.off("click",this.handleClick_);this.off(this.player_,"controlsvisible",this.update_);this.off(e,"mousemove",this.handleMouseMove_);this.off(e,"mouseup",this.handleMouseUp_);this.off(e,"touchmove",this.handleMouseMove_);this.off(e,"touchend",this.handleMouseUp_);this.removeAttribute("tabindex");this.addClass("disabled");if(this.playerEvent){this.off(this.player_,this.playerEvent,this.update)}this.enabled_=false}createEl(e,t={},i={}){t.className=t.className+" vjs-slider";t=Object.assign({tabIndex:0},t);i=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},i);return super.createEl(e,t,i)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;if(e.type==="mousedown"){e.preventDefault()}if(e.type==="touchstart"&&!ce){e.preventDefault()}Fe();this.addClass("vjs-sliding");this.trigger("slideractive");this.on(t,"mousemove",this.handleMouseMove_);this.on(t,"mouseup",this.handleMouseUp_);this.on(t,"touchmove",this.handleMouseMove_);this.on(t,"touchend",this.handleMouseUp_);this.handleMouseMove(e,true)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;qe();this.removeClass("vjs-sliding");this.trigger("sliderinactive");this.off(t,"mousemove",this.handleMouseMove_);this.off(t,"mouseup",this.handleMouseUp_);this.off(t,"touchmove",this.handleMouseMove_);this.off(t,"touchend",this.handleMouseUp_);this.update()}update(){if(!this.el_||!this.bar){return}const t=this.getProgress();if(t===this.progress_){return t}this.progress_=t;this.requestNamedAnimationFrame("Slider#update",()=>{const e=this.vertical()?"height":"width";this.bar.el().style[e]=(t*100).toFixed(2)+"%"});return t}getProgress(){return Number(qs(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=$e(this.el_,e);if(this.vertical()){return t.y}return t.x}handleKeyDown(e){if(a.isEventKey(e,"Left")||a.isEventKey(e,"Down")){e.preventDefault();e.stopPropagation();this.stepBack()}else if(a.isEventKey(e,"Right")||a.isEventKey(e,"Up")){e.preventDefault();e.stopPropagation();this.stepForward()}else{super.handleKeyDown(e)}}handleClick(e){e.stopPropagation();e.preventDefault()}vertical(e){if(e===undefined){return this.vertical_||false}this.vertical_=!!e;if(this.vertical_){this.addClass("vjs-slider-vertical")}else{this.addClass("vjs-slider-horizontal")}}}g.registerComponent("Slider",Hs);const $s=(e,t)=>qs(e/t*100,0,100).toFixed(2)+"%";class zs extends g{constructor(e,t){super(e,t);this.partEls_=[];this.on(e,"progress",e=>this.update(e))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"});const t=l("span",{className:"vjs-control-text"});const i=l("span",{textContent:this.localize("Loaded")});const n=iv.createTextNode(": ");this.percentageEl_=l("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"});e.appendChild(t);t.appendChild(i);t.appendChild(n);t.appendChild(this.percentageEl_);return e}dispose(){this.partEls_=null;this.percentageEl_=null;super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const e=this.player_.liveTracker;const i=this.player_.buffered();const t=e&&e.isLive()?e.seekableEnd():this.player_.duration();const n=this.player_.bufferedEnd();const s=this.partEls_;const r=$s(n,t);if(this.percent_!==r){this.el_.style.width=r;je(this.percentageEl_,r);this.percent_=r}for(let t=0;ti.length;e--){this.el_.removeChild(s[e-1])}s.length=i.length})}}g.registerComponent("LoadProgressBar",zs);class Gs extends g{constructor(e,t){super(e,t);this.update=wt(u(this,this.update),Et)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,i){const n=He(this.el_);const s=Ve(this.player_.el());const r=e.width*t;if(!s||!n){return}const a=e.left-s.left+r;const o=e.width-r+(s.right-e.right);let l=n.width/2;if(an.width){l=n.width}l=Math.round(l);this.el_.style.right=`-${l}px`;this.write(i)}write(e){je(this.el_,e)}updateTime(s,r,a,o){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let e;const t=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const i=this.player_.liveTracker.liveWindow();const n=i-r*i;e=(n<1?"":"-")+ii(n,i)}else{e=ii(a,t)}this.update(s,r,e);if(o){o()}})}}g.registerComponent("TimeTooltip",Gs);class Ws extends g{constructor(e,t){super(e,t);this.setIcon("circle");this.update=wt(u(this,this.update),Et)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const i=this.getChild("timeTooltip");if(!i){return}const n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}}Ws.prototype.options_={children:[]};if(!p&&!ae){Ws.prototype.options_.children.push("timeTooltip")}g.registerComponent("PlayProgressBar",Ws);class Ks extends g{constructor(e,t){super(e,t);this.update=wt(u(this,this.update),Et)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const i=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,i,()=>{this.el_.style.left=`${e.width*t}px`})}}Ks.prototype.options_={children:["timeTooltip"]};g.registerComponent("MouseTimeDisplay",Ks);const Xs=5;const Ys=12;class Qs extends Hs{constructor(e,t){super(e,t);this.setEventHandlers_()}setEventHandlers_(){this.update_=u(this,this.update);this.update=wt(this.update_,Et);this.on(this.player_,["ended","durationchange","timeupdate"],this.update);if(this.player_.liveTracker){this.on(this.player_.liveTracker,"liveedgechange",this.update)}this.updateInterval=null;this.enableIntervalHandler_=e=>this.enableInterval_(e);this.disableIntervalHandler_=e=>this.disableInterval_(e);this.on(this.player_,["playing"],this.enableIntervalHandler_);this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_);if("hidden"in iv&&"visibilityState"in iv){this.on(iv,"visibilitychange",this.toggleVisibility_)}}toggleVisibility_(e){if(iv.visibilityState==="hidden"){this.cancelNamedAnimationFrame("SeekBar#update");this.cancelNamedAnimationFrame("Slider#update");this.disableInterval_(e)}else{if(!this.player_.ended()&&!this.player_.paused()){this.enableInterval_()}this.update()}}enableInterval_(){if(this.updateInterval){return}this.updateInterval=this.setInterval(this.update,Et)}disableInterval_(e){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"){return}if(!this.updateInterval){return}this.clearInterval(this.updateInterval);this.updateInterval=null}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(iv.visibilityState==="hidden"){return}const n=super.update();this.requestNamedAnimationFrame("SeekBar#update",()=>{const e=this.player_.ended()?this.player_.duration():this.getCurrentTime_();const t=this.player_.liveTracker;let i=this.player_.duration();if(t&&t.isLive()){i=this.player_.liveTracker.liveCurrentTime()}if(this.percent_!==n){this.el_.setAttribute("aria-valuenow",(n*100).toFixed(2));this.percent_=n}if(this.currentTime_!==e||this.duration_!==i){this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[ii(e,i),ii(i,i)],"{1} of {2}"));this.currentTime_=e;this.duration_=i}if(this.bar){this.bar.update(Ve(this.el()),this.getProgress())}});return n}userSeek_(e){if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){this.player_.liveTracker.nextSeekedFromUser()}this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const i=this.player_.liveTracker;if(i&&i.isLive()){t=(e-i.seekableStart())/i.liveWindow();if(i.atLiveEdge()){t=1}}else{t=e/this.player_.duration()}return t}handleMouseDown(e){if(!Ye(e)){return}e.stopPropagation();this.videoWasPlaying=!this.player_.paused();this.player_.pause();super.handleMouseDown(e)}handleMouseMove(e,t=false){if(!Ye(e)||isNaN(this.player_.duration())){return}if(!t&&!this.player_.scrubbing()){this.player_.scrubbing(true)}let i;const n=this.calculateDistance(e);const s=this.player_.liveTracker;if(!s||!s.isLive()){i=n*this.player_.duration();if(i===this.player_.duration()){i=i-.1}}else{if(n>=.99){s.seekToLiveEdge();return}const r=s.seekableStart();const a=s.liveCurrentTime();i=r+n*s.liveWindow();if(i>=a){i=a}if(i<=r){i=r+.1}if(i===Infinity){return}}this.userSeek_(i)}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");if(!e){return}e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");if(!e){return}e.hide()}handleMouseUp(e){super.handleMouseUp(e);if(e){e.stopPropagation()}this.player_.scrubbing(false);this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:true});if(this.videoWasPlaying){li(this.player_.play())}else{this.update_()}}stepForward(){this.userSeek_(this.player_.currentTime()+Xs)}stepBack(){this.userSeek_(this.player_.currentTime()-Xs)}handleAction(e){if(this.player_.paused()){this.player_.play()}else{this.player_.pause()}}handleKeyDown(e){const t=this.player_.liveTracker;if(a.isEventKey(e,"Space")||a.isEventKey(e,"Enter")){e.preventDefault();e.stopPropagation();this.handleAction(e)}else if(a.isEventKey(e,"Home")){e.preventDefault();e.stopPropagation();this.userSeek_(0)}else if(a.isEventKey(e,"End")){e.preventDefault();e.stopPropagation();if(t&&t.isLive()){this.userSeek_(t.liveCurrentTime())}else{this.userSeek_(this.player_.duration())}}else if(/^[0-9]$/.test(a(e))){e.preventDefault();e.stopPropagation();const i=(a.codes[a(e)]-a.codes["0"])*10/100;if(t&&t.isLive()){this.userSeek_(t.seekableStart()+t.liveWindow()*i)}else{this.userSeek_(this.player_.duration()*i)}}else if(a.isEventKey(e,"PgDn")){e.preventDefault();e.stopPropagation();this.userSeek_(this.player_.currentTime()-Xs*Ys)}else if(a.isEventKey(e,"PgUp")){e.preventDefault();e.stopPropagation();this.userSeek_(this.player_.currentTime()+Xs*Ys)}else{super.handleKeyDown(e)}}dispose(){this.disableInterval_();this.off(this.player_,["ended","durationchange","timeupdate"],this.update);if(this.player_.liveTracker){this.off(this.player_.liveTracker,"liveedgechange",this.update)}this.off(this.player_,["playing"],this.enableIntervalHandler_);this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_);if("hidden"in iv&&"visibilityState"in iv){this.off(iv,"visibilitychange",this.toggleVisibility_)}super.dispose()}}Qs.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};if(!p&&!ae){Qs.prototype.options_.children.splice(1,0,"mouseTimeDisplay")}g.registerComponent("SeekBar",Qs);class Js extends g{constructor(e,t){super(e,t);this.handleMouseMove=wt(u(this,this.handleMouseMove),Et);this.throttledHandleMouseSeek=wt(u(this,this.handleMouseSeek),Et);this.handleMouseUpHandler_=e=>this.handleMouseUp(e);this.handleMouseDownHandler_=e=>this.handleMouseDown(e);this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t){return}const i=t.getChild("playProgressBar");const n=t.getChild("mouseTimeDisplay");if(!i&&!n){return}const s=t.el();const r=He(s);let a=$e(s,e).x;a=qs(a,0,1);if(n){n.update(r,a)}if(i){i.update(r,t.getProgress())}}handleMouseSeek(e){const t=this.getChild("seekBar");if(t){t.handleMouseMove(e)}}enabled(){return this.enabled_}disable(){this.children().forEach(e=>e.disable&&e.disable());if(!this.enabled()){return}this.off(["mousedown","touchstart"],this.handleMouseDownHandler_);this.off(this.el_,"mousemove",this.handleMouseMove);this.removeListenersAddedOnMousedownAndTouchstart();this.addClass("disabled");this.enabled_=false;if(this.player_.scrubbing()){const e=this.getChild("seekBar");this.player_.scrubbing(false);if(e.videoWasPlaying){li(this.player_.play())}}}enable(){this.children().forEach(e=>e.enable&&e.enable());if(this.enabled()){return}this.on(["mousedown","touchstart"],this.handleMouseDownHandler_);this.on(this.el_,"mousemove",this.handleMouseMove);this.removeClass("disabled");this.enabled_=true}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek);this.off(e,"touchmove",this.throttledHandleMouseSeek);this.off(e,"mouseup",this.handleMouseUpHandler_);this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument;const i=this.getChild("seekBar");if(i){i.handleMouseDown(e)}this.on(t,"mousemove",this.throttledHandleMouseSeek);this.on(t,"touchmove",this.throttledHandleMouseSeek);this.on(t,"mouseup",this.handleMouseUpHandler_);this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");if(t){t.handleMouseUp(e)}this.removeListenersAddedOnMousedownAndTouchstart()}}Js.prototype.options_={children:["seekBar"]};g.registerComponent("ProgressControl",Js);class Zs extends xs{constructor(e,t){super(e,t);this.setIcon("picture-in-picture-enter");this.on(e,["enterpictureinpicture","leavepictureinpicture"],e=>this.handlePictureInPictureChange(e));this.on(e,["disablepictureinpicturechanged","loadedmetadata"],e=>this.handlePictureInPictureEnabledChange(e));this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange());this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){const e=this.player_.currentType().substring(0,5)==="audio";const t=e||this.player_.audioPosterMode()||this.player_.audioOnlyMode();if(!t){this.show();return}if(this.player_.isInPictureInPicture()){this.player_.exitPictureInPicture()}this.hide()}handlePictureInPictureEnabledChange(){if(iv.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===false||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in tv){this.enable()}else{this.disable()}}handlePictureInPictureChange(e){if(this.player_.isInPictureInPicture()){this.setIcon("picture-in-picture-exit");this.controlText("Exit Picture-in-Picture")}else{this.setIcon("picture-in-picture-enter");this.controlText("Picture-in-Picture")}this.handlePictureInPictureEnabledChange()}handleClick(e){if(!this.player_.isInPictureInPicture()){this.player_.requestPictureInPicture()}else{this.player_.exitPictureInPicture()}}show(){if(typeof iv.exitPictureInPicture!=="function"){return}super.show()}}Zs.prototype.controlText_="Picture-in-Picture";g.registerComponent("PictureInPictureToggle",Zs);class er extends xs{constructor(e,t){super(e,t);this.setIcon("fullscreen-enter");this.on(e,"fullscreenchange",e=>this.handleFullscreenChange(e));if(iv[e.fsApi_.fullscreenEnabled]===false){this.disable()}}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){if(this.player_.isFullscreen()){this.controlText("Exit Fullscreen");this.setIcon("fullscreen-exit")}else{this.controlText("Fullscreen");this.setIcon("fullscreen-enter")}}handleClick(e){if(!this.player_.isFullscreen()){this.player_.requestFullscreen()}else{this.player_.exitFullscreen()}}}er.prototype.controlText_="Fullscreen";g.registerComponent("FullscreenToggle",er);const tr=function(e,t){if(t.tech_&&!t.tech_.featuresVolumeControl){e.addClass("vjs-hidden")}e.on(t,"loadstart",function(){if(!t.tech_.featuresVolumeControl){e.addClass("vjs-hidden")}else{e.removeClass("vjs-hidden")}})};class ir extends g{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});this.setIcon("circle",e);e.appendChild(super.createEl("span",{className:"vjs-control-text"}));return e}}g.registerComponent("VolumeLevel",ir);class nr extends g{constructor(e,t){super(e,t);this.update=wt(u(this,this.update),Et)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(t,i,e,n){if(!e){const s=Ve(this.el_);const r=Ve(this.player_.el());const a=t.width*i;if(!r||!s){return}const o=t.left-r.left+a;const l=t.width-a+(r.right-t.right);let e=s.width/2;if(os.width){e=s.width}this.el_.style.right=`-${e}px`}this.write(`${n}%`)}write(e){je(this.el_,e)}updateVolume(e,t,i,n,s){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,i,n.toFixed(0));if(s){s()}})}}g.registerComponent("VolumeLevelTooltip",nr);class sr extends g{constructor(e,t){super(e,t);this.update=wt(u(this,this.update),Et)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,i){const n=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,n,()=>{if(i){this.el_.style.bottom=`${e.height*t}px`}else{this.el_.style.left=`${e.width*t}px`}})}}sr.prototype.options_={children:["volumeLevelTooltip"]};g.registerComponent("MouseVolumeLevelDisplay",sr);class rr extends Hs{constructor(e,t){super(e,t);this.on("slideractive",e=>this.updateLastVolume_(e));this.on(e,"volumechange",e=>this.updateARIAAttributes(e));e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){if(!Ye(e)){return}super.handleMouseDown(e)}handleMouseMove(t){const i=this.getChild("mouseVolumeLevelDisplay");if(i){const n=this.el();const s=Ve(n);const r=this.vertical();let e=$e(n,t);e=r?e.y:e.x;e=qs(e,0,1);i.update(s,e,r)}if(!Ye(t)){return}this.checkMuted();this.player_.volume(this.calculateDistance(t))}checkMuted(){if(this.player_.muted()){this.player_.muted(false)}}getPercent(){if(this.player_.muted()){return 0}return this.player_.volume()}stepForward(){this.checkMuted();this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted();this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t);this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{if(this.player_.volume()===0){this.player_.lastVolume_(e)}})}}rr.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};if(!p&&!ae){rr.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay")}rr.prototype.playerEvent="volumechange";g.registerComponent("VolumeBar",rr);class ar extends g{constructor(e,t={}){t.vertical=t.vertical||false;if(typeof t.volumeBar==="undefined"||ee(t.volumeBar)){t.volumeBar=t.volumeBar||{};t.volumeBar.vertical=t.vertical}super(e,t);tr(this,e);this.throttledHandleMouseMove=wt(u(this,this.handleMouseMove),Et);this.handleMouseUpHandler_=e=>this.handleMouseUp(e);this.on("mousedown",e=>this.handleMouseDown(e));this.on("touchstart",e=>this.handleMouseDown(e));this.on("mousemove",e=>this.handleMouseMove(e));this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active");this.addClass("vjs-slider-active");this.trigger("slideractive")});this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active");this.removeClass("vjs-slider-active");this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";if(this.options_.vertical){e="vjs-volume-vertical"}return super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove);this.on(t,"touchmove",this.throttledHandleMouseMove);this.on(t,"mouseup",this.handleMouseUpHandler_);this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove);this.off(t,"touchmove",this.throttledHandleMouseMove);this.off(t,"mouseup",this.handleMouseUpHandler_);this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}ar.prototype.options_={children:["volumeBar"]};g.registerComponent("VolumeControl",ar);const or=function(e,t){if(t.tech_&&!t.tech_.featuresMuteControl){e.addClass("vjs-hidden")}e.on(t,"loadstart",function(){if(!t.tech_.featuresMuteControl){e.addClass("vjs-hidden")}else{e.removeClass("vjs-hidden")}})};class lr extends xs{constructor(e,t){super(e,t);or(this,e);this.on(e,["loadstart","volumechange"],e=>this.update(e))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume();const i=this.player_.lastVolume_();if(t===0){const n=i<.1?.1:i;this.player_.volume(n);this.player_.muted(false)}else{this.player_.muted(this.player_.muted()?false:true)}}update(e){this.updateIcon_();this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high");if(p&&this.player_.tech_&&this.player_.tech_.el_){this.player_.muted(this.player_.tech_.el_.muted)}if(e===0||this.player_.muted()){this.setIcon("volume-mute");t=0}else if(e<.33){this.setIcon("volume-low");t=1}else if(e<.67){this.setIcon("volume-medium");t=2}Oe(this.el_,[0,1,2,3].reduce((e,t)=>e+`${t?" ":""}vjs-vol-${t}`,""));Re(this.el_,`vjs-vol-${t}`)}updateControlText_(){const e=this.player_.muted()||this.player_.volume()===0;const t=e?"Unmute":"Mute";if(this.controlText()!==t){this.controlText(t)}}}lr.prototype.controlText_="Mute";g.registerComponent("MuteToggle",lr);class dr extends g{constructor(e,t={}){if(typeof t.inline!=="undefined"){t.inline=t.inline}else{t.inline=true}if(typeof t.volumeControl==="undefined"||ee(t.volumeControl)){t.volumeControl=t.volumeControl||{};t.volumeControl.vertical=!t.inline}super(e,t);this.handleKeyPressHandler_=e=>this.handleKeyPress(e);this.on(e,["loadstart"],e=>this.volumePanelState_(e));this.on(this.muteToggle,"keyup",e=>this.handleKeyPress(e));this.on(this.volumeControl,"keyup",e=>this.handleVolumeControlKeyUp(e));this.on("keydown",e=>this.handleKeyPress(e));this.on("mouseover",e=>this.handleMouseOver(e));this.on("mouseout",e=>this.handleMouseOut(e));this.on(this.volumeControl,["slideractive"],this.sliderActive_);this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){if(this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-hidden")}if(this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")){this.addClass("vjs-mute-toggle-only")}}createEl(){let e="vjs-volume-panel-horizontal";if(!this.options_.inline){e="vjs-volume-panel-vertical"}return super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut();super.dispose()}handleVolumeControlKeyUp(e){if(a.isEventKey(e,"Esc")){this.muteToggle.focus()}}handleMouseOver(e){this.addClass("vjs-hover");yt(iv,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover");d(iv,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){if(a.isEventKey(e,"Esc")){this.handleMouseOut()}}}dr.prototype.options_={children:["muteToggle","volumeControl"]};g.registerComponent("VolumePanel",dr);class ur extends xs{constructor(e,t){super(e,t);this.validOptions=[5,10,30];this.skipTime=this.getSkipForwardTime();if(this.skipTime&&this.validOptions.includes(this.skipTime)){this.setIcon(`forward-${this.skipTime}`);this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]));this.show()}else{this.hide()}}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration())){return}const t=this.player_.currentTime();const i=this.player_.liveTracker;const n=i&&i.isLive()?i.seekableEnd():this.player_.duration();let s;if(t+this.skipTime<=n){s=t+this.skipTime}else{s=n}this.player_.currentTime(s)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}g.registerComponent("SkipForward",ur);class cr extends xs{constructor(e,t){super(e,t);this.validOptions=[5,10,30];this.skipTime=this.getSkipBackwardTime();if(this.skipTime&&this.validOptions.includes(this.skipTime)){this.setIcon(`replay-${this.skipTime}`);this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]));this.show()}else{this.hide()}}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime();const i=this.player_.liveTracker;const n=i&&i.isLive()&&i.seekableStart();let s;if(n&&t-this.skipTime<=n){s=n}else if(t>=this.skipTime){s=t-this.skipTime}else{s=0}this.player_.currentTime(s)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}cr.prototype.controlText_="Skip Backward";g.registerComponent("SkipBackward",cr);class hr extends g{constructor(e,t){super(e,t);if(t){this.menuButton_=t.menuButton}this.focusedChild_=-1;this.on("keydown",e=>this.handleKeyDown(e));this.boundHandleBlur_=e=>this.handleBlur(e);this.boundHandleTapClick_=e=>this.handleTapClick(e)}addEventListenerForItem(e){if(!(e instanceof g)){return}this.on(e,"blur",this.boundHandleBlur_);this.on(e,["tap","click"],this.boundHandleTapClick_)}removeEventListenerForItem(e){if(!(e instanceof g)){return}this.off(e,"blur",this.boundHandleBlur_);this.off(e,["tap","click"],this.boundHandleTapClick_)}removeChild(e){if(typeof e==="string"){e=this.getChild(e)}this.removeEventListenerForItem(e);super.removeChild(e)}addItem(e){const t=this.addChild(e);if(t){this.addEventListenerForItem(t)}}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=l(e,{className:"vjs-menu-content"});this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});t.appendChild(this.contentEl_);yt(t,"click",function(e){e.preventDefault();e.stopImmediatePropagation()});return t}dispose(){this.contentEl_=null;this.boundHandleBlur_=null;this.boundHandleTapClick_=null;super.dispose()}handleBlur(e){const t=e.relatedTarget||iv.activeElement;if(!this.children().some(e=>{return e.el()===t})){const i=this.menuButton_;if(i&&i.buttonPressed_&&t!==i.el().firstChild){i.unpressButton()}}}handleTapClick(t){if(this.menuButton_){this.menuButton_.unpressButton();const e=this.children();if(!Array.isArray(e)){return}const i=e.filter(e=>e.el()===t.target)[0];if(!i){return}if(i.name()!=="CaptionSettingsMenuItem"){this.menuButton_.focus()}}}handleKeyDown(e){if(a.isEventKey(e,"Left")||a.isEventKey(e,"Down")){e.preventDefault();e.stopPropagation();this.stepForward()}else if(a.isEventKey(e,"Right")||a.isEventKey(e,"Up")){e.preventDefault();e.stopPropagation();this.stepBack()}}stepForward(){let e=0;if(this.focusedChild_!==undefined){e=this.focusedChild_+1}this.focus(e)}stepBack(){let e=0;if(this.focusedChild_!==undefined){e=this.focusedChild_-1}this.focus(e)}focus(e=0){const t=this.children().slice();const i=t.length&&t[0].hasClass("vjs-menu-title");if(i){t.shift()}if(t.length>0){if(e<0){e=0}else if(e>=t.length){e=t.length-1}this.focusedChild_=e;t[e].el_.focus()}}}g.registerComponent("Menu",hr);class fr extends g{constructor(e,t={}){super(e,t);this.menuButton_=new xs(e,t);this.menuButton_.controlText(this.controlText_);this.menuButton_.el_.setAttribute("aria-haspopup","true");const i=xs.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+i;this.menuButton_.removeClass("vjs-control");this.addChild(this.menuButton_);this.update();this.enabled_=true;const n=e=>this.handleClick(e);this.handleMenuKeyUp_=e=>this.handleMenuKeyUp(e);this.on(this.menuButton_,"tap",n);this.on(this.menuButton_,"click",n);this.on(this.menuButton_,"keydown",e=>this.handleKeyDown(e));this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover");this.menu.show();yt(iv,"keyup",this.handleMenuKeyUp_)});this.on("mouseleave",e=>this.handleMouseLeave(e));this.on("keydown",e=>this.handleSubmenuKeyDown(e))}update(){const e=this.createMenu();if(this.menu){this.menu.dispose();this.removeChild(this.menu)}this.menu=e;this.addChild(e);this.buttonPressed_=false;this.menuButton_.el_.setAttribute("aria-expanded","false");if(this.items&&this.items.length<=this.hideThreshold_){this.hide();this.menu.contentEl_.removeAttribute("role")}else{this.show();this.menu.contentEl_.setAttribute("role","menu")}}createMenu(){const t=new hr(this.player_,{menuButton:this});this.hideThreshold_=0;if(this.options_.title){const e=l("li",{className:"vjs-menu-title",textContent:m(this.options_.title),tabIndex:-1});const i=new g(this.player_,{el:e});t.addItem(i)}this.items=this.createItems();if(this.items){for(let e=0;ea.isEventKey(t,e))){super.handleKeyDown(t)}}handleClick(e){this.selected(true)}selected(e){if(this.selectable){if(e){this.addClass("vjs-selected");this.el_.setAttribute("aria-checked","true");this.controlText(", selected");this.isSelected_=true}else{this.removeClass("vjs-selected");this.el_.setAttribute("aria-checked","false");this.controlText("");this.isSelected_=false}}}}g.registerComponent("MenuItem",gr);class vr extends gr{constructor(e,t){const i=t.track;const n=e.textTracks();t.label=i.label||i.language||"Unknown";t.selected=i.mode==="showing";super(e,t);this.track=i;this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const s=(...e)=>{this.handleTracksChange.apply(this,e)};const r=(...e)=>{this.handleSelectedLanguageChange.apply(this,e)};e.on(["loadstart","texttrackchange"],s);n.addEventListener("change",s);n.addEventListener("selectedlanguagechange",r);this.on("dispose",function(){e.off(["loadstart","texttrackchange"],s);n.removeEventListener("change",s);n.removeEventListener("selectedlanguagechange",r)});if(n.onchange===undefined){let e;this.on(["tap","click"],function(){if(typeof tv.Event!=="object"){try{e=new tv.Event("change")}catch(e){}}if(!e){e=iv.createEvent("Event");e.initEvent("change",true,true)}n.dispatchEvent(e)})}this.handleTracksChange()}handleClick(e){const t=this.track;const i=this.player_.textTracks();super.handleClick(e);if(!i){return}for(let e=0;e-1&&s.mode==="showing"){n=false;break}}if(n!==this.isSelected_){this.selected(n)}}handleSelectedLanguageChange(e){const i=this.player().textTracks();let n=true;for(let e=0,t=i.length;e-1&&s.mode==="showing"){n=false;break}}if(n){this.player_.cache_.selectedLanguage={enabled:false}}}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label);super.handleLanguagechange()}}g.registerComponent("OffTextTrackMenuItem",yr);class br extends pr{constructor(e,t={}){t.tracks=e.textTracks();super(e,t)}createItems(t=[],i=vr){let e;if(this.label_){e=`${this.label_} off`}t.push(new yr(this.player_,{kinds:this.kinds_,kind:this.kind_,label:e}));this.hideThreshold_+=1;const n=this.player_.textTracks();if(!Array.isArray(this.kinds_)){this.kinds_=[this.kind_]}for(let e=0;e-1){const r=new i(this.player_,{track:s,kinds:this.kinds_,kind:this.kind_,selectable:true,multiSelectable:false});r.addClass(`vjs-${s.kind}-menu-item`);t.push(r)}}return t}}g.registerComponent("TextTrackButton",br);class _r extends gr{constructor(e,t){const i=t.track;const n=t.cue;const s=e.currentTime();t.selectable=true;t.multiSelectable=false;t.label=n.text;t.selected=n.startTime<=s&&s{this.items.forEach(e=>{e.selected(this.track_.activeCues[0]===e.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters"){return}const t=this.findChaptersTrack();if(t!==this.track_){this.setTrack(t);super.update()}else if(!this.items||t&&t.cues&&t.cues.length!==this.items.length){super.update()}}setTrack(e){if(this.track_===e){return}if(!this.updateHandler_){this.updateHandler_=this.update.bind(this)}if(this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(t){t.removeEventListener("load",this.updateHandler_)}this.track_.removeEventListener("cuechange",this.selectCurrentItem_);this.track_=null}this.track_=e;if(this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);if(t){t.addEventListener("load",this.updateHandler_)}this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}findChaptersTrack(){const t=this.player_.textTracks()||[];for(let e=t.length-1;e>=0;e--){const i=t[e];if(i.kind===this.kind_){return i}}}getMenuCaption(){if(this.track_&&this.track_.label){return this.track_.label}return this.localize(m(this.kind_))}createMenu(){this.options_.title=this.getMenuCaption();return super.createMenu()}createItems(){const i=[];if(!this.track_){return i}const n=this.track_.cues;if(!n){return i}for(let e=0,t=n.length;e-1){this.label_="captions";this.setIcon("captions")}this.menuButton_.controlText(m(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];if(!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")){e.push(new wr(this.player_,{kind:this.label_}));this.hideThreshold_+=1}e=super.createItems(e,kr);return e}}Cr.prototype.kinds_=["captions","subtitles"];Cr.prototype.controlText_="Subtitles";g.registerComponent("SubsCapsButton",Cr);class Ar extends gr{constructor(e,t){const i=t.track;const n=e.audioTracks();t.label=i.label||i.language||"Unknown";t.selected=i.enabled;super(e,t);this.track=i;this.addClass(`vjs-${i.kind}-menu-item`);const s=(...e)=>{this.handleTracksChange.apply(this,e)};n.addEventListener("change",s);this.on("dispose",()=>{n.removeEventListener("change",s)})}createEl(e,t,i){const n=super.createEl(e,t,i);const s=n.querySelector(".vjs-menu-item-text");if(["main-desc","description"].indexOf(this.options_.track.kind)>=0){s.appendChild(l("span",{className:"vjs-icon-placeholder"},{"aria-hidden":true}));s.appendChild(l("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))}return n}handleClick(e){super.handleClick(e);this.track.enabled=true;if(this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let e=0;ethis.update(e))}handleClick(e){super.handleClick();this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}xr.prototype.contentElType="button";g.registerComponent("PlaybackRateMenuItem",xr);class Dr extends fr{constructor(e,t){super(e,t);this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_);this.updateVisibility();this.updateLabel();this.on(e,"loadstart",e=>this.updateVisibility(e));this.on(e,"ratechange",e=>this.updateLabel(e));this.on(e,"playbackrateschange",e=>this.handlePlaybackRateschange(e))}createEl(){const e=super.createEl();this.labelElId_="vjs-playback-rate-value-label-"+this.id_;this.labelEl_=l("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"});e.appendChild(this.labelEl_);return e}dispose(){this.labelEl_=null;super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const t=this.playbackRates();const i=[];for(let e=t.length-1;e>=0;e--){i.push(new xr(this.player(),{rate:t[e]+"x"}))}return i}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){if(this.playbackRateSupported()){this.removeClass("vjs-hidden")}else{this.addClass("vjs-hidden")}}updateLabel(e){if(this.playbackRateSupported()){this.labelEl_.textContent=this.player().playbackRate()+"x"}}}Dr.prototype.controlText_="Playback Rate";g.registerComponent("PlaybackRateMenuButton",Dr);class Rr extends g{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},i={}){if(!t.className){t.className=this.buildCSSClass()}return super.createEl(e,t,i)}}g.registerComponent("Spacer",Rr);class Or extends Rr{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:"\xa0"})}}g.registerComponent("CustomControlSpacer",Or);class Pr extends g{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Pr.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};g.registerComponent("ControlBar",Pr);class Lr extends pi{constructor(e,t){super(e,t);this.on(e,"error",e=>this.open(e))}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Lr.prototype.options_=Object.assign({},pi.prototype.options_,{pauseOnOpen:false,fillAlways:true,temporary:false,uncloseable:true});g.registerComponent("ErrorDisplay",Lr);const Nr="vjs-text-track-settings";const Mr=["#000","Black"];const Ur=["#00F","Blue"];const Br=["#0FF","Cyan"];const Fr=["#0F0","Green"];const qr=["#F0F","Magenta"];const Vr=["#F00","Red"];const Hr=["#FFF","White"];const $r=["#FF0","Yellow"];const zr=["1","Opaque"];const Gr=["0.5","Semi-Transparent"];const Wr=["0","Transparent"];const Kr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Mr,Hr,Vr,Fr,Ur,$r,qr,Br]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[zr,Gr,Wr]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Hr,Mr,Vr,Fr,Ur,$r,qr,Br]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:e=>e==="1.00"?null:Number(e)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[zr,Gr]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Wr,Gr,zr]}};Kr.windowColor.options=Kr.backgroundColor.options;function Xr(e,t){if(t){e=t(e)}if(e&&e!=="none"){return e}}function Yr(e,t){const i=e.options[e.options.selectedIndex].value;return Xr(i,t)}function Qr(t,i,n){if(!i){return}for(let e=0;e{this.saveSettings();this.close()});this.on(this.$(".vjs-default-button"),"click",()=>{this.setDefaults();this.updateDisplay()});Q(Kr,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)});if(this.options_.persistTextTrackSettings){this.restoreSettings()}}dispose(){this.endDialog=null;super.dispose()}createElSelect_(e,t="",i="label"){const n=Kr[e];const s=n.id.replace("%s",this.id_);const r=[t,s].join(" ").trim();return[`<${i} id="${s}" class="${i==="label"?"vjs-label":""}">`,this.localize(n.label),``,`").join("")}createElFgColor_(){const e=`captions-text-legend-${this.id_}`;return['
',``,this.localize("Text"),"",'',this.createElSelect_("color",e),"",'',this.createElSelect_("textOpacity",e),"","
"].join("")}createElBgColor_(){const e=`captions-background-${this.id_}`;return['
',``,this.localize("Text Background"),"",'',this.createElSelect_("backgroundColor",e),"",'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")}createElWinColor_(){const e=`captions-window-${this.id_}`;return['
',``,this.localize("Caption Area Background"),"",'',this.createElSelect_("windowColor",e),"",'',this.createElSelect_("windowOpacity",e),"","
"].join("")}createElColors_(){return l("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return l("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})}createElControls_(){const e=this.localize("restore all settings to the default values");return l("div",{className:"vjs-track-settings-controls",innerHTML:[`",``].join("")})}content(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]}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 J(Kr,(e,t,i)=>{const n=Yr(this.$(t.selector),t.parser);if(n!==undefined){e[i]=n}return e},{})}setValues(i){Q(Kr,(e,t)=>{Qr(this.$(e.selector),i[t],e.parser)})}setDefaults(){Q(Kr,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(tv.localStorage.getItem(Nr))}catch(e){h.warn(e)}if(e){this.setValues(e)}}saveSettings(){if(!this.options_.persistTextTrackSettings){return}const e=this.getValues();try{if(Object.keys(e).length){tv.localStorage.setItem(Nr,JSON.stringify(e))}else{tv.localStorage.removeItem(Nr)}}catch(e){h.warn(e)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");if(e){e.updateDisplay()}}conditionalBlur_(){this.previouslyActiveEl_=null;const e=this.player_.controlBar;const t=e&&e.subsCapsButton;const i=e&&e.captionsButton;if(t){t.focus()}else if(i){i.focus()}}handleLanguagechange(){this.fill()}}g.registerComponent("TextTrackSettings",Jr);class Zr extends g{constructor(e,t){let i=t.ResizeObserver||tv.ResizeObserver;if(t.ResizeObserver===null){i=false}const n=f({createEl:!i,reportTouchActivity:false},t);super(e,n);this.ResizeObserver=t.ResizeObserver||tv.ResizeObserver;this.loadListener_=null;this.resizeObserver_=null;this.debouncedHandler_=It(()=>{this.resizeHandler()},100,false,this);if(i){this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_);this.resizeObserver_.observe(e.el())}else{this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow){return}const e=this.debouncedHandler_;let t=this.unloadListener_=function(){d(this,"resize",e);d(this,"unload",t);t=null};yt(this.el_.contentWindow,"unload",t);yt(this.el_.contentWindow,"resize",e)};this.one("load",this.loadListener_)}}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){if(!this.player_||!this.player_.trigger){return}this.player_.trigger("playerresize")}dispose(){if(this.debouncedHandler_){this.debouncedHandler_.cancel()}if(this.resizeObserver_){if(this.player_.el()){this.resizeObserver_.unobserve(this.player_.el())}this.resizeObserver_.disconnect()}if(this.loadListener_){this.off("load",this.loadListener_)}if(this.el_&&this.el_.contentWindow&&this.unloadListener_){this.unloadListener_.call(this.el_.contentWindow)}this.ResizeObserver=null;this.resizeObserver=null;this.debouncedHandler_=null;this.loadListener_=null;super.dispose()}}g.registerComponent("ResizeManager",Zr);const ea={trackingThreshold:20,liveTolerance:15};class ta extends g{constructor(e,t){const i=f(ea,t,{createEl:false});super(e,i);this.trackLiveHandler_=()=>this.trackLive_();this.handlePlay_=e=>this.handlePlay(e);this.handleFirstTimeupdate_=e=>this.handleFirstTimeupdate(e);this.handleSeeked_=e=>this.handleSeeked(e);this.seekToLiveEdge_=e=>this.seekToLiveEdge(e);this.reset_();this.on(this.player_,"durationchange",e=>this.handleDurationchange(e));this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length){return}const t=Number(tv.performance.now().toFixed(4));const i=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t;this.pastSeekEnd_=this.pastSeekEnd()+i;const n=this.liveCurrentTime();const s=this.player_.currentTime();let r=this.player_.paused()||this.seekedBehindLive_||Math.abs(n-s)>this.options_.liveTolerance;if(!this.timeupdateSeen_||n===Infinity){r=false}if(r!==this.behindLiveEdge_){this.behindLiveEdge_=r;this.trigger("liveedgechange")}}handleDurationchange(){this.toggleTracking()}toggleTracking(){if(this.player_.duration()===Infinity&&this.liveWindow()>=this.options_.trackingThreshold){if(this.player_.options_.liveui){this.player_.addClass("vjs-liveui")}this.startTracking()}else{this.player_.removeClass("vjs-liveui");this.stopTracking()}}startTracking(){if(this.isTracking()){return}if(!this.timeupdateSeen_){this.timeupdateSeen_=this.player_.hasStarted()}this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Et);this.trackLive_();this.on(this.player_,["play","pause"],this.trackLiveHandler_);if(!this.timeupdateSeen_){this.one(this.player_,"play",this.handlePlay_);this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)}else{this.on(this.player_,"seeked",this.handleSeeked_)}}handleFirstTimeupdate(){this.timeupdateSeen_=true;this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2;this.nextSeekedFromUser_=false;this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1;this.pastSeekEnd_=0;this.lastSeekEnd_=-1;this.behindLiveEdge_=true;this.timeupdateSeen_=false;this.seekedBehindLive_=false;this.nextSeekedFromUser_=false;this.clearInterval(this.trackingInterval_);this.trackingInterval_=null;this.off(this.player_,["play","pause"],this.trackLiveHandler_);this.off(this.player_,"seeked",this.handleSeeked_);this.off(this.player_,"play",this.handlePlay_);this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_);this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=true}stopTracking(){if(!this.isTracking()){return}this.reset_();this.trigger("liveedgechange")}seekableEnd(){const e=this.player_.seekable();const t=[];let i=e?e.length:0;while(i--){t.push(e.end(i))}return t.length?t.sort()[t.length-1]:Infinity}seekableStart(){const e=this.player_.seekable();const t=[];let i=e?e.length:0;while(i--){t.push(e.start(i))}return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();if(e===Infinity){return 0}return e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();if(this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_){this.pastSeekEnd_=0}this.lastSeekEnd_=e;return this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_==="number"}seekToLiveEdge(){this.seekedBehindLive_=false;if(this.atLiveEdge()){return}this.nextSeekedFromUser_=false;this.player_.currentTime(this.liveCurrentTime())}dispose(){this.stopTracking();super.dispose()}}g.registerComponent("LiveTracker",ta);class ia extends g{constructor(e,t){super(e,t);this.on("statechanged",e=>this.updateDom_());this.updateDom_()}createEl(){this.els={title:l("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${ct()}`}),description:l("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${ct()}`})};return l("div",{className:"vjs-title-bar"},{},te(this.els))}updateDom_(){const e=this.player_.tech_;const s=e&&e.el_;const r={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(e=>{const t=this.state[e];const i=this.els[e];const n=r[e];Ge(i);if(t){je(i,t)}if(s){s.removeAttribute(n);if(t){s.setAttribute(n,i.id)}}});if(this.state.title||this.state.description){this.show()}else{this.hide()}}update(e){this.setState(e)}dispose(){const e=this.player_.tech_;const t=e&&e.el_;if(t){t.removeAttribute("aria-labelledby");t.removeAttribute("aria-describedby")}super.dispose();this.els=null}}g.registerComponent("TitleBar",ia);const na=e=>{const t=e.el();if(t.hasAttribute("src")){e.triggerSourceset(t.src);return true}const i=e.$$("source");const n=[];let s="";if(!i.length){return false}for(let e=0;e{let n={};for(let e=0;era([e.el(),tv.HTMLMediaElement.prototype,tv.Element.prototype,sa],"innerHTML");const oa=function(n){const s=n.el();if(s.resetSourceWatch_){return}const t={};const e=aa(n);const i=i=>(...e)=>{const t=i.apply(s,e);na(n);return t};["append","appendChild","insertAdjacentHTML"].forEach(e=>{if(!s[e]){return}t[e]=s[e];s[e]=i(t[e])});Object.defineProperty(s,"innerHTML",f(e,{set:i(e.set)}));s.resetSourceWatch_=()=>{s.resetSourceWatch_=null;Object.keys(t).forEach(e=>{s[e]=t[e]});Object.defineProperty(s,"innerHTML",e)};n.one("sourceset",s.resetSourceWatch_)};const la=Object.defineProperty({},"src",{get(){if(this.hasAttribute("src")){return ji(tv.Element.prototype.getAttribute.call(this,"src"))}return""},set(e){tv.Element.prototype.setAttribute.call(this,"src",e);return e}});const da=e=>ra([e.el(),tv.HTMLMediaElement.prototype,la],"src");const ua=function(n){if(!n.featuresSourceset){return}const s=n.el();if(s.resetSourceset_){return}const i=da(n);const r=s.setAttribute;const t=s.load;Object.defineProperty(s,"src",f(i,{set:e=>{const t=i.set.call(s,e);n.triggerSourceset(s.src);return t}}));s.setAttribute=(e,t)=>{const i=r.call(s,e,t);if(/src/i.test(e)){n.triggerSourceset(s.src)}return i};s.load=()=>{const e=t.call(s);if(!na(n)){n.triggerSourceset("");oa(n)}return e};if(s.currentSrc){n.triggerSourceset(s.currentSrc)}else if(!na(n)){oa(n)}s.resetSourceset_=()=>{s.resetSourceset_=null;s.load=t;s.setAttribute=r;Object.defineProperty(s,"src",i);if(s.resetSourceWatch_){s.resetSourceWatch_()}}};class _ extends b{constructor(e,t){super(e,t);const i=e.source;let n=false;this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO";if(i&&(this.el_.currentSrc!==i.src||e.tag&&e.tag.initNetworkState_===3)){this.setSource(i)}else{this.handleLateInit_(this.el_)}if(e.enableSourceset){this.setupSourcesetHandling_()}this.isScrubbing_=false;if(this.el_.hasChildNodes()){const s=this.el_.childNodes;let e=s.length;const r=[];while(e--){const a=s[e];const o=a.nodeName.toLowerCase();if(o==="track"){if(!this.featuresNativeTextTracks){r.push(a)}else{this.remoteTextTrackEls().addTrackElement_(a);this.remoteTextTracks().addTrack(a.track);this.textTracks().addTrack(a.track);if(!n&&!this.el_.hasAttribute("crossorigin")&&Di(a.src)){n=true}}}}for(let e=0;e{n=[];for(let e=0;ei.removeEventListener("change",e));const s=()=>{for(let e=0;e{i.removeEventListener("change",e);i.removeEventListener("change",s);i.addEventListener("change",s)});this.on("webkitendfullscreen",()=>{i.removeEventListener("change",e);i.addEventListener("change",e);i.removeEventListener("change",s)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`]){return}const i=e.toLowerCase();if(this[`${i}TracksListeners_`]){Object.keys(this[`${i}TracksListeners_`]).forEach(e=>{const t=this.el()[`${i}Tracks`];t.removeEventListener(e,this[`${i}TracksListeners_`][e])})}this[`featuresNative${e}Tracks`]=!t;this[`${i}TracksListeners_`]=null;this.proxyNativeTracksForType_(i)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(i){const e=an[i];const n=this.el()[e.getterName];const s=this[e.getterName]();if(!this[`featuresNative${e.capitalName}Tracks`]||!n||!n.addEventListener){return}const r={change:e=>{const t={type:"change",target:s,currentTarget:s,srcElement:s};s.trigger(t);if(i==="text"){this[on.remoteText.getterName]().trigger(t)}},addtrack(e){s.addTrack(e.track)},removetrack(e){s.removeTrack(e.track)}};const t=function(){const e=[];for(let i=0;i{const i=r[t];n.addEventListener(t,i);this.on("dispose",e=>n.removeEventListener(t,i))});this.on("loadstart",t);this.on("dispose",e=>this.off("loadstart",t))}proxyNativeTracks_(){an.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let t=this.options_.tag;if(!t||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(t){const e=t.cloneNode(true);if(t.parentNode){t.parentNode.insertBefore(e,t)}_.disposeMediaElement(t);t=e}else{t=iv.createElement("video");const n=this.options_.tag&&Ne(this.options_.tag);const s=f({},n);if(!be||this.options_.nativeControlsForTouch!==true){delete s.controls}Le(t,Object.assign(s,{id:this.options_.techId,class:"vjs-tech"}))}t.playerId=this.options_.playerId}if(typeof this.options_.preload!=="undefined"){Ue(t,"preload",this.options_.preload)}if(this.options_.disablePictureInPicture!==undefined){t.disablePictureInPicture=this.options_.disablePictureInPicture}const i=["loop","muted","playsinline","autoplay"];for(let e=0;e=2){t.push("loadeddata")}if(e.readyState>=3){t.push("canplay")}if(e.readyState>=4){t.push("canplaythrough")}this.ready(function(){t.forEach(function(e){this.trigger(e)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{if(this.isScrubbing_&&this.el_.fastSeek&&Te){this.el_.fastSeek(e)}else{this.el_.currentTime=e}}catch(e){h(e,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===Infinity&&ae&&ce&&this.el_.currentTime===0){const e=()=>{if(this.el_.currentTime>0){if(this.el_.duration===Infinity){this.trigger("durationchange")}this.off("timeupdate",e)}};this.on("timeupdate",e);return NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_)){return}const e=function(){this.trigger("fullscreenchange",{isFullscreen:false});if(this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()){this.el_.controls=false}};const t=function(){if("webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"){this.one("webkitendfullscreen",e);this.trigger("fullscreenchange",{isFullscreen:true,nativeIOSFullscreen:true})}};this.on("webkitbeginfullscreen",t);this.on("dispose",()=>{this.off("webkitbeginfullscreen",t);this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen==="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA){li(this.el_.play());this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},0)}else{try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){if(this.featuresVideoFrameCallback&&!this.el_.webkitKeys){return this.el_.requestVideoFrameCallback(e)}return super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){if(this.featuresVideoFrameCallback&&!this.el_.webkitKeys){this.el_.cancelVideoFrameCallback(e)}else{super.cancelVideoFrameCallback(e)}}src(e){if(e===undefined){return this.el_.src}this.setSrc(e)}reset(){_.resetMediaElement(this.el_)}currentSrc(){if(this.currentSource_){return this.currentSource_.src}return this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,i){if(!this.featuresNativeTextTracks){return super.addTextTrack(e,t,i)}return this.el_.addTextTrack(e,t,i)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks){return super.createRemoteTextTrack(e)}const t=iv.createElement("track");if(e.kind){t.kind=e.kind}if(e.label){t.label=e.label}if(e.language||e.srclang){t.srclang=e.language||e.srclang}if(e.default){t.default=e.default}if(e.id){t.id=e.id}if(e.src){t.src=e.src}return t}addRemoteTextTrack(e,t){const i=super.addRemoteTextTrack(e,t);if(this.featuresNativeTextTracks){this.el().appendChild(i)}return i}removeRemoteTextTrack(t){super.removeRemoteTextTrack(t);if(this.featuresNativeTextTracks){const i=this.$$("track");let e=i.length;while(e--){if(t===i[e]||t===i[e].track){this.el().removeChild(i[e])}}}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality==="function"){return this.el().getVideoPlaybackQuality()}const e={};if(typeof this.el().webkitDroppedFrameCount!=="undefined"&&typeof this.el().webkitDecodedFrameCount!=="undefined"){e.droppedVideoFrames=this.el().webkitDroppedFrameCount;e.totalVideoFrames=this.el().webkitDecodedFrameCount}if(tv.performance){e.creationTime=tv.performance.now()}return e}}ie(_,"TEST_VID",function(){if(!Ie()){return}const e=iv.createElement("video");const t=iv.createElement("track");t.kind="captions";t.srclang="en";t.label="English";e.appendChild(t);return e});_.isSupported=function(){try{_.TEST_VID.volume=.5}catch(e){return false}return!!(_.TEST_VID&&_.TEST_VID.canPlayType)};_.canPlayType=function(e){return _.TEST_VID.canPlayType(e)};_.canPlaySource=function(e,t){return _.canPlayType(e.type)};_.canControlVolume=function(){try{const e=_.TEST_VID.volume;_.TEST_VID.volume=e/2+.1;const t=e!==_.TEST_VID.volume;if(t&&p){tv.setTimeout(()=>{if(_&&_.prototype){_.prototype.featuresVolumeControl=e!==_.TEST_VID.volume}});return false}return t}catch(e){return false}};_.canMuteVolume=function(){try{const e=_.TEST_VID.muted;_.TEST_VID.muted=!e;if(_.TEST_VID.muted){Ue(_.TEST_VID,"muted","muted")}else{Be(_.TEST_VID,"muted","muted")}return e!==_.TEST_VID.muted}catch(e){return false}};_.canControlPlaybackRate=function(){if(ae&&ce&&fe<58){return false}try{const e=_.TEST_VID.playbackRate;_.TEST_VID.playbackRate=e/2+.1;return e!==_.TEST_VID.playbackRate}catch(e){return false}};_.canOverrideAttributes=function(){try{const e=()=>{};Object.defineProperty(iv.createElement("video"),"src",{get:e,set:e});Object.defineProperty(iv.createElement("audio"),"src",{get:e,set:e});Object.defineProperty(iv.createElement("video"),"innerHTML",{get:e,set:e});Object.defineProperty(iv.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return false}return true};_.supportsNativeTextTracks=function(){return Te||p&&ce};_.supportsNativeVideoTracks=function(){return!!(_.TEST_VID&&_.TEST_VID.videoTracks)};_.supportsNativeAudioTracks=function(){return!!(_.TEST_VID&&_.TEST_VID.audioTracks)};_.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([e,t]){ie(_.prototype,e,()=>_[t](),true)});_.prototype.featuresVolumeControl=_.canControlVolume();_.prototype.movingMediaElementInDOM=!p;_.prototype.featuresFullscreenResize=true;_.prototype.featuresProgressEvents=true;_.prototype.featuresTimeupdateEvents=true;_.prototype.featuresVideoFrameCallback=!!(_.TEST_VID&&_.TEST_VID.requestVideoFrameCallback);_.disposeMediaElement=function(e){if(!e){return}if(e.parentNode){e.parentNode.removeChild(e)}while(e.hasChildNodes()){e.removeChild(e.firstChild)}e.removeAttribute("src");if(typeof e.load==="function"){(function(){try{e.load()}catch(e){}})()}};_.resetMediaElement=function(e){if(!e){return}const t=e.querySelectorAll("source");let i=t.length;while(i--){e.removeChild(t[i])}e.removeAttribute("src");if(typeof e.load==="function"){(function(){try{e.load()}catch(e){}})()}};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){_.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(t){_.prototype["set"+m(t)]=function(e){this.el_[t]=e;if(e){this.el_.setAttribute(t,t)}else{this.el_.removeAttribute(t)}}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){_.prototype[e]=function(){return this.el_[e]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(t){_.prototype["set"+m(t)]=function(e){this.el_[t]=e}});["pause","load","play"].forEach(function(e){_.prototype[e]=function(){return this.el_[e]()}});b.withSourceHandlers(_);_.nativeSourceHandler={};_.nativeSourceHandler.canPlayType=function(e){try{return _.TEST_VID.canPlayType(e)}catch(e){return""}};_.nativeSourceHandler.canHandleSource=function(e,t){if(e.type){return _.nativeSourceHandler.canPlayType(e.type)}else if(e.src){const i=xi(e.src);return _.nativeSourceHandler.canPlayType(`video/${i}`)}return""};_.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)};_.nativeSourceHandler.dispose=function(){};_.registerSourceHandler(_.nativeSourceHandler);b.registerTech("Html5",_);const ca=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"];const ha={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"};const fa=["tiny","xsmall","small","medium","large","xlarge","huge"];const pa={};fa.forEach(e=>{const t=e.charAt(0)==="x"?`x-${e.substring(1)}`:e;pa[e]=`vjs-layout-${t}`});const ma={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:Infinity};class T extends g{constructor(e,t,i){e.id=e.id||t.id||`vjs_video_${ct()}`;t=Object.assign(T.getTagSettings(e),t);t.initChildren=false;t.createEl=false;t.evented=false;t.reportTouchActivity=false;if(!t.language){const r=e.closest("[lang]");if(r){t.language=r.getAttribute("lang")}}super(null,t,i);this.boundDocumentFullscreenChange_=e=>this.documentFullscreenChange_(e);this.boundFullWindowOnEscKey_=e=>this.fullWindowOnEscKey(e);this.boundUpdateStyleEl_=e=>this.updateStyleEl_(e);this.boundApplyInitTime_=e=>this.applyInitTime_(e);this.boundUpdateCurrentBreakpoint_=e=>this.updateCurrentBreakpoint_(e);this.boundHandleTechClick_=e=>this.handleTechClick_(e);this.boundHandleTechDoubleClick_=e=>this.handleTechDoubleClick_(e);this.boundHandleTechTouchStart_=e=>this.handleTechTouchStart_(e);this.boundHandleTechTouchMove_=e=>this.handleTechTouchMove_(e);this.boundHandleTechTouchEnd_=e=>this.handleTechTouchEnd_(e);this.boundHandleTechTap_=e=>this.handleTechTap_(e);this.isFullscreen_=false;this.log=K(this.id_);this.fsApi_=V;this.isPosterFromTech_=false;this.queuedCallbacks_=[];this.isReady_=false;this.hasStarted_=false;this.userActive_=false;this.debugEnabled_=false;this.audioOnlyMode_=false;this.audioPosterMode_=false;this.audioOnlyCache_={playerHeight:null,hiddenChildren:[]};if(!this.options_||!this.options_.techOrder||!this.options_.techOrder.length){throw new Error("No techOrder specified. Did you overwrite "+"videojs.options instead of just changing the "+"properties you want to override?")}this.tag=e;this.tagAttributes=e&&Ne(e);this.language(this.options_.language);if(t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(e){a[e.toLowerCase()]=t.languages[e]});this.languages_=a}else{this.languages_=T.prototype.options_.languages}this.resetCache_();this.poster_=t.poster||"";this.controls_=!!t.controls;e.controls=false;e.removeAttribute("controls");this.changingSrc_=false;this.playCallbacks_=[];this.playTerminatedQueue_=[];if(e.hasAttribute("autoplay")){this.autoplay(true)}else{this.autoplay(this.options_.autoplay)}if(t.plugins){Object.keys(t.plugins).forEach(e=>{if(typeof this[e]!=="function"){throw new Error(`plugin "${e}" does not exist`)}})}this.scrubbing_=false;this.el_=this.createEl();Bt(this,{eventBusKey:"el_"});if(this.fsApi_.requestFullscreen){yt(iv,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)}if(this.fluid_){this.on(["playerreset","resize"],this.boundUpdateStyleEl_)}const n=f(this.options_);if(t.plugins){Object.keys(t.plugins).forEach(e=>{this[e](t.plugins[e])})}if(t.debug){this.debug(true)}this.options_.playerOptions=n;this.middleware_=[];this.playbackRates(t.playbackRates);if(t.experimentalSvgIcons){const o=new tv.DOMParser;const l=o.parseFromString(ys,"image/svg+xml");const d=l.querySelector("parsererror");if(d){h.warn("Failed to load SVG Icons. Falling back to Font Icons.");this.options_.experimentalSvgIcons=null}else{const u=l.documentElement;u.style.display="none";this.el_.appendChild(u);this.addClass("vjs-svg-icons-enabled")}}this.initChildren();this.isAudio(e.nodeName.toLowerCase()==="audio");if(this.controls()){this.addClass("vjs-controls-enabled")}else{this.addClass("vjs-controls-disabled")}this.el_.setAttribute("role","region");if(this.isAudio()){this.el_.setAttribute("aria-label",this.localize("Audio Player"))}else{this.el_.setAttribute("aria-label",this.localize("Video Player"))}if(this.isAudio()){this.addClass("vjs-audio")}if(be){this.addClass("vjs-touch-enabled")}if(!p){this.addClass("vjs-workinghover")}T.players[this.id_]=this;const s=N.split(".")[0];this.addClass(`vjs-v${s}`);this.userActive(true);this.reportUserActivity();this.one("play",e=>this.listenForUserActivity_(e));this.on("keydown",e=>this.handleKeyDown(e));this.on("languagechange",e=>this.handleLanguagechange(e));this.breakpoints(this.options_.breakpoints);this.responsive(this.options_.responsive);this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode);this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose");this.off("dispose");d(iv,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_);d(iv,"keydown",this.boundFullWindowOnEscKey_);if(this.styleEl_&&this.styleEl_.parentNode){this.styleEl_.parentNode.removeChild(this.styleEl_);this.styleEl_=null}T.players[this.id_]=null;if(this.tag&&this.tag.player){this.tag.player=null}if(this.el_&&this.el_.player){this.el_.player=null}if(this.tech_){this.tech_.dispose();this.isPosterFromTech_=false;this.poster_=""}if(this.playerElIngest_){this.playerElIngest_=null}if(this.tag){this.tag=null}us(this);v.names.forEach(e=>{const t=v[e];const i=this[t.getterName]();if(i&&i.off){i.off()}});super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let t=this.tag;let i;let e=this.playerElIngest_=t.parentNode&&t.parentNode.hasAttribute&&t.parentNode.hasAttribute("data-vjs-player");const n=this.tag.tagName.toLowerCase()==="video-js";if(e){i=this.el_=t.parentNode}else if(!n){i=this.el_=super.createEl("div")}const s=Ne(t);if(n){i=this.el_=t;t=this.tag=iv.createElement("video");while(i.children.length){t.appendChild(i.firstChild)}if(!De(i,"video-js")){Re(i,"video-js")}i.appendChild(t);e=this.playerElIngest_=i;Object.keys(i).forEach(e=>{try{t[e]=i[e]}catch(e){}})}t.setAttribute("tabindex","-1");s.tabindex="-1";if(ce&&ge){t.setAttribute("role","application");s.role="application"}t.removeAttribute("width");t.removeAttribute("height");if("width"in s){delete s.width}if("height"in s){delete s.height}Object.getOwnPropertyNames(s).forEach(function(e){if(!(n&&e==="class")){i.setAttribute(e,s[e])}if(n){t.setAttribute(e,s[e])}});t.playerId=t.id;t.id+="_html5_api";t.className="vjs-tech";t.player=i.player=this;this.addClass("vjs-paused");if(tv.VIDEOJS_NO_DYNAMIC_STYLE!==true){this.styleEl_=ot("vjs-styles-dimensions");const a=Qe(".vjs-styles-defaults");const e=Qe("head");e.insertBefore(this.styleEl_,a?a.nextSibling:e.firstChild)}this.fill_=false;this.fluid_=false;this.width(this.options_.width);this.height(this.options_.height);this.fill(this.options_.fill);this.fluid(this.options_.fluid);this.aspectRatio(this.options_.aspectRatio);this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const r=t.getElementsByTagName("a");for(let e=0;e{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})}else{this.removeClass("vjs-fluid")}this.updateStyleEl_()}fill(e){if(e===undefined){return!!this.fill_}this.fill_=!!e;if(e){this.addClass("vjs-fill");this.fluid(false)}else{this.removeClass("vjs-fill")}}aspectRatio(e){if(e===undefined){return this.aspectRatio_}if(!/^\d+\:\d+$/.test(e)){throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.")}this.aspectRatio_=e;this.fluid(true);this.updateStyleEl_()}updateStyleEl_(){if(tv.VIDEOJS_NO_DYNAMIC_STYLE===true){const e=typeof this.width_==="number"?this.width_:this.options_.width;const t=typeof this.height_==="number"?this.height_:this.options_.height;const a=this.tech_&&this.tech_.el();if(a){if(e>=0){a.width=e}if(t>=0){a.height=t}}return}let e;let t;let i;let n;if(this.aspectRatio_!==undefined&&this.aspectRatio_!=="auto"){i=this.aspectRatio_}else if(this.videoWidth()>0){i=this.videoWidth()+":"+this.videoHeight()}else{i="16:9"}const s=i.split(":");const r=s[1]/s[0];if(this.width_!==undefined){e=this.width_}else if(this.height_!==undefined){e=this.height_/r}else{e=this.videoWidth()||300}if(this.height_!==undefined){t=this.height_}else{t=e*r}if(/^[^a-zA-Z]/.test(this.id())){n="dimensions-"+this.id()}else{n=this.id()+"-dimensions"}this.addClass(n);lt(this.styleEl_,` .${n} { width: ${e}px; height: ${t}px; } .${n}.vjs-fluid:not(.vjs-audio-only-mode) { padding-top: ${r*100}%; } `)}loadTech_(e,t){if(this.tech_){this.unloadTech_()}const i=m(e);const n=e.charAt(0).toLowerCase()+e.slice(1);if(i!=="Html5"&&this.tag){b.getTech("Html5").disposeMediaElement(this.tag);this.tag.player=null;this.tag=null}this.techName_=i;this.isReady_=false;let s=this.autoplay();if(typeof this.autoplay()==="string"||this.autoplay()===true&&this.options_.normalizeAutoplay){s=false}const r={source:t,autoplay:s,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${n}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||false,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};v.names.forEach(e=>{const t=v[e];r[t.getterName]=this[t.privateName]});Object.assign(r,this.options_[i]);Object.assign(r,this.options_[n]);Object.assign(r,this.options_[e.toLowerCase()]);if(this.tag){r.tag=this.tag}if(t&&t.src===this.cache_.src&&this.cache_.currentTime>0){r.startTime=this.cache_.currentTime}const a=b.getTech(e);if(!a){throw new Error(`No Tech named '${i}' exists! '${i}' should be registered using videojs.registerTech()'`)}this.tech_=new a(r);this.tech_.ready(u(this,this.handleTechReady_),true);hi.jsonToTextTracks(this.textTracksJson_||[],this.tech_);ca.forEach(t=>{this.on(this.tech_,t,e=>this[`handleTech${m(t)}_`](e))});Object.keys(ha).forEach(t=>{this.on(this.tech_,t,e=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${ha[t]}_`].bind(this),event:e});return}this[`handleTech${ha[t]}_`](e)})});this.on(this.tech_,"loadstart",e=>this.handleTechLoadStart_(e));this.on(this.tech_,"sourceset",e=>this.handleTechSourceset_(e));this.on(this.tech_,"waiting",e=>this.handleTechWaiting_(e));this.on(this.tech_,"ended",e=>this.handleTechEnded_(e));this.on(this.tech_,"seeking",e=>this.handleTechSeeking_(e));this.on(this.tech_,"play",e=>this.handleTechPlay_(e));this.on(this.tech_,"pause",e=>this.handleTechPause_(e));this.on(this.tech_,"durationchange",e=>this.handleTechDurationChange_(e));this.on(this.tech_,"fullscreenchange",(e,t)=>this.handleTechFullscreenChange_(e,t));this.on(this.tech_,"fullscreenerror",(e,t)=>this.handleTechFullscreenError_(e,t));this.on(this.tech_,"enterpictureinpicture",e=>this.handleTechEnterPictureInPicture_(e));this.on(this.tech_,"leavepictureinpicture",e=>this.handleTechLeavePictureInPicture_(e));this.on(this.tech_,"error",e=>this.handleTechError_(e));this.on(this.tech_,"posterchange",e=>this.handleTechPosterChange_(e));this.on(this.tech_,"textdata",e=>this.handleTechTextData_(e));this.on(this.tech_,"ratechange",e=>this.handleTechRateChange_(e));this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_);this.usingNativeControls(this.techGet_("controls"));if(this.controls()&&!this.usingNativeControls()){this.addTechControlsListeners_()}if(this.tech_.el().parentNode!==this.el()&&(i!=="Html5"||!this.tag)){xe(this.tech_.el(),this.el())}if(this.tag){this.tag.player=null;this.tag=null}}unloadTech_(){v.names.forEach(e=>{const t=v[e];this[t.privateName]=this[t.getterName]()});this.textTracksJson_=hi.textTracksToJson(this.tech_);this.isReady_=false;this.tech_.dispose();this.tech_=false;if(this.isPosterFromTech_){this.poster_="";this.trigger("posterchange")}this.isPosterFromTech_=false}tech(e){if(e===undefined){h.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\n"+"See https://github.com/videojs/video.js/issues/2617 for more info.\n")}return this.tech_}addTechControlsListeners_(){this.removeTechControlsListeners_();this.on(this.tech_,"click",this.boundHandleTechClick_);this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_);this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_);this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_);this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_);this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_);this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_);this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_);this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_);this.off(this.tech_,"click",this.boundHandleTechClick_);this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady();if(this.cache_.volume){this.techCall_("setVolume",this.cache_.volume)}this.handleTechPosterChange_();this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking");this.error(null);this.handleTechDurationChange_();if(!this.paused()){this.trigger("loadstart")}else{this.hasStarted(false);this.trigger("loadstart")}this.manualAutoplay_(this.autoplay()===true&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!=="string"){return}const t=()=>{const e=this.muted();this.muted(true);const t=()=>{this.muted(e)};this.playTerminatedQueue_.push(t);const i=this.play();if(!oi(i)){return}return i.catch(e=>{t();throw new Error(`Rejection at manualAutoplay. Restoring muted value. ${e?e:""}`)})};let i;if(e==="any"&&!this.muted()){i=this.play();if(oi(i)){i=i.catch(t)}}else if(e==="muted"&&!this.muted()){i=t()}else{i=this.play()}if(!oi(i)){return}return i.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e;let i="";if(typeof t!=="string"){t=e.src;i=e.type}this.cache_.source=this.cache_.source||{};this.cache_.sources=this.cache_.sources||[];if(t&&!i){i=ms(this,t)}this.cache_.source=f({},e,{src:t,type:i});const n=this.cache_.sources.filter(e=>e.src&&e.src===t);const s=[];const r=this.$$("source");const a=[];for(let e=0;ethis.updateSourceCaches_(e);const i=this.currentSource().src;const n=t.src;if(i&&!/^blob:/.test(i)&&/^blob:/.test(n)){if(!this.lastSource_||this.lastSource_.tech!==n&&this.lastSource_.player!==i){e=()=>{}}}e(n);if(!t.src){this.tech_.any(["sourceset","loadstart"],e=>{if(e.type==="sourceset"){return}const t=this.techGet_("currentSrc");this.lastSource_.tech=t;this.updateSourceCaches_(t)})}}this.lastSource_={player:this.currentSource().src,tech:t.src};this.trigger({src:t.src,type:"sourceset"})}hasStarted(e){if(e===undefined){return this.hasStarted_}if(e===this.hasStarted_){return}this.hasStarted_=e;if(this.hasStarted_){this.addClass("vjs-has-started")}else{this.removeClass("vjs-has-started")}}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused");this.addClass("vjs-playing");this.hasStarted(true);this.trigger("play")}handleTechRateChange_(){if(this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0){this.queuedCallbacks_.forEach(e=>e.callback(e.event));this.queuedCallbacks_=[]}this.cache_.lastPlaybackRate=this.tech_.playbackRate();this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting");this.trigger("waiting");const e=this.currentTime();const t=()=>{if(e!==this.currentTime()){this.removeClass("vjs-waiting");this.off("timeupdate",t)}};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting");this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting");this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting");this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking");this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended");this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing");this.addClass("vjs-paused");this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended");this.removeClass("vjs-waiting");if(this.options_.loop){this.currentTime(0);this.play()}else if(!this.paused()){this.pause()}this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){if(!this.controls_){return}if(this.options_===undefined||this.options_.userActions===undefined||this.options_.userActions.click===undefined||this.options_.userActions.click!==false){if(this.options_!==undefined&&this.options_.userActions!==undefined&&typeof this.options_.userActions.click==="function"){this.options_.userActions.click.call(this,e)}else if(this.paused()){li(this.play())}else{this.pause()}}}handleTechDoubleClick_(t){if(!this.controls_){return}const e=Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),e=>e.contains(t.target));if(!e){if(this.options_===undefined||this.options_.userActions===undefined||this.options_.userActions.doubleClick===undefined||this.options_.userActions.doubleClick!==false){if(this.options_!==undefined&&this.options_.userActions!==undefined&&typeof this.options_.userActions.doubleClick==="function"){this.options_.userActions.doubleClick.call(this,t)}else if(this.isFullscreen()){this.exitFullscreen()}else{this.requestFullscreen()}}}}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){if(this.userWasActive){this.reportUserActivity()}}handleTechTouchEnd_(e){if(e.cancelable){e.preventDefault()}}toggleFullscreenClass_(){if(this.isFullscreen()){this.addClass("vjs-fullscreen")}else{this.removeClass("vjs-fullscreen")}}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this){return}const i=this.el();let n=iv[this.fsApi_.fullscreenElement]===i;if(!n&&i.matches){n=i.matches(":"+this.fsApi_.fullscreen)}this.isFullscreen(n)}handleTechFullscreenChange_(e,t){if(t){if(t.nativeIOSFullscreen){this.addClass("vjs-ios-native-fs");this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})}this.isFullscreen(t.isFullscreen)}}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){if(this.isInPictureInPicture()){this.addClass("vjs-picture-in-picture")}else{this.removeClass("vjs-picture-in-picture")}}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(true)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(false)}handleTechError_(){const e=this.tech_.error();this.error(e)}handleTechTextData_(){let e=null;if(arguments.length>1){e=arguments[1]}this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in as){return ns(this.middleware_,this.tech_,e,t)}else if(e in os){return ss(this.middleware_,this.tech_,e,t)}try{if(this.tech_){this.tech_[e](t)}}catch(e){h(e);throw e}},true)}techGet_(t){if(!this.tech_||!this.tech_.isReady_){return}if(t in rs){return is(this.middleware_,this.tech_,t)}else if(t in os){return ss(this.middleware_,this.tech_,t)}try{return this.tech_[t]()}catch(e){if(this.tech_[t]===undefined){h(`Video.js: ${t} method not defined for ${this.techName_} playback technology.`,e);throw e}if(e.name==="TypeError"){h(`Video.js: ${t} unavailable on ${this.techName_} playback technology element.`,e);this.tech_.isReady_=false;throw e}h(e);throw e}}play(){return new Promise(e=>{this.play_(e)})}play_(e=li){this.playCallbacks_.push(e);const t=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));const i=Boolean(Te||p);if(this.waitToPlay_){this.off(["ready","loadstart"],this.waitToPlay_);this.waitToPlay_=null}if(!this.isReady_||!t){this.waitToPlay_=e=>{this.play_()};this.one(["ready","loadstart"],this.waitToPlay_);if(!t&&i){this.load()}return}const n=this.techGet_("play");const s=i&&this.hasClass("vjs-ended");if(s){this.resetProgressBar_()}if(n===null){this.runPlayTerminatedQueue_()}else{this.runPlayCallbacks_(n)}}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[];e.forEach(function(e){e()})}runPlayCallbacks_(t){const e=this.playCallbacks_.slice(0);this.playCallbacks_=[];this.playTerminatedQueue_=[];e.forEach(function(e){e(t)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")===false?false:true}played(){return this.techGet_("played")||Qt(0,0)}scrubbing(e){if(typeof e==="undefined"){return this.scrubbing_}this.scrubbing_=!!e;this.techCall_("setScrubbing",this.scrubbing_);if(e){this.addClass("vjs-scrubbing")}else{this.removeClass("vjs-scrubbing")}}currentTime(e){if(e===undefined){this.cache_.currentTime=this.techGet_("currentTime")||0;return this.cache_.currentTime}if(e<0){e=0}if(!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e;this.off("canplay",this.boundApplyInitTime_);this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e);this.cache_.initTime=0;if(isFinite(e)){this.cache_.currentTime=Number(e)}}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===undefined){return this.cache_.duration!==undefined?this.cache_.duration:NaN}e=parseFloat(e);if(e<0){e=Infinity}if(e!==this.cache_.duration){this.cache_.duration=e;if(e===Infinity){this.addClass("vjs-live")}else{this.removeClass("vjs-live")}if(!isNaN(e)){this.trigger("durationchange")}}}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");if(!e||!e.length){e=Qt(0,0)}return e}bufferedPercent(){return si(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered();const t=this.duration();let i=e.end(e.length-1);if(i>t){i=t}return i}volume(e){let t;if(e!==undefined){t=Math.max(0,Math.min(1,e));this.cache_.volume=t;this.techCall_("setVolume",t);if(t>0){this.lastVolume_(t)}return}t=parseFloat(this.techGet_("volume"));return isNaN(t)?1:t}muted(e){if(e!==undefined){this.techCall_("setMuted",e);return}return this.techGet_("muted")||false}defaultMuted(e){if(e!==undefined){this.techCall_("setDefaultMuted",e)}return this.techGet_("defaultMuted")||false}lastVolume_(e){if(e!==undefined&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||false}isFullscreen(e){if(e!==undefined){const t=this.isFullscreen_;this.isFullscreen_=Boolean(e);if(this.isFullscreen_!==t&&this.fsApi_.prefixed){this.trigger("fullscreenchange")}this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(a){if(this.isInPictureInPicture()){this.exitPictureInPicture()}const o=this;return new Promise((e,i)=>{function n(){o.off("fullscreenerror",s);o.off("fullscreenchange",t)}function t(){n();e()}function s(e,t){n();i(t)}o.one("fullscreenchange",t);o.one("fullscreenerror",s);const r=o.requestFullscreenHelper_(a);if(r){r.then(n,n);r.then(e,i)}})}requestFullscreenHelper_(e){let t;if(!this.fsApi_.prefixed){t=this.options_.fullscreen&&this.options_.fullscreen.options||{};if(e!==undefined){t=e}}if(this.fsApi_.requestFullscreen){const i=this.el_[this.fsApi_.requestFullscreen](t);if(i){i.then(()=>this.isFullscreen(true),()=>this.isFullscreen(false))}return i}else if(this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow===true){this.techCall_("enterFullScreen")}else{this.enterFullWindow()}}exitFullscreen(){const a=this;return new Promise((e,i)=>{function n(){a.off("fullscreenerror",s);a.off("fullscreenchange",t)}function t(){n();e()}function s(e,t){n();i(t)}a.one("fullscreenchange",t);a.one("fullscreenerror",s);const r=a.exitFullscreenHelper_();if(r){r.then(n,n);r.then(e,i)}})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=iv[this.fsApi_.exitFullscreen]();if(e){li(e.then(()=>this.isFullscreen(false)))}return e}else if(this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow===true){this.techCall_("exitFullScreen")}else{this.exitFullWindow()}}enterFullWindow(){this.isFullscreen(true);this.isFullWindow=true;this.docOrigOverflow=iv.documentElement.style.overflow;yt(iv,"keydown",this.boundFullWindowOnEscKey_);iv.documentElement.style.overflow="hidden";Re(iv.body,"vjs-full-window");this.trigger("enterFullWindow")}fullWindowOnEscKey(e){if(a.isEventKey(e,"Esc")){if(this.isFullscreen()===true){if(!this.isFullWindow){this.exitFullscreen()}else{this.exitFullWindow()}}}}exitFullWindow(){this.isFullscreen(false);this.isFullWindow=false;d(iv,"keydown",this.boundFullWindowOnEscKey_);iv.documentElement.style.overflow=this.docOrigOverflow;Oe(iv.body,"vjs-full-window");this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===undefined){return this.techGet_("disablePictureInPicture")}this.techCall_("setDisablePictureInPicture",e);this.options_.disablePictureInPicture=e;this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==undefined){this.isInPictureInPicture_=!!e;this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&tv.documentPictureInPicture){const i=iv.createElement(this.el().tagName);i.classList=this.el().classList;i.classList.add("vjs-pip-container");if(this.posterImage){i.appendChild(this.posterImage.el().cloneNode(true))}if(this.titleBar){i.appendChild(this.titleBar.el().cloneNode(true))}i.appendChild(l("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture")));return tv.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(e=>{et(e);this.el_.parentNode.insertBefore(i,this.el_);e.document.body.appendChild(this.el_);e.document.body.classList.add("vjs-pip-window");this.player_.isInPictureInPicture(true);this.player_.trigger("enterpictureinpicture");e.addEventListener("pagehide",e=>{const t=e.target.querySelector(".video-js");i.parentNode.replaceChild(t,i);this.player_.isInPictureInPicture(false);this.player_.trigger("leavepictureinpicture")});return e})}if("pictureInPictureEnabled"in iv&&this.disablePictureInPicture()===false){return this.techGet_("requestPictureInPicture")}return Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(tv.documentPictureInPicture&&tv.documentPictureInPicture.window){tv.documentPictureInPicture.window.close();return Promise.resolve()}if("pictureInPictureEnabled"in iv){return iv.exitPictureInPicture()}}handleKeyDown(e){const{userActions:t}=this.options_;if(!t||!t.hotkeys){return}const i=e=>{const t=e.tagName.toLowerCase();if(e.isContentEditable){return true}const i=["button","checkbox","hidden","radio","reset","submit"];if(t==="input"){return i.indexOf(e.type)===-1}const n=["textarea"];return n.indexOf(t)!==-1};if(i(this.el_.ownerDocument.activeElement)){return}if(typeof t.hotkeys==="function"){t.hotkeys.call(this,e)}else{this.handleHotkeys(e)}}handleHotkeys(t){const e=this.options_.userActions?this.options_.userActions.hotkeys:{};const{fullscreenKey:i=e=>a.isEventKey(e,"f"),muteKey:n=e=>a.isEventKey(e,"m"),playPauseKey:s=e=>a.isEventKey(e,"k")||a.isEventKey(e,"Space")}=e;if(i.call(this,t)){t.preventDefault();t.stopPropagation();const r=g.getComponent("FullscreenToggle");if(iv[this.fsApi_.fullscreenEnabled]!==false){r.prototype.handleClick.call(this,t)}}else if(n.call(this,t)){t.preventDefault();t.stopPropagation();const e=g.getComponent("MuteToggle");e.prototype.handleClick.call(this,t)}else if(s.call(this,t)){t.preventDefault();t.stopPropagation();const e=g.getComponent("PlayToggle");e.prototype.handleClick.call(this,t)}}canPlayType(n){let s;for(let t=0,i=this.options_.techOrder;t{return[e,b.getTech(e)]}).filter(([e,t])=>{if(t){return t.isSupported()}h.error(`The "${e}" tech is undefined. Skipped browser support check for that tech.`);return false});const i=function(e,i,n){let s;e.some(t=>{return i.some(e=>{s=n(t,e);if(s){return true}})});return s};let n;const s=i=>(e,t)=>i(t,e);const r=([e,t],i)=>{if(t.canPlaySource(i,this.options_[e.toLowerCase()])){return{source:i,tech:e}}};if(this.options_.sourceOrder){n=i(e,t,s(r))}else{n=i(t,e,r)}return n||false}handleSrc_(e,n){if(typeof e==="undefined"){return this.cache_.src||""}if(this.resetRetryOnError_){this.resetRetryOnError_()}const s=gs(e);if(!s.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}this.changingSrc_=true;if(!n){this.cache_.sources=s}this.updateSourceCaches_(s[0]);es(this,s[0],(e,t)=>{this.middleware_=t;if(!n){this.cache_.sources=s}this.updateSourceCaches_(e);const i=this.src_(e);if(i){if(s.length>1){return this.handleSrc_(s.slice(1))}this.changingSrc_=false;this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);this.triggerReady();return}ts(t,this.tech_)});if(s.length>1){const t=()=>{this.error(null);this.handleSrc_(s.slice(1),true)};const i=()=>{this.off("error",t)};this.one("error",t);this.one("playing",i);this.resetRetryOnError_=()=>{this.off("error",t);this.off("playing",i)}}}src(e){return this.handleSrc_(e,false)}src_(e){const t=this.selectSource([e]);if(!t){return true}if(!Ht(t.tech,this.techName_)){this.changingSrc_=true;this.loadTech_(t.tech,t.source);this.tech_.ready(()=>{this.changingSrc_=false});return false}this.ready(function(){if(this.tech_.constructor.prototype.hasOwnProperty("setSource")){this.techCall_("setSource",e)}else{this.techCall_("src",e.src)}this.changingSrc_=false},true);return false}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused()){this.doReset_()}else{const e=this.play();li(e.then(()=>this.doReset_()))}}doReset_(){if(this.tech_){this.tech_.clearTracks("text")}this.resetCache_();this.poster("");this.loadTech_(this.options_.techOrder[0],null);this.techCall_("reset");this.resetControlBarUI_();if(xt(this)){this.trigger("playerreset")}}resetControlBarUI_(){this.resetProgressBar_();this.resetPlaybackRate_();this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:i,remainingTimeDisplay:n}=this.controlBar||{};const{seekBar:s}=i||{};if(e){e.updateContent()}if(t){t.updateContent()}if(n){n.updateContent()}if(s){s.update();if(s.loadProgressBar){s.loadProgressBar.update()}}}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate());this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1);this.trigger("volumechange")}currentSources(){const e=this.currentSource();const t=[];if(Object.keys(e).length!==0){t.push(e)}return this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==undefined){this.techCall_("setPreload",e);this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===undefined){return this.options_.autoplay||false}let t;if(typeof e==="string"&&/(any|play|muted)/.test(e)||e===true&&this.options_.normalizeAutoplay){this.options_.autoplay=e;this.manualAutoplay_(typeof e==="string"?e:"play");t=false}else if(!e){this.options_.autoplay=false}else{this.options_.autoplay=true}t=typeof t==="undefined"?this.options_.autoplay:t;if(this.tech_){this.techCall_("setAutoplay",t)}}playsinline(e){if(e!==undefined){this.techCall_("setPlaysinline",e);this.options_.playsinline=e}return this.techGet_("playsinline")}loop(e){if(e!==undefined){this.techCall_("setLoop",e);this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===undefined){return this.poster_}if(!e){e=""}if(e===this.poster_){return}this.poster_=e;this.techCall_("setPoster",e);this.isPosterFromTech_=false;this.trigger("posterchange")}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";if(e!==this.poster_){this.poster_=e;this.isPosterFromTech_=true;this.trigger("posterchange")}}}controls(e){if(e===undefined){return!!this.controls_}e=!!e;if(this.controls_===e){return}this.controls_=e;if(this.usingNativeControls()){this.techCall_("setControls",e)}if(this.controls_){this.removeClass("vjs-controls-disabled");this.addClass("vjs-controls-enabled");this.trigger("controlsenabled");if(!this.usingNativeControls()){this.addTechControlsListeners_()}}else{this.removeClass("vjs-controls-enabled");this.addClass("vjs-controls-disabled");this.trigger("controlsdisabled");if(!this.usingNativeControls()){this.removeTechControlsListeners_()}}}usingNativeControls(e){if(e===undefined){return!!this.usingNativeControls_}e=!!e;if(this.usingNativeControls_===e){return}this.usingNativeControls_=e;if(this.usingNativeControls_){this.addClass("vjs-using-native-controls");this.trigger("usingnativecontrols")}else{this.removeClass("vjs-using-native-controls");this.trigger("usingcustomcontrols")}}error(i){if(i===undefined){return this.error_||null}U("beforeerror").forEach(e=>{const t=e(this,i);if(!(Z(t)&&!Array.isArray(t)||typeof t==="string"||typeof t==="number"||t===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}i=t});if(this.options_.suppressNotSupportedError&&i&&i.code===4){const e=function(){this.error(i)};this.options_.suppressNotSupportedError=false;this.any(["click","touchstart"],e);this.one("loadstart",function(){this.off(["click","touchstart"],e)});return}if(i===null){this.error_=null;this.removeClass("vjs-error");if(this.errorDisplay){this.errorDisplay.close()}return}this.error_=new t(i);this.addClass("vjs-error");h.error(`(CODE:${this.error_.code} ${t.errorTypes[this.error_.code]})`,this.error_.message,this.error_);this.trigger("error");U("error").forEach(e=>e(this,this.error_));return}reportUserActivity(e){this.userActivity_=true}userActive(e){if(e===undefined){return this.userActive_}e=!!e;if(e===this.userActive_){return}this.userActive_=e;if(this.userActive_){this.userActivity_=true;this.removeClass("vjs-user-inactive");this.addClass("vjs-user-active");this.trigger("useractive");return}if(this.tech_){this.tech_.one("mousemove",function(e){e.stopPropagation();e.preventDefault()})}this.userActivity_=false;this.removeClass("vjs-user-active");this.addClass("vjs-user-inactive");this.trigger("userinactive")}listenForUserActivity_(){let t;let i;let n;const s=u(this,this.reportUserActivity);const e=function(e){if(e.screenX!==i||e.screenY!==n){i=e.screenX;n=e.screenY;s()}};const r=function(){s();this.clearInterval(t);t=this.setInterval(s,250)};const a=function(e){s();this.clearInterval(t)};this.on("mousedown",r);this.on("mousemove",e);this.on("mouseup",a);this.on("mouseleave",a);const o=this.getChild("controlBar");if(o&&!p&&!ae){o.on("mouseenter",function(e){if(this.player().options_.inactivityTimeout!==0){this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout}this.player().options_.inactivityTimeout=0});o.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})}this.on("keydown",s);this.on("keyup",s);let l;const d=function(){if(!this.userActivity_){return}this.userActivity_=false;this.userActive(true);this.clearTimeout(l);const e=this.options_.inactivityTimeout;if(e<=0){return}l=this.setTimeout(function(){if(!this.userActivity_){this.userActive(false)}},e)};this.setInterval(d,250)}playbackRate(e){if(e!==undefined){this.techCall_("setPlaybackRate",e);return}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.cache_.lastPlaybackRate||this.techGet_("playbackRate")}return 1}defaultPlaybackRate(e){if(e!==undefined){return this.techCall_("setDefaultPlaybackRate",e)}if(this.tech_&&this.tech_.featuresPlaybackRate){return this.techGet_("defaultPlaybackRate")}return 1}isAudio(e){if(e!==undefined){this.isAudio_=!!e;return}return!!this.isAudio_}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children();const t=this.getChild("ControlBar");const i=t&&t.currentHeight();e.forEach(e=>{if(e===t){return}if(e.el_&&!e.hasClass("vjs-hidden")){e.hide();this.audioOnlyCache_.hiddenChildren.push(e)}});this.audioOnlyCache_.playerHeight=this.currentHeight();this.height(i);this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode");this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show());this.height(this.audioOnlyCache_.playerHeight);this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!=="boolean"||e===this.audioOnlyMode_){return this.audioOnlyMode_}this.audioOnlyMode_=e;if(e){const t=[];if(this.isInPictureInPicture()){t.push(this.exitPictureInPicture())}if(this.isFullscreen()){t.push(this.exitFullscreen())}if(this.audioPosterMode()){t.push(this.audioPosterMode(false))}return Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){const e=this.tech_&&this.tech_;e.hide();this.addClass("vjs-audio-poster-mode");this.trigger("audiopostermodechange")}disablePosterModeUI_(){const e=this.tech_&&this.tech_;e.show();this.removeClass("vjs-audio-poster-mode");this.trigger("audiopostermodechange")}audioPosterMode(e){if(typeof e!=="boolean"||e===this.audioPosterMode_){return this.audioPosterMode_}this.audioPosterMode_=e;if(e){if(this.audioOnlyMode()){const t=this.audioOnlyMode(false);return t.then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.enablePosterModeUI_()})}return Promise.resolve().then(()=>{this.disablePosterModeUI_()})}addTextTrack(e,t,i){if(this.tech_){return this.tech_.addTextTrack(e,t,i)}}addRemoteTextTrack(e,t){if(this.tech_){return this.tech_.addRemoteTextTrack(e,t)}}removeRemoteTextTrack(e={}){let{track:t}=e;if(!t){t=e}if(this.tech_){return this.tech_.removeRemoteTextTrack(t)}}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===undefined){return this.language_}if(this.language_!==String(e).toLowerCase()){this.language_=String(e).toLowerCase();if(xt(this)){this.trigger("languagechange")}}}languages(){return f(T.prototype.options_.languages,this.languages_)}toJSON(){const i=f(this.options_);const n=i.tracks;i.tracks=[];for(let t=0;t{this.removeChild(i)});i.open();return i}updateCurrentBreakpoint_(){if(!this.responsive()){return}const t=this.currentBreakpoint();const i=this.currentWidth();for(let e=0;ethis.addRemoteTextTrack(e,false))}if(this.titleBar){this.titleBar.update({title:d,description:r||n||""})}this.ready(t)}getMedia(){if(!this.cache_.media){const t=this.poster();const i=this.currentSources();const n=Array.prototype.map.call(this.remoteTextTracks(),e=>({kind:e.kind,label:e.label,language:e.language,src:e.src}));const e={src:i,textTracks:n};if(t){e.poster=t;e.artwork=[{src:e.poster,type:ps(e.poster)}]}return e}return f(this.cache_.media)}static getTagSettings(e){const i={sources:[],tracks:[]};const t=Ne(e);const n=t["data-setup"];if(De(e,"vjs-fill")){t.fill=true}if(De(e,"vjs-fluid")){t.fluid=true}if(n!==null){const[s,r]=ri(n||"{}");if(s){h.error(s)}Object.assign(t,r)}Object.assign(i,t);if(e.hasChildNodes()){const a=e.childNodes;for(let e=0,t=a.length;etypeof e==="number")){return}this.cache_.playbackRates=e;this.trigger("playbackrateschange")}}v.names.forEach(function(e){const t=v[e];T.prototype[t.getterName]=function(){if(this.tech_){return this.tech_[t.getterName]()}this[t.privateName]=this[t.privateName]||new t.ListClass;return this[t.privateName]}});T.prototype.crossorigin=T.prototype.crossOrigin;T.players={};const ga=tv.navigator;T.prototype.options_={techOrder:b.defaultTechOrder_,html5:{},enableSourceset:true,inactivityTimeout:2e3,playbackRates:[],liveui:false,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:ga&&(ga.languages&&ga.languages[0]||ga.userLanguage||ga.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:false,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:false,audioOnlyMode:false,audioPosterMode:false};["ended","seeking","seekable","networkState","readyState"].forEach(function(e){T.prototype[e]=function(){return this.techGet_(e)}});ca.forEach(function(e){T.prototype[`handleTech${m(e)}_`]=function(){return this.trigger(e)}});g.registerComponent("Player",T);const va="plugin";const ya="activePlugins_";const ba={};const _a=e=>ba.hasOwnProperty(e);const Ta=e=>_a(e)?ba[e]:undefined;const Sa=(e,t)=>{e[ya]=e[ya]||{};e[ya][t]=true};const Ea=(e,t,i)=>{const n=(i?"before":"")+"pluginsetup";e.trigger(n,t);e.trigger(n+":"+t.name,t)};const wa=function(t,i){const n=function(){Ea(this,{name:t,plugin:i,instance:null},true);const e=i.apply(this,arguments);Sa(this,t);Ea(this,{name:t,plugin:i,instance:e});return e};Object.keys(i).forEach(function(e){n[e]=i[e]});return n};const Ia=(i,n)=>{n.prototype.name=i;return function(...e){Ea(this,{name:i,plugin:n,instance:null},true);const t=new n(...[this,...e]);this[i]=()=>t;Ea(this,t.getEventHash());return t}};class ka{constructor(e){if(this.constructor===ka){throw new Error("Plugin must be sub-classed; not directly instantiated.")}this.player=e;if(!this.log){this.log=this.player.log.createLogger(this.name)}Bt(this);delete this.trigger;qt(this,this.constructor.defaultState);Sa(e,this.name);this.dispose=this.dispose.bind(this);e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){e.name=this.name;e.plugin=this.constructor;e.instance=this;return e}trigger(e,t={}){return bt(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose");this.off();t.off("dispose",this.dispose);t[ya][e]=false;this.player=this.state=null;t[e]=Ia(e,ba[e])}static isBasic(e){const t=typeof e==="string"?Ta(e):e;return typeof t==="function"&&!ka.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!=="string"){throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`)}if(_a(e)){h.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`)}else if(T.prototype.hasOwnProperty(e)){throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`)}if(typeof t!=="function"){throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`)}ba[e]=t;if(e!==va){if(ka.isBasic(t)){T.prototype[e]=wa(e,t)}else{T.prototype[e]=Ia(e,t)}}return t}static deregisterPlugin(e){if(e===va){throw new Error("Cannot de-register base plugin.")}if(_a(e)){delete ba[e];delete T.prototype[e]}}static getPlugins(e=Object.keys(ba)){let i;e.forEach(e=>{const t=Ta(e);if(t){i=i||{};i[e]=t}});return i}static getPluginVersion(e){const t=Ta(e);return t&&t.VERSION||""}}ka.getPlugin=Ta;ka.BASE_PLUGIN_NAME=va;ka.registerPlugin(va,ka);T.prototype.usingPlugin=function(e){return!!this[ya]&&this[ya][e]===true};T.prototype.hasPlugin=function(e){return!!_a(e)};function Ca(t,i){let n=false;return function(...e){if(!n){h.warn(t)}n=true;return i.apply(this,e)}}function Aa(e,t,i,n){return Ca(`${t} is deprecated and will be removed in ${e}.0; please use ${i} instead.`,n)}const ja=e=>e.indexOf("#")===0?e.slice(1):e;function S(e,i,t){let n=S.getPlayer(e);if(n){if(i){h.warn(`Player "${e}" is already initialised. Options will not be applied.`)}if(t){n.ready(t)}return n}const s=typeof e==="string"?Qe("#"+ja(e)):e;if(!ke(s)){throw new TypeError("The element or ID supplied is not valid. (videojs)")}const r="getRootNode"in s?s.getRootNode()instanceof tv.ShadowRoot:false;const a=r?s.getRootNode():s.ownerDocument.body;if(!s.ownerDocument.defaultView||!a.contains(s)){h.warn("The element supplied is not included in the DOM")}i=i||{};if(i.restoreEl===true){i.restoreEl=(s.parentNode&&s.parentNode.hasAttribute("data-vjs-player")?s.parentNode:s).cloneNode(true)}U("beforesetup").forEach(e=>{const t=e(s,f(i));if(!Z(t)||Array.isArray(t)){h.error("please return an object in beforesetup hooks");return}i=f(i,t)});const o=g.getComponent("Player");n=new o(s,i,t);U("setup").forEach(e=>e(n));return n}S.hooks_=M;S.hooks=U;S.hook=B;S.hookOnce=q;S.removeHook=F;if(tv.VIDEOJS_NO_DYNAMIC_STYLE!==true&&Ie()){let t=Qe(".vjs-styles-defaults");if(!t){t=ot("vjs-styles-defaults");const e=Qe("head");if(e){e.insertBefore(t,e.firstChild)}lt(t,` .video-js { width: 300px; height: 150px; } .vjs-fluid:not(.vjs-audio-only-mode) { padding-top: 56.25% } `)}}rt(1,S);S.VERSION=N;S.options=T.prototype.options_;S.getPlayers=()=>T.players;S.getPlayer=e=>{const t=T.players;let i;if(typeof e==="string"){const n=ja(e);const s=t[n];if(s){return s}i=Qe("#"+n)}else{i=e}if(ke(i)){const{player:s,playerId:e}=i;if(s||t[e]){return s||t[e]}}};S.getAllPlayers=()=>Object.keys(T.players).map(e=>T.players[e]).filter(Boolean);S.players=T.players;S.getComponent=g.getComponent;S.registerComponent=(e,t)=>{if(b.isTech(t)){h.warn(`The ${e} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`)}return g.registerComponent.call(g,e,t)};S.getTech=b.getTech;S.registerTech=b.registerTech;S.use=Zn;Object.defineProperty(S,"middleware",{value:{},writeable:false,enumerable:true});Object.defineProperty(S.middleware,"TERMINATOR",{value:Jn,writeable:false,enumerable:true});S.browser=Se;S.obj=ne;S.mergeOptions=Aa(9,"videojs.mergeOptions","videojs.obj.merge",f);S.defineLazyProperty=Aa(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",ie);S.bind=Aa(9,"videojs.bind","native Function.prototype.bind",u);S.registerPlugin=ka.registerPlugin;S.deregisterPlugin=ka.deregisterPlugin;S.plugin=(e,t)=>{h.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead");return ka.registerPlugin(e,t)};S.getPlugins=ka.getPlugins;S.getPlugin=ka.getPlugin;S.getPluginVersion=ka.getPluginVersion;S.addLanguage=function(e,t){e=(""+e).toLowerCase();S.options.languages=f(S.options.languages,{[e]:t});return S.options.languages[e]};S.log=h;S.createLogger=K;S.time=ni;S.createTimeRange=Aa(9,"videojs.createTimeRange","videojs.time.createTimeRanges",Qt);S.createTimeRanges=Aa(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",Qt);S.formatTime=Aa(9,"videojs.formatTime","videojs.time.formatTime",ii);S.setFormatTime=Aa(9,"videojs.setFormatTime","videojs.time.setFormatTime",ei);S.resetFormatTime=Aa(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",ti);S.parseUrl=Aa(9,"videojs.parseUrl","videojs.url.parseUrl",Ai);S.isCrossOrigin=Aa(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Di);S.EventTarget=At;S.any=Tt;S.on=yt;S.one=_t;S.off=d;S.trigger=bt;S.xhr=$i;S.TextTrack=tn;S.AudioTrack=nn;S.VideoTrack=sn;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(e=>{S[e]=function(){h.warn(`videojs.${e}() is deprecated; use videojs.dom.${e}() instead`);return tt[e].apply(null,arguments)}});S.computedStyle=Aa(9,"videojs.computedStyle","videojs.dom.computedStyle",Ze);S.dom=tt;S.fn=kt;S.num=Vs;S.str=$t;S.url=Ri;Wt(function(i,e){(function(e,t){i.exports=t(S)})(zt,function(e){function t(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var i=t(e);class n{constructor(e){let t=this;t.id=e.id;t.label=t.id;t.width=e.width;t.height=e.height;t.bitrate=e.bandwidth;t.frameRate=e.frameRate;t.enabled_=e.enabled;Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(e){t.enabled_(e)}});return t}}class r extends i["default"].EventTarget{constructor(){super();let e=this;e.levels_=[];e.selectedIndex_=-1;Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}});Object.defineProperty(e,"length",{get(){return e.levels_.length}});e[Symbol.iterator]=()=>e.levels_.values();return e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t){return t}const i=this.levels_.length;t=new n(e);if(!(""+i in this)){Object.defineProperty(this,i,{get(){return this.levels_[i]}})}this.levels_.push(t);this.trigger({qualityLevel:t,type:"addqualitylevel"});return t}removeQualityLevel(i){let n=null;for(let e=0,t=this.length;ee){this.selectedIndex_--}break}}if(n){this.trigger({qualityLevel:i,type:"removequalitylevel"})}return n}getQualityLevelById(i){for(let e=0,t=this.length;en;e.qualityLevels.VERSION=a;return n};const o=function(e){return s(this,i["default"].obj.merge({},e))};i["default"].registerPlugin("qualityLevels",o);o.VERSION=a;return o})});var xa=Wt(function(s,e){(function(e){var i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/;var u=/^(?=([^\/?#]*))\1([^]*)$/;var t=/(?:\/|^)\.(?=\/)/g;var n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g;var c={buildAbsoluteURL:function(e,t,i){i=i||{};e=e.trim();t=t.trim();if(!t){if(!i.alwaysNormalize){return e}var n=c.parseURL(e);if(!n){throw new Error("Error trying to parse base URL.")}n.path=c.normalizePath(n.path);return c.buildURLFromParts(n)}var s=c.parseURL(t);if(!s){throw new Error("Error trying to parse relative URL.")}if(s.scheme){if(!i.alwaysNormalize){return t}s.path=c.normalizePath(s.path);return c.buildURLFromParts(s)}var r=c.parseURL(e);if(!r){throw new Error("Error trying to parse base URL.")}if(!r.netLoc&&r.path&&r.path[0]!=="/"){var a=u.exec(r.path);r.netLoc=a[1];r.path=a[2]}if(r.netLoc&&!r.path){r.path="/"}var o={scheme:r.scheme,netLoc:s.netLoc,path:null,params:s.params,query:s.query,fragment:s.fragment};if(!s.netLoc){o.netLoc=r.netLoc;if(s.path[0]!=="/"){if(!s.path){o.path=r.path;if(!s.params){o.params=r.params;if(!s.query){o.query=r.query}}}else{var l=r.path;var d=l.substring(0,l.lastIndexOf("/")+1)+s.path;o.path=c.normalizePath(d)}}}if(o.path===null){o.path=i.alwaysNormalize?c.normalizePath(s.path):s.path}return c.buildURLFromParts(o)},parseURL:function(e){var t=i.exec(e);if(!t){return null}return{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}},normalizePath:function(e){e=e.split("").reverse().join("").replace(t,"");while(e.length!==(e=e.replace(n,"")).length){}return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};s.exports=c})()});var Da="http://example.com";var Ra=function e(t,i){if(/^[a-z]+:/i.test(i)){return i}if(/^data:/.test(t)){t=tv.location&&tv.location.href||""}var n=typeof tv.URL==="function";var s=/^\/\//.test(t);var r=!tv.location&&!/\/\//i.test(t);if(n){t=new tv.URL(t,tv.location||Da)}else if(!/\/\//i.test(t)){t=xa.buildAbsoluteURL(tv.location&&tv.location.href||"",t)}if(n){var a=new URL(i,t);if(r){return a.href.slice(Da.length)}else if(s){return a.href.slice(a.protocol.length)}return a.href}return xa.buildAbsoluteURL(t,i)};var Oa=function(){function e(){this.listeners={}}var t=e.prototype;t.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};t.off=function e(t,i){if(!this.listeners[t]){return false}var n=this.listeners[t].indexOf(i);this.listeners[t]=this.listeners[t].slice(0);this.listeners[t].splice(n,1);return n>-1};t.trigger=function e(t){var i=this.listeners[t];if(!i){return}if(arguments.length===2){var n=i.length;for(var s=0;s-1;t=this.buffer.indexOf("\n")){this.trigger("data",this.buffer.substring(0,t));this.buffer=this.buffer.substring(t+1)}}}const Ma=String.fromCharCode(9);const Ua=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||"");const i={};if(t[1]){i.length=parseInt(t[1],10)}if(t[2]){i.offset=parseInt(t[2],10)}return i};const Ba=function(){const e="[^=]*";const t='"[^"]*"|[^,]*';const i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")};const Fa=function(e){const t={};if(!e){return t}const i=e.split(Ba());let n=i.length;let s;while(n--){if(i[n]===""){continue}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");t[s[0]]=s[1]}return t};class qa extends Oa{constructor(){super();this.customParsers=[];this.tagMappers=[]}push(n){let o;let l;n=n.trim();if(n.length===0){return}if(n[0]!=="#"){this.trigger("data",{type:"uri",uri:n});return}const e=this.tagMappers.reduce((e,t)=>{const i=t(n);if(i===n){return e}return e.concat([i])},[n]);e.forEach(t=>{for(let e=0;ee}this.customParsers.push(e=>{const t=i.exec(e);if(t){this.trigger("data",{type:"custom",data:s(e),customType:n,segment:r});return true}})}addTagMapper({expression:t,map:i}){const e=e=>{if(t.test(e)){return i(e)}return e};this.tagMappers.push(e)}}const Va=e=>e.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase());const Ha=function(t){const i={};Object.keys(t).forEach(function(e){i[Va(e)]=t[e]});return i};const $a=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:n}=e;if(!t){return}const s="#EXT-X-SERVER-CONTROL";const r="holdBack";const a="partHoldBack";const o=i&&i*3;const l=n&&n*2;if(i&&!t.hasOwnProperty(r)){t[r]=o;this.trigger("info",{message:`${s} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})}if(o&&t[r]{if(r.uri||!r.parts&&!r.preloadHints){return}if(!r.map&&s){r.map=s}if(!r.key&&a){r.key=a}if(!r.timeline&&typeof h==="number"){r.timeline=h}this.manifest.preloadSegment=r});this.parseStream.on("data",function(o){let t;let i;({tag(){({version(){if(o.version){this.manifest.version=o.version}},"allow-cache"(){this.manifest.allowCache=o.allowed;if(!("allowed"in o)){this.trigger("info",{message:"defaulting allowCache to YES"});this.manifest.allowCache=true}},byterange(){const e={};if("length"in o){r.byterange=e;e.length=o.length;if(!("offset"in o)){o.offset=f}}if("offset"in o){r.byterange=e;e.offset=o.offset}f=e.offset+e.length},endlist(){this.manifest.endList=true},inf(){if(!("mediaSequence"in this.manifest)){this.manifest.mediaSequence=0;this.trigger("info",{message:"defaulting media sequence to zero"})}if(!("discontinuitySequence"in this.manifest)){this.manifest.discontinuitySequence=0;this.trigger("info",{message:"defaulting discontinuity sequence to zero"})}if(o.title){r.title=o.title}if(o.duration>0){r.duration=o.duration}if(o.duration===0){r.duration=.01;this.trigger("info",{message:"updating zero segment duration to a small value"})}this.manifest.segments=n},key(){if(!o.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(o.attributes.METHOD==="NONE"){a=null;return}if(!o.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(o.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:o.attributes};return}if(o.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.microsoft.playready"]={uri:o.attributes.URI};return}if(o.attributes.KEYFORMAT===c){const e=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(e.indexOf(o.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(o.attributes.METHOD==="SAMPLE-AES-CENC"){this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"})}if(o.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(o.attributes.KEYID&&o.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:o.attributes.KEYFORMAT,keyId:o.attributes.KEYID.substring(2)},pssh:La(o.attributes.URI.split(",")[1])};return}if(!o.attributes.METHOD){this.trigger("warn",{message:"defaulting key method to AES-128"})}a={method:o.attributes.METHOD||"AES-128",uri:o.attributes.URI};if(typeof o.attributes.IV!=="undefined"){a.iv=o.attributes.IV}},"media-sequence"(){if(!isFinite(o.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+o.number});return}this.manifest.mediaSequence=o.number},"discontinuity-sequence"(){if(!isFinite(o.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+o.number});return}this.manifest.discontinuitySequence=o.number;h=o.number},"playlist-type"(){if(!/VOD|EVENT/.test(o.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+o.playlist});return}this.manifest.playlistType=o.playlistType},map(){s={};if(o.uri){s.uri=o.uri}if(o.byterange){s.byterange=o.byterange}if(a){s.key=a}},"stream-inf"(){this.manifest.playlists=n;this.manifest.mediaGroups=this.manifest.mediaGroups||u;if(!o.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}if(!r.attributes){r.attributes={}}Ni(r.attributes,o.attributes)},media(){this.manifest.mediaGroups=this.manifest.mediaGroups||u;if(!(o.attributes&&o.attributes.TYPE&&o.attributes["GROUP-ID"]&&o.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const e=this.manifest.mediaGroups[o.attributes.TYPE];e[o.attributes["GROUP-ID"]]=e[o.attributes["GROUP-ID"]]||{};t=e[o.attributes["GROUP-ID"]];i={default:/yes/i.test(o.attributes.DEFAULT)};if(i.default){i.autoselect=true}else{i.autoselect=/yes/i.test(o.attributes.AUTOSELECT)}if(o.attributes.LANGUAGE){i.language=o.attributes.LANGUAGE}if(o.attributes.URI){i.uri=o.attributes.URI}if(o.attributes["INSTREAM-ID"]){i.instreamId=o.attributes["INSTREAM-ID"]}if(o.attributes.CHARACTERISTICS){i.characteristics=o.attributes.CHARACTERISTICS}if(o.attributes.FORCED){i.forced=/yes/i.test(o.attributes.FORCED)}t[o.attributes.NAME]=i},discontinuity(){h+=1;r.discontinuity=true;this.manifest.discontinuityStarts.push(n.length)},"program-date-time"(){if(typeof this.manifest.dateTimeString==="undefined"){this.manifest.dateTimeString=o.dateTimeString;this.manifest.dateTimeObject=o.dateTimeObject}r.dateTimeString=o.dateTimeString;r.dateTimeObject=o.dateTimeObject;const{lastProgramDateTime:e}=this;this.lastProgramDateTime=new Date(o.dateTimeString).getTime();if(e===null){this.manifest.segments.reduceRight((e,t)=>{t.programDateTime=e-t.duration*1e3;return t.programDateTime},this.lastProgramDateTime)}},targetduration(){if(!isFinite(o.duration)||o.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+o.duration});return}this.manifest.targetDuration=o.duration;$a.call(this,this.manifest)},start(){if(!o.attributes||isNaN(o.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:o.attributes["TIME-OFFSET"],precise:o.attributes.PRECISE}},"cue-out"(){r.cueOut=o.data},"cue-out-cont"(){r.cueOutCont=o.data},"cue-in"(){r.cueIn=o.data},skip(){this.manifest.skip=Ha(o.attributes);this.warnOnMissingAttributes_("#EXT-X-SKIP",o.attributes,["SKIPPED-SEGMENTS"])},part(){l=true;const e=this.manifest.segments.length;const t=Ha(o.attributes);r.parts=r.parts||[];r.parts.push(t);if(t.byterange){if(!t.byterange.hasOwnProperty("offset")){t.byterange.offset=p}p=t.byterange.offset+t.byterange.length}const i=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${i} for segment #${e}`,o.attributes,["URI","DURATION"]);if(this.manifest.renditionReports){this.manifest.renditionReports.forEach((e,t)=>{if(!e.hasOwnProperty("lastPart")){this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}})}},"server-control"(){const e=this.manifest.serverControl=Ha(o.attributes);if(!e.hasOwnProperty("canBlockReload")){e.canBlockReload=false;this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})}$a.call(this,this.manifest);if(e.canSkipDateranges&&!e.hasOwnProperty("canSkipUntil")){this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})}},"preload-hint"(){const t=this.manifest.segments.length;const i=Ha(o.attributes);const e=i.type&&i.type==="PART";r.preloadHints=r.preloadHints||[];r.preloadHints.push(i);if(i.byterange){if(!i.byterange.hasOwnProperty("offset")){i.byterange.offset=e?p:0;if(e){p=i.byterange.offset+i.byterange.length}}}const n=r.preloadHints.length-1;this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${n} for segment #${t}`,o.attributes,["TYPE","URI"]);if(!i.type){return}for(let e=0;ee.id===t.id);this.manifest.dateRanges[r]=Ni(this.manifest.dateRanges[r],t);m[t.id]=Ni(m[t.id],t);this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=true},"content-steering"(){this.manifest.contentSteering=Ha(o.attributes);this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",o.attributes,["SERVER-URI"])}}[o.tagType]||d).call(e)},uri(){r.uri=o.uri;n.push(r);if(this.manifest.targetDuration&&!("duration"in r)){this.trigger("warn",{message:"defaulting segment duration to the target duration"});r.duration=this.manifest.targetDuration}if(a){r.key=a}r.timeline=h;if(s){r.map=s}p=0;if(this.lastProgramDateTime!==null){r.programDateTime=this.lastProgramDateTime;this.lastProgramDateTime+=r.duration*1e3}r={}},comment(){},custom(){if(o.segment){r.custom=r.custom||{};r.custom[o.customType]=o.data}else{this.manifest.custom=this.manifest.custom||{};this.manifest.custom[o.customType]=o.data}}})[o.type].call(e)})}warnOnMissingAttributes_(e,t,i){const n=[];i.forEach(function(e){if(!t.hasOwnProperty(e)){n.push(e)}});if(n.length){this.trigger("warn",{message:`${e} lacks required attribute(s): ${n.join(", ")}`})}}push(e){this.lineStream.push(e)}end(){this.lineStream.push("\n");if(this.manifest.dateRanges.length&&this.lastProgramDateTime===null){this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"})}this.lastProgramDateTime=null;this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var Ga={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/};var Wa=["video","audio","text"];var Ka=["Video","Audio","Text"];var Xa=function e(t){if(!t){return t}return t.replace(/avc1\.(\d+)\.(\d+)/i,function(e,t,i){var n=("00"+Number(t).toString(16)).slice(-2);var s=("00"+Number(i).toString(16)).slice(-2);return"avc1."+n+"00"+s})};var Ya=function e(t){if(t===void 0){t=""}var i=t.split(",");var a=[];i.forEach(function(s){s=s.trim();var r;Wa.forEach(function(e){var t=Ga[e].exec(s.toLowerCase());if(!t||t.length<=1){return}r=e;var i=s.substring(0,t[1].length);var n=s.replace(i,"");a.push({type:i,details:n,mediaType:e})});if(!r){a.push({type:s,details:"",mediaType:"unknown"})}});return a};var Qa=function e(t,i){if(!t.mediaGroups.AUDIO||!i){return null}var n=t.mediaGroups.AUDIO[i];if(!n){return null}for(var s in n){var r=n[s];if(r.default&&r.playlists){return Ya(r.playlists[0].attributes.CODECS)}}return null};var Ja=function e(t){if(t===void 0){t=""}return Ga.audio.test(t.trim().toLowerCase())};var Za=function e(t){if(t===void 0){t=""}return Ga.text.test(t.trim().toLowerCase())};var eo=function e(t){if(!t||typeof t!=="string"){return}var i=t.toLowerCase().split(",").map(function(e){return Xa(e.trim())});var n="video";if(i.length===1&&Ja(i[0])){n="audio"}else if(i.length===1&&Za(i[0])){n="application"}var s="mp4";if(i.every(function(e){return Ga.mp4.test(e)})){s="mp4"}else if(i.every(function(e){return Ga.webm.test(e)})){s="webm"}else if(i.every(function(e){return Ga.ogg.test(e)})){s="ogg"}return n+"/"+s+';codecs="'+t+'"'};var to=function e(t){if(t===void 0){t=""}return tv.MediaSource&&tv.MediaSource.isTypeSupported&&tv.MediaSource.isTypeSupported(eo(t))||false};var io=function e(t){if(t===void 0){t=""}return t.toLowerCase().split(",").every(function(e){e=e.trim();for(var t=0;tc){u-=c;u-=c;u-=w(2)}}return Number(u)};var mo=function e(t,i){var n=i===void 0?{}:i,s=n.le,r=s===void 0?false:s;if(typeof t!=="bigint"&&typeof t!=="number"||typeof t==="number"&&t!==t){t=0}t=w(t);var a=uo(t);var o=new Uint8Array(new ArrayBuffer(a));for(var l=0;l=t.length&&d.call(t,function(e,t){var i=l[t]?l[t]&n[a+t]:n[a+t];return e===i})};var yo="http://example.com";var bo=function e(t,i){if(/^[a-z]+:/i.test(i)){return i}if(/^data:/.test(t)){t=tv.location&&tv.location.href||""}var n=typeof tv.URL==="function";var s=/^\/\//.test(t);var r=!tv.location&&!/\/\//i.test(t);if(n){t=new tv.URL(t,tv.location||yo)}else if(!/\/\//i.test(t)){t=xa.buildAbsoluteURL(tv.location&&tv.location.href||"",t)}if(n){var a=new URL(i,t);if(r){return a.href.slice(yo.length)}else if(s){return a.href.slice(a.protocol.length)}return a.href}return xa.buildAbsoluteURL(t,i)};var _o=function e(s,t,r){t.forEach(function(e){for(var t in s.mediaGroups[e]){for(var i in s.mediaGroups[e][t]){var n=s.mediaGroups[e][t][i];r(n,e,t,i)}}})};var To=function e(t){return tv.atob?tv.atob(t):Buffer.from(t,"base64").toString("binary")};function So(e){var t=To(e);var i=new Uint8Array(t.length);for(var n=0;n=0&&e=0){var s=t.length-1;while(n0},lookupPrefix:function(e){var t=this;while(t){var i=t._nsMap;if(i){for(var n in i){if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===e){return n}}}t=t.nodeType==Ho?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){var t=this;while(t){var i=t._nsMap;if(i){if(Object.prototype.hasOwnProperty.call(i,e)){return i[e]}}t=t.nodeType==Ho?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){var t=this.lookupPrefix(e);return t==null}};function cl(e){return e=="<"&&"<"||e==">"&&">"||e=="&"&&"&"||e=='"'&&"""||"&#"+e.charCodeAt()+";"}qo(i,C);qo(i,C.prototype);function hl(e,t){if(t(e)){return true}if(e=e.firstChild){do{if(hl(e,t)){return true}}while(e=e.nextSibling)}}function fl(){this.ownerDocument=this}function pl(e,t,i){e&&e._inc++;var n=i.namespaceURI;if(n===Lo.XMLNS){t._nsMap[i.prefix?i.localName:""]=i.value}}function ml(e,t,i,n){e&&e._inc++;var s=i.namespaceURI;if(s===Lo.XMLNS){delete t._nsMap[i.prefix?i.localName:""]}}function gl(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i){n[n.length++]=i}else{var s=t.firstChild;var r=0;while(s){n[r++]=s;s=s.nextSibling}n.length=r;delete n[n.length]}}}function vl(e,t){var i=t.previousSibling;var n=t.nextSibling;if(i){i.nextSibling=n}else{e.firstChild=n}if(n){n.previousSibling=i}else{e.lastChild=i}t.parentNode=null;t.previousSibling=null;t.nextSibling=null;gl(e.ownerDocument,e);return t}function yl(e){return e&&(e.nodeType===C.DOCUMENT_NODE||e.nodeType===C.DOCUMENT_FRAGMENT_NODE||e.nodeType===C.ELEMENT_NODE)}function bl(e){return e&&(Tl(e)||Sl(e)||_l(e)||e.nodeType===C.DOCUMENT_FRAGMENT_NODE||e.nodeType===C.COMMENT_NODE||e.nodeType===C.PROCESSING_INSTRUCTION_NODE)}function _l(e){return e&&e.nodeType===C.DOCUMENT_TYPE_NODE}function Tl(e){return e&&e.nodeType===C.ELEMENT_NODE}function Sl(e){return e&&e.nodeType===C.TEXT_NODE}function El(e,t){var i=e.childNodes||[];if(Po(i,Tl)||_l(t)){return false}var n=Po(i,_l);return!(t&&n&&i.indexOf(n)>i.indexOf(t))}function wl(e,t){var i=e.childNodes||[];function n(e){return Tl(e)&&e!==t}if(Po(i,n)){return false}var s=Po(i,_l);return!(t&&s&&i.indexOf(s)>i.indexOf(t))}function Il(e,t,i){if(!yl(e)){throw new k(el,"Unexpected parent node type "+e.nodeType)}if(i&&i.parentNode!==e){throw new k(tl,"child not in parent")}if(!bl(t)||_l(t)&&e.nodeType!==C.DOCUMENT_NODE){throw new k(el,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}}function kl(e,t,i){var n=e.childNodes||[];var s=t.childNodes||[];if(t.nodeType===C.DOCUMENT_FRAGMENT_NODE){var r=s.filter(Tl);if(r.length>1||Po(s,Sl)){throw new k(el,"More than one element or text in fragment")}if(r.length===1&&!El(e,i)){throw new k(el,"Element in fragment can not be inserted before doctype")}}if(Tl(t)){if(!El(e,i)){throw new k(el,"Only one element can be added and only after doctype")}}if(_l(t)){if(Po(n,_l)){throw new k(el,"Only one doctype is allowed")}var a=Po(n,Tl);if(i&&n.indexOf(a)1||Po(s,Sl)){throw new k(el,"More than one element or text in fragment")}if(r.length===1&&!wl(e,i)){throw new k(el,"Element in fragment can not be inserted before doctype")}}if(Tl(t)){if(!wl(e,i)){throw new k(el,"Only one element can be added and only after doctype")}}if(_l(t)){function a(e){return _l(e)&&e!==i}if(Po(n,a)){throw new k(el,"Only one doctype is allowed")}var o=Po(n,Tl);if(i&&n.indexOf(o)0){hl(s.documentElement,function(e){if(e!==s&&e.nodeType===Vo){var t=e.getAttribute("class");if(t){var i=a===t;if(!i){var n=Bo(t);i=o.every(Fo(n))}if(i){r.push(e)}}}})}return r})},createElement:function(e){var t=new xl;t.ownerDocument=this;t.nodeName=e;t.tagName=e;t.localName=e;t.childNodes=new nl;var i=t.attributes=new al;i._ownerElement=t;return t},createDocumentFragment:function(){var e=new Fl;e.ownerDocument=this;e.childNodes=new nl;return e},createTextNode:function(e){var t=new Ol;t.ownerDocument=this;t.appendData(e);return t},createComment:function(e){var t=new Pl;t.ownerDocument=this;t.appendData(e);return t},createCDATASection:function(e){var t=new Ll;t.ownerDocument=this;t.appendData(e);return t},createProcessingInstruction:function(e,t){var i=new ql;i.ownerDocument=this;i.tagName=i.nodeName=i.target=e;i.nodeValue=i.data=t;return i},createAttribute:function(e){var t=new Dl;t.ownerDocument=this;t.name=e;t.nodeName=e;t.localName=e;t.specified=true;return t},createEntityReference:function(e){var t=new Bl;t.ownerDocument=this;t.nodeName=e;return t},createElementNS:function(e,t){var i=new xl;var n=t.split(":");var s=i.attributes=new al;i.childNodes=new nl;i.ownerDocument=this;i.nodeName=t;i.tagName=t;i.namespaceURI=e;if(n.length==2){i.prefix=n[0];i.localName=n[1]}else{i.localName=t}s._ownerElement=i;return i},createAttributeNS:function(e,t){var i=new Dl;var n=t.split(":");i.ownerDocument=this;i.nodeName=t;i.name=t;i.namespaceURI=e;i.specified=true;if(n.length==2){i.prefix=n[0];i.localName=n[1]}else{i.localName=t}return i}};e(fl,C);function xl(){this._nsMap={}}xl.prototype={nodeType:Vo,hasAttribute:function(e){return this.getAttributeNode(e)!=null},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t;this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){if(e.nodeType===Jo){return this.insertBefore(e,null)}else{return jl(this,e)}},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return this.getAttributeNodeNS(e,t)!=null},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i;this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(n){return new sl(this,function(t){var i=[];hl(t,function(e){if(e!==t&&e.nodeType==Vo&&(n==="*"||e.tagName==n)){i.push(e)}});return i})},getElementsByTagNameNS:function(n,s){return new sl(this,function(t){var i=[];hl(t,function(e){if(e!==t&&e.nodeType===Vo&&(n==="*"||e.namespaceURI===n)&&(s==="*"||e.localName==s)){i.push(e)}});return i})}};fl.prototype.getElementsByTagName=xl.prototype.getElementsByTagName;fl.prototype.getElementsByTagNameNS=xl.prototype.getElementsByTagNameNS;e(xl,C);function Dl(){}Dl.prototype.nodeType=Ho;e(Dl,C);function Rl(){}Rl.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e;this.nodeValue=this.data=e;this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(s[el])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){var n=this.data.substring(0,e);var s=this.data.substring(e+t);i=n+i+s;this.nodeValue=this.data=i;this.length=i.length}};e(Rl,C);function Ol(){}Ol.prototype={nodeName:"#text",nodeType:$o,splitText:function(e){var t=this.data;var i=t.substring(e);t=t.substring(0,e);this.data=this.nodeValue=t;this.length=t.length;var n=this.ownerDocument.createTextNode(i);if(this.parentNode){this.parentNode.insertBefore(n,this.nextSibling)}return n}};e(Ol,Rl);function Pl(){}Pl.prototype={nodeName:"#comment",nodeType:Xo};e(Pl,Rl);function Ll(){}Ll.prototype={nodeName:"#cdata-section",nodeType:zo};e(Ll,Rl);function Nl(){}Nl.prototype.nodeType=Qo;e(Nl,C);function Ml(){}Ml.prototype.nodeType=Zo;e(Ml,C);function Ul(){}Ul.prototype.nodeType=Wo;e(Ul,C);function Bl(){}Bl.prototype.nodeType=Go;e(Bl,C);function Fl(){}Fl.prototype.nodeName="#document-fragment";Fl.prototype.nodeType=Jo;e(Fl,C);function ql(){}ql.prototype.nodeType=Ko;e(ql,C);function Vl(){}Vl.prototype.serializeToString=function(e,t,i){return Hl.call(e,t,i)};C.prototype.toString=Hl;function Hl(e,t){var i=[];var n=this.nodeType==9&&this.documentElement||this;var s=n.prefix;var r=n.namespaceURI;if(r&&s==null){var s=n.lookupPrefix(r);if(s==null){var a=[{namespace:r,prefix:null}]}}Gl(this,i,e,t,a);return i.join("")}function $l(e,t,i){var n=e.prefix||"";var s=e.namespaceURI;if(!s){return false}if(n==="xml"&&s===Lo.XML||s===Lo.XMLNS){return false}var r=i.length;while(r--){var a=i[r];if(a.prefix===n){return a.namespace!==s}}return true}function zl(e,t,i){e.push(" ",t,'="',i.replace(/[<>&"\t\n\r]/g,cl),'"')}function Gl(e,t,i,n,s){if(!s){s=[]}if(n){e=n(e);if(e){if(typeof e=="string"){t.push(e);return}}else{return}}switch(e.nodeType){case Vo:var r=e.attributes;var a=r.length;var o=e.firstChild;var l=e.tagName;i=Lo.isHTML(e.namespaceURI)||i;var d=l;if(!i&&!e.prefix&&e.namespaceURI){var u;for(var c=0;c=0;h--){var f=s[h];if(f.prefix===""&&f.namespace===e.namespaceURI){u=f.namespace;break}}}if(u!==e.namespaceURI){for(var h=s.length-1;h>=0;h--){var f=s[h];if(f.namespace===e.namespaceURI){if(f.prefix){d=f.prefix+":"+l}break}}}}t.push("<",d);for(var p=0;p");if(i&&/^script$/i.test(l)){while(o){if(o.data){t.push(o.data)}else{Gl(o,t,i,n,s.slice())}o=o.nextSibling}}else{while(o){Gl(o,t,i,n,s.slice());o=o.nextSibling}}t.push("")}else{t.push("/>")}return;case Yo:case Jo:var o=e.firstChild;while(o){Gl(o,t,i,n,s.slice());o=o.nextSibling}return;case Ho:return zl(t,e.name,e.value);case $o:return t.push(e.data.replace(/[<&>]/g,cl));case zo:return t.push("");case Xo:return t.push("\x3c!--",e.data,"--\x3e");case Qo:var y=e.publicId;var b=e.systemId;t.push("")}else if(b&&b!="."){t.push(" SYSTEM ",b,">")}else{var _=e.internalSubset;if(_){t.push(" [",_,"]")}t.push(">")}return;case Ko:return t.push("");case Go:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function Wl(e,t,i){var n;switch(t.nodeType){case Vo:n=t.cloneNode(false);n.ownerDocument=e;case Jo:break;case Ho:i=true;break}if(!n){n=t.cloneNode(false)}n.ownerDocument=e;n.parentNode=null;if(i){var s=t.firstChild;while(s){n.appendChild(Wl(e,s,i));s=s.nextSibling}}return n}function Kl(e,t,i){var n=new t.constructor;for(var s in t){if(Object.prototype.hasOwnProperty.call(t,s)){var r=t[s];if(typeof r!="object"){if(r!=n[s]){n[s]=r}}}}if(t.childNodes){n.childNodes=new nl}n.ownerDocument=e;switch(n.nodeType){case Vo:var a=t.attributes;var o=n.attributes=new al;var l=a.length;o._ownerElement=n;for(var d=0;d",lt:"<",quot:'"'});t.HTML_ENTITIES=i({Aacute:"\xc1",aacute:"\xe1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223e",acd:"\u223f",acE:"\u223e\u0333",Acirc:"\xc2",acirc:"\xe2",acute:"\xb4",Acy:"\u0410",acy:"\u0430",AElig:"\xc6",aelig:"\xe6",af:"\u2061",Afr:"\ud835\udd04",afr:"\ud835\udd1e",Agrave:"\xc0",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03b1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2a3f",AMP:"&",amp:"&",And:"\u2a53",and:"\u2227",andand:"\u2a55",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\xc5",angzarr:"\u237c",Aogon:"\u0104",aogon:"\u0105",Aopf:"\ud835\udd38",aopf:"\ud835\udd52",ap:"\u2248",apacir:"\u2a6f",apE:"\u2a70",ape:"\u224a",apid:"\u224b",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224a",Aring:"\xc5",aring:"\xe5",Ascr:"\ud835\udc9c",ascr:"\ud835\udcb6",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224d",Atilde:"\xc3",atilde:"\xe3",Auml:"\xc4",auml:"\xe4",awconint:"\u2233",awint:"\u2a11",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",Backslash:"\u2216",Barv:"\u2ae7",barvee:"\u22bd",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",Bernoullis:"\u212c",Beta:"\u0392",beta:"\u03b2",beth:"\u2136",between:"\u226c",Bfr:"\ud835\udd05",bfr:"\ud835\udd1f",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bNot:"\u2aed",bnot:"\u2310",Bopf:"\ud835\udd39",bopf:"\ud835\udd53",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxbox:"\u29c9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250c",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252c",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxUL:"\u255d",boxUl:"\u255c",boxuL:"\u255b",boxul:"\u2518",boxUR:"\u255a",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256c",boxVh:"\u256b",boxvH:"\u256a",boxvh:"\u253c",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255f",boxvR:"\u255e",boxvr:"\u251c",bprime:"\u2035",Breve:"\u02d8",breve:"\u02d8",brvbar:"\xa6",Bscr:"\u212c",bscr:"\ud835\udcb7",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsol:"\\",bsolb:"\u29c5",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",Bumpeq:"\u224e",bumpeq:"\u224f",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22d2",cap:"\u2229",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",capcup:"\u2a47",capdot:"\u2a40",CapitalDifferentialD:"\u2145",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",Cayleys:"\u212d",ccaps:"\u2a4d",Ccaron:"\u010c",ccaron:"\u010d",Ccedil:"\xc7",ccedil:"\xe7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2a4c",ccupssm:"\u2a50",Cdot:"\u010a",cdot:"\u010b",cedil:"\xb8",Cedilla:"\xb8",cemptyv:"\u29b2",cent:"\xa2",CenterDot:"\xb7",centerdot:"\xb7",Cfr:"\u212d",cfr:"\ud835\udd20",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03a7",chi:"\u03c7",cir:"\u25cb",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",CircleDot:"\u2299",circledR:"\xae",circledS:"\u24c8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29c3",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2a74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",Congruent:"\u2261",Conint:"\u222f",conint:"\u222e",ContourIntegral:"\u222e",Copf:"\u2102",copf:"\ud835\udd54",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xa9",copy:"\xa9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21b5",Cross:"\u2a2f",cross:"\u2717",Cscr:"\ud835\udc9e",cscr:"\ud835\udcb8",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cularrp:"\u293d",Cup:"\u22d3",cup:"\u222a",cupbrcap:"\u2a48",CupCap:"\u224d",cupcap:"\u2a46",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\xa4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21a1",dArr:"\u21d3",darr:"\u2193",dash:"\u2010",Dashv:"\u2ae4",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",Dcaron:"\u010e",dcaron:"\u010f",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21ca",DDotrahd:"\u2911",ddotseq:"\u2a77",deg:"\xb0",Del:"\u2207",Delta:"\u0394",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",Dfr:"\ud835\udd07",dfr:"\ud835\udd21",dHar:"\u2965",dharl:"\u21c3",dharr:"\u21c2",DiacriticalAcute:"\xb4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`",DiacriticalTilde:"\u02dc",diam:"\u22c4",Diamond:"\u22c4",diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\xa8",DifferentialD:"\u2146",digamma:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",Dopf:"\ud835\udd3b",dopf:"\ud835\udd55",Dot:"\xa8",dot:"\u02d9",DotDot:"\u20dc",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222f",DoubleDot:"\xa8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21d3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21f5",DownBreve:"\u0311",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVector:"\u21bd",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295f",DownRightVector:"\u21c1",DownRightVectorBar:"\u2957",DownTee:"\u22a4",DownTeeArrow:"\u21a7",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",Dscr:"\ud835\udc9f",dscr:"\ud835\udcb9",DScy:"\u0405",dscy:"\u0455",dsol:"\u29f6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",DZcy:"\u040f",dzcy:"\u045f",dzigrarr:"\u27ff",Eacute:"\xc9",eacute:"\xe9",easter:"\u2a6e",Ecaron:"\u011a",ecaron:"\u011b",ecir:"\u2256",Ecirc:"\xca",ecirc:"\xea",ecolon:"\u2255",Ecy:"\u042d",ecy:"\u044d",eDDot:"\u2a77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\ud835\udd08",efr:"\ud835\udd22",eg:"\u2a9a",Egrave:"\xc8",egrave:"\xe8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",Element:"\u2208",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25fb",emptyv:"\u2205",EmptyVerySmallSquare:"\u25ab",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014a",eng:"\u014b",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\ud835\udd3c",eopf:"\ud835\udd56",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",Epsilon:"\u0395",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96",eqslantless:"\u2a95",Equal:"\u2a75",equals:"=",EqualTilde:"\u2242",equest:"\u225f",Equilibrium:"\u21cc",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212f",esdot:"\u2250",Esim:"\u2a73",esim:"\u2242",Eta:"\u0397",eta:"\u03b7",ETH:"\xd0",eth:"\xf0",Euml:"\xcb",euml:"\xeb",euro:"\u20ac",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",Ffr:"\ud835\udd09",ffr:"\ud835\udd23",filig:"\ufb01",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",Fopf:"\ud835\udd3d",fopf:"\ud835\udd57",ForAll:"\u2200",forall:"\u2200",fork:"\u22d4",forkv:"\u2ad9",Fouriertrf:"\u2131",fpartint:"\u2a0d",frac12:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\ud835\udcbb",gacute:"\u01f5",Gamma:"\u0393",gamma:"\u03b3",Gammad:"\u03dc",gammad:"\u03dd",gap:"\u2a86",Gbreve:"\u011e",gbreve:"\u011f",Gcedil:"\u0122",Gcirc:"\u011c",gcirc:"\u011d",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2a8c",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",ges:"\u2a7e",gescc:"\u2aa9",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",Gfr:"\ud835\udd0a",gfr:"\ud835\udd24",Gg:"\u22d9",gg:"\u226b",ggg:"\u22d9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2aa5",glE:"\u2a92",glj:"\u2aa4",gnap:"\u2a8a",gnapprox:"\u2a8a",gnE:"\u2269",gne:"\u2a88",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",Gopf:"\ud835\udd3e",gopf:"\ud835\udd58",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\ud835\udca2",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",Gt:"\u226b",GT:">",gt:">",gtcc:"\u2aa7",gtcir:"\u2a7a",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",Hacek:"\u02c7",hairsp:"\u200a",half:"\xbd",hamilt:"\u210b",HARDcy:"\u042a",hardcy:"\u044a",hArr:"\u21d4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21ad",Hat:"^",hbar:"\u210f",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",Hfr:"\u210c",hfr:"\ud835\udd25",HilbertSpace:"\u210b",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",Hopf:"\u210d",hopf:"\ud835\udd59",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210b",hscr:"\ud835\udcbd",hslash:"\u210f",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224e",HumpEqual:"\u224f",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xcd",iacute:"\xed",ic:"\u2063",Icirc:"\xce",icirc:"\xee",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xa1",iff:"\u21d4",Ifr:"\u2111",ifr:"\ud835\udd26",Igrave:"\xcc",igrave:"\xec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012a",imacr:"\u012b",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22b7",imped:"\u01b5",Implies:"\u21d2",in:"\u2208",incare:"\u2105",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",Int:"\u222c",int:"\u222b",intcal:"\u22ba",integers:"\u2124",Integral:"\u222b",intercal:"\u22ba",Intersection:"\u22c2",intlarhk:"\u2a17",intprod:"\u2a3c",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012e",iogon:"\u012f",Iopf:"\ud835\udd40",iopf:"\ud835\udd5a",Iota:"\u0399",iota:"\u03b9",iprod:"\u2a3c",iquest:"\xbf",Iscr:"\u2110",iscr:"\ud835\udcbe",isin:"\u2208",isindot:"\u22f5",isinE:"\u22f9",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xcf",iuml:"\xef",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\ud835\udd0d",jfr:"\ud835\udd27",jmath:"\u0237",Jopf:"\ud835\udd41",jopf:"\ud835\udd5b",Jscr:"\ud835\udca5",jscr:"\ud835\udcbf",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039a",kappa:"\u03ba",kappav:"\u03f0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041a",kcy:"\u043a",Kfr:"\ud835\udd0e",kfr:"\ud835\udd28",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040c",kjcy:"\u045c",Kopf:"\ud835\udd42",kopf:"\ud835\udd5c",Kscr:"\ud835\udca6",kscr:"\ud835\udcc0",lAarr:"\u21da",Lacute:"\u0139",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",Lambda:"\u039b",lambda:"\u03bb",Lang:"\u27ea",lang:"\u27e8",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",Laplacetrf:"\u2112",laquo:"\xab",Larr:"\u219e",lArr:"\u21d0",larr:"\u2190",larrb:"\u21e4",larrbfs:"\u291f",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",lat:"\u2aab",lAtail:"\u291b",latail:"\u2919",late:"\u2aad",lates:"\u2aad\ufe00",lBarr:"\u290e",lbarr:"\u290c",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",Lcaron:"\u013d",lcaron:"\u013e",Lcedil:"\u013b",lcedil:"\u013c",lceil:"\u2308",lcub:"{",Lcy:"\u041b",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27e8",LeftArrow:"\u2190",Leftarrow:"\u21d0",leftarrow:"\u2190",LeftArrowBar:"\u21e4",LeftArrowRightArrow:"\u21c6",leftarrowtail:"\u21a2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21c3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230a",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21d4",leftrightarrow:"\u2194",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",LeftRightVector:"\u294e",LeftTee:"\u22a3",LeftTeeArrow:"\u21a4",LeftTeeVector:"\u295a",leftthreetimes:"\u22cb",LeftTriangle:"\u22b2",LeftTriangleBar:"\u29cf",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21bf",LeftUpVectorBar:"\u2958",LeftVector:"\u21bc",LeftVectorBar:"\u2952",lEg:"\u2a8b",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",les:"\u2a7d",lescc:"\u2aa8",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2aa1",lesssim:"\u2272",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",lfisht:"\u297c",lfloor:"\u230a",Lfr:"\ud835\udd0f",lfr:"\ud835\udd29",lg:"\u2276",lgE:"\u2a91",lHar:"\u2962",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22d8",ll:"\u226a",llarr:"\u21c7",llcorner:"\u231e",Lleftarrow:"\u21da",llhard:"\u296b",lltri:"\u25fa",Lmidot:"\u013f",lmidot:"\u0140",lmoust:"\u23b0",lmoustache:"\u23b0",lnap:"\u2a89",lnapprox:"\u2a89",lnE:"\u2268",lne:"\u2a87",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",LongLeftArrow:"\u27f5",Longleftarrow:"\u27f8",longleftarrow:"\u27f5",LongLeftRightArrow:"\u27f7",Longleftrightarrow:"\u27fa",longleftrightarrow:"\u27f7",longmapsto:"\u27fc",LongRightArrow:"\u27f6",Longrightarrow:"\u27f9",longrightarrow:"\u27f6",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",Lopf:"\ud835\udd43",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\ud835\udcc1",Lsh:"\u21b0",lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226a",LT:"<",lt:"<",ltcc:"\u2aa6",ltcir:"\u2a79",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",ltrPar:"\u2996",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",macr:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21a6",mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",Mcy:"\u041c",mcy:"\u043c",mdash:"\u2014",mDDot:"\u223a",measuredangle:"\u2221",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\ud835\udd10",mfr:"\ud835\udd2a",mho:"\u2127",micro:"\xb5",mid:"\u2223",midast:"*",midcir:"\u2af0",middot:"\xb7",minus:"\u2212",minusb:"\u229f",minusd:"\u2238",minusdu:"\u2a2a",MinusPlus:"\u2213",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",Mopf:"\ud835\udd44",mopf:"\ud835\udd5e",mp:"\u2213",Mscr:"\u2133",mscr:"\ud835\udcc2",mstpos:"\u223e",Mu:"\u039c",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266e",natural:"\u266e",naturals:"\u2115",nbsp:"\xa0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",Ncy:"\u041d",ncy:"\u043d",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21d7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",nexist:"\u2204",nexists:"\u2204",Nfr:"\ud835\udd11",nfr:"\ud835\udd2b",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",nGg:"\u22d9\u0338",ngsim:"\u2275",nGt:"\u226b\u20d2",ngt:"\u226f",ngtr:"\u226f",nGtv:"\u226b\u0338",nhArr:"\u21ce",nharr:"\u21ae",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",NJcy:"\u040a",njcy:"\u045a",nlArr:"\u21cd",nlarr:"\u219a",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21cd",nleftarrow:"\u219a",nLeftrightarrow:"\u21ce",nleftrightarrow:"\u21ae",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",nless:"\u226e",nLl:"\u22d8\u0338",nlsim:"\u2274",nLt:"\u226a\u20d2",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nLtv:"\u226a\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xa0",Nopf:"\u2115",nopf:"\ud835\udd5f",Not:"\u2aec",not:"\xac",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",notin:"\u2209",notindot:"\u22f5\u0338",notinE:"\u22f9\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",NotLeftTriangle:"\u22ea",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangle:"\u22eb",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",npre:"\u2aaf\u0338",nprec:"\u2280",npreceq:"\u2aaf\u0338",nrArr:"\u21cf",nrarr:"\u219b",nrarrc:"\u2933\u0338",nrarrw:"\u219d\u0338",nRightarrow:"\u21cf",nrightarrow:"\u219b",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",Nscr:"\ud835\udca9",nscr:"\ud835\udcc3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281",nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",Ntilde:"\xd1",ntilde:"\xf1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",Nu:"\u039d",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224d\u20d2",nVDash:"\u22af",nVdash:"\u22ae",nvDash:"\u22ad",nvdash:"\u22ac",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvHarr:"\u2904",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwarhk:"\u2923",nwArr:"\u21d6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xd3",oacute:"\xf3",oast:"\u229b",ocir:"\u229a",Ocirc:"\xd4",ocirc:"\xf4",Ocy:"\u041e",ocy:"\u043e",odash:"\u229d",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29bf",Ofr:"\ud835\udd12",ofr:"\ud835\udd2c",ogon:"\u02db",Ograve:"\xd2",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",Omacr:"\u014c",omacr:"\u014d",Omega:"\u03a9",omega:"\u03c9",Omicron:"\u039f",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",Oopf:"\ud835\udd46",oopf:"\ud835\udd60",opar:"\u29b7",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",operp:"\u29b9",oplus:"\u2295",Or:"\u2a54",or:"\u2228",orarr:"\u21bb",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oS:"\u24c8",Oscr:"\ud835\udcaa",oscr:"\u2134",Oslash:"\xd8",oslash:"\xf8",osol:"\u2298",Otilde:"\xd5",otilde:"\xf5",Otimes:"\u2a37",otimes:"\u2297",otimesas:"\u2a36",Ouml:"\xd6",ouml:"\xf6",ovbar:"\u233d",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",par:"\u2225",para:"\xb6",parallel:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",PartialD:"\u2202",Pcy:"\u041f",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",Pfr:"\ud835\udd13",pfr:"\ud835\udd2d",Phi:"\u03a6",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",Pi:"\u03a0",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plus:"+",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",PlusMinus:"\xb1",plusmn:"\xb1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\xb1",Poincareplane:"\u210c",pointint:"\u2a15",Popf:"\u2119",popf:"\ud835\udd61",pound:"\xa3",Pr:"\u2abb",pr:"\u227a",prap:"\u2ab7",prcue:"\u227c",prE:"\u2ab3",pre:"\u2aaf",prec:"\u227a",precapprox:"\u2ab7",preccurlyeq:"\u227c",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",precsim:"\u227e",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2ab9",prnE:"\u2ab5",prnsim:"\u22e8",prod:"\u220f",Product:"\u220f",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",Proportion:"\u2237",Proportional:"\u221d",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",Pscr:"\ud835\udcab",pscr:"\ud835\udcc5",Psi:"\u03a8",psi:"\u03c8",puncsp:"\u2008",Qfr:"\ud835\udd14",qfr:"\ud835\udd2e",qint:"\u2a0c",Qopf:"\u211a",qopf:"\ud835\udd62",qprime:"\u2057",Qscr:"\ud835\udcac",qscr:"\ud835\udcc6",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",QUOT:'"',quot:'"',rAarr:"\u21db",race:"\u223d\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",Rang:"\u27eb",rang:"\u27e9",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\xbb",Rarr:"\u21a0",rArr:"\u21d2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21a3",rarrw:"\u219d",rAtail:"\u291c",ratail:"\u291a",ratio:"\u2236",rationals:"\u211a",RBarr:"\u2910",rBarr:"\u290f",rbarr:"\u290d",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",Re:"\u211c",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",rect:"\u25ad",REG:"\xae",reg:"\xae",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",rfisht:"\u297d",rfloor:"\u230b",Rfr:"\u211c",rfr:"\ud835\udd2f",rHar:"\u2964",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",Rho:"\u03a1",rho:"\u03c1",rhov:"\u03f1",RightAngleBracket:"\u27e9",RightArrow:"\u2192",Rightarrow:"\u21d2",rightarrow:"\u2192",RightArrowBar:"\u21e5",RightArrowLeftArrow:"\u21c4",rightarrowtail:"\u21a3",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVector:"\u21c2",RightDownVectorBar:"\u2955",RightFloor:"\u230b",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc",rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",RightTee:"\u22a2",RightTeeArrow:"\u21a6",RightTeeVector:"\u295b",rightthreetimes:"\u22cc",RightTriangle:"\u22b3",RightTriangleBar:"\u29d0",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVector:"\u21be",RightUpVectorBar:"\u2954",RightVector:"\u21c0",RightVectorBar:"\u2953",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoust:"\u23b1",rmoustache:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",Ropf:"\u211d",ropf:"\ud835\udd63",roplus:"\u2a2e",rotimes:"\u2a35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",Rrightarrow:"\u21db",rsaquo:"\u203a",Rscr:"\u211b",rscr:"\ud835\udcc7",Rsh:"\u21b1",rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",RuleDelayed:"\u29f4",ruluhar:"\u2968",rx:"\u211e",Sacute:"\u015a",sacute:"\u015b",sbquo:"\u201a",Sc:"\u2abc",sc:"\u227b",scap:"\u2ab8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227d",scE:"\u2ab4",sce:"\u2ab0",Scedil:"\u015e",scedil:"\u015f",Scirc:"\u015c",scirc:"\u015d",scnap:"\u2aba",scnE:"\u2ab6",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",Scy:"\u0421",scy:"\u0441",sdot:"\u22c5",sdotb:"\u22a1",sdote:"\u2a66",searhk:"\u2925",seArr:"\u21d8",searr:"\u2198",searrow:"\u2198",sect:"\xa7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\ud835\udd16",sfr:"\ud835\udd30",sfrown:"\u2322",sharp:"\u266f",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xad",Sigma:"\u03a3",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",SOFTcy:"\u042c",softcy:"\u044c",sol:"/",solb:"\u29c4",solbar:"\u233f",Sopf:"\ud835\udd4a",sopf:"\ud835\udd64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",Sqrt:"\u221a",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25a1",Square:"\u25a1",square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25aa",squf:"\u25aa",srarr:"\u2192",Sscr:"\ud835\udcae",sscr:"\ud835\udcc8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",Star:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\xaf",Sub:"\u22d0",sub:"\u2282",subdot:"\u2abd",subE:"\u2ac5",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",Subset:"\u22d0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2ac5",SubsetEqual:"\u2286",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succ:"\u227b",succapprox:"\u2ab8",succcurlyeq:"\u227d",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6",succnsim:"\u22e9",succsim:"\u227f",SuchThat:"\u220b",Sum:"\u2211",sum:"\u2211",sung:"\u266a",Sup:"\u22d1",sup:"\u2283",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",supdot:"\u2abe",supdsub:"\u2ad8",supE:"\u2ac6",supe:"\u2287",supedot:"\u2ac4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",Supset:"\u22d1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swarhk:"\u2926",swArr:"\u21d9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292a",szlig:"\xdf",Tab:"\t",target:"\u2316",Tau:"\u03a4",tau:"\u03c4",tbrk:"\u23b4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",Tfr:"\ud835\udd17",tfr:"\ud835\udd31",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248",thicksim:"\u223c",ThickSpace:"\u205f\u200a",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223c",THORN:"\xde",thorn:"\xfe",Tilde:"\u223c",tilde:"\u02dc",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xd7",timesb:"\u22a0",timesbar:"\u2a31",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",top:"\u22a4",topbot:"\u2336",topcir:"\u2af1",Topf:"\ud835\udd4b",topf:"\ud835\udd65",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25b5",triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",TripleDot:"\u20db",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",Tscr:"\ud835\udcaf",tscr:"\ud835\udcc9",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040b",tshcy:"\u045b",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",Uacute:"\xda",uacute:"\xfa",Uarr:"\u219f",uArr:"\u21d1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040e",ubrcy:"\u045e",Ubreve:"\u016c",ubreve:"\u016d",Ucirc:"\xdb",ucirc:"\xfb",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21c5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",Ufr:"\ud835\udd18",ufr:"\ud835\udd32",Ugrave:"\xd9",ugrave:"\xf9",uHar:"\u2963",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",Umacr:"\u016a",umacr:"\u016b",uml:"\xa8",UnderBar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",uogon:"\u0173",Uopf:"\ud835\udd4c",uopf:"\ud835\udd66",UpArrow:"\u2191",Uparrow:"\u21d1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21c5",UpDownArrow:"\u2195",Updownarrow:"\u21d5",updownarrow:"\u2195",UpEquilibrium:"\u296e",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03d2",upsi:"\u03c5",upsih:"\u03d2",Upsilon:"\u03a5",upsilon:"\u03c5",UpTee:"\u22a5",UpTeeArrow:"\u21a5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",Uring:"\u016e",uring:"\u016f",urtri:"\u25f9",Uscr:"\ud835\udcb0",uscr:"\ud835\udcca",utdot:"\u22f0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",Uuml:"\xdc",uuml:"\xfc",uwangle:"\u29a7",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",vArr:"\u21d5",varr:"\u2195",varrho:"\u03f1",varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",Vbar:"\u2aeb",vBar:"\u2ae8",vBarv:"\u2ae9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22ab",Vdash:"\u22a9",vDash:"\u22a8",vdash:"\u22a2",Vdashl:"\u2ae6",Vee:"\u22c1",vee:"\u2228",veebar:"\u22bb",veeeq:"\u225a",vellip:"\u22ee",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\ud835\udd19",vfr:"\ud835\udd33",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",Vopf:"\ud835\udd4d",vopf:"\ud835\udd67",vprop:"\u221d",vrtri:"\u22b3",Vscr:"\ud835\udcb1",vscr:"\ud835\udccb",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",Vvdash:"\u22aa",vzigzag:"\u299a",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2a5f",Wedge:"\u22c0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\ud835\udd1a",wfr:"\ud835\udd34",Wopf:"\ud835\udd4e",wopf:"\ud835\udd68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\ud835\udcb2",wscr:"\ud835\udccc",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",Xfr:"\ud835\udd1b",xfr:"\ud835\udd35",xhArr:"\u27fa",xharr:"\u27f7",Xi:"\u039e",xi:"\u03be",xlArr:"\u27f8",xlarr:"\u27f5",xmap:"\u27fc",xnis:"\u22fb",xodot:"\u2a00",Xopf:"\ud835\udd4f",xopf:"\ud835\udd69",xoplus:"\u2a01",xotime:"\u2a02",xrArr:"\u27f9",xrarr:"\u27f6",Xscr:"\ud835\udcb3",xscr:"\ud835\udccd",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",Yacute:"\xdd",yacute:"\xfd",YAcy:"\u042f",yacy:"\u044f",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042b",ycy:"\u044b",yen:"\xa5",Yfr:"\ud835\udd1c",yfr:"\ud835\udd36",YIcy:"\u0407",yicy:"\u0457",Yopf:"\ud835\udd50",yopf:"\ud835\udd6a",Yscr:"\ud835\udcb4",yscr:"\ud835\udcce",YUcy:"\u042e",yucy:"\u044e",Yuml:"\u0178",yuml:"\xff",Zacute:"\u0179",zacute:"\u017a",Zcaron:"\u017d",zcaron:"\u017e",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017b",zdot:"\u017c",zeetrf:"\u2128",ZeroWidthSpace:"\u200b",Zeta:"\u0396",zeta:"\u03b6",Zfr:"\u2128",zfr:"\ud835\udd37",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21dd",Zopf:"\u2124",zopf:"\ud835\udd6b",Zscr:"\ud835\udcb5",zscr:"\ud835\udccf",zwj:"\u200d",zwnj:"\u200c"});t.entityMap=t.HTML_ENTITIES});rd.XML_ENTITIES;rd.HTML_ENTITIES;rd.entityMap;var ad=Oo.NAMESPACE;var od=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/;var ld=new RegExp("[\\-\\.0-9"+od.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]");var dd=new RegExp("^"+od.source+ld.source+"*(?::"+od.source+ld.source+"*)?$");var ud=0;var cd=1;var hd=2;var fd=3;var pd=4;var md=5;var gd=6;var vd=7;function yd(e,t){this.message=e;this.locator=t;if(Error.captureStackTrace)Error.captureStackTrace(this,yd)}yd.prototype=new Error;yd.prototype.name=yd.name;function bd(){}bd.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument();kd(t,t={});_d(e,t,i,n,this.errorHandler);n.endDocument()}};function _d(i,e,n,s,r){function a(e){if(e>65535){e-=65536;var t=55296+(e>>10),i=56320+(e&1023);return String.fromCharCode(t,i)}else{return String.fromCharCode(e)}}function o(e){var t=e.slice(1,-1);if(Object.hasOwnProperty.call(n,t)){return n[t]}else if(t.charAt(0)==="#"){return a(parseInt(t.substr(1).replace("x","0x")))}else{r.error("entity not found:"+e);return e}}function t(e){if(e>m){var t=i.substring(m,e).replace(/&#?\w+;/g,o);h&&l(m);s.characters(t,0,e-m);m=e}}function l(e,t){while(e>=u&&(t=c.exec(i))){d=t.index;u=d+t[0].length;h.lineNumber++}h.columnNumber=e-d+1}var d=0;var u=0;var c=/.*(?:\r\n?|\n)|.*$/g;var h=s.locator;var f=[{currentNSMap:e}];var p={};var m=0;while(true){try{var g=i.indexOf("<",m);if(g<0){if(!i.substr(m).match(/^\s*$/)){var v=s.doc;var y=v.createTextNode(i.substr(m));v.appendChild(y);s.currentElement=y}return}if(g>m){t(g)}switch(i.charAt(g+1)){case"/":var b=i.indexOf(">",g+3);var _=i.substring(g+2,b).replace(/[ \t\n\r]+$/g,"");var T=f.pop();if(b<0){_=i.substring(g+2).replace(/[\s<].*/,"");r.error("end tag name: "+_+" is not complete:"+T.tagName);b=g+1+_.length}else if(_.match(/\sm){m=b}else{t(Math.max(g,m)+1)}}}function Td(e,t){t.lineNumber=e.lineNumber;t.columnNumber=e.columnNumber;return t}function Sd(e,t,n,i,s,r){function a(e,t,i){if(n.attributeNames.hasOwnProperty(e)){r.fatalError("Attribute "+e+" redefined")}n.addValue(e,t.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,s),i)}var o;var l;var d=++t;var u=ud;while(true){var c=e.charAt(d);switch(c){case"=":if(u===cd){o=e.slice(t,d);u=fd}else if(u===hd){u=fd}else{throw new Error("attribute equal must after attrName")}break;case"'":case'"':if(u===fd||u===cd){if(u===cd){r.warning('attribute value must after "="');o=e.slice(t,d)}t=d+1;d=e.indexOf(c,t);if(d>0){l=e.slice(t,d);a(o,l,t-1);u=md}else{throw new Error("attribute value no end '"+c+"' match")}}else if(u==pd){l=e.slice(t,d);a(o,l,t);r.warning('attribute "'+o+'" missed start quot('+c+")!!");t=d+1;u=md}else{throw new Error('attribute value must after "="')}break;case"/":switch(u){case ud:n.setTagName(e.slice(t,d));case md:case gd:case vd:u=vd;n.closed=true;case pd:case cd:break;case hd:n.closed=true;break;default:throw new Error("attribute invalid close char('/')")}break;case"":r.error("unexpected end of input");if(u==ud){n.setTagName(e.slice(t,d))}return d;case">":switch(u){case ud:n.setTagName(e.slice(t,d));case md:case gd:case vd:break;case pd:case cd:l=e.slice(t,d);if(l.slice(-1)==="/"){n.closed=true;l=l.slice(0,-1)}case hd:if(u===hd){l=o}if(u==pd){r.warning('attribute "'+l+'" missed quot(")!');a(o,l,t)}else{if(!ad.isHTML(i[""])||!l.match(/^(?:disabled|checked|selected)$/i)){r.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!')}a(l,l,t)}break;case fd:throw new Error("attribute value missed!!")}return d;case"\x80":c=" ";default:if(c<=" "){switch(u){case ud:n.setTagName(e.slice(t,d));u=gd;break;case cd:o=e.slice(t,d);u=hd;break;case pd:var l=e.slice(t,d);r.warning('attribute "'+l+'" missed quot(")!!');a(o,l,t);case md:u=gd;break}}else{switch(u){case hd:n.tagName;if(!ad.isHTML(i[""])||!o.match(/^(?:disabled|checked|selected)$/i)){r.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!')}a(o,o,t);t=d;u=cd;break;case md:r.warning('attribute space is required"'+o+'"!!');case gd:u=cd;t=d;break;case fd:u=pd;t=d;break;case vd:throw new Error("elements closed character '/' and '>' must be connected to")}}}d++}}function Ed(e,t,i){var n=e.tagName;var s=null;var r=e.length;while(r--){var a=e[r];var o=a.qName;var l=a.value;var d=o.indexOf(":");if(d>0){var u=a.prefix=o.slice(0,d);var c=o.slice(d+1);var h=u==="xmlns"&&c}else{c=o;u=null;h=o==="xmlns"&&""}a.localName=c;if(h!==false){if(s==null){s={};kd(i,i={})}i[h]=s[h]=l;a.uri=ad.XMLNS;t.startPrefixMapping(h,l)}}var r=e.length;while(r--){a=e[r];var u=a.prefix;if(u){if(u==="xml"){a.uri=ad.XML}if(u!=="xmlns"){a.uri=i[u||""]}}}var d=n.indexOf(":");if(d>0){u=e.prefix=n.slice(0,d);c=e.localName=n.slice(d+1)}else{u=null;c=e.localName=n}var f=e.uri=i[u||""];t.startElement(f,c,n,e);if(e.closed){t.endElement(f,c,n);if(s){for(u in s){if(Object.prototype.hasOwnProperty.call(s,u)){t.endPrefixMapping(u)}}}}else{e.currentNSMap=i;e.localNSMap=s;return true}}function wd(e,t,i,n,s){if(/^(?:script|textarea)$/i.test(i)){var r=e.indexOf("",t);var a=e.substring(t+1,r);if(/[&<]/.test(a)){if(/^script$/i.test(i)){s.characters(a,0,a.length);return r}a=a.replace(/&#?\w+;/g,n);s.characters(a,0,a.length);return r}}return t+1}function Id(e,t,i,n){var s=n[i];if(s==null){s=e.lastIndexOf("");if(st){i.comment(e,t+4,r-t-4);return r+3}else{n.error("Unclosed comment");return-1}}else{return-1}default:if(e.substr(t+3,6)=="CDATA["){var r=e.indexOf("]]>",t+9);i.startCDATA();i.characters(e,t+9,r-t-9);i.endCDATA();return r+3}var a=xd(e,t);var o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var l=a[1][0];var d=false;var u=false;if(o>3){if(/^public$/i.test(a[2][0])){d=a[3][0];u=o>4&&a[4][0]}else if(/^system$/i.test(a[2][0])){u=a[3][0]}}var c=a[o-1];i.startDTD(l,d,u);i.endDTD();return c.index+c[0].length}}return-1}function Ad(e,t,i){var n=e.indexOf("?>",t);if(n){var s=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(s){s[0].length;i.processingInstruction(s[1],s[2]);return n+2}else{return-1}}return-1}function jd(){this.attributeNames={}}jd.prototype={setTagName:function(e){if(!dd.test(e)){throw new Error("invalid tagName:"+e)}this.tagName=e},addValue:function(e,t,i){if(!dd.test(e)){throw new Error("invalid attribute:"+e)}this.attributeNames[e]=this.length;this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};function xd(e,t){var i;var n=[];var s=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;s.lastIndex=t;s.exec(e);while(i=s.exec(e)){n.push(i);if(i[1])return n}}var Dd=bd;var Rd=yd;var Od={XMLReader:Dd,ParseError:Rd};var Pd=sd.DOMImplementation;var Ld=Oo.NAMESPACE;var Nd=Od.ParseError;var Md=Od.XMLReader;function Ud(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function Bd(e){this.options=e||{locator:{}}}Bd.prototype.parseFromString=function(e,t){var i=this.options;var n=new Md;var s=i.domBuilder||new qd;var r=i.errorHandler;var a=i.locator;var o=i.xmlns||{};var l=/\/x?html?$/.test(t);var d=l?rd.HTML_ENTITIES:rd.XML_ENTITIES;if(a){s.setDocumentLocator(a)}n.errorHandler=Fd(r,s,a);n.domBuilder=i.domBuilder||s;if(l){o[""]=Ld.HTML}o.xml=o.xml||Ld.XML;var u=i.normalizeLineEndings||Ud;if(e&&typeof e==="string"){n.parse(u(e),o,d)}else{n.errorHandler.error("invalid doc source")}return s.doc};function Fd(n,e,s){if(!n){if(e instanceof qd){return e}n=e}var r={};var a=n instanceof Function;s=s||{};function t(t){var i=n[t];if(!i&&a){i=n.length==2?function(e){n(t,e)}:n}r[t]=i&&function(e){i("[xmldom "+t+"]\t"+e+Hd(s))}||function(){}}t("warning");t("error");t("fatalError");return r}function qd(){this.cdata=false}function Vd(e,t){t.lineNumber=e.lineNumber;t.columnNumber=e.columnNumber}qd.prototype={startDocument:function(){this.doc=(new Pd).createDocument(null,null,null);if(this.locator){this.doc.documentURI=this.locator.systemId}},startElement:function(e,t,i,n){var s=this.doc;var r=s.createElementNS(e,i||t);var a=n.length;zd(this,r);this.currentElement=r;this.locator&&Vd(this.locator,r);for(var o=0;o=t+i||t){return new java.lang.String(e,t,i)+""}return e}}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(e){qd.prototype[e]=function(){return null}});function zd(e,t){if(!e.currentElement){e.doc.appendChild(t)}else{e.currentElement.appendChild(t)}}var Gd=qd;var Wd=Ud;var Kd=Bd;var Xd={__DOMHandler:Gd,normalizeLineEndings:Wd,DOMParser:Kd};var Yd=Xd.DOMParser;const Qd=e=>{return!!e&&typeof e==="object"};const A=(...e)=>{return e.reduce((t,i)=>{if(typeof i!=="object"){return t}Object.keys(i).forEach(e=>{if(Array.isArray(t[e])&&Array.isArray(i[e])){t[e]=t[e].concat(i[e])}else if(Qd(t[e])&&Qd(i[e])){t[e]=A(t[e],i[e])}else{t[e]=i[e]}});return t},{})};const Jd=t=>Object.keys(t).map(e=>t[e]);const Zd=(t,i)=>{const n=[];for(let e=t;ee.reduce((e,t)=>e.concat(t),[]);const tu=t=>{if(!t.length){return[]}const i=[];for(let e=0;ee.reduce((e,t,i)=>{if(t[n]){e.push(i)}return e},[]);const nu=(e,i)=>{return Jd(e.reduce((t,e)=>{e.forEach(e=>{t[i(e)]=e});return t},{}))};var su={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",INVALID_NUMBER_OF_CONTENT_STEERING:"INVALID_NUMBER_OF_CONTENT_STEERING",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",MISSING_SEGMENT_INFORMATION:"MISSING_SEGMENT_INFORMATION",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const ru=({baseUrl:e="",source:t="",range:n="",indexRange:s=""})=>{const r={uri:t,resolvedUri:bo(e||"",t)};if(n||s){const a=n?n:s;const o=a.split("-");let e=tv.BigInt?tv.BigInt(o[0]):parseInt(o[0],10);let t=tv.BigInt?tv.BigInt(o[1]):parseInt(o[1],10);if(e{let t;if(typeof e.offset==="bigint"||typeof e.length==="bigint"){t=tv.BigInt(e.offset)+tv.BigInt(e.length)-tv.BigInt(1)}else{t=e.offset+e.length-1}return`${e.offset}-${t}`};const ou=e=>{if(e&&typeof e!=="number"){e=parseInt(e,10)}if(isNaN(e)){return null}return e};const lu={static(e){const{duration:t,timescale:i=1,sourceDuration:n,periodDuration:s}=e;const r=ou(e.endNumber);const a=t/i;if(typeof r==="number"){return{start:0,end:r}}if(typeof s==="number"){return{start:0,end:s/a}}return{start:0,end:n/a}},dynamic(e){const{NOW:t,clientOffset:i,availabilityStartTime:n,timescale:s=1,duration:r,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=Infinity}=e;const d=ou(e.endNumber);const u=(t+i)/1e3;const c=n+a;const h=u+o;const f=h-c;const p=Math.ceil(f*s/r);const m=Math.floor((u-c-l)*s/r);const g=Math.floor((u-c)*s/r);return{start:Math.max(0,m),end:typeof d==="number"?d:Math.min(p,g)}}};const du=r=>e=>{const{duration:t,timescale:i=1,periodStart:n,startNumber:s=1}=r;return{number:s+e,duration:t/i,timeline:n,time:e*t}};const uu=e=>{const{type:t,duration:i,timescale:n=1,periodDuration:s,sourceDuration:r}=e;const{start:a,end:o}=lu[t](e);const l=Zd(a,o).map(du(e));if(t==="static"){const e=l.length-1;const d=typeof s==="number"?s:r;l[e].duration=d-i/n*e}return l};const cu=e=>{const{baseUrl:t,initialization:i={},sourceDuration:n,indexRange:s="",periodStart:r,presentationTime:a,number:o=0,duration:l}=e;if(!t){throw new Error(su.NO_BASE_URL)}const d=ru({baseUrl:t,source:i.sourceURL,range:i.range});const u=ru({baseUrl:t,source:t,indexRange:s});u.map=d;if(l){const c=uu(e);if(c.length){u.duration=c[0].duration;u.timeline=c[0].timeline}}else if(n){u.duration=n;u.timeline=r}u.presentationTime=a||r;u.number=o;return[u]};const hu=(e,n,s)=>{const r=e.sidx.map?e.sidx.map:null;const a=e.sidx.duration;const o=e.timeline||0;const t=e.sidx.byterange;const i=t.offset+t.length;const l=n.timescale;const d=n.references.filter(e=>e.referenceType!==1);const u=[];const c=e.endList?"static":"dynamic";const h=e.sidx.timeline;let f=h;let p=e.mediaSequence||0;let m;if(typeof n.firstOffset==="bigint"){m=tv.BigInt(i)+n.firstOffset}else{m=i+n.firstOffset}for(let i=0;i{return nu(e,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1)};const gu=(t,i)=>{for(let e=0;e{let s=[];_o(e,fu,(e,t,i,n)=>{s=s.concat(e.playlists||[])});return s};const yu=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e;i.segments.forEach((e,t)=>{e.number=i.mediaSequence+t})};const bu=({oldPlaylists:r,newPlaylists:e,timelineStarts:a})=>{e.forEach(t=>{t.discontinuitySequence=a.findIndex(function({timeline:e}){return e===t.timeline});const e=gu(r,t.attributes.NAME);if(!e){return}if(t.sidx){return}const i=t.segments[0];const n=e.segments.findIndex(function(e){return Math.abs(e.presentationTime-i.presentationTime)e.timeline||e.segments.length&&t.timeline>e.segments[e.segments.length-1].timeline){t.discontinuitySequence--}return}const s=e.segments[n];if(s.discontinuity&&!i.discontinuity){i.discontinuity=true;t.discontinuityStarts.unshift(0);t.discontinuitySequence--}yu({playlist:t,mediaSequence:e.segments[n].number})})};const _u=({oldManifest:e,newManifest:t})=>{const i=e.playlists.concat(vu(e));const n=t.playlists.concat(vu(t));t.timelineStarts=mu([e.timelineStarts,t.timelineStarts]);bu({oldPlaylists:i,newPlaylists:n,timelineStarts:t.timelineStarts});return t};const Tu=e=>e&&e.uri+"-"+au(e.byterange);const Su=e=>{const t=e.reduce(function(e,t){if(!e[t.attributes.baseUrl]){e[t.attributes.baseUrl]=[]}e[t.attributes.baseUrl].push(t);return e},{});let i=[];Object.values(t).forEach(e=>{const t=Jd(e.reduce((e,t)=>{const i=t.attributes.id+(t.attributes.lang||"");if(!e[i]){e[i]=t;e[i].attributes.timelineStarts=[]}else{if(t.segments){if(t.segments[0]){t.segments[0].discontinuity=true}e[i].segments.push(...t.segments)}if(t.attributes.contentProtection){e[i].attributes.contentProtection=t.attributes.contentProtection}}e[i].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart});return e},{}));i=i.concat(t)});return i.map(e=>{e.discontinuityStarts=iu(e.segments||[],"discontinuity");return e})};const Eu=(e,t)=>{const i=Tu(e.sidx);const n=i&&t[i]&&t[i].sidx;if(n){hu(e,n,e.sidx.resolvedUri)}return e};const wu=(t,i={})=>{if(!Object.keys(i).length){return t}for(const e in t){t[e]=Eu(t[e],i)}return t};const Iu=({attributes:e,segments:t,sidx:i,mediaSequence:n,discontinuitySequence:s,discontinuityStarts:r},a)=>{const o={attributes:{NAME:e.id,BANDWIDTH:e.bandwidth,CODECS:e.codecs,["PROGRAM-ID"]:1},uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuitySequence:s,discontinuityStarts:r,timelineStarts:e.timelineStarts,mediaSequence:n,segments:t};if(e.contentProtection){o.contentProtection=e.contentProtection}if(e.serviceLocation){o.attributes.serviceLocation=e.serviceLocation}if(i){o.sidx=i}if(a){o.attributes.AUDIO="audio";o.attributes.SUBTITLES="subs"}return o};const ku=({attributes:e,segments:t,mediaSequence:i,discontinuityStarts:n,discontinuitySequence:s})=>{if(typeof t==="undefined"){t=[{uri:e.baseUrl,timeline:e.periodStart,resolvedUri:e.baseUrl||"",duration:e.sourceDuration,number:0}];e.duration=e.sourceDuration}const r={NAME:e.id,BANDWIDTH:e.bandwidth,["PROGRAM-ID"]:1};if(e.codecs){r.CODECS=e.codecs}const a={attributes:r,uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,timelineStarts:e.timelineStarts,discontinuityStarts:n,discontinuitySequence:s,mediaSequence:i,segments:t};if(e.serviceLocation){a.attributes.serviceLocation=e.serviceLocation}return a};const Cu=(e,o={},l=false)=>{let d;const t=e.reduce((e,t)=>{const i=t.attributes.role&&t.attributes.role.value||"";const n=t.attributes.lang||"";let s=t.attributes.label||"main";if(n&&!t.attributes.label){const a=i?` (${i})`:"";s=`${t.attributes.lang}${a}`}if(!e[s]){e[s]={language:n,autoselect:true,default:i==="main",playlists:[],uri:""}}const r=Eu(Iu(t,l),o);e[s].playlists.push(r);if(typeof d==="undefined"&&i==="main"){d=t;d.default=true}return e},{});if(!d){const i=Object.keys(t)[0];t[i].default=true}return t};const Au=(e,n={})=>{return e.reduce((e,t)=>{const i=t.attributes.label||t.attributes.lang||"text";if(!e[i]){e[i]={language:i,default:false,autoselect:false,playlists:[],uri:""}}e[i].playlists.push(Eu(ku(t),n));return e},{})};const ju=e=>e.reduce((n,e)=>{if(!e){return n}e.forEach(e=>{const{channel:t,language:i}=e;n[i]={autoselect:false,default:false,instreamId:t,language:i};if(e.hasOwnProperty("aspectRatio")){n[i].aspectRatio=e.aspectRatio}if(e.hasOwnProperty("easyReader")){n[i].easyReader=e.easyReader}if(e.hasOwnProperty("3D")){n[i]["3D"]=e["3D"]}});return n},{});const xu=({attributes:e,segments:t,sidx:i,discontinuityStarts:n})=>{const s={attributes:{NAME:e.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:e.width,height:e.height},CODECS:e.codecs,BANDWIDTH:e.bandwidth,["PROGRAM-ID"]:1},uri:"",endList:e.type==="static",timeline:e.periodStart,resolvedUri:e.baseUrl||"",targetDuration:e.duration,discontinuityStarts:n,timelineStarts:e.timelineStarts,segments:t};if(e.frameRate){s.attributes["FRAME-RATE"]=e.frameRate}if(e.contentProtection){s.contentProtection=e.contentProtection}if(e.serviceLocation){s.attributes.serviceLocation=e.serviceLocation}if(i){s.sidx=i}return s};const Du=({attributes:e})=>e.mimeType==="video/mp4"||e.mimeType==="video/webm"||e.contentType==="video";const Ru=({attributes:e})=>e.mimeType==="audio/mp4"||e.mimeType==="audio/webm"||e.contentType==="audio";const Ou=({attributes:e})=>e.mimeType==="text/vtt"||e.contentType==="text";const Pu=(e,i)=>{e.forEach(t=>{t.mediaSequence=0;t.discontinuitySequence=i.findIndex(function({timeline:e}){return e===t.timeline});if(!t.segments){return}t.segments.forEach((e,t)=>{e.number=t})})};const Lu=n=>{if(!n){return[]}return Object.keys(n).reduce((e,t)=>{const i=n[t];return e.concat(i.playlists)},[])};const Nu=({dashPlaylists:e,locations:t,contentSteering:i,sidxMapping:n={},previousManifest:s,eventStream:r})=>{if(!e.length){return{}}const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:d}=e[0].attributes;const u=Su(e.filter(Du)).map(xu);const c=Su(e.filter(Ru));const h=Su(e.filter(Ou));const f=e.map(e=>e.attributes.captionServices).filter(Boolean);const p={allowCache:true,discontinuityStarts:[],segments:[],endList:true,mediaGroups:{AUDIO:{},VIDEO:{},["CLOSED-CAPTIONS"]:{},SUBTITLES:{}},uri:"",duration:a,playlists:wu(u,n)};if(d>=0){p.minimumUpdatePeriod=d*1e3}if(t){p.locations=t}if(i){p.contentSteering=i}if(o==="dynamic"){p.suggestedPresentationDelay=l}if(r&&r.length>0){p.eventStream=r}const m=p.playlists.length===0;const g=c.length?Cu(c,n,m):null;const v=h.length?Au(h,n):null;const y=u.concat(Lu(g),Lu(v));const b=y.map(({timelineStarts:e})=>e);p.timelineStarts=mu(b);Pu(y,p.timelineStarts);if(g){p.mediaGroups.AUDIO.audio=g}if(v){p.mediaGroups.SUBTITLES.subs=v}if(f.length){p.mediaGroups["CLOSED-CAPTIONS"].cc=ju(f)}if(s){return _u({oldManifest:s,newManifest:p})}return p};const Mu=(e,t,i)=>{const{NOW:n,clientOffset:s,availabilityStartTime:r,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=e;const d=(n+s)/1e3;const u=r+o;const c=d+l;const h=c-u;return Math.ceil((h*a-t)/i)};const Uu=(s,r)=>{const{type:a,minimumUpdatePeriod:o=0,media:l="",sourceDuration:d,timescale:u=1,startNumber:c=1,periodStart:h}=s;const f=[];let p=-1;for(let n=0;np){p=v}let t;if(g<0){const b=n+1;if(b===r.length){if(a==="dynamic"&&o>0&&l.indexOf("$Number$")>0){t=Mu(s,p,e)}else{t=(d*u-p)/e}}else{t=(r[b].t-p)/e}}else{t=g+1}const y=c+f.length+t;let i=c+f.length;while(i(e,t,i,n)=>{if(e==="$$"){return"$"}if(typeof r[t]==="undefined"){return e}const s=""+r[t];if(t==="RepresentationID"){return s}if(!i){n=1}else{n=parseInt(n,10)}if(s.length>=n){return s}return`${new Array(n-s.length+1).join("0")}${s}`};const qu=(e,t)=>e.replace(Bu,Fu(t));const Vu=(e,t)=>{if(!e.duration&&!t){return[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]}if(e.duration){return uu(e)}return Uu(e,t)};const Hu=(a,e)=>{const o={RepresentationID:a.id,Bandwidth:a.bandwidth||0};const{initialization:t={sourceURL:"",range:""}}=a;const l=ru({baseUrl:a.baseUrl,source:qu(t.sourceURL,o),range:t.range});const i=Vu(a,e);return i.map(e=>{o.Number=e.number;o.Time=e.time;const t=qu(a.media||"",o);const i=a.timescale||1;const n=a.presentationTimeOffset||0;const s=a.periodStart+(e.time-n)/i;const r={uri:t,timeline:e.timeline,duration:e.duration,resolvedUri:bo(a.baseUrl||"",t),map:l,number:e.number,presentationTime:s};return r})};const $u=(e,t)=>{const{baseUrl:i,initialization:n={}}=e;const s=ru({baseUrl:i,source:n.sourceURL,range:n.range});const r=ru({baseUrl:i,source:t.media,range:t.mediaRange});r.map=s;return r};const zu=(r,e)=>{const{duration:t,segmentUrls:i=[],periodStart:a}=r;if(!t&&!e||t&&e){throw new Error(su.SEGMENT_TIME_UNSPECIFIED)}const o=i.map(e=>$u(r,e));let n;if(t){n=uu(r)}if(e){n=Uu(r,e)}const s=n.map((e,t)=>{if(o[t]){const i=o[t];const n=r.timescale||1;const s=r.presentationTimeOffset||0;i.timeline=e.timeline;i.duration=e.duration;i.number=e.number;i.presentationTime=a+(e.time-s)/n;return i}}).filter(e=>e);return s};const Gu=({attributes:e,segmentInfo:t})=>{let i;let n;if(t.template){n=Hu;i=A(e,t.template)}else if(t.base){n=cu;i=A(e,t.base)}else if(t.list){n=zu;i=A(e,t.list)}const s={attributes:e};if(!n){return s}const r=n(i,t.segmentTimeline);if(i.duration){const{duration:e,timescale:a=1}=i;i.duration=e/a}else if(r.length){i.duration=r.reduce((e,t)=>{return Math.max(e,Math.ceil(t.duration))},0)}else{i.duration=0}s.attributes=i;s.segments=r;if(t.base&&i.indexRange){s.sidx=r[0];s.segments=[]}return s};const Wu=e=>e.map(Gu);const j=(e,t)=>tu(e.childNodes).filter(({tagName:e})=>e===t);const Ku=e=>e.textContent.trim();const Xu=e=>{return parseFloat(e.split("/").reduce((e,t)=>e/t))};const Yu=e=>{const t=365*24*60*60;const i=30*24*60*60;const n=24*60*60;const s=60*60;const r=60;const a=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/;const o=a.exec(e);if(!o){return 0}const[l,d,u,c,h,f]=o.slice(1);return parseFloat(l||0)*t+parseFloat(d||0)*i+parseFloat(u||0)*n+parseFloat(c||0)*s+parseFloat(h||0)*r+parseFloat(f||0)};const Qu=e=>{const t=/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/;if(t.test(e)){e+="Z"}return Date.parse(e)};const Ju={mediaPresentationDuration(e){return Yu(e)},availabilityStartTime(e){return Qu(e)/1e3},minimumUpdatePeriod(e){return Yu(e)},suggestedPresentationDelay(e){return Yu(e)},type(e){return e},timeShiftBufferDepth(e){return Yu(e)},start(e){return Yu(e)},width(e){return parseInt(e,10)},height(e){return parseInt(e,10)},bandwidth(e){return parseInt(e,10)},frameRate(e){return Xu(e)},startNumber(e){return parseInt(e,10)},timescale(e){return parseInt(e,10)},presentationTimeOffset(e){return parseInt(e,10)},duration(e){const t=parseInt(e,10);if(isNaN(t)){return Yu(e)}return t},d(e){return parseInt(e,10)},t(e){return parseInt(e,10)},r(e){return parseInt(e,10)},presentationTime(e){return parseInt(e,10)},DEFAULT(e){return e}};const x=e=>{if(!(e&&e.attributes)){return{}}return tu(e.attributes).reduce((e,t)=>{const i=Ju[t.name]||Ju.DEFAULT;e[t.name]=i(t.value);return e},{})};const Zu={"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"};const ec=(e,t)=>{if(!t.length){return e}return eu(e.map(function(s){return t.map(function(e){const t=Ku(e);const i=bo(s.baseUrl,t);const n=A(x(e),{baseUrl:i});if(i!==t&&!n.serviceLocation&&s.serviceLocation){n.serviceLocation=s.serviceLocation}return n})}))};const tc=e=>{const t=j(e,"SegmentTemplate")[0];const i=j(e,"SegmentList")[0];const n=i&&j(i,"SegmentURL").map(e=>A({tag:"SegmentURL"},x(e)));const s=j(e,"SegmentBase")[0];const r=i||t;const a=r&&j(r,"SegmentTimeline")[0];const o=i||s||t;const l=o&&j(o,"Initialization")[0];const d=t&&x(t);if(d&&l){d.initialization=l&&x(l)}else if(d&&d.initialization){d.initialization={sourceURL:d.initialization}}const u={template:d,segmentTimeline:a&&j(a,"S").map(e=>x(e)),list:i&&A(x(i),{segmentUrls:n,initialization:x(l)}),base:s&&A(x(s),{initialization:x(l)})};Object.keys(u).forEach(e=>{if(!u[e]){delete u[e]}});return u};const ic=(r,a,o)=>e=>{const t=j(e,"BaseURL");const i=ec(a,t);const n=A(r,x(e));const s=tc(e);return i.map(e=>{return{segmentInfo:A(o,s),attributes:A(n,e)}})};const nc=e=>{return e.reduce((e,t)=>{const i=x(t);if(i.schemeIdUri){i.schemeIdUri=i.schemeIdUri.toLowerCase()}const n=Zu[i.schemeIdUri];if(n){e[n]={attributes:i};const s=j(t,"cenc:pssh")[0];if(s){const r=Ku(s);e[n].pssh=r&&So(r)}}return e},{})};const sc=t=>{if(t.schemeIdUri==="urn:scte:dash:cc:cea-608:2015"){const e=typeof t.value!=="string"?[]:t.value.split(";");return e.map(e=>{let t;let i;i=e;if(/^CC\d=/.test(e)){[t,i]=e.split("=")}else if(/^CC\d$/.test(e)){t=e}return{channel:t,language:i}})}else if(t.schemeIdUri==="urn:scte:dash:cc:cea-708:2015"){const e=typeof t.value!=="string"?[]:t.value.split(";");return e.map(e=>{const n={channel:undefined,language:undefined,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(e)){const[t,i=""]=e.split("=");n.channel=t;n.language=e;i.split(",").forEach(e=>{const[t,i]=e.split(":");if(t==="lang"){n.language=i}else if(t==="er"){n.easyReader=Number(i)}else if(t==="war"){n.aspectRatio=Number(i)}else if(t==="3D"){n["3D"]=Number(i)}})}else{n.language=e}if(n.channel){n.channel="SERVICE"+n.channel}return n})}};const rc=l=>{return eu(j(l.node,"EventStream").map(e=>{const a=x(e);const o=a.schemeIdUri;return j(e,"Event").map(e=>{const t=x(e);const i=t.presentationTime||0;const n=a.timescale||1;const s=t.duration||0;const r=i/n+l.attributes.start;return{schemeIdUri:o,value:a.value,id:t.id,start:r,end:r+s/n,messageData:Ku(e)||t.messageData,contentEncoding:a.contentEncoding,presentationTimeOffset:a.presentationTimeOffset||0}})}))};const ac=(p,m,g)=>e=>{const t=x(e);const i=ec(m,j(e,"BaseURL"));const n=j(e,"Role")[0];const s={role:x(n)};let r=A(p,t,s);const a=j(e,"Accessibility")[0];const o=sc(x(a));if(o){r=A(r,{captionServices:o})}const l=j(e,"Label")[0];if(l&&l.childNodes.length){const f=l.childNodes[0].nodeValue.trim();r=A(r,{label:f})}const d=nc(j(e,"ContentProtection"));if(Object.keys(d).length){r=A(r,{contentProtection:d})}const u=tc(e);const c=j(e,"Representation");const h=A(g,u);return eu(c.map(ic(r,i,h)))};const oc=(a,o)=>(e,t)=>{const i=ec(o,j(e.node,"BaseURL"));const n=A(a,{periodStart:e.attributes.start});if(typeof e.attributes.duration==="number"){n.periodDuration=e.attributes.duration}const s=j(e.node,"AdaptationSet");const r=tc(e.node);return eu(s.map(ac(n,i,r)))};const lc=(e,t)=>{if(e.length>1){t({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"})}if(!e.length){return null}const i=A({serverURL:Ku(e[0])},x(e[0]));i.queryBeforeStart=i.queryBeforeStart==="true";return i};const dc=({attributes:e,priorPeriodAttributes:t,mpdType:i})=>{if(typeof e.start==="number"){return e.start}if(t&&typeof t.start==="number"&&typeof t.duration==="number"){return t.start+t.duration}if(!t&&i==="static"){return 0}return null};const uc=(e,t={})=>{const{manifestUri:i="",NOW:n=Date.now(),clientOffset:s=0,eventHandler:r=function(){}}=t;const a=j(e,"Period");if(!a.length){throw new Error(su.INVALID_NUMBER_OF_PERIOD)}const o=j(e,"Location");const l=x(e);const d=ec([{baseUrl:i}],j(e,"BaseURL"));const u=j(e,"ContentSteering");l.type=l.type||"static";l.sourceDuration=l.mediaPresentationDuration||0;l.NOW=n;l.clientOffset=s;if(o.length){l.locations=o.map(Ku)}const c=[];a.forEach((e,t)=>{const i=x(e);const n=c[t-1];i.start=dc({attributes:i,priorPeriodAttributes:n?n.attributes:null,mpdType:l.type});c.push({node:e,attributes:i})});return{locations:l.locations,contentSteeringInfo:lc(u,r),representationInfo:eu(c.map(oc(l,d))),eventStream:eu(c.map(rc))}};const cc=e=>{if(e===""){throw new Error(su.DASH_EMPTY_MANIFEST)}const t=new Yd;let i;let n;try{i=t.parseFromString(e,"application/xml");n=i&&i.documentElement.tagName==="MPD"?i.documentElement:null}catch(e){}if(!n||n&&n.getElementsByTagName("parsererror").length>0){throw new Error(su.DASH_INVALID_XML)}return n};const hc=e=>{const t=j(e,"UTCTiming")[0];if(!t){return null}const i=x(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT";i.value=Date.parse(i.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(su.UNSUPPORTED_UTC_TIMING_SCHEME)}return i};const fc=(e,t={})=>{const i=uc(cc(e),t);const n=Wu(i.representationInfo);return Nu({dashPlaylists:n,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest,eventStream:i.eventStream})};const pc=e=>hc(cc(e));var mc=Math.pow(2,32);var gc=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength);var i;if(t.getBigUint64){i=t.getBigUint64(0);if(i0;n+=12,s--){i.references.push({referenceType:(e[n]&128)>>>7,referencedSize:t.getUint32(n)&2147483647,subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(e[n+8]&128),sapType:(e[n+8]&112)>>>4,sapDeltaTime:t.getUint32(n+8)&268435455})}return i};var _c=bc;var Tc=E([73,68,51]);var Sc=function e(t,i){if(i===void 0){i=0}t=E(t);var n=t[i+5];var s=t[i+6]<<21|t[i+7]<<14|t[i+8]<<7|t[i+9];var r=(n&16)>>4;if(r){return s+20}return s+10};var Ec=function e(t,i){if(i===void 0){i=0}t=E(t);if(t.length-i<10||!I(t,Tc,{offset:i})){return i}i+=Sc(t,i);return e(t,i)};var wc=function e(t){if(typeof t==="string"){return go(t)}if(typeof t==="number"){return t}return t};var Ic=function e(t){if(!Array.isArray(t)){return[wc(t)]}return t.map(function(e){return wc(e)})};var kc=function e(t,i,n){if(n===void 0){n=false}i=Ic(i);t=E(t);var s=[];if(!i.length){return s}var r=0;while(r>>0;var o=t.subarray(r+4,r+8);if(a===0){break}var l=r+a;if(l>t.length){if(n){break}l=t.length}var d=t.subarray(r+8,l);if(I(o,i[0])){if(i.length===1){s.push(d)}else{s.push.apply(s,e(d,i.slice(1),n))}}r=l}return s};var Cc={EBML:E([26,69,223,163]),DocType:E([66,130]),Segment:E([24,83,128,103]),SegmentInfo:E([21,73,169,102]),Tracks:E([22,84,174,107]),Track:E([174]),TrackNumber:E([215]),DefaultDuration:E([35,227,131]),TrackEntry:E([174]),TrackType:E([131]),FlagDefault:E([136]),CodecID:E([134]),CodecPrivate:E([99,162]),VideoTrack:E([224]),AudioTrack:E([225]),Cluster:E([31,67,182,117]),Timestamp:E([231]),TimestampScale:E([42,215,177]),BlockGroup:E([160]),BlockDuration:E([155]),Block:E([161]),SimpleBlock:E([163])};var Ac=[128,64,32,16,8,4,2,1];var jc=function e(t){var i=1;for(var n=0;n=i.length){return i.length}var s=xc(i,n,false);if(I(t.bytes,s.bytes)){return n}var r=xc(i,n+s.length);return e(t,i,n+r.length+r.value+s.length)};var Pc=function e(t,i){i=Rc(i);t=E(t);var n=[];if(!i.length){return n}var s=0;while(st.length?t.length:o+a.value;var d=t.subarray(o,l);if(I(i[0],r.bytes)){if(i.length===1){n.push(d)}else{n=n.concat(e(d,i.slice(1)))}}var u=r.length+a.length+d.length;s+=u}return n};var Lc=E([0,0,0,1]);var Nc=E([0,0,1]);var Mc=E([0,0,3]);var Uc=function e(t){var i=[];var n=1;while(n>1&63}if(n.indexOf(d)!==-1){a=r+l}r+=l+(i==="h264"?1:2)}return t.subarray(0,0)};var Fc=function e(t,i,n){return Bc(t,"h264",i,n)};var qc=function e(t,i,n){return Bc(t,"h265",i,n)};var r={webm:E([119,101,98,109]),matroska:E([109,97,116,114,111,115,107,97]),flac:E([102,76,97,67]),ogg:E([79,103,103,83]),ac3:E([11,119]),riff:E([82,73,70,70]),avi:E([65,86,73]),wav:E([87,65,86,69]),"3gp":E([102,116,121,112,51,103]),mp4:E([102,116,121,112]),fmp4:E([115,116,121,112]),mov:E([102,116,121,112,113,116]),moov:E([109,111,111,118]),moof:E([109,111,111,102])};var Vc={aac:function e(t){var i=Ec(t);return I(t,[255,16],{offset:i,mask:[255,22]})},mp3:function e(t){var i=Ec(t);return I(t,[255,2],{offset:i,mask:[255,6]})},webm:function e(t){var i=Pc(t,[Cc.EBML,Cc.DocType])[0];return I(i,r.webm)},mkv:function e(t){var i=Pc(t,[Cc.EBML,Cc.DocType])[0];return I(i,r.matroska)},mp4:function e(t){if(Vc["3gp"](t)||Vc.mov(t)){return false}if(I(t,r.mp4,{offset:4})||I(t,r.fmp4,{offset:4})){return true}if(I(t,r.moof,{offset:4})||I(t,r.moov,{offset:4})){return true}},mov:function e(t){return I(t,r.mov,{offset:4})},"3gp":function e(t){return I(t,r["3gp"],{offset:4})},ac3:function e(t){var i=Ec(t);return I(t,r.ac3,{offset:i})},ts:function e(t){if(t.length<189&&t.length>=1){return t[0]===71}var i=0;while(i+1880};var Wc=9e4,Kc,Xc,Yc,Qc,Jc,Zc,eh;Kc=function(e){return e*Wc};Xc=function(e,t){return e*t};Yc=function(e){return e/Wc};Qc=function(e,t){return e/t};Jc=function(e,t){return Kc(Qc(e,t))};Zc=function(e,t){return Xc(Yc(e),t)};eh=function(e,t,i){return Yc(i?e:e-t)};var th={ONE_SECOND_IN_TS:Wc,secondsToVideoTs:Kc,secondsToAudioTs:Xc,videoTsToSeconds:Yc,audioTsToSeconds:Qc,audioTsToVideoTs:Jc,videoTsToAudioTs:Zc,metadataTsToSeconds:eh};var ih=th.ONE_SECOND_IN_TS;const nh=Ra;const sh=(e,t)=>{if(t&&t.responseURL&&e!==t.responseURL){return t.responseURL}return e};const rh=e=>{if(S.log.debug){return S.log.debug.bind(S,"VHS:",`${e} >`)}return function(){}};function P(...e){const t=S.obj||S;const i=t.merge||t.mergeOptions;return i.apply(t,e)}function D(...e){const t=S.time||S;const i=t.createTimeRanges||t.createTimeRanges;return i.apply(t,e)}function ah(i){let n="";for(let t=0;t ${r})`}return n||"empty"}const oh=1/30;const lh=oh*3;const dh=function(e,t){const i=[];let n;if(e&&e.length){for(n=0;n=i})};const ch=function(e,t){return dh(e,function(e){return e-oh>=t})};const hh=function(t){if(t.length<2){return D()}const i=[];for(let e=1;e{const i=[];if(!t||!t.length){return""}for(let e=0;e "+t.end(e))}return i.join(", ")};const mh=function(e,t,i=1){const n=e.length?e.end(e.length-1):0;return(n-t)/i};const gh=t=>{const i=[];for(let e=0;er){continue}if(i>s&&i<=r){n+=r-i;continue}n+=r-s}return n};const _h=(t,e)=>{if(!e.preload){return e.duration}let i=0;(e.parts||[]).forEach(function(e){i+=e.duration});(e.preloadHints||[]).forEach(function(e){if(e.type==="PART"){i+=t.partTargetDuration}});return i};const Th=e=>(e.segments||[]).reduce((i,n,s)=>{if(n.parts){n.parts.forEach(function(e,t){i.push({duration:e.duration,segmentIndex:s,partIndex:t,part:e,segment:n})})}else{i.push({duration:n.duration,segmentIndex:s,partIndex:null,segment:n,part:null})}return i},[]);const Sh=e=>{const t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]};const Eh=({preloadSegment:e})=>{if(!e){return}const{parts:t,preloadHints:i}=e;let n=(i||[]).reduce((e,t)=>e+(t.type==="PART"?1:0),0);n+=t&&t.length?t.length:0;return n};const wh=(e,t)=>{if(t.endList){return 0}if(e&&e.suggestedPresentationDelay){return e.suggestedPresentationDelay}const i=Sh(t).length>0;if(i&&t.serverControl&&t.serverControl.partHoldBack){return t.serverControl.partHoldBack}else if(i&&t.partTargetDuration){return t.partTargetDuration*3}else if(t.serverControl&&t.serverControl.holdBack){return t.serverControl.holdBack}else if(t.targetDuration){return t.targetDuration*3}return 0};const Ih=function(e,t){let i=0;let n=t-e.mediaSequence;let s=e.segments[n];if(s){if(typeof s.start!=="undefined"){return{result:s.start,precise:true}}if(typeof s.end!=="undefined"){return{result:s.end-s.duration,precise:true}}}while(n--){s=e.segments[n];if(typeof s.end!=="undefined"){return{result:i+s.end,precise:true}}i+=_h(e,s);if(typeof s.start!=="undefined"){return{result:i+s.start,precise:true}}}return{result:i,precise:false}};const kh=function(e,t){let i=0;let n;let s=t-e.mediaSequence;for(;ss){[n,s]=[s,n]}if(n<0){for(let e=n;e0){for(let e=d-1;e>=0;e--){const u=l[e];o+=u.duration;if(a){if(o<0){continue}}else if(o+oh<=0){continue}return{partIndex:u.partIndex,segmentIndex:u.segmentIndex,startTime:r-jh({defaultDuration:t.targetDuration,durationList:l,startIndex:d,endIndex:e})}}}return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:i}}if(d<0){for(let e=d;e<0;e++){o-=t.targetDuration;if(o<0){return{partIndex:l[0]&&l[0].partIndex||null,segmentIndex:l[0]&&l[0].segmentIndex||0,startTime:i}}}d=0}for(let e=d;e0){continue}}else if(o-oh>=0){continue}return{partIndex:u.partIndex,segmentIndex:u.segmentIndex,startTime:r+jh({defaultDuration:t.targetDuration,durationList:l,startIndex:d,endIndex:e})}}return{segmentIndex:l[l.length-1].segmentIndex,partIndex:l[l.length-1].partIndex,startTime:i}};const Oh=function(e){return e.excludeUntil&&e.excludeUntil>Date.now()};const Ph=function(e){return e.excludeUntil&&e.excludeUntil===Infinity};const Lh=function(e){const t=Oh(e);return!e.disabled&&!t};const Nh=function(e){return e.disabled};const Mh=function(t){for(let e=0;e{if(e.playlists.length===1){return true}const i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return e.playlists.filter(e=>{if(!Lh(e)){return false}return(e.attributes.BANDWIDTH||0){if(!e&&!t||!e&&t||e&&!t){return false}if(e===t){return true}if(e.id&&t.id&&e.id===t.id){return true}if(e.resolvedUri&&t.resolvedUri&&e.resolvedUri===t.resolvedUri){return true}if(e.uri&&t.uri&&e.uri===t.uri){return true}return false};const Vh=function(e,t){const i=e&&e.mediaGroups&&e.mediaGroups.AUDIO||{};let n=false;for(const s in i){for(const r in i[s]){n=t(i[s][r]);if(n){break}}if(n){break}}return!!n};const Hh=t=>{if(!t||!t.playlists||!t.playlists.length){const i=Vh(t,e=>e.playlists&&e.playlists.length||e.uri);return i}for(let e=0;eJa(e))){continue}const i=Vh(t,e=>qh(n,e));if(i){continue}return false}return true};var $h={liveEdgeDelay:wh,duration:Ah,seekable:Dh,getMediaInfoForTime:Rh,isEnabled:Lh,isDisabled:Nh,isExcluded:Oh,isIncompatible:Ph,playlistEnd:xh,isAes:Mh,hasAttribute:Uh,estimateSegmentRequestTime:Bh,isLowestEnabledRendition:Fh,isAudioOnly:Hh,playlistMatch:qh,segmentDurationWithParts:_h};const{log:zh}=S;const Gh=(e,t)=>{return`${e}-${t}`};const Wh=(e,t,i)=>{return`placeholder-uri-${e}-${t}-${i}`};const Kh=({onwarn:t,oninfo:e,manifestString:i,customTagParsers:n=[],customTagMappers:s=[],llhls:r})=>{const a=new za;if(t){a.on("warn",t)}if(e){a.on("info",e)}n.forEach(e=>a.addParser(e));s.forEach(e=>a.addTagMapper(e));a.push(i);a.end();const o=a.manifest;if(!r){["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){if(o.hasOwnProperty(e)){delete o[e]}});if(o.segments){o.segments.forEach(function(t){["parts","preloadHints"].forEach(function(e){if(t.hasOwnProperty(e)){delete t[e]}})})}}if(!o.targetDuration){let e=10;if(o.segments&&o.segments.length){e=o.segments.reduce((e,t)=>Math.max(e,t.duration),0)}if(t){t(`manifest has no targetDuration defaulting to ${e}`)}o.targetDuration=e}const l=Sh(o);if(l.length&&!o.partTargetDuration){const d=l.reduce((e,t)=>Math.max(e,t.duration),0);if(t){t(`manifest has no partTargetDuration defaulting to ${d}`);zh.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")}o.partTargetDuration=d}return o};const Xh=(s,r)=>{if(!s.mediaGroups){return}["AUDIO","SUBTITLES"].forEach(e=>{if(!s.mediaGroups[e]){return}for(const t in s.mediaGroups[e]){for(const i in s.mediaGroups[e][t]){const n=s.mediaGroups[e][t][i];r(n,e,t,i)}}})};const Yh=({playlist:e,uri:t,id:i})=>{e.id=i;e.playlistErrors_=0;if(t){e.uri=t}e.attributes=e.attributes||{}};const Qh=e=>{let t=e.playlists.length;while(t--){const i=e.playlists[t];Yh({playlist:i,id:Gh(t,i.uri)});i.resolvedUri=nh(e.uri,i.uri);e.playlists[i.id]=i;e.playlists[i.uri]=i;if(!i.attributes.BANDWIDTH){zh.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}}};const Jh=t=>{Xh(t,e=>{if(e.uri){e.resolvedUri=nh(t.uri,e.uri)}})};const Zh=(e,t)=>{const i=Gh(0,t);const n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:tv.location.href,resolvedUri:tv.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};n.playlists[i]=n.playlists[0];n.playlists[t]=n.playlists[0];return n};const ef=(o,e,l=Wh)=>{o.uri=e;for(let e=0;e{if(!e.playlists||!e.playlists.length){if(i&&s==="AUDIO"&&!e.uri){for(let e=0;e{e.set(t.id,t);return e},new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id);this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null){return[]}const n={};const s=[];this.pendingDateRanges_.forEach((e,t)=>{if(this.processedDateRanges_.has(t)){return}e.startTime=e.startDate.getTime()/1e3-this.offset_;e.processDateRange=()=>this.processDateRange(e);s.push(e);if(!e.class){return}if(n[e.class]){const i=n[e.class].push(e);e.classListIndex=i-1}else{n[e.class]=[e];e.classListIndex=0}});for(const e of s){const t=n[e.class]||[];if(e.endDate){e.endTime=e.endDate.getTime()/1e3-this.offset_}else if(e.endOnNext&&t[e.classListIndex+1]){e.endTime=t[e.classListIndex+1].startTime}else if(e.duration){e.endTime=e.startTime+e.duration}else if(e.plannedDuration){e.endTime=e.startTime+e.plannedDuration}else{e.endTime=e.startTime}}return s}trimProcessedDateRanges_(i){const e=new Map(this.processedDateRanges_);e.forEach((e,t)=>{if(e.startDate.getTime(){if(t.endList||!t.serverControl){return e}const i={};if(t.serverControl.canBlockReload){const{preloadSegment:n}=t;let e=t.mediaSequence+t.segments.length;if(n){const s=n.parts||[];const r=Eh(t)-1;if(r>-1&&r!==s.length-1){i._HLS_part=r}if(r>-1||s.length){e--}}i._HLS_msn=e}if(t.serverControl&&t.serverControl.canSkipUntil){i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"}if(Object.keys(i).length){const a=new tv.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){if(!i.hasOwnProperty(e)){return}a.searchParams.set(e,i[e])});e=a.toString()}return e};const rf=(t,i)=>{if(!t){return i}const n=P(t,i);if(t.preloadHints&&!i.preloadHints){delete n.preloadHints}if(t.parts&&!i.parts){delete n.parts}else if(t.parts&&i.parts){for(let e=0;e{const n=e.slice();const s=t.slice();i=i||0;const r=[];let a;for(let e=0;e{if(!e.resolvedUri&&e.uri){e.resolvedUri=nh(t,e.uri)}if(e.key&&!e.key.resolvedUri){e.key.resolvedUri=nh(t,e.key.uri)}if(e.map&&!e.map.resolvedUri){e.map.resolvedUri=nh(t,e.map.uri)}if(e.map&&e.map.key&&!e.map.key.resolvedUri){e.map.key.resolvedUri=nh(t,e.map.key.uri)}if(e.parts&&e.parts.length){e.parts.forEach(e=>{if(e.resolvedUri){return}e.resolvedUri=nh(t,e.uri)})}if(e.preloadHints&&e.preloadHints.length){e.preloadHints.forEach(e=>{if(e.resolvedUri){return}e.resolvedUri=nh(t,e.uri)})}};const lf=function(e){const t=e.segments||[];const i=e.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let e=0;ee===t||e.segments&&t.segments&&e.segments.length===t.segments.length&&e.endList===t.endList&&e.mediaSequence===t.mediaSequence&&e.preloadSegment===t.preloadSegment;const uf=(e,s,t=df)=>{const i=P(e,{});const n=i.playlists[s.id];if(!n){return null}if(t(n,s)){return null}s.segments=lf(s);const r=P(n,s);if(r.preloadSegment&&!s.preloadSegment){delete r.preloadSegment}if(n.segments){if(s.skip){s.segments=s.segments||[];for(let e=0;e{of(e,r.resolvedUri)});for(let e=0;e{if(!t.playlists){return}for(let e=0;e{const i=e.segments||[];const n=i[i.length-1];const s=n&&n.parts&&n.parts[n.parts.length-1];const r=s&&s.duration||n&&n.duration;if(t&&r){return r*1e3}return(e.partTargetDuration||e.targetDuration||10)*500};class hf extends nf{constructor(e,t,i={}){super();if(!e){throw new Error("A non-empty playlist URL or object is required")}this.logger_=rh("PlaylistLoader");const{withCredentials:n=false}=i;this.src=e;this.vhs_=t;this.withCredentials=n;this.addDateRangesToTextTrack_=i.addDateRangesToTextTrack;const s=t.options_;this.customTagParsers=s&&s.customTagParsers||[];this.customTagMappers=s&&s.customTagMappers||[];this.llhls=s&&s.llhls;this.dateRangesStorage_=new tf;this.state="HAVE_NOTHING";this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this);this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_);this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e){return}this.dateRangesStorage_.setOffset(e.segments);this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();if(!t.length||!this.addDateRangesToTextTrack_){return}this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA"){return}const e=this.media();let t=nh(this.main.uri,e.uri);if(this.llhls){t=sf(t,e)}this.state="HAVE_CURRENT_METADATA";this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials},(e,t)=>{if(!this.request){return}if(e){return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA")}this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})})}playlistRequestError(e,t,i){const{uri:n,id:s}=t;this.request=null;if(i){this.state=i}this.error={playlist:this.main.playlists[s],status:e.status,message:`HLS playlist request error at URL: ${n}.`,responseText:e.responseText,code:e.status>=500?4:2};this.trigger("error")}parseManifest_({url:t,manifestString:e}){return Kh({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})}haveMetadata({playlistString:e,playlistObject:t,url:i,id:n}){this.request=null;this.state="HAVE_METADATA";const s=t||this.parseManifest_({url:i,manifestString:e});s.lastRequest=Date.now();Yh({playlist:s,uri:i,id:n});const r=uf(this.main,s);this.targetDuration=s.partTargetDuration||s.targetDuration;this.pendingMedia_=null;if(r){this.main=r;this.media_=this.main.playlists[n]}else{this.trigger("playlistunchanged")}this.updateMediaUpdateTimeout_(cf(this.media(),!!r));this.trigger("loadedplaylist")}dispose(){this.trigger("dispose");this.stopRequest();tv.clearTimeout(this.mediaUpdateTimeout);tv.clearTimeout(this.finalRenditionTimeout);this.dateRangesStorage_=new tf;this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null;e.onreadystatechange=null;e.abort()}}media(i,e){if(!i){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}if(typeof i==="string"){if(!this.main.playlists[i]){throw new Error("Unknown playlist URI: "+i)}i=this.main.playlists[i]}tv.clearTimeout(this.finalRenditionTimeout);if(e){const r=(i.partTargetDuration||i.targetDuration)/2*1e3||5*1e3;this.finalRenditionTimeout=tv.setTimeout(this.media.bind(this,i,false),r);return}const n=this.state;const t=!this.media_||i.id!==this.media_.id;const s=this.main.playlists[i.id];if(s&&s.endList||i.endList&&i.segments.length){if(this.request){this.request.onreadystatechange=null;this.request.abort();this.request=null}this.state="HAVE_METADATA";this.media_=i;if(t){this.trigger("mediachanging");if(n==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}return}this.updateMediaUpdateTimeout_(cf(i,true));if(!t){return}this.state="SWITCHING_MEDIA";if(this.request){if(i.resolvedUri===this.request.url){return}this.request.onreadystatechange=null;this.request.abort();this.request=null}if(this.media_){this.trigger("mediachanging")}this.pendingMedia_=i;this.request=this.vhs_.xhr({uri:i.resolvedUri,withCredentials:this.withCredentials},(e,t)=>{if(!this.request){return}i.lastRequest=Date.now();i.resolvedUri=sh(i.resolvedUri,t);if(e){return this.playlistRequestError(this.request,i,n)}this.haveMetadata({playlistString:t.responseText,url:i.uri,id:i.id});if(n==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}})}pause(){if(this.mediaUpdateTimeout){tv.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}this.stopRequest();if(this.state==="HAVE_NOTHING"){this.started=false}if(this.state==="SWITCHING_MEDIA"){if(this.media_){this.state="HAVE_METADATA"}else{this.state="HAVE_MAIN_MANIFEST"}}else if(this.state==="HAVE_CURRENT_METADATA"){this.state="HAVE_METADATA"}}load(e){if(this.mediaUpdateTimeout){tv.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}const t=this.media();if(e){const i=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5*1e3;this.mediaUpdateTimeout=tv.setTimeout(()=>{this.mediaUpdateTimeout=null;this.load()},i);return}if(!this.started){this.start();return}if(t&&!t.endList){this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}updateMediaUpdateTimeout_(e){if(this.mediaUpdateTimeout){tv.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null}if(!this.media()||this.media().endList){return}this.mediaUpdateTimeout=tv.setTimeout(()=>{this.mediaUpdateTimeout=null;this.trigger("mediaupdatetimeout");this.updateMediaUpdateTimeout_(e)},e)}start(){this.started=true;if(typeof this.src==="object"){if(!this.src.uri){this.src.uri=tv.location.href}this.src.resolvedUri=this.src.uri;setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},(e,t)=>{if(!this.request){return}this.request=null;if(e){this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2};if(this.state==="HAVE_NOTHING"){this.started=false}return this.trigger("error")}this.src=sh(this.src,t);const i=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(i)})}srcUri(){return typeof this.src==="string"?this.src:this.src.uri}setupInitialPlaylist(e){this.state="HAVE_MAIN_MANIFEST";if(e.playlists){this.main=e;ef(this.main,this.srcUri());e.playlists.forEach(t=>{t.segments=lf(t);t.segments.forEach(e=>{of(e,t.resolvedUri)})});this.trigger("loadedplaylist");if(!this.request){this.media(this.main.playlists[0])}return}const t=this.srcUri()||tv.location.href;this.main=Zh(e,t);this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id});this.trigger("loadedmetadata")}}const{xhr:ff}=S;const pf=function(e,t,i,n){const s=e.responseType==="arraybuffer"?e.response:e.responseText;if(!t&&s){e.responseTime=Date.now();e.roundTripTime=e.responseTime-e.requestTime;e.bytesReceived=s.byteLength||s.length;if(!e.bandwidth){e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3)}}if(i.headers){e.responseHeaders=i.headers}if(t&&t.code==="ETIMEDOUT"){e.timedout=true}if(!t&&!e.aborted&&i.statusCode!==200&&i.statusCode!==206&&i.statusCode!==0){t=new Error("XHR Failed with a response of: "+(e&&(s||e.responseText)))}n(t,e)};const mf=(e,t)=>{if(!e||!e.size){return}let i=t;e.forEach(e=>{i=e(i)});return i};const gf=(e,t,i,n)=>{if(!e||!e.size){return}e.forEach(e=>{e(t,i,n)})};const vf=function(){const e=function e(t,i){t=P({timeout:45e3},t);const n=e.beforeRequest||S.Vhs.xhr.beforeRequest;const s=e._requestCallbackSet||S.Vhs.xhr._requestCallbackSet||new Set;const r=e._responseCallbackSet||S.Vhs.xhr._responseCallbackSet;if(n&&typeof n==="function"){S.log.warn("beforeRequest is deprecated, use onRequest instead.");s.add(n)}const a=S.Vhs.xhr.original===true?ff:S.Vhs.xhr;const o=mf(s,t);s.delete(n);const l=a(o||t,function(e,t){gf(r,l,e,t);return pf(l,e,t,i)});const d=l.abort;l.abort=function(){l.aborted=true;return d.apply(l,arguments)};l.uri=t.uri;l.requestTime=Date.now();return l};e.original=true;return e};const yf=function(e){let t;const i=e.offset;if(typeof e.offset==="bigint"||typeof e.length==="bigint"){t=tv.BigInt(e.offset)+tv.BigInt(e.length)-tv.BigInt(1)}else{t=e.offset+e.length-1}return"bytes="+i+"-"+t};const bf=function(e){const t={};if(e.byterange){t.Range=yf(e.byterange)}return t};const _f=function(e,t){return e.start(t)+"-"+e.end(t)};const Tf=function(e,t){const i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")};const Sf=function(e){if(e>=32&&e<126){return String.fromCharCode(e)}return"."};const Ef=function(i){const n={};Object.keys(i).forEach(e=>{const t=i[e];if(co(t)){n[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}}else{n[e]=t}});return n};const wf=function(e){const t=e.byterange||{length:Infinity,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")};const If=function(e){return e.resolvedUri};const kf=e=>{const t=Array.prototype.slice.call(e);const i=16;let n="";let s;let r;for(let e=0;ekf(e);const Af=e=>{let t="";let i;for(i=0;i{if(!t.dateTimeObject){return null}const i=t.videoTimingInfo.transmuxerPrependedSeconds;const n=t.videoTimingInfo.transmuxedPresentationStart;const s=n+i;const r=e-s;return new Date(t.dateTimeObject.getTime()+r*1e3)};const Rf=e=>{return e.transmuxedPresentationEnd-e.transmuxedPresentationStart-e.transmuxerPrependedSeconds};const Of=(e,t)=>{let i;try{i=new Date(e)}catch(e){return null}if(!t||!t.segments||t.segments.length===0){return null}let n=t.segments[0];if(io){return null}if(i>new Date(r)){n=s}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:$h.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"}};const Pf=(t,i)=>{if(!i||!i.segments||i.segments.length===0){return null}let n=0;let s;for(let e=0;en){if(t>n+e.duration*xf){return null}s=e}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:n-s.duration,type:s.videoTimingInfo?"accurate":"estimate"}};const Lf=(e,t)=>{let i;let n;try{i=new Date(e);n=new Date(t)}catch(e){}const s=i.getTime();const r=n.getTime();return(r-s)/1e3};const Nf=t=>{if(!t.segments||t.segments.length===0){return false}for(let e=0;e{if(!i){throw new Error("getProgramTime: callback must be provided")}if(!e||t===undefined){return i({message:"getProgramTime: playlist and time must be provided"})}const n=Pf(t,e);if(!n){return i({message:"valid programTime was not found"})}if(n.type==="estimate"){return i({message:"Accurate programTime could not be determined."+" Please seek to e.seekTime and try again",seekTime:n.estimatedStart})}const s={mediaSeconds:t};const r=Df(t,n.segment);if(r){s.programDateTime=r.toISOString()}return i(null,s)};const Uf=({programTime:e,playlist:t,retryCount:i=2,seekTo:n,pauseAfterSeek:s=true,tech:r,callback:a})=>{if(!a){throw new Error("seekToProgramTime: callback must be provided")}if(typeof e==="undefined"||!t||!n){return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"})}if(!t.endList&&!r.hasStarted_){return a({message:"player must be playing a live stream to start buffering"})}if(!Nf(t)){return a({message:"programDateTime tags must be provided in the manifest "+t.resolvedUri})}const o=Of(e,t);if(!o){return a({message:`${e} was not found in the stream`})}const l=o.segment;const d=Lf(l.dateTimeObject,e);if(o.type==="estimate"){if(i===0){return a({message:`${e} is not buffered yet. Try again`})}n(o.estimatedStart+d);r.one("seeked",()=>{Uf({programTime:e,playlist:t,retryCount:i-1,seekTo:n,pauseAfterSeek:s,tech:r,callback:a})});return}const u=l.start+d;const c=()=>{return a(null,r.currentTime())};r.one("seeked",c);if(s){r.pause()}n(u)};const Bf=(e,t)=>{if(e.readyState===4){return t()}return};const Ff=(e,t,s)=>{let r=[];let a;let o=false;const l=function(e,t,i,n){t.abort();o=true;return s(e,t,i,n)};const n=function(e,t){if(o){return}if(e){return l(e,t,"",r)}const i=t.responseText.substring(r&&r.byteLength||0,t.responseText.length);r=vo(r,go(i,true));a=a||Ec(r);if(r.length<10||a&&r.lengthl(e,t,"",r))}const n=zc(r);if(n==="ts"&&r.length<188){return Bf(t,()=>l(e,t,"",r))}if(!n&&r.length<376){return Bf(t,()=>l(e,t,"",r))}return l(null,t,n,r)};const i={uri:e,beforeSend(i){i.overrideMimeType("text/plain; charset=x-user-defined");i.addEventListener("progress",function({total:e,loaded:t}){return pf(i,null,{statusCode:i.status},n)})}};const d=t(i,function(e,t){return pf(d,e,t,n)});return d};const{EventTarget:qf}=S;const Vf=function(t,i){if(!df(t,i)){return false}if(t.sidx&&i.sidx&&(t.sidx.offset!==i.sidx.offset||t.sidx.length!==i.sidx.length)){return false}else if(!t.sidx&&i.sidx||t.sidx&&!i.sidx){return false}if(t.segments&&!i.segments||!t.segments&&i.segments){return false}if(!t.segments&&!i.segments){return true}for(let e=0;e{const s=n.attributes.NAME||i;return`placeholder-uri-${e}-${t}-${s}`};const $f=({mainXml:e,srcUrl:t,clientOffset:i,sidxMapping:n,previousManifest:s})=>{const r=fc(e,{manifestUri:t,clientOffset:i,sidxMapping:n,previousManifest:s});ef(r,t,Hf);return r};const zf=(s,r)=>{Xh(s,(e,t,i,n)=>{if(!(n in r.mediaGroups[t][i])){delete s.mediaGroups[t][i][n]}})};const Gf=(e,t,i)=>{let a=true;let o=P(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts});for(let e=0;e{if(t.playlists&&t.playlists.length){const r=t.playlists[0].id;const e=uf(o,t.playlists[0],Vf);if(e){o=e;if(!(s in o.mediaGroups[i][n])){o.mediaGroups[i][n][s]=t}o.mediaGroups[i][n][s].playlists[0]=o.playlists[r];a=false}}});zf(o,t);if(t.minimumUpdatePeriod!==e.minimumUpdatePeriod){a=false}if(a){return null}return o};const Wf=(e,t)=>{const i=Boolean(!e.map&&!t.map);const n=i||Boolean(e.map&&t.map&&e.map.byterange.offset===t.map.byterange.offset&&e.map.byterange.length===t.map.byterange.length);return n&&e.uri===t.uri&&e.byterange.offset===t.byterange.offset&&e.byterange.length===t.byterange.length};const Kf=(e,t)=>{const i={};for(const n in e){const s=e[n];const r=s.sidx;if(r){const a=Tu(r);if(!t[a]){break}const o=t[a].sidxInfo;if(Wf(o,r)){i[a]=t[a]}}}return i};const Xf=(e,r)=>{const t=Kf(e.playlists,r);let a=t;Xh(e,(e,t,i,n)=>{if(e.playlists&&e.playlists.length){const s=e.playlists;a=P(a,Kf(s,r))}});return a};class Yf extends qf{constructor(e,t,i={},n){super();this.mainPlaylistLoader_=n||this;if(!n){this.isMain_=true}const{withCredentials:s=false}=i;this.vhs_=t;this.withCredentials=s;this.addMetadataToTextTrack=i.addMetadataToTextTrack;if(!e){throw new Error("A non-empty playlist URL or object is required")}this.on("minimumUpdatePeriod",()=>{this.refreshXml_()});this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)});this.state="HAVE_NOTHING";this.loadedPlaylists_={};this.logger_=rh("DashPlaylistLoader");if(this.isMain_){this.mainPlaylistLoader_.srcUrl=e;this.mainPlaylistLoader_.sidxMapping_={}}else{this.childPlaylist_=e}}requestErrored_(e,t,i){if(!this.request){return true}this.request=null;if(e){this.error=typeof e==="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2};if(i){this.state=i}this.trigger("error");return true}}addSidxSegments_(a,s,r){const o=a.sidx&&Tu(a.sidx);if(!a.sidx||!o||this.mainPlaylistLoader_.sidxMapping_[o]){this.mediaRequest_=tv.setTimeout(()=>r(false),0);return}const l=sh(a.sidx.resolvedUri);const d=(e,t)=>{if(this.requestErrored_(e,t,s)){return}const i=this.mainPlaylistLoader_.sidxMapping_;let n;try{n=_c(E(t.response).subarray(8))}catch(e){this.requestErrored_(e,t,s);return}i[o]={sidxInfo:a.sidx,sidx:n};hu(a,n,a.sidx.resolvedUri);return r(true)};this.request=Ff(l,this.vhs_.xhr,(e,t,i,n)=>{if(e){return d(e,t)}if(!i||i!=="mp4"){return d({status:t.status,message:`Unsupported ${i||"unknown"} container type for sidx segment at URL: ${l}`,response:"",playlist:a,internal:true,playlistExclusionDuration:Infinity,code:2},t)}const{offset:s,length:r}=a.sidx.byterange;if(n.length>=r+s){return d(e,{response:n.subarray(s,s+r),status:t.status,uri:t.uri})}this.request=this.vhs_.xhr({uri:l,responseType:"arraybuffer",headers:bf({byterange:a.sidx.byterange})},d)})}dispose(){this.trigger("dispose");this.stopRequest();this.loadedPlaylists_={};tv.clearTimeout(this.minimumUpdatePeriodTimeout_);tv.clearTimeout(this.mediaRequest_);tv.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;this.mediaRequest_=null;this.minimumUpdatePeriodTimeout_=null;if(this.mainPlaylistLoader_.createMupOnMedia_){this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_);this.mainPlaylistLoader_.createMupOnMedia_=null}this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null;e.onreadystatechange=null;e.abort()}}media(t){if(!t){return this.media_}if(this.state==="HAVE_NOTHING"){throw new Error("Cannot switch media playlist from "+this.state)}const i=this.state;if(typeof t==="string"){if(!this.mainPlaylistLoader_.main.playlists[t]){throw new Error("Unknown playlist URI: "+t)}t=this.mainPlaylistLoader_.main.playlists[t]}const e=!this.media_||t.id!==this.media_.id;if(e&&this.loadedPlaylists_[t.id]&&this.loadedPlaylists_[t.id].endList){this.state="HAVE_METADATA";this.media_=t;if(e){this.trigger("mediachanging");this.trigger("mediachange")}return}if(!e){return}if(this.media_){this.trigger("mediachanging")}this.addSidxSegments_(t,i,e=>{this.haveMetadata({startingState:i,playlist:t})})}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA";this.loadedPlaylists_[t.id]=t;this.mediaRequest_=null;this.refreshMedia_(t.id);if(e==="HAVE_MAIN_MANIFEST"){this.trigger("loadedmetadata")}else{this.trigger("mediachange")}}pause(){if(this.mainPlaylistLoader_.createMupOnMedia_){this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_);this.mainPlaylistLoader_.createMupOnMedia_=null}this.stopRequest();tv.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;if(this.isMain_){tv.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_);this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null}if(this.state==="HAVE_NOTHING"){this.started=false}}load(e){tv.clearTimeout(this.mediaUpdateTimeout);this.mediaUpdateTimeout=null;const t=this.media();if(e){const i=t?t.targetDuration/2*1e3:5*1e3;this.mediaUpdateTimeout=tv.setTimeout(()=>this.load(),i);return}if(!this.started){this.start();return}if(t&&!t.endList){if(this.isMain_&&!this.minimumUpdatePeriodTimeout_){this.trigger("minimumUpdatePeriod");this.updateMinimumUpdatePeriodTimeout_()}this.trigger("mediaupdatetimeout")}else{this.trigger("loadedplaylist")}}start(){this.started=true;if(!this.isMain_){this.mediaRequest_=tv.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_();if(!this.hasPendingRequest()&&!this.media_){this.media(this.mainPlaylistLoader_.main.playlists[0])}})}requestMain_(n){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},(e,t)=>{if(this.requestErrored_(e,t)){if(this.state==="HAVE_NOTHING"){this.started=false}return}const i=t.responseText!==this.mainPlaylistLoader_.mainXml_;this.mainPlaylistLoader_.mainXml_=t.responseText;if(t.responseHeaders&&t.responseHeaders.date){this.mainLoaded_=Date.parse(t.responseHeaders.date)}else{this.mainLoaded_=Date.now()}this.mainPlaylistLoader_.srcUrl=sh(this.mainPlaylistLoader_.srcUrl,t);if(i){this.handleMain_();this.syncClientServerClock_(()=>{return n(t,i)});return}return n(t,i)})}syncClientServerClock_(n){const s=pc(this.mainPlaylistLoader_.mainXml_);if(s===null){this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now();return n()}if(s.method==="DIRECT"){this.mainPlaylistLoader_.clientOffset_=s.value-Date.now();return n()}this.request=this.vhs_.xhr({uri:nh(this.mainPlaylistLoader_.srcUrl,s.value),method:s.method,withCredentials:this.withCredentials},(e,t)=>{if(!this.request){return}if(e){this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now();return n()}let i;if(s.method==="HEAD"){if(!t.responseHeaders||!t.responseHeaders.date){i=this.mainLoaded_}else{i=Date.parse(t.responseHeaders.date)}}else{i=Date.parse(t.responseText)}this.mainPlaylistLoader_.clientOffset_=i-Date.now();n()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST";if(this.isMain_){this.trigger("loadedplaylist")}else if(!this.media_){this.media(this.childPlaylist_)}}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main;let t=$f({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});if(e){t=Gf(e,t,this.mainPlaylistLoader_.sidxMapping_)}this.mainPlaylistLoader_.main=t?t:e;const i=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(i&&i!==this.mainPlaylistLoader_.srcUrl){this.mainPlaylistLoader_.srcUrl=i}if(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod){this.updateMinimumUpdatePeriodTimeout_()}this.addEventStreamToMetadataTrack_(t);return Boolean(t)}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;if(e.createMupOnMedia_){e.off("loadedmetadata",e.createMupOnMedia_);e.createMupOnMedia_=null}if(e.minimumUpdatePeriodTimeout_){tv.clearTimeout(e.minimumUpdatePeriodTimeout_);e.minimumUpdatePeriodTimeout_=null}let t=e.main&&e.main.minimumUpdatePeriod;if(t===0){if(e.media()){t=e.media().targetDuration*1e3}else{e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_;e.one("loadedmetadata",e.createMupOnMedia_)}}if(typeof t!=="number"||t<=0){if(t<0){this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`)}return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=tv.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null;t.trigger("minimumUpdatePeriod");t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{if(!t){return}if(this.media_){this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]}this.mainPlaylistLoader_.sidxMapping_=Xf(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_);this.addSidxSegments_(this.media(),this.state,e=>{this.refreshMedia_(this.media().id)})})}refreshMedia_(e){if(!e){throw new Error("refreshMedia_ must take a media id")}if(this.media_&&this.isMain_){this.handleMain_()}const t=this.mainPlaylistLoader_.main.playlists;const i=!this.media_||this.media_!==t[e];if(i){this.media_=t[e]}else{this.trigger("playlistunchanged")}if(!this.mediaUpdateTimeout){const n=()=>{if(this.media().endList){return}this.mediaUpdateTimeout=tv.setTimeout(()=>{this.trigger("mediaupdatetimeout");n()},cf(this.media(),Boolean(i)))};n()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(e=>{return{cueTime:e.start,frames:[{data:e.messageData}]}});this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}}var R={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 Qf=t=>{const i=new Uint8Array(new ArrayBuffer(t.length));for(let e=0;e-1};this.trigger=function(e){var t,i,n,s;t=r[e];if(!t){return}if(arguments.length===2){n=t.length;for(i=0;i>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))};H=function(){return d(u.ftyp,le,de,le,ue)};te=function(e){return d(u.hdlr,fe[e])};$=function(e){return d(u.mdat,e)};ee=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,e.duration&255,85,196,0,0]);if(e.samplerate){t[12]=e.samplerate>>>24&255;t[13]=e.samplerate>>>16&255;t[14]=e.samplerate>>>8&255;t[15]=e.samplerate&255}return d(u.mdhd,t)};Z=function(e){return d(u.mdia,ee(e),te(e.type),G(e))};z=function(e){return d(u.mfhd,new Uint8Array([0,0,0,0,(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255]))};G=function(e){return d(u.minf,e.type==="video"?d(u.vmhd,pe):d(u.smhd,me),q(),ne(e))};W=function(e,t){var i=[],n=t.length;while(n--){i[n]=re(t[n])}return d.apply(null,[u.moof,z(e)].concat(i))};K=function(e){var t=e.length,i=[];while(t--){i[t]=Q(e[t])}return d.apply(null,[u.moov,Y(4294967295)].concat(i).concat(X(e)))};X=function(e){var t=e.length,i=[];while(t--){i[t]=ae(e[t])}return d.apply(null,[u.mvex].concat(i))};Y=function(e){var t=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(e&4278190080)>>24,(e&16711680)>>16,(e&65280)>>8,e&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return d(u.mvhd,t)};ie=function(e){var t=e.samples||[],i=new Uint8Array(4+t.length),n,s;for(s=0;s>>8);n.push(t[r].byteLength&255);n=n.concat(Array.prototype.slice.call(t[r]))}for(r=0;r>>8);s.push(i[r].byteLength&255);s=s.concat(Array.prototype.slice.call(i[r]))}a=[u.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,(e.width&65280)>>8,e.width&255,(e.height&65280)>>8,e.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),d(u.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([t.length],n,[i.length],s))),d(u.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))];if(e.sarRatio){var o=e.sarRatio[0],l=e.sarRatio[1];a.push(d(u.pasp,new Uint8Array([(o&4278190080)>>24,(o&16711680)>>16,(o&65280)>>8,o&255,(l&4278190080)>>24,(l&16711680)>>16,(l&65280)>>8,l&255])))}return d.apply(null,a)};i=function(e){return d(u.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(e.channelcount&65280)>>8,e.channelcount&255,(e.samplesize&65280)>>8,e.samplesize&255,0,0,0,0,(e.samplerate&65280)>>8,e.samplerate&255,0,0]),V(e))}})();J=function(e){var t=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,0,(e.duration&4278190080)>>24,(e.duration&16711680)>>16,(e.duration&65280)>>8,e.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(e.width&65280)>>8,e.width&255,0,0,(e.height&65280)>>8,e.height&255,0,0]);return d(u.tkhd,t)};re=function(e){var t,i,n,s,r,a,o;t=d(u.tfhd,new Uint8Array([0,0,0,58,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0]));a=Math.floor(e.baseMediaDecodeTime/F);o=Math.floor(e.baseMediaDecodeTime%F);i=d(u.tfdt,new Uint8Array([1,0,0,0,a>>>24&255,a>>>16&255,a>>>8&255,a&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255]));r=32+20+8+16+8+8;if(e.type==="audio"){n=oe(e,r);return d(u.traf,t,i,n)}s=ie(e);n=oe(e,s.length+r);return d(u.traf,t,i,n,s)};Q=function(e){e.duration=e.duration||4294967295;return d(u.trak,J(e),Z(e))};ae=function(e){var t=new Uint8Array([0,0,0,0,(e.id&4278190080)>>24,(e.id&16711680)>>16,(e.id&65280)>>8,e.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);if(e.type!=="video"){t[t.length-1]=0}return d(u.trex,t)};(function(){var i,n,l;l=function(e,t){var i=0,n=0,s=0,r=0;if(e.length){if(e[0].duration!==undefined){i=1}if(e[0].size!==undefined){n=2}if(e[0].flags!==undefined){s=4}if(e[0].compositionTimeOffset!==undefined){r=8}}return[0,0,i|n|s|r,1,(e.length&4278190080)>>>24,(e.length&16711680)>>>16,(e.length&65280)>>>8,e.length&255,(t&4278190080)>>>24,(t&16711680)>>>16,(t&65280)>>>8,t&255]};n=function(e,t){var i,n,s,r,a,o;r=e.samples||[];t+=8+12+16*r.length;s=l(r,t);n=new Uint8Array(s.length+r.length*16);n.set(s);i=s.length;for(o=0;o>>24;n[i++]=(a.duration&16711680)>>>16;n[i++]=(a.duration&65280)>>>8;n[i++]=a.duration&255;n[i++]=(a.size&4278190080)>>>24;n[i++]=(a.size&16711680)>>>16;n[i++]=(a.size&65280)>>>8;n[i++]=a.size&255;n[i++]=a.flags.isLeading<<2|a.flags.dependsOn;n[i++]=a.flags.isDependedOn<<6|a.flags.hasRedundancy<<4|a.flags.paddingValue<<1|a.flags.isNonSyncSample;n[i++]=a.flags.degradationPriority&240<<8;n[i++]=a.flags.degradationPriority&15;n[i++]=(a.compositionTimeOffset&4278190080)>>>24;n[i++]=(a.compositionTimeOffset&16711680)>>>16;n[i++]=(a.compositionTimeOffset&65280)>>>8;n[i++]=a.compositionTimeOffset&255}return d(u.trun,n)};i=function(e,t){var i,n,s,r,a,o;r=e.samples||[];t+=8+12+8*r.length;s=l(r,t);i=new Uint8Array(s.length+r.length*8);i.set(s);n=s.length;for(o=0;o>>24;i[n++]=(a.duration&16711680)>>>16;i[n++]=(a.duration&65280)>>>8;i[n++]=a.duration&255;i[n++]=(a.size&4278190080)>>>24;i[n++]=(a.size&16711680)>>>16;i[n++]=(a.size&65280)>>>8;i[n++]=a.size&255}return d(u.trun,i)};oe=function(e,t){if(e.type==="audio"){return i(e,t)}return n(e,t)}})();var Te={ftyp:H,mdat:$,moof:W,moov:K,initSegment:function(e){var t=H(),i=K(e),n;n=new Uint8Array(t.byteLength+i.byteLength);n.set(t);n.set(i,t.byteLength);return n}};var Se=function(e){var t,i,n=[],s=[];s.byteLength=0;s.nalCount=0;s.duration=0;n.byteLength=0;for(t=0;t1){t=e.shift();e.byteLength-=t.byteLength;e.nalCount-=t.nalCount;e[0][0].dts=t.dts;e[0][0].pts=t.pts;e[0][0].duration+=t.duration}return e};var Ie=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}};var ke=function(e,t){var i=Ie();i.dataOffset=t;i.compositionTimeOffset=e.pts-e.dts;i.duration=e.duration;i.size=4*e.length;i.size+=e.byteLength;if(e.keyFrame){i.flags.dependsOn=2;i.flags.isNonSyncSample=0}return i};var Ce=function(e,t){var i,n,s,r,a,o=t||0,l=[];for(i=0;ize.ONE_SECOND_IN_TS/2){return}d=$e()[e.samplerate];if(!d){d=t[0].data}for(u=0;u=i){return e}t.minSegmentDts=Infinity;return e.filter(function(e){if(e.dts>=i){t.minSegmentDts=Math.min(t.minSegmentDts,e.dts);t.minSegmentPts=t.minSegmentDts;return true}return false})};var Xe=function(e){var t,i,n=[];for(t=0;t=this.virtualRowCount&&typeof this.beforeRowOverflow==="function"){this.beforeRowOverflow(e)}if(this.rows.length>0){this.rows.push("");this.rowIdx++}while(this.rows.length>this.virtualRowCount){this.rows.shift();this.rowIdx--}};a.prototype.isEmpty=function(){if(this.rows.length===0){return true}else if(this.rows.length===1){return this.rows[0]===""}return false};a.prototype.addText=function(e){this.rows[this.rowIdx]+=e};a.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var mt=function(e,t,i){this.serviceNum=e;this.text="";this.currentWindow=new a(-1);this.windows=[];this.stream=i;if(typeof t==="string"){this.createTextDecoder(t)}};mt.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++){this.windows[i]=new a(i);if(typeof t==="function"){this.windows[i].beforeRowOverflow=t}}};mt.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]};mt.prototype.createTextDecoder=function(t){if(typeof TextDecoder==="undefined"){this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"})}else{try{this.textDecoder_=new TextDecoder(t)}catch(e){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+t+" encoding. "+e})}}};var o=function(e){e=e||{};o.prototype.init.call(this);var t=this;var i=e.captionServices||{};var n={};var s;Object.keys(i).forEach(e=>{s=i[e];if(/^SERVICE/.test(e)){n[e]=s.encoding}});this.serviceEncodings=n;this.current708Packet=null;this.services={};this.push=function(e){if(e.type===3){t.new708Packet();t.add708Bytes(e)}else{if(t.current708Packet===null){t.new708Packet()}t.add708Bytes(e)}}};o.prototype=new ut;o.prototype.new708Packet=function(){if(this.current708Packet!==null){this.push708Packet()}this.current708Packet={data:[],ptsVals:[]}};o.prototype.add708Bytes=function(e){var t=e.ccData;var i=t>>>8;var n=t&255;this.current708Packet.ptsVals.push(e.pts);this.current708Packet.data.push(i);this.current708Packet.data.push(n)};o.prototype.push708Packet=function(){var e=this.current708Packet;var t=e.data;var i=null;var n=null;var s=0;var r=t[s++];e.seq=r>>6;e.sizeCode=r&63;for(;s>5;n=r&31;if(i===7&&n>0){r=t[s++];i=r}this.pushServiceBlock(i,s,n);if(n>0){s+=n-1}}};o.prototype.pushServiceBlock=function(e,t,i){var n;var s=t;var r=this.current708Packet.data;var a=this.services[e];if(!a){a=this.initService(e,s)}for(;s>5;r.rowLock=(n&16)>>4;r.columnLock=(n&8)>>3;r.priority=n&7;n=i[++e];r.relativePositioning=(n&128)>>7;r.anchorVertical=n&127;n=i[++e];r.anchorHorizontal=n;n=i[++e];r.anchorPoint=(n&240)>>4;r.rowCount=n&15;n=i[++e];r.columnCount=n&63;n=i[++e];r.windowStyle=(n&56)>>3;r.penStyle=n&7;r.virtualRowCount=r.rowCount+1;return e};o.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data;var n=i[e];var s=t.currentWindow.winAttr;n=i[++e];s.fillOpacity=(n&192)>>6;s.fillRed=(n&48)>>4;s.fillGreen=(n&12)>>2;s.fillBlue=n&3;n=i[++e];s.borderType=(n&192)>>6;s.borderRed=(n&48)>>4;s.borderGreen=(n&12)>>2;s.borderBlue=n&3;n=i[++e];s.borderType+=(n&128)>>5;s.wordWrap=(n&64)>>6;s.printDirection=(n&48)>>4;s.scrollDirection=(n&12)>>2;s.justify=n&3;n=i[++e];s.effectSpeed=(n&240)>>4;s.effectDirection=(n&12)>>2;s.displayEffect=n&3;return e};o.prototype.flushDisplayed=function(e,t){var i=[];for(var n=0;n<8;n++){if(t.windows[n].visible&&!t.windows[n].isEmpty()){i.push(t.windows[n].getText())}}t.endPts=e;t.text=i.join("\n\n");this.pushCaption(t);t.startPts=e};o.prototype.pushCaption=function(e){if(e.text!==""){this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum});e.text="";e.startPts=e.endPts}};o.prototype.displayWindows=function(e,t){var i=this.current708Packet.data;var n=i[++e];var s=this.getPts(e);this.flushDisplayed(s,t);for(var r=0;r<8;r++){if(n&1<>4;s.offset=(n&12)>>2;s.penSize=n&3;n=i[++e];s.italics=(n&128)>>7;s.underline=(n&64)>>6;s.edgeType=(n&56)>>3;s.fontStyle=n&7;return e};o.prototype.setPenColor=function(e,t){var i=this.current708Packet.data;var n=i[e];var s=t.currentWindow.penColor;n=i[++e];s.fgOpacity=(n&192)>>6;s.fgRed=(n&48)>>4;s.fgGreen=(n&12)>>2;s.fgBlue=n&3;n=i[++e];s.bgOpacity=(n&192)>>6;s.bgRed=(n&48)>>4;s.bgGreen=(n&12)>>2;s.bgBlue=n&3;n=i[++e];s.edgeRed=(n&48)>>4;s.edgeGreen=(n&12)>>2;s.edgeBlue=n&3;return e};o.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data;var n=i[e];var s=t.currentWindow.penLoc;t.currentWindow.pendingNewLine=true;n=i[++e];s.row=n&15;n=i[++e];s.column=n&63;return e};o.prototype.reset=function(e,t){var i=this.getPts(e);this.flushDisplayed(i,t);return this.initService(t.serviceNum,e)};var gt={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496};var vt=function(e){if(e===null){return""}e=gt[e]||e;return String.fromCharCode(e)};var yt=14;var bt=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152];var c=function(){var e=[],t=yt+1;while(t--){e.push({text:"",indent:0,offset:0})}return e};var l=function(e,t){l.prototype.init.call(this);this.field_=e||0;this.dataChannel_=t||0;this.name_="CC"+((this.field_<<1|this.dataChannel_)+1);this.setConstants();this.reset();this.push=function(e){var t,i,n,s,r;t=e.ccData&32639;if(t===this.lastControlCode_){this.lastControlCode_=null;return}if((t&61440)===4096){this.lastControlCode_=t}else if(t!==this.PADDING_){this.lastControlCode_=null}n=t>>>8;s=t&255;if(t===this.PADDING_){return}else if(t===this.RESUME_CAPTION_LOADING_){this.mode_="popOn"}else if(t===this.END_OF_CAPTION_){this.mode_="popOn";this.clearFormatting(e.pts);this.flushDisplayed(e.pts);i=this.displayed_;this.displayed_=this.nonDisplayed_;this.nonDisplayed_=i;this.startPts_=e.pts}else if(t===this.ROLL_UP_2_ROWS_){this.rollUpRows_=2;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_3_ROWS_){this.rollUpRows_=3;this.setRollUp(e.pts)}else if(t===this.ROLL_UP_4_ROWS_){this.rollUpRows_=4;this.setRollUp(e.pts)}else if(t===this.CARRIAGE_RETURN_){this.clearFormatting(e.pts);this.flushDisplayed(e.pts);this.shiftRowsUp_();this.startPts_=e.pts}else if(t===this.BACKSPACE_){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1)}else{this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1)}}else if(t===this.ERASE_DISPLAYED_MEMORY_){this.flushDisplayed(e.pts);this.displayed_=c()}else if(t===this.ERASE_NON_DISPLAYED_MEMORY_){this.nonDisplayed_=c()}else if(t===this.RESUME_DIRECT_CAPTIONING_){if(this.mode_!=="paintOn"){this.flushDisplayed(e.pts);this.displayed_=c()}this.mode_="paintOn";this.startPts_=e.pts}else if(this.isSpecialCharacter(n,s)){n=(n&3)<<8;r=vt(n|s);this[this.mode_](e.pts,r);this.column_++}else if(this.isExtCharacter(n,s)){if(this.mode_==="popOn"){this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1)}else{this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1)}n=(n&3)<<8;r=vt(n|s);this[this.mode_](e.pts,r);this.column_++}else if(this.isMidRowCode(n,s)){this.clearFormatting(e.pts);this[this.mode_](e.pts," ");this.column_++;if((s&14)===14){this.addFormatting(e.pts,["i"])}if((s&1)===1){this.addFormatting(e.pts,["u"])}}else if(this.isOffsetControlCode(n,s)){const o=s&3;this.nonDisplayed_[this.row_].offset=o;this.column_+=o}else if(this.isPAC(n,s)){var a=bt.indexOf(t&7968);if(this.mode_==="rollUp"){if(a-this.rollUpRows_+1<0){a=this.rollUpRows_-1}this.setRollUp(e.pts,a)}if(a!==this.row_){this.clearFormatting(e.pts);this.row_=a}if(s&1&&this.formatting_.indexOf("u")===-1){this.addFormatting(e.pts,["u"])}if((t&16)===16){const l=(t&14)>>1;this.column_=l*4;this.nonDisplayed_[this.row_].indent+=l}if(this.isColorPAC(s)){if((s&14)===14){this.addFormatting(e.pts,["i"])}}}else if(this.isNormalChar(n)){if(s===0){s=null}r=vt(n);r+=vt(s);this[this.mode_](e.pts,r);this.column_+=r.length}}};l.prototype=new ut;l.prototype.flushDisplayed=function(e){const i=e=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+e+"."})};const n=[];this.displayed_.forEach((e,t)=>{if(e&&e.text&&e.text.length){try{e.text=e.text.trim()}catch(e){i(t)}if(e.text.length){n.push({text:e.text,line:t+1,position:10+Math.min(70,e.indent*10)+e.offset*2.5})}}else if(e===undefined||e===null){i(t)}});if(n.length){this.trigger("data",{startPts:this.startPts_,endPts:e,content:n,stream:this.name_})}};l.prototype.reset=function(){this.mode_="popOn";this.topRow_=0;this.startPts_=0;this.displayed_=c();this.nonDisplayed_=c();this.lastControlCode_=null;this.column_=0;this.row_=yt;this.rollUpRows_=2;this.formatting_=[]};l.prototype.setConstants=function(){if(this.dataChannel_===0){this.BASE_=16;this.EXT_=17;this.CONTROL_=(20|this.field_)<<8;this.OFFSET_=23}else if(this.dataChannel_===1){this.BASE_=24;this.EXT_=25;this.CONTROL_=(28|this.field_)<<8;this.OFFSET_=31}this.PADDING_=0;this.RESUME_CAPTION_LOADING_=this.CONTROL_|32;this.END_OF_CAPTION_=this.CONTROL_|47;this.ROLL_UP_2_ROWS_=this.CONTROL_|37;this.ROLL_UP_3_ROWS_=this.CONTROL_|38;this.ROLL_UP_4_ROWS_=this.CONTROL_|39;this.CARRIAGE_RETURN_=this.CONTROL_|45;this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41;this.BACKSPACE_=this.CONTROL_|33;this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44;this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46};l.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63};l.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63};l.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47};l.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35};l.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127};l.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127};l.prototype.isNormalChar=function(e){return e>=32&&e<=127};l.prototype.setRollUp=function(e,t){if(this.mode_!=="rollUp"){this.row_=yt;this.mode_="rollUp";this.flushDisplayed(e);this.nonDisplayed_=c();this.displayed_=c()}if(t!==undefined&&t!==this.row_){for(var i=0;i"},"");this[this.mode_](e,i)};l.prototype.clearFormatting=function(e){if(!this.formatting_.length){return}var t=this.formatting_.reverse().reduce(function(e,t){return e+""},"");this.formatting_=[];this[this.mode_](e,t)};l.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_].text;i+=t;this.nonDisplayed_[this.row_].text=i};l.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_].text;i+=t;this.displayed_[this.row_].text=i};l.prototype.shiftRowsUp_=function(){var e;for(e=0;et){i=-1}while(Math.abs(t-e)>wt){e+=i*Et}return e};var Ct=function(e){var t,i;Ct.prototype.init.call(this);this.type_=e||It;this.push=function(e){if(this.type_!==It&&e.type!==this.type_){return}if(i===undefined){i=e.dts}e.dts=kt(e.dts,i);e.pts=kt(e.pts,i);t=e.dts;this.trigger("data",e)};this.flush=function(){i=t;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")};this.discontinuity=function(){i=void 0;t=void 0};this.reset=function(){this.discontinuity();this.trigger("reset")}};Ct.prototype=new St;var At={TimestampRolloverStream:Ct,handleRollover:kt};var jt=(e,t,i)=>{if(!e){return-1}var n=i;for(;n>>2;l*=4;l+=o[7]&3;s.timeStamp=l;if(t.pts===undefined&&t.dts===undefined){t.pts=s.timeStamp;t.dts=s.timeStamp}this.trigger("timestamp",s)}t.frames.push(s);i+=10;i+=n}while(i>>4>1){i+=e[i]+1}if(t.pid===0){t.type="pat";n(e.subarray(i),t);this.trigger("data",t)}else if(t.pid===this.pmtPid){t.type="pmt";n(e.subarray(i),t);this.trigger("data",t);while(this.packetsWaitingForPmt.length){this.processPes_.apply(this,this.packetsWaitingForPmt.shift())}}else if(this.programMapTable===undefined){this.packetsWaitingForPmt.push([e,i,t])}else{this.processPes_(e,i,t)}};this.processPes_=function(e,t,i){if(i.pid===this.programMapTable.video){i.streamType=v.H264_STREAM_TYPE}else if(i.pid===this.programMapTable.audio){i.streamType=v.ADTS_STREAM_TYPE}else{i.streamType=this.programMapTable["timed-metadata"][i.pid]}i.type="pes";i.data=e.subarray(t);this.trigger("data",i)}};y.prototype=new Ft;y.STREAM_TYPES={h264:27,adts:15};$t=function(){var d=this,t=false,n={data:[],size:0},s={data:[],size:0},r={data:[],size:0},a,u=function(e,t){var i;const n=e[0]<<16|e[1]<<8|e[2];t.data=new Uint8Array;if(n!==1){return}t.packetLength=6+(e[4]<<8|e[5]);t.dataAlignmentIndicator=(e[6]&4)!==0;i=e[7];if(i&192){t.pts=(e[9]&14)<<27|(e[10]&255)<<20|(e[11]&254)<<12|(e[12]&255)<<5|(e[13]&254)>>>3;t.pts*=4;t.pts+=(e[13]&6)>>>1;t.dts=t.pts;if(i&64){t.dts=(e[14]&14)<<27|(e[15]&255)<<20|(e[16]&254)<<12|(e[17]&255)<<5|(e[18]&254)>>>3;t.dts*=4;t.dts+=(e[18]&6)>>>1}}t.data=e.subarray(9+e[8])},o=function(e,t,i){var n=new Uint8Array(e.size),s={type:t},r=0,a=0,o=false,l;if(!e.data.length||e.size<9){return}s.trackId=e.data[0].pid;for(r=0;r>5;r=((d[t+6]&3)+1)*1024;a=r*Yt/Jt[(d[t+2]&60)>>>2];if(d.byteLength-t>>6&3)+1,channelcount:(d[t+2]&1)<<2|(d[t+3]&192)>>>6,samplerate:Jt[(d[t+2]&60)>>>2],samplingfrequencyindex:(d[t+2]&60)>>>2,samplesize:16,data:d.subarray(t+7+n,t+i)});u++;t+=i}if(typeof o==="number"){this.skipWarn_(o,t);o=null}d=d.subarray(t)};this.flush=function(){u=0;this.trigger("done")};this.reset=function(){d=void 0;this.trigger("reset")};this.endTimeline=function(){d=void 0;this.trigger("endedtimeline")}};Qt.prototype=new Xt;var Zt=Qt;var ei;ei=function(n){var s=n.byteLength,r=0,a=0;this.length=function(){return 8*s};this.bitsAvailable=function(){return 8*s+a};this.loadWord=function(){var e=n.byteLength-s,t=new Uint8Array(4),i=Math.min(4,s);if(i===0){throw new Error("no bytes available")}t.set(n.subarray(e,e+i));r=new DataView(t.buffer).getUint32(0);a=i*8;s-=i};this.skipBits=function(e){var t;if(a>e){r<<=e;a-=e}else{e-=a;t=Math.floor(e/8);e-=t*8;s-=t;this.loadWord();r<<=e;a-=e}};this.readBits=function(e){var t=Math.min(a,e),i=r>>>32-t;a-=t;if(a>0){r<<=t}else if(s>0){this.loadWord()}t=e-t;if(t>0){return i<>>e)!==0){r<<=e;a-=e;return e}}this.loadWord();return e+this.skipLeadingZeros()};this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())};this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1};this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();if(1&e){return 1+e>>>1}return-1*(e>>>1)};this.readBoolean=function(){return this.readBits(1)===1};this.readUnsignedByte=function(){return this.readBits(8)};this.loadWord()};var ti=ei;var ii=t;var ni=ti;var si,_;var ri;_=function(){var n=0,s,r;_.prototype.init.call(this);this.push=function(e){var t;if(!r){r=e.data}else{t=new Uint8Array(r.byteLength+e.data.byteLength);t.set(r);t.set(e.data,r.byteLength);r=t}var i=r.byteLength;for(;n3){this.trigger("data",r.subarray(n+3))}r=null;n=0;this.trigger("done")};this.endTimeline=function(){this.flush();this.trigger("endedtimeline")}};_.prototype=new ii;ri={100:true,110:true,122:true,244:true,44:true,83:true,86:true,118:true,128:true,138:true,139:true,134:true};si=function(){var t=new _,i,n,s,r,a,o,b;si.prototype.init.call(this);i=this;this.push=function(e){if(e.type!=="video"){return}n=e.trackId;s=e.pts;r=e.dts;t.push(e)};t.on("data",function(e){var t={trackId:n,pts:s,dts:r,data:e,nalUnitTypeCode:e[0]&31};switch(t.nalUnitTypeCode){case 5:t.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:t.nalUnitType="sei_rbsp";t.escapedRBSP=a(e.subarray(1));break;case 7:t.nalUnitType="seq_parameter_set_rbsp";t.escapedRBSP=a(e.subarray(1));t.config=o(t.escapedRBSP);break;case 8:t.nalUnitType="pic_parameter_set_rbsp";break;case 9:t.nalUnitType="access_unit_delimiter_rbsp";break}i.trigger("data",t)});t.on("done",function(){i.trigger("done")});t.on("partialdone",function(){i.trigger("partialdone")});t.on("reset",function(){i.trigger("reset")});t.on("endedtimeline",function(){i.trigger("endedtimeline")});this.flush=function(){t.flush()};this.partialFlush=function(){t.partialFlush()};this.reset=function(){t.reset()};this.endTimeline=function(){t.endTimeline()};b=function(e,t){var i=8,n=8,s,r;for(s=0;s>4;i=i>=0?i:0;if(s){return i+20}return i+10};var di=function(e,t){if(e.length-t<10||e[t]!=="I".charCodeAt(0)||e[t+1]!=="D".charCodeAt(0)||e[t+2]!=="3".charCodeAt(0)){return t}t+=li(e,t);return di(e,t)};var ui=function(e){var t=di(e,0);return e.length>=t+2&&(e[t]&255)===255&&(e[t+1]&240)===240&&(e[t+1]&22)===16};var ci=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]};var hi=function(e,t,i){var n,s="";for(n=t;n>5,n=e[t+4]<<3,s=e[t+3]&3<<11;return s|n|i};var mi=function(e,t){if(e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)){return"timed-metadata"}else if(e[t]&255===255&&(e[t+1]&240)===240){return"audio"}return null};var gi=function(e){var t=0;while(t+5>>2]}return null};var vi=function(e){var t,i,n,s;t=10;if(e[5]&64){t+=4;t+=ci(e.subarray(10,14))}do{i=ci(e.subarray(t+4,t+8));if(i<1){return null}s=String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3]);if(s==="PRIV"){n=e.subarray(t+10,t+i+10);for(var r=0;r>>2;l*=4;l+=o[7]&3;return l}break}}}t+=10;t+=i}while(t=3){if(o[i]==="I".charCodeAt(0)&&o[i+1]==="D".charCodeAt(0)&&o[i+2]==="3".charCodeAt(0)){if(o.length-i<10){break}t=_i.parseId3TagSize(o,i);if(i+t>o.length){break}s={type:"timed-metadata",data:o.subarray(i,i+t)};this.trigger("data",s);i+=t;continue}else if((o[i]&255)===255&&(o[i+1]&240)===240){if(o.length-i<7){break}t=_i.parseAdtsSize(o,i);if(i+t>o.length){break}r={type:"audio",data:o.subarray(i,i+t),pts:l,dts:l};this.trigger("data",r);i+=t;continue}i++}n=o.length-i;if(n>0){o=o.subarray(i)}else{o=new Uint8Array}};this.reset=function(){o=new Uint8Array;this.trigger("reset")};this.endTimeline=function(){o=new Uint8Array;this.trigger("endedtimeline")}};Ti.prototype=new bi;var Si=Ti;var Ei=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"];var wi=Ei;var Ii=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"];var ki=Ii;var Ci=t;var T=Te;var S=De;var Ai=Qe;var E=it;var w=Kt;var ji=r;var xi=Zt;var Di=ai.H264Stream;var Ri=Si;var Oi=yi.isLikelyAacData;var Pi=r.ONE_SECOND_IN_TS;var Li=wi;var Ni=ki;var I,k,Mi,C;var Ui=function(e,t){t.stream=e;this.trigger("log",t)};var Bi=function(e,t){var i=Object.keys(t);for(var n=0;n=-i&&s<=t){if(!r||n>s){r=o;n=s}}}if(r){return r.gop}return null};this.alignGopsAtStart_=function(e){var t,i,n,s,r,a,o,l;r=e.byteLength;a=e.nalCount;o=e.duration;t=i=0;while(tn.pts){t++;continue}i++;r-=s.byteLength;a-=s.nalCount;o-=s.duration}if(i===0){return e}if(i===e.length){return null}l=e.slice(i);l.byteLength=r;l.duration=o;l.nalCount=a;l.pts=l[0].pts;l.dts=l[0].dts;return l};this.alignGopsAtEnd_=function(e){var t,i,n,s,r,a;t=p.length-1;i=e.length-1;r=null;a=false;while(t>=0&&i>=0){n=p[t];s=e[i];if(n.pts===s.pts){a=true;break}if(n.pts>s.pts){t--;continue}if(t===p.length-1){r=i}i--}if(!a&&r===null){return null}var o;if(a){o=i}else{o=r}if(o===0){return e}var l=e.slice(o);var d=l.reduce(function(e,t){e.byteLength+=t.byteLength;e.duration+=t.duration;e.nalCount+=t.nalCount;return e},{byteLength:0,duration:0,nalCount:0});l.byteLength=d.byteLength;l.duration=d.duration;l.nalCount=d.nalCount;l.pts=l[0].pts;l.dts=l[0].dts;return l};this.alignGopsWith=function(e){p=e}};I.prototype=new Ci;C=function(e,t){this.numberOfTracks=0;this.metadataStream=t;e=e||{};if(typeof e.remux!=="undefined"){this.remuxTracks=!!e.remux}else{this.remuxTracks=true}if(typeof e.keepOriginalTimestamps==="boolean"){this.keepOriginalTimestamps=e.keepOriginalTimestamps}else{this.keepOriginalTimestamps=false}this.pendingTracks=[];this.videoTrack=null;this.pendingBoxes=[];this.pendingCaptions=[];this.pendingMetadata=[];this.pendingBytes=0;this.emittedTracks=0;C.prototype.init.call(this);this.push=function(e){if(e.content||e.text){return this.pendingCaptions.push(e)}if(e.frames){return this.pendingMetadata.push(e)}this.pendingTracks.push(e.track);this.pendingBytes+=e.boxes.byteLength;if(e.track.type==="video"){this.videoTrack=e.track;this.pendingBoxes.push(e.boxes)}if(e.track.type==="audio"){this.audioTrack=e.track;this.pendingBoxes.unshift(e.boxes)}}};C.prototype=new Ci;C.prototype.flush=function(e){var t=0,i={captions:[],captionStreams:{},metadata:[],info:{}},n,s,r,a=0,o;if(this.pendingTracks.length=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}return}}if(this.videoTrack){a=this.videoTrack.timelineStartInfo.pts;Ni.forEach(function(e){i.info[e]=this.videoTrack[e]},this)}else if(this.audioTrack){a=this.audioTrack.timelineStartInfo.pts;Li.forEach(function(e){i.info[e]=this.audioTrack[e]},this)}if(this.videoTrack||this.audioTrack){if(this.pendingTracks.length===1){i.type=this.pendingTracks[0].type}else{i.type="combined"}this.emittedTracks+=this.pendingTracks.length;r=T.initSegment(this.pendingTracks);i.initSegment=new Uint8Array(r.byteLength);i.initSegment.set(r);i.data=new Uint8Array(this.pendingBytes);for(o=0;o=this.numberOfTracks){this.trigger("done");this.emittedTracks=0}};C.prototype.setRemux=function(e){this.remuxTracks=e};Mi=function(n){var s=this,i=true,r,a;Mi.prototype.init.call(this);n=n||{};this.baseMediaDecodeTime=n.baseMediaDecodeTime||0;this.transmuxPipeline_={};this.setupAacPipeline=function(){var t={};this.transmuxPipeline_=t;t.type="aac";t.metadataStream=new w.MetadataStream;t.aacStream=new Ri;t.audioTimestampRolloverStream=new w.TimestampRolloverStream("audio");t.timedMetadataTimestampRolloverStream=new w.TimestampRolloverStream("timed-metadata");t.adtsStream=new xi;t.coalesceStream=new C(n,t.metadataStream);t.headOfPipeline=t.aacStream;t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream);t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream);t.metadataStream.on("timestamp",function(e){t.aacStream.setTimestamp(e.timeStamp)});t.aacStream.on("data",function(e){if(e.type!=="timed-metadata"&&e.type!=="audio"||t.audioSegmentStream){return}a=a||{timelineStartInfo:{baseMediaDecodeTime:s.baseMediaDecodeTime},codec:"adts",type:"audio"};t.coalesceStream.numberOfTracks++;t.audioSegmentStream=new k(a,n);t.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream"));t.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo"));t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream);s.trigger("trackinfo",{hasAudio:!!a,hasVideo:!!r})});t.coalesceStream.on("data",this.trigger.bind(this,"data"));t.coalesceStream.on("done",this.trigger.bind(this,"done"));Bi(this,t)};this.setupTsPipeline=function(){var i={};this.transmuxPipeline_=i;i.type="ts";i.metadataStream=new w.MetadataStream;i.packetStream=new w.TransportPacketStream;i.parseStream=new w.TransportParseStream;i.elementaryStream=new w.ElementaryStream;i.timestampRolloverStream=new w.TimestampRolloverStream;i.adtsStream=new xi;i.h264Stream=new Di;i.captionStream=new w.CaptionStream(n);i.coalesceStream=new C(n,i.metadataStream);i.headOfPipeline=i.packetStream;i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream);i.timestampRolloverStream.pipe(i.h264Stream);i.timestampRolloverStream.pipe(i.adtsStream);i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream);i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream);i.elementaryStream.on("data",function(e){var t;if(e.type==="metadata"){t=e.tracks.length;while(t--){if(!r&&e.tracks[t].type==="video"){r=e.tracks[t];r.timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime}else if(!a&&e.tracks[t].type==="audio"){a=e.tracks[t];a.timelineStartInfo.baseMediaDecodeTime=s.baseMediaDecodeTime}}if(r&&!i.videoSegmentStream){i.coalesceStream.numberOfTracks++;i.videoSegmentStream=new I(r,n);i.videoSegmentStream.on("log",s.getLogTrigger_("videoSegmentStream"));i.videoSegmentStream.on("timelineStartInfo",function(e){if(a&&!n.keepOriginalTimestamps){a.timelineStartInfo=e;i.audioSegmentStream.setEarliestDts(e.dts-s.baseMediaDecodeTime)}});i.videoSegmentStream.on("processedGopsInfo",s.trigger.bind(s,"gopInfo"));i.videoSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"videoSegmentTimingInfo"));i.videoSegmentStream.on("baseMediaDecodeTime",function(e){if(a){i.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}});i.videoSegmentStream.on("timingInfo",s.trigger.bind(s,"videoTimingInfo"));i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)}if(a&&!i.audioSegmentStream){i.coalesceStream.numberOfTracks++;i.audioSegmentStream=new k(a,n);i.audioSegmentStream.on("log",s.getLogTrigger_("audioSegmentStream"));i.audioSegmentStream.on("timingInfo",s.trigger.bind(s,"audioTimingInfo"));i.audioSegmentStream.on("segmentTimingInfo",s.trigger.bind(s,"audioSegmentTimingInfo"));i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)}s.trigger("trackinfo",{hasAudio:!!a,hasVideo:!!r})}});i.coalesceStream.on("data",this.trigger.bind(this,"data"));i.coalesceStream.on("id3Frame",function(e){e.dispatchType=i.metadataStream.dispatchType;s.trigger("id3Frame",e)});i.coalesceStream.on("caption",this.trigger.bind(this,"caption"));i.coalesceStream.on("done",this.trigger.bind(this,"done"));Bi(this,i)};this.setBaseMediaDecodeTime=function(e){var t=this.transmuxPipeline_;if(!n.keepOriginalTimestamps){this.baseMediaDecodeTime=e}if(a){a.timelineStartInfo.dts=undefined;a.timelineStartInfo.pts=undefined;E.clearDtsInfo(a);if(t.audioTimestampRolloverStream){t.audioTimestampRolloverStream.discontinuity()}}if(r){if(t.videoSegmentStream){t.videoSegmentStream.gopCache_=[]}r.timelineStartInfo.dts=undefined;r.timelineStartInfo.pts=undefined;E.clearDtsInfo(r);t.captionStream.reset()}if(t.timestampRolloverStream){t.timestampRolloverStream.discontinuity()}};this.setAudioAppendStart=function(e){if(a){this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)}};this.setRemux=function(e){var t=this.transmuxPipeline_;n.remux=e;if(t&&t.coalesceStream){t.coalesceStream.setRemux(e)}};this.alignGopsWith=function(e){if(r&&this.transmuxPipeline_.videoSegmentStream){this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)}};this.getLogTrigger_=function(t){var i=this;return function(e){e.stream=t;i.trigger("log",e)}};this.push=function(e){if(i){var t=Oi(e);if(t&&this.transmuxPipeline_.type!=="aac"){this.setupAacPipeline()}else if(!t&&this.transmuxPipeline_.type!=="ts"){this.setupTsPipeline()}i=false}this.transmuxPipeline_.headOfPipeline.push(e)};this.flush=function(){i=true;this.transmuxPipeline_.headOfPipeline.flush()};this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()};this.reset=function(){if(this.transmuxPipeline_.headOfPipeline){this.transmuxPipeline_.headOfPipeline.reset()}};this.resetCaptions=function(){if(this.transmuxPipeline_.captionStream){this.transmuxPipeline_.captionStream.reset()}}};Mi.prototype=new Ci;var Vi={Transmuxer:Mi,VideoSegmentStream:I,AudioSegmentStream:k,AUDIO_PROPERTIES:Li,VIDEO_PROPERTIES:Ni,generateSegmentTimingInfo:qi};var Hi=function(e){return e>>>0};var $i=function(e){return("00"+e.toString(16)).slice(-2)};var zi={toUnsigned:Hi,toHexString:$i};var Gi=function(e){var t="";t+=String.fromCharCode(e[0]);t+=String.fromCharCode(e[1]);t+=String.fromCharCode(e[2]);t+=String.fromCharCode(e[3]);return t};var Wi=Gi;var Ki=zi.toUnsigned;var Xi=Wi;var Yi=function(e,t){var i=[],n,s,r,a,o;if(!t.length){return null}for(n=0;n1?n+s:e.byteLength;if(r===t[0]){if(t.length===1){i.push(e.subarray(n+8,a))}else{o=Yi(e.subarray(n+8,a),t.slice(1));if(o.length){i=i.concat(o)}}}n=a}return i};var Qi=Yi;var Ji=zi.toUnsigned;var Zi=B.getUint64;var en=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};if(t.version===1){t.baseMediaDecodeTime=Zi(e.subarray(4))}else{t.baseMediaDecodeTime=Ji(e[4]<<24|e[5]<<16|e[6]<<8|e[7])}return t};var tn=en;var nn=function(e){return{isLeading:(e[0]&12)>>>2,dependsOn:e[0]&3,isDependedOn:(e[1]&192)>>>6,hasRedundancy:(e[1]&48)>>>4,paddingValue:(e[1]&14)>>>1,isNonSyncSample:e[1]&1,degradationPriority:e[2]<<8|e[3]}};var sn=nn;var rn=sn;var an=function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4)),samples:[]},i=new DataView(e.buffer,e.byteOffset,e.byteLength),n=t.flags[2]&1,s=t.flags[2]&4,r=t.flags[1]&1,a=t.flags[1]&2,o=t.flags[1]&4,l=t.flags[1]&8,d=i.getUint32(4),u=8,c;if(n){t.dataOffset=i.getInt32(u);u+=4}if(s&&d){c={flags:rn(e.subarray(u,u+4))};u+=4;if(r){c.duration=i.getUint32(u);u+=4}if(a){c.size=i.getUint32(u);u+=4}if(l){if(t.version===1){c.compositionTimeOffset=i.getInt32(u)}else{c.compositionTimeOffset=i.getUint32(u)}u+=4}t.samples.push(c);d--}while(d--){c={};if(r){c.duration=i.getUint32(u);u+=4}if(a){c.size=i.getUint32(u);u+=4}if(o){c.flags=rn(e.subarray(u,u+4));u+=4}if(l){if(t.version===1){c.compositionTimeOffset=i.getInt32(u)}else{c.compositionTimeOffset=i.getUint32(u)}u+=4}t.samples.push(c)}return t};var on=an;var ln=function(e){var t=new DataView(e.buffer,e.byteOffset,e.byteLength),i={version:e[0],flags:new Uint8Array(e.subarray(1,4)),trackId:t.getUint32(4)},n=i.flags[2]&1,s=i.flags[2]&2,r=i.flags[2]&8,a=i.flags[2]&16,o=i.flags[2]&32,l=i.flags[0]&65536,d=i.flags[0]&131072,u;u=8;if(n){u+=4;i.baseDataOffset=t.getUint32(12);u+=4}if(s){i.sampleDescriptionIndex=t.getUint32(u);u+=4}if(r){i.defaultSampleDuration=t.getUint32(u);u+=4}if(a){i.defaultSampleSize=t.getUint32(u);u+=4}if(o){i.defaultSampleFlags=t.getUint32(u)}if(l){i.durationIsEmpty=true}if(!n&&d){i.baseDataOffsetIsMoof=true}return i};var dn=ln;var A;if(typeof tv!=="undefined"){A=tv}else if(typeof N!=="undefined"){A=N}else if(typeof self!=="undefined"){A=self}else{A={}}var un=A;var cn=dt.discardEmulationPreventionBytes;var hn=_t.CaptionStream;var fn=Qi;var pn=tn;var mn=on;var gn=dn;var vn=un;var yn=function(e,t){var i=e;for(var n=0;n0?pn(a[0]).baseMediaDecodeTime:0;var l=fn(i,["trun"]);var d;var u;if(c===r&&l.length>0){d=_n(l,o,s);u=bn(t,d,r);if(!h[r]){h[r]={seiNals:[],logs:[]}}h[r].seiNals=h[r].seiNals.concat(u.seiNals);h[r].logs=h[r].logs.concat(u.logs)}});return h};var Sn=function(e,t,i){var n;if(t===null){return null}n=Tn(e,t);var s=n[t]||{};return{seiNals:s.seiNals,logs:s.logs,timescale:i}};var En=function(){var t=false;var i;var r;var a;var o;var l;var n;this.isInitialized=function(){return t};this.init=function(e){i=new hn;t=true;n=e?e.isPartial:false;i.on("data",function(e){e.startTime=e.startPts/o;e.endTime=e.endPts/o;l.captions.push(e);l.captionStreams[e.stream]=true});i.on("log",function(e){l.logs.push(e)})};this.isNewInit=function(e,t){if(e&&e.length===0||t&&typeof t==="object"&&Object.keys(t).length===0){return false}return a!==e[0]||o!==t[a]};this.parse=function(e,t,i){var n;if(!this.isInitialized()){return null}else if(!t||!i){return null}else if(this.isNewInit(t,i)){a=t[0];o=i[a]}else if(a===null||!o){r.push(e);return null}while(r.length>0){var s=r.shift();this.parse(s,t,i)}n=Sn(e,a,o);if(n&&n.logs){l.logs=l.logs.concat(n.logs)}if(n===null||!n.seiNals){if(l.logs.length){return{logs:l.logs,captions:[],captionStreams:[]}}return null}this.pushNals(n.seiNals);this.flushStream();return l};this.pushNals=function(e){if(!this.isInitialized()||!e||e.length===0){return null}e.forEach(function(e){i.push(e)})};this.flushStream=function(){if(!this.isInitialized()){return null}if(!n){i.flush()}else{i.partialFlush()}};this.clearParsedCaptions=function(){l.captions=[];l.captionStreams={};l.logs=[]};this.resetCaptionStream=function(){if(!this.isInitialized()){return null}i.reset()};this.clearAllCaptions=function(){this.clearParsedCaptions();this.resetCaptionStream()};this.reset=function(){r=[];a=null;o=null;if(!l){l={captions:[],captionStreams:{},logs:[]}}else{this.clearParsedCaptions()}this.resetCaptionStream()};this.reset()};var wn=En;var In=function(e){var t=0;var i=String.fromCharCode(e[t]);var n="";while(i!=="\0"){n+=i;t++;i=String.fromCharCode(e[t])}n+=i;return n};var kn={uint8ToCString:In};var Cn=kn.uint8ToCString;var An=B.getUint64;var jn=function(e){var t=4;var i=e[0];var n,s,r,a,o,l,d,u;if(i===0){n=Cn(e.subarray(t));t+=n.length;s=Cn(e.subarray(t));t+=s.length;var c=new DataView(e.buffer);r=c.getUint32(t);t+=4;o=c.getUint32(t);t+=4;l=c.getUint32(t);t+=4;d=c.getUint32(t);t+=4}else if(i===1){var c=new DataView(e.buffer);r=c.getUint32(t);t+=4;a=An(e.subarray(t));t+=8;l=c.getUint32(t);t+=4;d=c.getUint32(t);t+=4;n=Cn(e.subarray(t));t+=n.length;s=Cn(e.subarray(t));t+=s.length}u=new Uint8Array(e.subarray(t,e.byteLength));var h={scheme_id_uri:n,value:s,timescale:r?r:1,presentation_time:a,presentation_time_delta:o,event_duration:l,id:d,message_data:u};return Dn(i,h)?h:undefined};var xn=function(e,t,i,n){return e||e===0?e/t:n+i/t};var Dn=function(e,t){var i=t.scheme_id_uri!=="\0";var n=e===0&&Rn(t.presentation_time_delta)&&i;var s=e===1&&Rn(t.presentation_time)&&i;return!(e>1)&&n||s};var Rn=function(e){return e!==undefined||e!==null};var On={parseEmsgBox:jn,scaleTime:xn};var Pn=zi.toUnsigned;var Ln=zi.toHexString;var j=Qi;var x=Wi;var Nn=On;var Mn=dn;var Un=on;var Bn=tn;var Fn=B.getUint64;var qn,Vn,Hn,$n,zn,Gn,Wn;var Kn=un;var Xn=Lt.parseId3Frames;qn=function(e){var t={},i=j(e,["moov","trak"]);return i.reduce(function(e,t){var i,n,s,r,a;i=j(t,["tkhd"])[0];if(!i){return null}n=i[0];s=n===0?12:20;r=Pn(i[s]<<24|i[s+1]<<16|i[s+2]<<8|i[s+3]);a=j(t,["mdia","mdhd"])[0];if(!a){return null}n=a[0];s=n===0?12:20;e[r]=Pn(a[s]<<24|a[s+1]<<16|a[s+2]<<8|a[s+3]);return e},t)};Vn=function(d,e){var t;t=j(e,["moof","traf"]);var i=t.reduce(function(e,t){var i=j(t,["tfhd"])[0];var n=Pn(i[4]<<24|i[5]<<16|i[6]<<8|i[7]);var s=d[n]||9e4;var r=j(t,["tfdt"])[0];var a=new DataView(r.buffer,r.byteOffset,r.byteLength);var o;if(r[0]===1){o=Fn(r.subarray(4,12))}else{o=a.getUint32(4)}let l;if(typeof o==="bigint"){l=o/Kn.BigInt(s)}else if(typeof o==="number"&&!isNaN(o)){l=o/s}if(l11){t.codec+=".";t.codec+=Ln(u[9]);t.codec+=Ln(u[10]);t.codec+=Ln(u[11])}else{t.codec="avc1.4d400d"}}else if(/^mp4[a,v]$/i.test(t.codec)){u=d.subarray(28);c=x(u.subarray(4,8));if(c==="esds"&&u.length>20&&u[19]!==0){t.codec+="."+Ln(u[19]);t.codec+="."+Ln(u[20]>>>2&63).replace(/^0/,"")}else{t.codec="mp4a.40.2"}}else{t.codec=t.codec.toLowerCase()}}}var h=j(e,["mdia","mdhd"])[0];if(h){t.timescale=Gn(h)}f.push(t)});return f};Wn=function(e,n=0){var t=j(e,["emsg"]);return t.map(e=>{var t=Nn.parseEmsgBox(new Uint8Array(e));var i=Xn(t.message_data);return{cueTime:Nn.scaleTime(t.presentation_time,t.timescale,t.presentation_time_delta,n),duration:Nn.scaleTime(t.event_duration,t.timescale),frames:i}})};var Yn={findBox:j,parseType:x,timescale:qn,startTime:Vn,compositionStartTime:Hn,videoTrackIds:$n,tracks:zn,getTimescaleFromMediaHeader:Gn,getEmsgID3:Wn};var Qn=Tt;var Jn=function(e){var t=e[1]&31;t<<=8;t|=e[2];return t};var Zn=function(e){return!!(e[1]&64)};var es=function(e){var t=0;if((e[3]&48)>>>4>1){t+=e[4]+1}return t};var ts=function(e,t){var i=Jn(e);if(i===0){return"pat"}else if(i===t){return"pmt"}else if(t){return"pes"}return null};var is=function(e){var t=Zn(e);var i=4+es(e);if(t){i+=e[i]+1}return(e[i+10]&31)<<8|e[i+11]};var ns=function(e){var t={};var i=Zn(e);var n=4+es(e);if(i){n+=e[n]+1}if(!(e[n+5]&1)){return}var s,r,a;s=(e[n+1]&15)<<8|e[n+2];r=3+s-4;a=(e[n+10]&15)<<8|e[n+11];var o=12+a;while(o=e.byteLength){return null}var n=null;var s;s=e[i+7];if(s&192){n={};n.pts=(e[i+9]&14)<<27|(e[i+10]&255)<<20|(e[i+11]&254)<<12|(e[i+12]&255)<<5|(e[i+13]&254)>>>3;n.pts*=4;n.pts+=(e[i+13]&6)>>>1;n.dts=n.pts;if(s&64){n.dts=(e[i+14]&14)<<27|(e[i+15]&255)<<20|(e[i+16]&254)<<12|(e[i+17]&255)<<5|(e[i+18]&254)>>>3;n.dts*=4;n.dts+=(e[i+18]&6)>>>1}}return n};var as=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}};var os=function(e){var t=4+es(e);var i=e.subarray(t);var n=0;var s=0;var r=false;var a;for(;s3){a=as(i[s+3]&31);if(a==="slice_layer_without_partitioning_rbsp_idr"){r=true}}return r};var ls={parseType:ts,parsePat:is,parsePmt:ns,parsePayloadUnitStartIndicator:Zn,parsePesType:ss,parsePesTime:rs,videoPacketContainsKeyFrame:os};var ds=Tt;var D=At.handleRollover;var R={};R.ts=ls;R.aac=yi;var O=r.ONE_SECOND_IN_TS;var P=188,L=71;var us=function(e,t){var i=0,n=P,s,r;while(n=0){if(e[n]===L&&(e[s]===L||s===e.byteLength)){r=e.subarray(n,s);a=R.ts.parseType(r,t.pid);switch(a){case"pes":o=R.ts.parsePesType(r,t.table);l=R.ts.parsePayloadUnitStartIndicator(r);if(o==="audio"&&l){d=R.ts.parsePesTime(r);if(d){d.type="audio";i.audio.push(d);u=true}}break}if(u){break}n-=P;s-=P;continue}n--;s--}};var hs=function(e,t,i){var n=0,s=P,r,a,o,l,d,u,c,h;var f=false;var p={data:[],size:0};while(s=0){if(e[n]===L&&e[s]===L){r=e.subarray(n,s);a=R.ts.parseType(r,t.pid);switch(a){case"pes":o=R.ts.parsePesType(r,t.table);l=R.ts.parsePayloadUnitStartIndicator(r);if(o==="video"&&l){d=R.ts.parsePesTime(r);if(d){d.type="video";i.video.push(d);f=true}}break}if(f){break}n-=P;s-=P;continue}n--;s--}};var fs=function(e,t){if(e.audio&&e.audio.length){var i=t;if(typeof i==="undefined"||isNaN(i)){i=e.audio[0].dts}e.audio.forEach(function(e){e.dts=D(e.dts,i);e.pts=D(e.pts,i);e.dtsTime=e.dts/O;e.ptsTime=e.pts/O})}if(e.video&&e.video.length){var n=t;if(typeof n==="undefined"||isNaN(n)){n=e.video[0].dts}e.video.forEach(function(e){e.dts=D(e.dts,n);e.pts=D(e.pts,n);e.dtsTime=e.dts/O;e.ptsTime=e.pts/O});if(e.firstKeyFrame){var s=e.firstKeyFrame;s.dts=D(s.dts,n);s.pts=D(s.pts,n);s.dtsTime=s.dts/O;s.ptsTime=s.pts/O}}};var ps=function(e){var t=false,i=0,n=null,s=null,r=0,a=0,o;while(e.length-a>=3){var l=R.aac.parseType(e,a);switch(l){case"timed-metadata":if(e.length-a<10){t=true;break}r=R.aac.parseId3TagSize(e,a);if(r>e.length){t=true;break}if(s===null){o=e.subarray(a,a+r);s=R.aac.parseAacTimestamp(o)}a+=r;break;case"audio":if(e.length-a<7){t=true;break}r=R.aac.parseAdtsSize(e,a);if(r>e.length){t=true;break}if(n===null){o=e.subarray(a,a+r);n=R.aac.parseSampleRate(o)}i++;a+=r;break;default:a++;break}if(t){return null}}if(n===null||s===null){return null}var d=O/n;var u={audio:[{type:"audio",dts:s,pts:s},{type:"audio",dts:s+i*1024*d,pts:s+i*1024*d}]};return u};var ms=function(e){var t={pid:null,table:null};var i={};us(e,t);for(var n in t.table){if(t.table.hasOwnProperty(n)){var s=t.table[n];switch(s){case ds.H264_STREAM_TYPE:i.video=[];hs(e,t,i);if(i.video.length===0){delete i.video}break;case ds.ADTS_STREAM_TYPE:i.audio=[];cs(e,t,i);if(i.audio.length===0){delete i.audio}break}}}return i};var gs=function(e,t){var i=R.aac.isLikelyAacData(e);var n;if(i){n=ps(e)}else{n=ms(e)}if(!n||!n.audio&&!n.video){return null}fs(n,t);return n};var vs={inspect:gs,parseAudioPes_:cs};const ys=function(n,e){e.on("data",function(e){const t=e.initSegment;e.initSegment={data:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength};const i=e.data;e.data=i.buffer;n.postMessage({action:"data",segment:e,byteOffset:i.byteOffset,byteLength:i.byteLength},[e.data])});e.on("done",function(e){n.postMessage({action:"done"})});e.on("gopInfo",function(e){n.postMessage({action:"gopInfo",gopInfo:e})});e.on("videoSegmentTimingInfo",function(e){const t={start:{decode:r.videoTsToSeconds(e.start.dts),presentation:r.videoTsToSeconds(e.start.pts)},end:{decode:r.videoTsToSeconds(e.end.dts),presentation:r.videoTsToSeconds(e.end.pts)},baseMediaDecodeTime:r.videoTsToSeconds(e.baseMediaDecodeTime)};if(e.prependedContentDuration){t.prependedContentDuration=r.videoTsToSeconds(e.prependedContentDuration)}n.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:t})});e.on("audioSegmentTimingInfo",function(e){const t={start:{decode:r.videoTsToSeconds(e.start.dts),presentation:r.videoTsToSeconds(e.start.pts)},end:{decode:r.videoTsToSeconds(e.end.dts),presentation:r.videoTsToSeconds(e.end.pts)},baseMediaDecodeTime:r.videoTsToSeconds(e.baseMediaDecodeTime)};if(e.prependedContentDuration){t.prependedContentDuration=r.videoTsToSeconds(e.prependedContentDuration)}n.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:t})});e.on("id3Frame",function(e){n.postMessage({action:"id3Frame",id3Frame:e})});e.on("caption",function(e){n.postMessage({action:"caption",caption:e})});e.on("trackinfo",function(e){n.postMessage({action:"trackinfo",trackInfo:e})});e.on("audioTimingInfo",function(e){n.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:r.videoTsToSeconds(e.start),end:r.videoTsToSeconds(e.end)}})});e.on("videoTimingInfo",function(e){n.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:r.videoTsToSeconds(e.start),end:r.videoTsToSeconds(e.end)}})});e.on("log",function(e){n.postMessage({action:"log",log:e})})};class bs{constructor(e,t){this.options=t||{};this.self=e;this.init()}init(){if(this.transmuxer){this.transmuxer.dispose()}this.transmuxer=new Vi.Transmuxer(this.options);ys(this.self,this.transmuxer)}pushMp4Captions(e){if(!this.captionParser){this.captionParser=new wn;this.captionParser.init()}const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);const i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])}probeMp4StartTime({timescales:e,data:t}){const i=Yn.startTime(e,t);this.self.postMessage({action:"probeMp4StartTime",startTime:i,data:t},[t.buffer])}probeMp4Tracks({data:e}){const t=Yn.tracks(e);this.self.postMessage({action:"probeMp4Tracks",tracks:t,data:e},[e.buffer])}probeEmsgID3({data:e,offset:t}){const i=Yn.getEmsgID3(e,t);this.self.postMessage({action:"probeEmsgID3",id3Frames:i,emsgData:e},[e.buffer])}probeTs({data:e,baseStartTime:t}){const i=typeof t==="number"&&!isNaN(t)?t*r.ONE_SECOND_IN_TS:void 0;const n=vs.inspect(e,i);let s=null;if(n){s={hasVideo:n.video&&n.video.length===2||false,hasAudio:n.audio&&n.audio.length===2||false};if(s.hasVideo){s.videoStart=n.video[0].ptsTime}if(s.hasAudio){s.audioStart=n.audio[0].ptsTime}}this.self.postMessage({action:"probeTs",result:s,data:e},[e.buffer])}clearAllMp4Captions(){if(this.captionParser){this.captionParser.clearAllCaptions()}}clearParsedMp4Captions(){if(this.captionParser){this.captionParser.clearParsedCaptions()}}push(e){const t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)}reset(){this.transmuxer.reset()}setTimestampOffset(e){const t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(r.secondsToVideoTs(t)))}setAudioAppendStart(e){this.transmuxer.setAudioAppendStart(Math.ceil(r.secondsToVideoTs(e.appendStart)))}setRemux(e){this.transmuxer.setRemux(e.remux)}flush(e){this.transmuxer.flush();self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline();self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())}}self.onmessage=function(e){if(e.data.action==="init"&&e.data.options){this.messageHandlers=new bs(self,e.data.options);return}if(!this.messageHandlers){this.messageHandlers=new bs(self)}if(e.data&&e.data.action&&e.data.action!=="init"){if(this.messageHandlers[e.data.action]){this.messageHandlers[e.data.action](e.data)}}}}));var sp=ep(np);const rp=(e,t,i)=>{const{type:n,initSegment:s,captions:r,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:d}=e.data.segment;t.buffer.push({captions:r,captionStreams:a,metadata:o});const u=e.data.segment.boxes||{data:e.data.segment.data};const c={type:n,data:new Uint8Array(u.data,u.data.byteOffset,u.data.byteLength),initSegment:new Uint8Array(s.data,s.byteOffset,s.byteLength)};if(typeof l!=="undefined"){c.videoFrameDtsTime=l}if(typeof d!=="undefined"){c.videoFramePtsTime=d}i(c)};const ap=({transmuxedData:e,callback:t})=>{e.buffer=[];t(e)};const op=(e,t)=>{t.gopInfo=e.data.gopInfo};const lp=t=>{const{transmuxer:i,bytes:e,audioAppendStart:n,gopsToAlignWith:s,remux:r,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:d,onVideoSegmentTimingInfo:u,onAudioSegmentTimingInfo:c,onId3:h,onCaptions:f,onDone:p,onEndedTimeline:m,onTransmuxerLog:g,isEndOfTimeline:v}=t;const y={buffer:[]};let b=v;const _=e=>{if(i.currentTransmux!==t){return}if(e.data.action==="data"){rp(e,y,a)}if(e.data.action==="trackinfo"){o(e.data.trackInfo)}if(e.data.action==="gopInfo"){op(e,y)}if(e.data.action==="audioTimingInfo"){l(e.data.audioTimingInfo)}if(e.data.action==="videoTimingInfo"){d(e.data.videoTimingInfo)}if(e.data.action==="videoSegmentTimingInfo"){u(e.data.videoSegmentTimingInfo)}if(e.data.action==="audioSegmentTimingInfo"){c(e.data.audioSegmentTimingInfo)}if(e.data.action==="id3Frame"){h([e.data.id3Frame],e.data.id3Frame.dispatchType)}if(e.data.action==="caption"){f(e.data.caption)}if(e.data.action==="endedtimeline"){b=false;m()}if(e.data.action==="log"){g(e.data.log)}if(e.data.type!=="transmuxed"){return}if(b){return}i.onmessage=null;ap({transmuxedData:y,callback:p});dp(i)};i.onmessage=_;if(n){i.postMessage({action:"setAudioAppendStart",appendStart:n})}if(Array.isArray(s)){i.postMessage({action:"alignGopsWith",gopsToAlignWith:s})}if(typeof r!=="undefined"){i.postMessage({action:"setRemux",remux:r})}if(e.byteLength){const T=e instanceof ArrayBuffer?e:e.buffer;const S=e instanceof ArrayBuffer?0:e.byteOffset;i.postMessage({action:"push",data:T,byteOffset:S,byteLength:e.byteLength},[T])}if(v){i.postMessage({action:"endTimeline"})}i.postMessage({action:"flush"})};const dp=e=>{e.currentTransmux=null;if(e.transmuxQueue.length){e.currentTransmux=e.transmuxQueue.shift();if(typeof e.currentTransmux==="function"){e.currentTransmux()}else{lp(e.currentTransmux)}}};const up=(e,t)=>{e.postMessage({action:t});dp(e)};const cp=(e,t)=>{if(!t.currentTransmux){t.currentTransmux=e;up(t,e);return}t.transmuxQueue.push(up.bind(null,t,e))};const hp=e=>{cp("reset",e)};const fp=e=>{cp("endTimeline",e)};const pp=e=>{if(!e.transmuxer.currentTransmux){e.transmuxer.currentTransmux=e;lp(e);return}e.transmuxer.transmuxQueue.push(e)};const mp=e=>{const t=new sp;t.currentTransmux=null;t.transmuxQueue=[];const i=t.terminate;t.terminate=()=>{t.currentTransmux=null;t.transmuxQueue.length=0;return i.call(t)};t.postMessage({action:"init",options:e});return t};var gp={reset:hp,endTimeline:fp,transmux:pp,createTransmuxer:mp};const vp=function(t){const i=t.transmuxer;const n=t.endAction||t.action;const s=t.callback;const e=Ni({},t,{endAction:null,transmuxer:null,callback:null});const r=e=>{if(e.data.action!==n){return}i.removeEventListener("message",r);if(e.data.data){e.data.data=new Uint8Array(e.data.data,t.byteOffset||0,t.byteLength||e.data.data.byteLength);if(t.data){t.data=e.data.data}}s(e.data)};i.addEventListener("message",r);if(t.data){const a=t.data instanceof ArrayBuffer;e.byteOffset=a?0:t.data.byteOffset;e.byteLength=t.data.byteLength;const o=[a?t.data:t.data.buffer];i.postMessage(e,o)}else{i.postMessage(e)}};const yp={FAILURE:2,TIMEOUT:-101,ABORTED:-102};const bp=e=>{e.forEach(e=>{e.abort()})};const _p=e=>{return{bandwidth:e.bandwidth,bytesReceived:e.bytesReceived||0,roundTripTime:e.roundTripTime||0}};const Tp=e=>{const t=e.target;const i=Date.now()-t.requestTime;const n={bandwidth:Infinity,bytesReceived:0,roundTripTime:i||0};n.bytesReceived=e.loaded;n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3);return n};const Sp=(e,t)=>{if(t.timedout){return{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:yp.TIMEOUT,xhr:t}}if(t.aborted){return{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:yp.ABORTED,xhr:t}}if(e){return{status:t.status,message:"HLS request errored at URL: "+t.uri,code:yp.FAILURE,xhr:t}}if(t.responseType==="arraybuffer"&&t.response.byteLength===0){return{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:yp.FAILURE,xhr:t}}return null};const Ep=(a,o,l)=>(e,t)=>{const i=t.response;const n=Sp(e,t);if(n){return l(n,a)}if(i.byteLength!==16){return l({status:t.status,message:"Invalid HLS key at URL: "+t.uri,code:yp.FAILURE,xhr:t},a)}const s=new DataView(i);const r=new Uint32Array([s.getUint32(0),s.getUint32(4),s.getUint32(8),s.getUint32(12)]);for(let e=0;e{const e=zc(i.map.bytes);if(e!=="mp4"){const t=i.map.resolvedUri||i.map.uri;return n({internal:true,message:`Found unsupported ${e||"unknown"} container for initialization segment at URL: ${t}`,code:yp.FAILURE})}vp({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:e,data:t})=>{i.map.bytes=t;e.forEach(function(e){i.map.tracks=i.map.tracks||{};if(i.map.tracks[e.type]){return}i.map.tracks[e.type]=e;if(typeof e.id==="number"&&e.timescale){i.map.timescales=i.map.timescales||{};i.map.timescales[e.id]=e.timescale}});return n(null)}})};const Ip=({segment:s,finishProcessingFn:r})=>(e,t)=>{const i=Sp(e,t);if(i){return r(i,s)}const n=new Uint8Array(t.response);if(s.map.key){s.map.encryptedBytes=n;return r(null,s)}s.map.bytes=n;wp(s,function(e){if(e){e.xhr=t;e.status=t.status;return r(e,s)}r(null,s)})};const kp=({segment:s,finishProcessingFn:r,responseType:a})=>(e,t)=>{const i=Sp(e,t);if(i){return r(i,s)}const n=a==="arraybuffer"||!t.responseText?t.response:Qf(t.responseText.substring(s.lastReachedChar||0));s.stats=_p(t);if(s.key){s.encryptedBytes=new Uint8Array(n)}else{s.bytes=new Uint8Array(n)}return r(null,s)};const Cp=({segment:i,bytes:n,trackInfoFn:s,timingInfoFn:e,videoSegmentTimingInfoFn:t,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u,doneFn:c,onTransmuxerLog:h})=>{const f=i.map&&i.map.tracks||{};const p=Boolean(f.audio&&f.video);let m=e.bind(null,i,"audio","start");const g=e.bind(null,i,"audio","end");let v=e.bind(null,i,"video","start");const y=e.bind(null,i,"video","end");const b=()=>pp({bytes:n,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:p,onData:e=>{e.type=e.type==="combined"?"video":e.type;u(i,e)},onTrackInfo:e=>{if(s){if(p){e.isMuxed=true}s(i,e)}},onAudioTimingInfo:e=>{if(m&&typeof e.start!=="undefined"){m(e.start);m=null}if(g&&typeof e.end!=="undefined"){g(e.end)}},onVideoTimingInfo:e=>{if(v&&typeof e.start!=="undefined"){v(e.start);v=null}if(y&&typeof e.end!=="undefined"){y(e.end)}},onVideoSegmentTimingInfo:e=>{t(e)},onAudioSegmentTimingInfo:e=>{r(e)},onId3:(e,t)=>{a(i,e,t)},onCaptions:e=>{o(i,[e])},isEndOfTimeline:l,onEndedTimeline:()=>{d()},onTransmuxerLog:h,onDone:e=>{if(!c){return}e.type=e.type==="combined"?"video":e.type;c(null,i,e)}});vp({action:"probeTs",transmuxer:i.transmuxer,data:n,baseStartTime:i.baseStartTime,callback:e=>{i.bytes=n=e.data;const t=e.result;if(t){s(i,{hasAudio:t.hasAudio,hasVideo:t.hasVideo,isMuxed:p});s=null}b()}})};const Ap=({segment:n,bytes:s,trackInfoFn:e,timingInfoFn:t,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u,doneFn:c,onTransmuxerLog:h})=>{let f=new Uint8Array(s);if(Gc(f)){n.isFmp4=true;const{tracks:p}=n.map;const m={isFmp4:true,hasVideo:!!p.video,hasAudio:!!p.audio};if(p.audio&&p.audio.codec&&p.audio.codec!=="enca"){m.audioCodec=p.audio.codec}if(p.video&&p.video.codec&&p.video.codec!=="encv"){m.videoCodec=p.video.codec}if(p.video&&p.audio){m.isMuxed=true}e(n,m);const g=(e,t)=>{u(n,{data:f,type:m.hasAudio&&!m.isMuxed?"audio":"video"});if(t&&t.length){a(n,t)}if(e&&e.length){o(n,e)}c(null,n,{})};vp({action:"probeMp4StartTime",timescales:n.map.timescales,data:f,transmuxer:n.transmuxer,callback:({data:i,startTime:e})=>{s=i.buffer;n.bytes=f=i;if(m.hasAudio&&!m.isMuxed){t(n,"audio","start",e)}if(m.hasVideo){t(n,"video","start",e)}vp({action:"probeEmsgID3",data:f,transmuxer:n.transmuxer,offset:e,callback:({emsgData:e,id3Frames:t})=>{s=e.buffer;n.bytes=f=e;if(!p.video||!i.byteLength||!n.transmuxer){g(undefined,t);return}vp({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:n.transmuxer,data:f,timescales:n.map.timescales,trackIds:[p.video.id],callback:e=>{s=e.data.buffer;n.bytes=f=e.data;e.logs.forEach(function(e){h(P(e,{stream:"mp4CaptionParser"}))});g(e.captions,t)}})}})}});return}if(!n.transmuxer){c(null,n,{});return}if(typeof n.container==="undefined"){n.container=zc(f)}if(n.container!=="ts"&&n.container!=="aac"){e(n,{hasAudio:false,hasVideo:false});c(null,n,{});return}Cp({segment:n,bytes:s,trackInfoFn:e,timingInfoFn:t,videoSegmentTimingInfoFn:i,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u,doneFn:c,onTransmuxerLog:h})};const jp=function({id:i,key:e,encryptedBytes:t,decryptionWorker:n},s){const r=e=>{if(e.data.source===i){n.removeEventListener("message",r);const t=e.data.decrypted;s(new Uint8Array(t.bytes,t.byteOffset,t.byteLength))}};n.addEventListener("message",r);let a;if(e.bytes.slice){a=e.bytes.slice()}else{a=new Uint32Array(Array.prototype.slice.call(e.bytes))}n.postMessage(Ef({source:i,encrypted:t,key:a,iv:e.iv}),[t.buffer,a.buffer])};const xp=({decryptionWorker:e,segment:t,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u,doneFn:c,onTransmuxerLog:h})=>{jp({id:t.requestId,key:t.key,encryptedBytes:t.encryptedBytes,decryptionWorker:e},e=>{t.bytes=e;Ap({segment:t,bytes:t.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u,doneFn:c,onTransmuxerLog:h})})};const Dp=({activeXhrs:n,decryptionWorker:s,trackInfoFn:r,timingInfoFn:a,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:d,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:f,doneFn:p,onTransmuxerLog:m})=>{let g=0;let v=false;return(e,t)=>{if(v){return}if(e){v=true;bp(n);return p(e,t)}g+=1;if(g===n.length){const i=function(){if(t.encryptedBytes){return xp({decryptionWorker:s,segment:t,trackInfoFn:r,timingInfoFn:a,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:d,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:f,doneFn:p,onTransmuxerLog:m})}Ap({segment:t,bytes:t.bytes,trackInfoFn:r,timingInfoFn:a,videoSegmentTimingInfoFn:o,audioSegmentTimingInfoFn:l,id3Fn:d,captionsFn:u,isEndOfTimeline:c,endedTimelineFn:h,dataFn:f,doneFn:p,onTransmuxerLog:m})};t.endOfAllRequests=Date.now();if(t.map&&t.map.encryptedBytes&&!t.map.bytes){return jp({decryptionWorker:s,id:t.requestId+"-init",encryptedBytes:t.map.encryptedBytes,key:t.map.key},e=>{t.map.bytes=e;wp(t,e=>{if(e){bp(n);return p(e,t)}i()})})}i()}}};const Rp=({loadendState:i,abortFn:n})=>e=>{const t=e.target;if(t.aborted&&n&&!i.calledAbortFn){n();i.calledAbortFn=true}};const Op=({segment:i,progressFn:n,trackInfoFn:e,timingInfoFn:t,videoSegmentTimingInfoFn:s,audioSegmentTimingInfoFn:r,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:d,dataFn:u})=>e=>{const t=e.target;if(t.aborted){return}i.stats=P(i.stats,Tp(e));if(!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived){i.stats.firstBytesReceivedAt=Date.now()}return n(e,i)};const Pp=({xhr:e,xhrOptions:t,decryptionWorker:i,segment:n,abortFn:s,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:u,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:f,dataFn:p,doneFn:m,onTransmuxerLog:g})=>{const v=[];const y=Dp({activeXhrs:v,decryptionWorker:i,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:u,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:f,dataFn:p,doneFn:m,onTransmuxerLog:g});if(n.key&&!n.key.bytes){const E=[n.key];if(n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri){E.push(n.map.key)}const w=P(t,{uri:n.key.resolvedUri,responseType:"arraybuffer"});const I=Ep(n,E,y);const k=e(w,I);v.push(k)}if(n.map&&!n.map.bytes){const C=n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri);if(C){const D=P(t,{uri:n.map.key.resolvedUri,responseType:"arraybuffer"});const R=Ep(n,[n.map.key],y);const O=e(D,R);v.push(O)}const A=P(t,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:bf(n.map)});const j=Ip({segment:n,finishProcessingFn:y});const x=e(A,j);v.push(x)}const b=P(t,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:bf(n)});const _=kp({segment:n,finishProcessingFn:y,responseType:b.responseType});const T=e(b,_);T.addEventListener("progress",Op({segment:n,progressFn:r,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:d,id3Fn:u,captionsFn:c,isEndOfTimeline:h,endedTimelineFn:f,dataFn:p}));v.push(T);const S={};v.forEach(e=>{e.addEventListener("loadend",Rp({loadendState:S,abortFn:s}))});return()=>bp(v)};const Lp=rh("CodecUtils");const Np=function(e){const t=e.attributes||{};if(t.CODECS){return Ya(t.CODECS)}};const Mp=(e,t)=>{const i=t.attributes||{};return e&&e.mediaGroups&&e.mediaGroups.AUDIO&&i.AUDIO&&e.mediaGroups.AUDIO[i.AUDIO]};const Up=(e,t)=>{if(!Mp(e,t)){return true}const i=t.attributes||{};const n=e.mediaGroups.AUDIO[i.AUDIO];for(const s in n){if(!n[s].uri&&!n[s].playlists){return true}}return false};const Bp=function(e){const n={};e.forEach(({mediaType:e,type:t,details:i})=>{n[e]=n[e]||[];n[e].push(Xa(`${t}${i}`))});Object.keys(n).forEach(function(e){if(n[e].length>1){Lp(`multiple ${e} codecs found as attributes: ${n[e].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`);n[e]=null;return}n[e]=n[e][0]});return n};const Fp=function(e){let t=0;if(e.audio){t++}if(e.video){t++}return t};const qp=function(e,t){const i=t.attributes||{};const n=Bp(Np(t)||[]);if(Mp(e,t)&&!n.audio){if(!Up(e,t)){const s=Bp(Qa(e,i.AUDIO)||[]);if(s.audio){n.audio=s.audio}}}return n};const Vp=rh("PlaylistSelector");const Hp=function(e){if(!e||!e.playlist){return}const t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})};const $p=function(e,t){if(!e){return""}const i=tv.getComputedStyle(e);if(!i){return""}return i[t]};const zp=function(e,n){const s=e.slice();e.sort(function(e,t){const i=n(e,t);if(i===0){return s.indexOf(e)-s.indexOf(t)}return i})};const Gp=function(e,t){let i;let n;if(e.attributes.BANDWIDTH){i=e.attributes.BANDWIDTH}i=i||tv.Number.MAX_VALUE;if(t.attributes.BANDWIDTH){n=t.attributes.BANDWIDTH}n=n||tv.Number.MAX_VALUE;return i-n};const Wp=function(e,t){let i;let n;if(e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width){i=e.attributes.RESOLUTION.width}i=i||tv.Number.MAX_VALUE;if(t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width){n=t.attributes.RESOLUTION.width}n=n||tv.Number.MAX_VALUE;if(i===n&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH){return e.attributes.BANDWIDTH-t.attributes.BANDWIDTH}return i-n};let Kp=function(e,t,i,n,s,r){if(!e){return}const a={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:s};let o=e.playlists;if($h.isAudioOnly(e)){o=r.getAudioTrackPlaylists_();a.audioOnly=true}let l=o.map(e=>{let t;const i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width;const n=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;t=e.attributes&&e.attributes.BANDWIDTH;t=t||tv.Number.MAX_VALUE;return{bandwidth:t,width:i,height:n,playlist:e}});zp(l,(e,t)=>e.bandwidth-t.bandwidth);l=l.filter(e=>!$h.isIncompatible(e.playlist));let d=l.filter(e=>$h.isEnabled(e.playlist));if(!d.length){d=l.filter(e=>!$h.isDisabled(e.playlist))}const u=d.filter(e=>e.bandwidth*R.BANDWIDTH_VARIANCEe.bandwidth===c.bandwidth)[0];if(s===false){const _=h||d[0]||l[0];if(_&&_.playlist){let e="sortedPlaylistReps";if(h){e="bandwidthBestRep"}if(d[0]){e="enabledPlaylistReps"}Vp(`choosing ${Hp(_)} using ${e} with options`,a);return _.playlist}Vp("could not choose a playlist with options",a);return null}const f=u.filter(e=>e.width&&e.height);zp(f,(e,t)=>e.width-t.width);const p=f.filter(e=>e.width===i&&e.height===n);c=p[p.length-1];const m=p.filter(e=>e.bandwidth===c.bandwidth)[0];let g;let v;let y;if(!m){g=f.filter(e=>e.width>i||e.height>n);v=g.filter(e=>e.width===g[0].width&&e.height===g[0].height);c=v[v.length-1];y=v.filter(e=>e.bandwidth===c.bandwidth)[0]}let b;if(r.leastPixelDiffSelector){const T=f.map(e=>{e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n);return e});zp(T,(e,t)=>{if(e.pixelDiff===t.pixelDiff){return t.bandwidth-e.bandwidth}return e.pixelDiff-t.pixelDiff});b=T[0]}const _=b||y||m||h||d[0]||l[0];if(_&&_.playlist){let e="sortedPlaylistReps";if(b){e="leastPixelDiffRep"}else if(y){e="resolutionPlusOneRep"}else if(m){e="resolutionBestRep"}else if(h){e="bandwidthBestRep"}else if(d[0]){e="enabledPlaylistReps"}Vp(`choosing ${Hp(_)} using ${e} with options`,a);return _.playlist}Vp("could not choose a playlist with options",a);return null};const Xp=function(){const e=this.useDevicePixelRatio?tv.devicePixelRatio||1:1;return Kp(this.playlists.main,this.systemBandwidth,parseInt($p(this.tech_.el(),"width"),10)*e,parseInt($p(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)};const Yp=function(t){let i=-1;let n=-1;if(t<0||t>1){throw new Error("Moving average bandwidth decay must be between 0 and 1.")}return function(){const e=this.useDevicePixelRatio?tv.devicePixelRatio||1:1;if(i<0){i=this.systemBandwidth;n=this.systemBandwidth}if(this.systemBandwidth>0&&this.systemBandwidth!==n){i=t*this.systemBandwidth+(1-t)*i;n=this.systemBandwidth}return Kp(this.playlists.main,i,parseInt($p(this.tech_.el(),"width"),10)*e,parseInt($p(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.playlistController_)}};const Qp=function(e){const{main:t,currentTime:r,bandwidth:a,duration:o,segmentDuration:l,timeUntilRebuffer:d,currentTimeline:u,syncController:c}=e;const i=t.playlists.filter(e=>!$h.isIncompatible(e));let n=i.filter($h.isEnabled);if(!n.length){n=i.filter(e=>!$h.isDisabled(e))}const s=n.filter($h.hasAttribute.bind(null,"BANDWIDTH"));const h=s.map(e=>{const t=c.getSyncPoint(e,o,u,r);const i=t?1:2;const n=$h.estimateSegmentRequestTime(l,a,e);const s=n*i-d;return{playlist:e,rebufferingImpact:s}});const f=h.filter(e=>e.rebufferingImpact<=0);zp(f,(e,t)=>Gp(t.playlist,e.playlist));if(f.length){return f[0]}zp(h,(e,t)=>e.rebufferingImpact-t.rebufferingImpact);return h[0]||null};const Jp=function(){const e=this.playlists.main.playlists.filter($h.isEnabled);zp(e,(e,t)=>Gp(e,t));const t=e.filter(e=>!!qp(this.playlists.main,e).video);return t[0]||null};const Zp=e=>{let t=0;let i;if(e.bytes){i=new Uint8Array(e.bytes);e.segments.forEach(e=>{i.set(e,t);t+=e.byteLength})}return i};const em=function(s,r,a){if(!s[a]){r.trigger({type:"usage",name:"vhs-608"});let n=a;if(/^cc708_/.test(a)){n="SERVICE"+a.split("_")[1]}const e=r.textTracks().getTrackById(n);if(e){s[a]=e}else{const o=r.options_.vhs&&r.options_.vhs.captionServices||{};let e=a;let t=a;let i=false;const l=o[n];if(l){e=l.label;t=l.language;i=l.default}s[a]=r.addRemoteTextTrack({kind:"captions",id:n,default:i,label:e,language:t},false).track}}};const tm=function({inbandTextTracks:s,captionArray:e,timestampOffset:r}){if(!e){return}const a=tv.WebKitDataCue||tv.VTTCue;e.forEach(i=>{const n=i.stream;if(i.content){i.content.forEach(e=>{const t=new a(i.startTime+r,i.endTime+r,e.text);t.line=e.line;t.align="left";t.position=e.position;t.positionAlign="line-left";s[n].addCue(t)})}else{s[n].addCue(new a(i.startTime+r,i.endTime+r,i.text))}})};const im=function(e){Object.defineProperties(e.frame,{id:{get(){S.log.warn("cue.frame.id is deprecated. Use cue.value.key instead.");return e.value.key}},value:{get(){S.log.warn("cue.frame.value is deprecated. Use cue.value.data instead.");return e.value.data}},privateData:{get(){S.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead.");return e.value.data}}})};const nm=({inbandTextTracks:e,metadataArray:t,timestampOffset:n,videoDuration:r})=>{if(!t){return}const s=tv.WebKitDataCue||tv.VTTCue;const a=e.metadataTrack_;if(!a){return}t.forEach(e=>{const i=e.cueTime+n;if(typeof i!=="number"||tv.isNaN(i)||i<0||!(i{const t=new s(i,i,e.value||e.url||e.data||"");t.frame=e;t.value=e;im(t);a.addCue(t)})});if(!a.cues||!a.cues.length){return}const i=a.cues;const o=[];for(let e=0;e{const i=e[t.startTime]||[];i.push(t);e[t.startTime]=i;return e},{});const d=Object.keys(l).sort((e,t)=>Number(e)-Number(t));d.forEach((e,t)=>{const i=l[e];const n=isFinite(r)?r:0;const s=Number(d[t+1])||n;i.forEach(e=>{e.endTime=s})})};const sm={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"};const rm=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]);const am=({inbandTextTracks:e,dateRanges:t})=>{const n=e.metadataTrack_;if(!n){return}const s=tv.WebKitDataCue||tv.VTTCue;t.forEach(e=>{for(const t of Object.keys(e)){if(rm.has(t)){continue}const i=new s(e.startTime,e.endTime,"");i.id=e.id;i.type="com.apple.quicktime.HLS";i.value={key:sm[t],data:e[t]};if(t==="scte35Out"||t==="scte35In"){i.value.data=new Uint8Array(i.value.data.match(/[\da-f]{2}/gi)).buffer}n.addCue(i)}e.processDateRange()})};const om=(e,t,i)=>{if(e.metadataTrack_){return}e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},false).track;if(!S.browser.IS_ANY_SAFARI){e.metadataTrack_.inBandMetadataTrackDispatchType=t}};const lm=function(e,t,i){let n;let s;if(!i){return}if(!i.cues){return}n=i.cues.length;while(n--){s=i.cues[n];if(s.startTime>=e&&s.endTime<=t){i.removeCue(s)}}};const dm=function(t){const i=t.cues;if(!i){return}const n={};for(let e=i.length-1;e>=0;e--){const s=i[e];const r=`${s.startTime}-${s.endTime}-${s.text}`;if(n[r]){t.removeCue(s)}else{n[r]=s}}};const um=(e,t,i)=>{if(typeof t==="undefined"||t===null||!e.length){return[]}const n=Math.ceil((t-i+3)*ih);let s;for(s=0;sn){break}}return e.slice(s)};const cm=(e,t,i)=>{if(!t.length){return e}if(i){return t.slice()}const n=t[0].pts;let s=0;for(s;s=n){break}}return e.slice(0,s).concat(t)};const hm=(e,t,i,n)=>{const s=Math.ceil((t-n)*ih);const r=Math.ceil((i-n)*ih);const a=e.slice();let o=e.length;while(o--){if(e[o].pts<=r){break}}if(o===-1){return a}let l=o+1;while(l--){if(e[l].pts<=s){break}}l=Math.max(l,0);a.splice(l,o-l+1);return a};const fm=function(t,i){if(!t&&!i||!t&&i||t&&!i){return false}if(t===i){return true}const n=Object.keys(t).sort();const s=Object.keys(i).sort();if(n.length!==s.length){return false}for(let e=0;en){return e}}}if(s.length===0){return 0}return s[s.length-1]};const gm=1;const vm=500;const ym=e=>typeof e==="number"&&isFinite(e);const bm=1/60;const _m=(e,t,i)=>{if(e!=="main"||!t||!i){return null}if(!i.hasAudio&&!i.hasVideo){return"Neither audio nor video found in segment."}if(t.hasVideo&&!i.hasVideo){return"Only audio found in segment when we expected video."+" We can't switch to audio only from a stream that had video."+" To get rid of this message, please add codec information to the manifest."}if(!t.hasVideo&&i.hasVideo){return"Video found in segment when we expected only audio."+" We can't switch to a stream with video from an audio only stream."+" To get rid of this message, please add codec information to the manifest."}return null};const Tm=(e,t,i)=>{let n=t-R.BACK_BUFFER_LENGTH;if(e.length){n=Math.max(n,e.start(0))}const s=t-i;return Math.min(s,n)};const Sm=e=>{const{startOfSegment:t,duration:i,segment:n,part:s,playlist:{mediaSequence:r,id:a,segments:o=[]},mediaIndex:l,partIndex:d,timeline:u}=e;const c=o.length-1;let h="mediaIndex/partIndex increment";if(e.getMediaInfoForTime){h=`getMediaInfoForTime (${e.getMediaInfoForTime})`}else if(e.isSyncRequest){h="getSyncSegmentCandidate (isSyncRequest)"}if(e.independent){h+=` with independent ${e.independent}`}const f=typeof d==="number";const p=e.segment.uri?"segment":"pre-segment";const m=f?Eh({preloadSegment:n})-1:0;return`${p} [${r+l}/${r+c}]`+(f?` part [${d}/${m}]`:"")+` segment start/end [${n.start} => ${n.end}]`+(f?` part start/end [${s.start} => ${s.end}]`:"")+` startOfSegment [${t}]`+` duration [${i}]`+` timeline [${u}]`+` selected by [${h}]`+` playlist [${a}]`};const Em=e=>`${e}TimingInfo`;const wm=(e,t)=>e.length?e.end(e.length-1):t;const Im=({segmentTimeline:e,currentTimeline:t,startOfSegment:i,buffered:n,calculateTimestampOffsetForEachSegment:s,overrideCheck:r})=>{if(s){return wm(n,i)}if(!r&&e===t){return null}if(e{if(t===i){return false}if(n==="audio"){const r=e.lastTimelineChange({type:"main"});return!r||r.to!==i}if(n==="main"&&s){const a=e.pendingTimelineChange({type:"audio"});if(a&&a.to===i){return false}return true}return false};const Cm=r=>{let a=0;["video","audio"].forEach(function(e){const t=r[`${e}TimingInfo`];if(!t){return}const{start:i,end:n}=t;let s;if(typeof i==="bigint"||typeof n==="bigint"){s=tv.BigInt(n)-tv.BigInt(i)}else if(typeof i==="number"&&typeof n==="number"){s=n-i}if(typeof s!=="undefined"&&s>a){a=s}});if(typeof a==="bigint"&&a{if(!e){return false}return Math.round(e)>t+oh};const jm=(e,t)=>{if(t!=="hls"){return null}const i=Cm({audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo});if(!i){return null}const n=e.playlist.targetDuration;const s=Am({segmentDuration:i,maxDuration:n*2});const r=Am({segmentDuration:i,maxDuration:n});const a=`Segment with index ${e.mediaIndex} `+`from playlist ${e.playlist.id} `+`has a duration of ${i} `+`when the reported duration is ${e.duration} `+`and the target duration is ${n}. `+"For HLS content, a duration in excess of the target duration may result in "+"playback issues. See the HLS specification section on EXT-X-TARGETDURATION for "+"more details: "+"https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1";if(s||r){return{severity:s?"warn":"info",message:a}}return null};class xm extends S.EventTarget{constructor(e,t={}){super();if(!e){throw new TypeError("Initialization settings are required")}if(typeof e.currentTime!=="function"){throw new TypeError("No currentTime getter specified")}if(!e.mediaSource){throw new TypeError("No MediaSource specified")}this.bandwidth=e.bandwidth;this.throughput={rate:0,count:0};this.roundTrip=NaN;this.resetStats_();this.mediaIndex=null;this.partIndex=null;this.hasPlayed_=e.hasPlayed;this.currentTime_=e.currentTime;this.seekable_=e.seekable;this.seeking_=e.seeking;this.duration_=e.duration;this.mediaSource_=e.mediaSource;this.vhs_=e.vhs;this.loaderType_=e.loaderType;this.currentMediaInfo_=void 0;this.startingMediaInfo_=void 0;this.segmentMetadataTrack_=e.segmentMetadataTrack;this.goalBufferLength_=e.goalBufferLength;this.sourceType_=e.sourceType;this.sourceUpdater_=e.sourceUpdater;this.inbandTextTracks_=e.inbandTextTracks;this.state_="INIT";this.timelineChangeController_=e.timelineChangeController;this.shouldSaveSegmentTimingInfo_=true;this.parse708captions_=e.parse708captions;this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset;this.calculateTimestampOffsetForEachSegment_=e.calculateTimestampOffsetForEachSegment;this.captionServices_=e.captionServices;this.exactManifestTimings=e.exactManifestTimings;this.addMetadataToTextTrack=e.addMetadataToTextTrack;this.checkBufferTimeout_=null;this.error_=void 0;this.currentTimeline_=-1;this.pendingSegment_=null;this.xhrOptions_=null;this.pendingSegments_=[];this.audioDisabled_=false;this.isPendingTimestampOffset_=false;this.gopBuffer_=[];this.timeMapping_=0;this.safeAppend_=false;this.appendInitSegment_={audio:true,video:true};this.playlistOfLastInitSegment_={audio:null,video:null};this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_={id3:[],caption:[]};this.waitingOnRemove_=false;this.quotaExceededErrorRetryTimeout_=null;this.activeInitSegmentId_=null;this.initSegments_={};this.cacheEncryptionKeys_=e.cacheEncryptionKeys;this.keyCache_={};this.decrypter_=e.decrypter;this.syncController_=e.syncController;this.syncPoint_={segmentIndex:0,time:0};this.transmuxer_=this.createTransmuxer_();this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate");this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_);this.mediaSource_.addEventListener("sourceopen",()=>{if(!this.isEndOfStream_()){this.ended_=false}});this.fetchAtBuffer_=false;this.replaceSegmentsUntil_=-1;this.logger_=rh(`SegmentLoader[${this.loaderType_}]`);Object.defineProperty(this,"state",{get(){return this.state_},set(e){if(e!==this.state_){this.logger_(`${this.state_} -> ${e}`);this.state_=e;this.trigger("statechange")}}});this.sourceUpdater_.on("ready",()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}});if(this.loaderType_==="main"){this.timelineChangeController_.on("pendingtimelinechange",()=>{if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}})}if(this.loaderType_==="audio"){this.timelineChangeController_.on("timelinechange",()=>{if(this.hasEnoughInfoToLoad_()){this.processLoadQueue_()}if(this.hasEnoughInfoToAppend_()){this.processCallQueue_()}})}}createTransmuxer_(){return gp.createTransmuxer({remux:false,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:true,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0;this.mediaRequests=0;this.mediaRequestsAborted=0;this.mediaRequestsTimedout=0;this.mediaRequestsErrored=0;this.mediaTransferDuration=0;this.mediaSecondsLoaded=0;this.mediaAppends=0}dispose(){this.trigger("dispose");this.state="DISPOSED";this.pause();this.abort_();if(this.transmuxer_){this.transmuxer_.terminate()}this.resetStats_();if(this.checkBufferTimeout_){tv.clearTimeout(this.checkBufferTimeout_)}if(this.syncController_&&this.triggerSyncInfoUpdate_){this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_)}this.off()}setAudio(e){this.audioDisabled_=!e;if(e){this.appendInitSegment_.audio=true}else{this.sourceUpdater_.removeAudio(0,this.duration_())}}abort(){if(this.state!=="WAITING"){if(this.pendingSegment_){this.pendingSegment_=null}return}this.abort_();this.state="READY";if(!this.paused()){this.monitorBuffer_()}}abort_(){if(this.pendingSegment_&&this.pendingSegment_.abortRequests){this.pendingSegment_.abortRequests()}this.pendingSegment_=null;this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_.id3=[];this.metadataQueue_.caption=[];this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);this.waitingOnRemove_=false;tv.clearTimeout(this.quotaExceededErrorRetryTimeout_);this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){if(this.state==="APPENDING"&&!this.pendingSegment_){this.state="READY";return true}if(!this.pendingSegment_||this.pendingSegment_.requestId!==e){return true}return false}error(e){if(typeof e!=="undefined"){this.logger_("error occurred:",e);this.error_=e}this.pendingSegment_=null;return this.error_}endOfStream(){this.ended_=true;if(this.transmuxer_){gp.reset(this.transmuxer_)}this.gopBuffer_.length=0;this.pause();this.trigger("ended")}buffered_(){const t=this.getMediaInfo_();if(!this.sourceUpdater_||!t){return D()}if(this.loaderType_==="main"){const{hasAudio:i,hasVideo:n,isMuxed:e}=t;if(n&&i&&!this.audioDisabled_&&!e){return this.sourceUpdater_.buffered()}if(n){return this.sourceUpdater_.videoBuffered()}}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=false){if(!e){return null}const i=wf(e);let n=this.initSegments_[i];if(t&&!n&&e.bytes){this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}}return n||e}segmentKey(e,t=false){if(!e){return null}const i=If(e);let n=this.keyCache_[i];if(this.cacheEncryptionKeys_&&t&&!n&&e.bytes){this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes}}const s={resolvedUri:(n||e).resolvedUri};if(n){s.bytes=n.bytes}return s}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){this.monitorBuffer_();if(!this.playlist_){return}if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"){return}this.state="READY"}init_(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}playlist(e,t={}){if(!e){return}const i=this.playlist_;const n=this.pendingSegment_;this.playlist_=e;this.xhrOptions_=t;if(this.state==="INIT"){e.syncInfo={mediaSequence:e.mediaSequence,time:0};if(this.loaderType_==="main"){this.syncController_.setDateTimeMappingForStart(e)}}let s=null;if(i){if(i.id){s=i.id}else if(i.uri){s=i.uri}}this.logger_(`playlist update [${s} => ${e.id||e.uri}]`);this.trigger("syncinfoupdate");if(this.state==="INIT"&&this.couldBeginLoading_()){return this.init_()}if(!i||i.uri!==e.uri){if(this.mediaIndex!==null){const a=!e.endList&&typeof e.partTargetDuration==="number";if(a){this.resetLoader()}else{this.resyncLoader()}}this.currentMediaInfo_=void 0;this.trigger("playlistupdate");return}const r=e.mediaSequence-i.mediaSequence;this.logger_(`live window shift [${r}]`);if(this.mediaIndex!==null){this.mediaIndex-=r;if(this.mediaIndex<0){this.mediaIndex=null;this.partIndex=null}else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`);this.resetLoader();this.mediaIndex=l}}}if(n){n.mediaIndex-=r;if(n.mediaIndex<0){n.mediaIndex=null;n.partIndex=null}else{if(n.mediaIndex>=0){n.segment=e.segments[n.mediaIndex]}if(n.partIndex>=0&&n.segment.parts){n.part=n.segment.parts[n.partIndex]}}}this.syncController_.saveExpiredSegmentInfo(i,e)}pause(){if(this.checkBufferTimeout_){tv.clearTimeout(this.checkBufferTimeout_);this.checkBufferTimeout_=null}}paused(){return this.checkBufferTimeout_===null}resetLoaderProperties(){this.ended_=false;this.activeInitSegmentId_=null;this.appendInitSegment_={audio:true,video:true}}resetEverything(e){this.resetLoaderProperties();this.resetLoader();this.remove(0,Infinity,e);if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearAllMp4Captions"});this.transmuxer_.postMessage({action:"reset"})}}resetLoader(){this.fetchAtBuffer_=false;this.resyncLoader()}resyncLoader(){if(this.transmuxer_){gp.reset(this.transmuxer_)}this.mediaIndex=null;this.partIndex=null;this.syncPoint_=null;this.isPendingTimestampOffset_=false;this.callQueue_=[];this.loadQueue_=[];this.metadataQueue_.id3=[];this.metadataQueue_.caption=[];this.abort();if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}}remove(e,t,i=()=>{},n=false){if(t===Infinity){t=this.duration_()}if(t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let s=1;const r=()=>{s--;if(s===0){i()}};if(n||!this.audioDisabled_){s++;this.sourceUpdater_.removeAudio(e,t,r)}if(n||this.loaderType_==="main"){this.gopBuffer_=hm(this.gopBuffer_,e,t,this.timeMapping_);s++;this.sourceUpdater_.removeVideo(e,t,r)}for(const a in this.inbandTextTracks_){lm(e,t,this.inbandTextTracks_[a])}lm(e,t,this.segmentMetadataTrack_);r()}monitorBuffer_(){if(this.checkBufferTimeout_){tv.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=tv.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){if(this.state==="READY"){this.fillBuffer_()}if(this.checkBufferTimeout_){tv.clearTimeout(this.checkBufferTimeout_)}this.checkBufferTimeout_=tv.setTimeout(this.monitorBufferTick_.bind(this),vm)}fillBuffer_(){if(this.sourceUpdater_.updating()){return}const e=this.chooseNextRequest_();if(!e){return}if(typeof e.timestampOffset==="number"){this.isPendingTimestampOffset_=false;this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})}this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,i=this.partIndex){if(!t||!this.mediaSource_){return false}const n=typeof e==="number"&&t.segments[e];const s=e+1===t.segments.length;const r=!n||!n.parts||i+1===n.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&s&&r}chooseNextRequest_(){const e=this.buffered_();const t=yh(e)||0;const i=bh(e,this.currentTime_());const n=!this.hasPlayed_()&&i>=1;const s=i>=this.goalBufferLength_();const r=this.playlist_.segments;if(!r.length||n||s){return null}this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());const a={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(a.isSyncRequest){a.mediaIndex=mm(this.currentTimeline_,r,t)}else if(this.mediaIndex!==null){const c=r[this.mediaIndex];const h=typeof this.partIndex==="number"?this.partIndex:-1;a.startOfSegment=c.end?c.end:t;if(c.parts&&c.parts[h+1]){a.mediaIndex=this.mediaIndex;a.partIndex=h+1}else{a.mediaIndex=this.mediaIndex+1}}else{const{segmentIndex:f,startTime:p,partIndex:h}=$h.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});a.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${t}`:`currentTime ${this.currentTime_()}`;a.mediaIndex=f;a.startOfSegment=p;a.partIndex=h}const o=r[a.mediaIndex];let l=o&&typeof a.partIndex==="number"&&o.parts&&o.parts[a.partIndex];if(!o||typeof a.partIndex==="number"&&!l){return null}if(typeof a.partIndex!=="number"&&o.parts){a.partIndex=0;l=o.parts[0]}const d=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!i&&l&&!d&&!l.independent){if(a.partIndex===0){const m=r[a.mediaIndex-1];const g=m.parts&&m.parts.length&&m.parts[m.parts.length-1];if(g&&g.independent){a.mediaIndex-=1;a.partIndex=m.parts.length-1;a.independent="previous segment"}}else if(o.parts[a.partIndex-1].independent){a.partIndex-=1;a.independent="previous part"}}const u=this.mediaSource_&&this.mediaSource_.readyState==="ended";if(a.mediaIndex>=r.length-1&&u&&!this.seeking_()){return null}return this.generateSegmentInfo_(a)}generateSegmentInfo_(e){const{independent:t,playlist:i,mediaIndex:n,startOfSegment:s,isSyncRequest:r,partIndex:a,forceTimestampOffset:o,getMediaInfoForTime:l}=e;const d=i.segments[n];const u=typeof a==="number"&&d.parts[a];const c={requestId:"segment-loader-"+Math.random(),uri:u&&u.resolvedUri||d.resolvedUri,mediaIndex:n,partIndex:u?a:null,isSyncRequest:r,startOfSegment:s,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:d.timeline,duration:u&&u.duration||d.duration,segment:d,part:u,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:l,independent:t};const h=typeof o!=="undefined"?o:this.isPendingTimestampOffset_;c.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:d.timeline,currentTimeline:this.currentTimeline_,startOfSegment:s,buffered:this.buffered_(),calculateTimestampOffsetForEachSegment:this.calculateTimestampOffsetForEachSegment_,overrideCheck:h});const f=yh(this.sourceUpdater_.audioBuffered());if(typeof f==="number"){c.audioAppendStart=f-this.sourceUpdater_.audioTimestampOffset()}if(this.sourceUpdater_.videoBuffered().length){c.gopsToAlignWith=um(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)}return c}timestampOffsetForSegment_(e){return Im(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH){return}if(Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3){return}const t=this.currentTime_();const i=e.bandwidth;const n=this.pendingSegment_.duration;const s=$h.estimateSegmentRequestTime(n,i,this.playlist_,e.bytesReceived);const r=mh(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(s<=r){return}const a=Qp({main:this.vhs_.playlists.main,currentTime:t,bandwidth:i,duration:this.duration_(),segmentDuration:n,timeUntilRebuffer:r,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!a){return}const o=s-r;const l=o-a.rebufferingImpact;let d=.5;if(r<=oh){d=1}if(!a.playlist||a.playlist.uri===this.playlist_.uri||l{a[e.stream]=a[e.stream]||{startTime:Infinity,captions:[],endTime:0};const t=a[e.stream];t.startTime=Math.min(t.startTime,e.startTime+r);t.endTime=Math.max(t.endTime,e.endTime+r);t.captions.push(e)});Object.keys(a).forEach(e=>{const{startTime:t,endTime:i,captions:n}=a[e];const s=this.inbandTextTracks_;this.logger_(`adding cues from ${t} -> ${i} for ${e}`);em(s,this.vhs_.tech_,e);lm(t,i,s[e]);tm({captionArray:n,inbandTextTracks:s,timestampOffset:r})});if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}}handleId3_(e,t,i){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}const n=this.pendingSegment_;if(!n.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,i));return}this.addMetadataToTextTrack(i,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e());this.metadataQueue_.caption.forEach(e=>e());this.metadataQueue_.id3=[];this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[];e.forEach(e=>e())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[];e.forEach(e=>e())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio"){return true}const e=this.pendingSegment_;if(!e){return false}if(!this.getCurrentMediaInfo_()){return true}if(km({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})){return false}return true}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()){return false}if(this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_){return false}const e=this.pendingSegment_;const t=this.getCurrentMediaInfo_();if(!e||!t){return false}const{hasAudio:i,hasVideo:n,isMuxed:s}=t;if(n&&!e.videoTimingInfo){return false}if(i&&!this.audioDisabled_&&!s&&!e.audioTimingInfo){return false}if(km({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_})){return false}return true}handleData_(e,t){this.earlyAbortWhenNeeded_(e.stats);if(this.checkForAbort_(e.requestId)){return}if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,t));return}const i=this.pendingSegment_;this.setTimeMapping_(i.timeline);this.updateMediaSecondsLoaded_(i.part||i.segment);if(this.mediaSource_.readyState==="closed"){return}if(e.map){e.map=this.initSegmentForMap(e.map,true);i.segment.map=e.map}if(e.key){this.segmentKey(e.key,true)}i.isFmp4=e.isFmp4;i.timingInfo=i.timingInfo||{};if(i.isFmp4){this.trigger("fmp4");i.timingInfo.start=i[Em(t.type)].start}else{const n=this.getCurrentMediaInfo_();const s=this.loaderType_==="main"&&n&&n.hasVideo;let e;if(s){e=i.videoTimingInfo.start}i.timingInfo.start=this.trueSegmentStart_({currentStart:i.timingInfo.start,playlist:i.playlist,mediaIndex:i.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:s,firstVideoFrameTimeForData:e,videoTimingInfo:i.videoTimingInfo,audioTimingInfo:i.audioTimingInfo})}this.updateAppendInitSegmentStatus(i,t.type);this.updateSourceBufferTimestampOffset_(i);if(i.isSyncRequest){this.updateTimingInfoEnd_(i);this.syncController_.saveSegmentTimingInfo({segmentInfo:i,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==i.mediaIndex||r.partIndex!==i.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}i.hasAppendedData_=true;this.processMetadataQueue_();this.appendData_(i,t)}updateAppendInitSegmentStatus(e,t){if(this.loaderType_==="main"&&typeof e.timestampOffset==="number"&&!e.changedTimestampOffset){this.appendInitSegment_={audio:true,video:true}}if(this.playlistOfLastInitSegment_[t]!==e.playlist){this.appendInitSegment_[t]=true}}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:i,playlist:n}){if(i){const s=wf(i);if(this.activeInitSegmentId_===s){return null}t=this.initSegmentForMap(i,true).bytes;this.activeInitSegmentId_=s}if(t&&this.appendInitSegment_[e]){this.playlistOfLastInitSegment_[e]=n;this.appendInitSegment_[e]=false;this.activeInitSegmentId_=null;return t}return null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i},n){const s=this.sourceUpdater_.audioBuffered();const r=this.sourceUpdater_.videoBuffered();if(s.length>1){this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+gh(s).join(", "))}if(r.length>1){this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+gh(r).join(", "))}const a=s.length?s.start(0):0;const o=s.length?s.end(s.length-1):0;const l=r.length?r.start(0):0;const d=r.length?r.end(r.length-1):0;if(o-a<=gm&&d-l<=gm){this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to "+"buffer, triggering an error. "+`Appended byte length: ${i.byteLength}, `+`audio buffer: ${gh(s).join(", ")}, `+`video buffer: ${gh(r).join(", ")}, `);this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:Infinity});this.trigger("error");return}this.waitingOnRemove_=true;this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:i}));const u=this.currentTime_();const c=u-gm;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${c}`);this.remove(0,c,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${gm}s`);this.waitingOnRemove_=false;this.quotaExceededErrorRetryTimeout_=tv.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue");this.quotaExceededErrorRetryTimeout_=null;this.processCallQueue_()},gm*1e3)},true)}handleAppendError_({segmentInfo:e,type:t,bytes:i},n){if(!n){return}if(n.code===pm){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:i});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",n);this.error(`${t} append of ${i.length}b failed for segment `+`#${e.mediaIndex} in playlist ${e.playlist.id}`);this.trigger("appenderror")}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:i,data:n,bytes:s}){if(!s){const r=[n];let e=n.byteLength;if(i){r.unshift(i);e+=i.byteLength}s=Zp({bytes:e,segments:r})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:s},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:s}))}handleSegmentTimingInfo_(e,t,i){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId){return}const n=this.pendingSegment_.segment;const s=`${e}TimingInfo`;if(!n[s]){n[s]={}}n[s].transmuxerPrependedSeconds=i.prependedContentDuration||0;n[s].transmuxedPresentationStart=i.start.presentation;n[s].transmuxedDecodeStart=i.start.decode;n[s].transmuxedPresentationEnd=i.end.presentation;n[s].transmuxedDecodeEnd=i.end.decode;n[s].baseMediaDecodeTime=i.baseMediaDecodeTime}appendData_(e,t){const{type:i,data:n}=t;if(!n||!n.byteLength){return}if(i==="audio"&&this.audioDisabled_){return}const s=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:s,data:n})}loadSegment_(t){this.state="WAITING";this.pendingSegment_=t;this.trimBackBuffer_(t);if(typeof t.timestampOffset==="number"){if(this.transmuxer_){this.transmuxer_.postMessage({action:"clearAllMp4Captions"})}}if(!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(()=>{const e=Ni({},t,{forceTimestampOffset:true});Ni(t,this.generateSegmentInfo_(e));this.isPendingTimestampOffset_=false;this.updateTransmuxerAndRequestSegment_(t)});return}this.updateTransmuxerAndRequestSegment_(t)}updateTransmuxerAndRequestSegment_(n){if(this.shouldUpdateTransmuxerTimestampOffset_(n.timestampOffset)){this.gopBuffer_.length=0;n.gopsToAlignWith=[];this.timeMapping_=0;this.transmuxer_.postMessage({action:"reset"});this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:n.timestampOffset})}const e=this.createSimplifiedSegmentObj_(n);const t=this.isEndOfStream_(n.mediaIndex,n.playlist,n.partIndex);const i=this.mediaIndex!==null;const s=n.timeline!==this.currentTimeline_&&n.timeline>0;const r=t||i&&s;this.logger_(`Requesting ${Sm(n)}`);if(e.map&&!e.map.bytes){this.logger_("going to request init segment.");this.appendInitSegment_={video:true,audio:true}}n.abortRequests=Pp({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:e,abortFn:this.handleAbort_.bind(this,n),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",n.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",n.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:r,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:e,level:t,stream:i})=>{this.logger_(`${Sm(n)} logged from transmuxer stream ${i} as a ${t}: ${e}`)}})}trimBackBuffer_(e){const t=Tm(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);if(t>0){this.remove(0,t)}}createSimplifiedSegmentObj_(e){const t=e.segment;const i=e.part;const n={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part};const s=e.playlist.segments[e.mediaIndex-1];if(s&&s.timeline===t.timeline){if(s.videoTimingInfo){n.baseStartTime=s.videoTimingInfo.transmuxedDecodeEnd}else if(s.audioTimingInfo){n.baseStartTime=s.audioTimingInfo.transmuxedDecodeEnd}}if(t.key){const r=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key);n.key.iv=r}if(t.map){n.map=this.initSegmentForMap(t.map)}return n}saveTransferStats_(e){this.mediaRequests+=1;if(e){this.mediaBytesTransferred+=e.bytesReceived;this.mediaTransferDuration+=e.roundTripTime}}saveBandwidthRelatedStats_(e,t){this.pendingSegment_.byteLength=t.bytesReceived;if(e=this.replaceSegmentsUntil_){this.replaceSegmentsUntil_=-1;this.fetchAtBuffer_=true}if(this.currentTimeline_!==e.timeline){this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline});if(this.loaderType_==="main"&&!this.audioDisabled_){this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})}}this.currentTimeline_=e.timeline;this.trigger("syncinfoupdate");const i=e.segment;const n=e.part;const s=i.end&&this.currentTime_()-i.end>e.playlist.targetDuration*3;const r=n&&n.end&&this.currentTime_()-n.end>e.playlist.partTargetDuration*3;if(s||r){this.logger_(`bad ${s?"segment":"part"} ${Sm(e)}`);this.resetEverything();return}const a=this.mediaIndex!==null;if(a){this.trigger("bandwidthupdate")}this.trigger("progress");this.mediaIndex=e.mediaIndex;this.partIndex=e.partIndex;if(this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)){this.endOfStream()}this.trigger("appended");if(e.hasAppendedData_){this.mediaAppends++}if(!this.paused()){this.monitorBuffer_()}}recordThroughput_(e){if(e.duratione.toUpperCase())};const Om=["video","audio"];const Pm=(e,t)=>{const i=t[`${e}Buffer`];return i&&i.updating||t.queuePending[e]};const Lm=(t,i)=>{for(let e=0;e{if(t.queue.length===0){return}let i=0;let n=t.queue[i];if(n.type==="mediaSource"){if(!t.updating()&&t.mediaSource.readyState!=="closed"){t.queue.shift();n.action(t);if(n.doneFn){n.doneFn()}Nm("audio",t);Nm("video",t)}return}if(e==="mediaSource"){return}if(!t.ready()||t.mediaSource.readyState==="closed"||Pm(e,t)){return}if(n.type!==e){i=Lm(e,t.queue);if(i===null){return}n=t.queue[i]}t.queue.splice(i,1);t.queuePending[e]=n;n.action(e,t);if(!n.doneFn){t.queuePending[e]=null;Nm(e,t);return}};const Mm=(e,t)=>{const i=t[`${e}Buffer`];const n=Rm(e);if(!i){return}i.removeEventListener("updateend",t[`on${n}UpdateEnd_`]);i.removeEventListener("error",t[`on${n}Error_`]);t.codecs[e]=null;t[`${e}Buffer`]=null};const Um=(e,t)=>e&&t&&Array.prototype.indexOf.call(e.sourceBuffers,t)!==-1;const Bm={appendBuffer:(n,s,r)=>(t,i)=>{const e=i[`${t}Buffer`];if(!Um(i.mediaSource,e)){return}i.logger_(`Appending segment ${s.mediaIndex}'s ${n.length} bytes to ${t}Buffer`);try{e.appendBuffer(n)}catch(e){i.logger_(`Error with code ${e.code} `+(e.code===pm?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${s.mediaIndex} to ${t}Buffer`);i.queuePending[t]=null;r(e)}},remove:(n,s)=>(t,i)=>{const e=i[`${t}Buffer`];if(!Um(i.mediaSource,e)){return}i.logger_(`Removing ${n} to ${s} from ${t}Buffer`);try{e.remove(n,s)}catch(e){i.logger_(`Remove ${n} to ${s} from ${t}Buffer failed`)}},timestampOffset:n=>(e,t)=>{const i=t[`${e}Buffer`];if(!Um(t.mediaSource,i)){return}t.logger_(`Setting ${e}timestampOffset to ${n}`);i.timestampOffset=n},callback:i=>(e,t)=>{i()},endOfStream:t=>e=>{if(e.mediaSource.readyState!=="open"){return}e.logger_(`Calling mediaSource endOfStream(${t||""})`);try{e.mediaSource.endOfStream(t)}catch(e){S.log.warn("Failed to call media source endOfStream",e)}},duration:t=>e=>{e.logger_(`Setting mediaSource duration to ${t}`);try{e.mediaSource.duration=t}catch(e){S.log.warn("Failed to set media source duration",e)}},abort:()=>(t,e)=>{if(e.mediaSource.readyState!=="open"){return}const i=e[`${t}Buffer`];if(!Um(e.mediaSource,i)){return}e.logger_(`calling abort on ${t}Buffer`);try{i.abort()}catch(e){S.log.warn(`Failed to abort on ${t}Buffer`,e)}},addSourceBuffer:(s,r)=>e=>{const t=Rm(s);const i=eo(r);e.logger_(`Adding ${s}Buffer with codec ${r} to mediaSource`);const n=e.mediaSource.addSourceBuffer(i);n.addEventListener("updateend",e[`on${t}UpdateEnd_`]);n.addEventListener("error",e[`on${t}Error_`]);e.codecs[s]=r;e[`${s}Buffer`]=n},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];Mm(i,e);if(!Um(e.mediaSource,t)){return}e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(e){S.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,e)}},changeType:s=>(e,t)=>{const i=t[`${e}Buffer`];const n=eo(s);if(!Um(t.mediaSource,i)){return}if(t.codecs[e]===s){return}t.logger_(`changing ${e}Buffer codec from ${t.codecs[e]} to ${s}`);i.changeType(n);t.codecs[e]=s}};const Fm=({type:e,sourceUpdater:t,action:i,doneFn:n,name:s})=>{t.queue.push({type:e,action:i,doneFn:n,name:s});Nm(e,t)};const qm=(s,r)=>e=>{const t=r[`${s}Buffered`]();const i=ah(t);r.logger_(`${s} source buffer update end. Buffered: \n`,i);if(r.queuePending[s]){const n=r.queuePending[s].doneFn;r.queuePending[s]=null;if(n){n(r[`${s}Error_`])}}Nm(s,r)};class Vm extends S.EventTarget{constructor(e){super();this.mediaSource=e;this.sourceopenListener_=()=>Nm("mediaSource",this);this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_);this.logger_=rh("SourceUpdater");this.audioTimestampOffset_=0;this.videoTimestampOffset_=0;this.queue=[];this.queuePending={audio:null,video:null};this.delayedAudioAppendQueue_=[];this.videoAppendQueued_=false;this.codecs={};this.onVideoUpdateEnd_=qm("video",this);this.onAudioUpdateEnd_=qm("audio",this);this.onVideoError_=e=>{this.videoError_=e};this.onAudioError_=e=>{this.audioError_=e};this.createdSourceBuffers_=false;this.initializedEme_=false;this.triggeredReady_=false}initializedEme(){this.initializedEme_=true;this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){if(this.hasCreatedSourceBuffers()){return}this.addOrChangeSourceBuffers(e);this.createdSourceBuffers_=true;this.trigger("createdsourcebuffers");this.triggerReady()}triggerReady(){if(this.ready()&&!this.triggeredReady_){this.triggeredReady_=true;this.trigger("ready")}}addSourceBuffer(e,t){Fm({type:"mediaSource",sourceUpdater:this,action:Bm.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){Fm({type:e,sourceUpdater:this,action:Bm.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){S.log.error("removeSourceBuffer is not supported!");return}Fm({type:"mediaSource",sourceUpdater:this,action:Bm.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!S.browser.IS_FIREFOX&&tv.MediaSource&&tv.MediaSource.prototype&&typeof tv.MediaSource.prototype.removeSourceBuffer==="function"}static canChangeType(){return tv.SourceBuffer&&tv.SourceBuffer.prototype&&typeof tv.SourceBuffer.prototype.changeType==="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){S.log.error("changeType is not supported!");return}Fm({type:e,sourceUpdater:this,action:Bm.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(i){if(!i||typeof i!=="object"||Object.keys(i).length===0){throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs")}Object.keys(i).forEach(e=>{const t=i[e];if(!this.hasCreatedSourceBuffers()){return this.addSourceBuffer(e,t)}if(this.canChangeType()){this.changeType(e,t)}})}appendBuffer(e,t){const{segmentInfo:i,type:n,bytes:s}=e;this.processedAppend_=true;if(n==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]);this.logger_(`delayed audio append of ${s.length} until video append`);return}const r=t;Fm({type:n,sourceUpdater:this,action:Bm.appendBuffer(s,i||{mediaIndex:-1},r),doneFn:t,name:"appendBuffer"});if(n==="video"){this.videoAppendQueued_=true;if(!this.delayedAudioAppendQueue_.length){return}const a=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${a.length} appendBuffers`);this.delayedAudioAppendQueue_.length=0;a.forEach(e=>{this.appendBuffer.apply(this,e)})}}audioBuffered(){if(!Um(this.mediaSource,this.audioBuffer)){return D()}return this.audioBuffer.buffered?this.audioBuffer.buffered:D()}videoBuffered(){if(!Um(this.mediaSource,this.videoBuffer)){return D()}return this.videoBuffer.buffered?this.videoBuffer.buffered:D()}buffered(){const e=Um(this.mediaSource,this.videoBuffer)?this.videoBuffer:null;const t=Um(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;if(t&&!e){return this.audioBuffered()}if(e&&!t){return this.videoBuffered()}return fh(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Dm){Fm({type:"mediaSource",sourceUpdater:this,action:Bm.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Dm){if(typeof e!=="string"){e=undefined}Fm({type:"mediaSource",sourceUpdater:this,action:Bm.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,i=Dm){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){i();return}Fm({type:"audio",sourceUpdater:this,action:Bm.remove(e,t),doneFn:i,name:"remove"})}removeVideo(e,t,i=Dm){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){i();return}Fm({type:"video",sourceUpdater:this,action:Bm.remove(e,t),doneFn:i,name:"remove"})}updating(){if(Pm("audio",this)||Pm("video",this)){return true}return false}audioTimestampOffset(e){if(typeof e!=="undefined"&&this.audioBuffer&&this.audioTimestampOffset_!==e){Fm({type:"audio",sourceUpdater:this,action:Bm.timestampOffset(e),name:"timestampOffset"});this.audioTimestampOffset_=e}return this.audioTimestampOffset_}videoTimestampOffset(e){if(typeof e!=="undefined"&&this.videoBuffer&&this.videoTimestampOffset!==e){Fm({type:"video",sourceUpdater:this,action:Bm.timestampOffset(e),name:"timestampOffset"});this.videoTimestampOffset_=e}return this.videoTimestampOffset_}audioQueueCallback(e){if(!this.audioBuffer){return}Fm({type:"audio",sourceUpdater:this,action:Bm.callback(e),name:"callback"})}videoQueueCallback(e){if(!this.videoBuffer){return}Fm({type:"video",sourceUpdater:this,action:Bm.callback(e),name:"callback"})}dispose(){this.trigger("dispose");Om.forEach(e=>{this.abort(e);if(this.canRemoveSourceBuffer()){this.removeSourceBuffer(e)}else{this[`${e}QueueCallback`](()=>Mm(e,this))}});this.videoAppendQueued_=false;this.delayedAudioAppendQueue_.length=0;if(this.sourceopenListener_){this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_)}this.off()}}const Hm=e=>decodeURIComponent(escape(String.fromCharCode.apply(null,e)));const $m=new Uint8Array("\n\n".split("").map(e=>e.charCodeAt(0)));class zm extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class Gm extends xm{constructor(e,t={}){super(e,t);this.mediaSource_=null;this.subtitlesTrack_=null;this.loaderType_="subtitle";this.featuresNativeTextTracks_=e.featuresNativeTextTracks;this.loadVttJs=e.loadVttJs;this.shouldSaveSegmentTimingInfo_=false}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length){return D()}const e=this.subtitlesTrack_.cues;const t=e[0].startTime;const i=e[e.length-1].startTime;return D([[t,i]])}initSegmentForMap(e,t=false){if(!e){return null}const i=wf(e);let n=this.initSegments_[i];if(t&&!n&&e.bytes){const s=$m.byteLength+e.bytes.byteLength;const r=new Uint8Array(s);r.set(e.bytes);r.set($m,e.bytes.byteLength);this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:r}}return n||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){this.state="READY";this.resetEverything();return this.monitorBuffer_()}track(e){if(typeof e==="undefined"){return this.subtitlesTrack_}this.subtitlesTrack_=e;if(this.state==="INIT"&&this.couldBeginLoading_()){this.init_()}return this.subtitlesTrack_}remove(e,t){lm(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(!e){return}if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY";if(!this.paused()){this.monitorBuffer_()}};this.syncController_.one("timestampoffset",t);this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){while(e&&e.segment.empty){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e);this.state="READY";this.pause();this.trigger("error")}segmentRequestFinished_(e,t,i){if(!this.subtitlesTrack_){this.state="READY";return}this.saveTransferStats_(t.stats);if(!this.pendingSegment_){this.state="READY";this.mediaRequestsAborted+=1;return}if(e){if(e.code===yp.TIMEOUT){this.handleTimeout_()}if(e.code===yp.ABORTED){this.mediaRequestsAborted+=1}else{this.mediaRequestsErrored+=1}this.stopForError(e);return}const n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats);if(t.key){this.segmentKey(t.key,true)}this.state="APPENDING";this.trigger("appending");const s=n.segment;if(s.map){s.map.bytes=t.map.bytes}n.bytes=t.bytes;if(typeof tv.WebVTT!=="function"&&typeof this.loadVttJs==="function"){this.state="WAITING_ON_VTTJS";this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,i),()=>this.stopForError({message:"Error loading vtt.js"}));return}s.requested=true;try{this.parseVTTCues_(n)}catch(e){this.stopForError({message:e.message});return}this.updateTimeMapping_(n,this.syncController_.timelines[n.timeline],this.playlist_);if(n.cues.length){n.timingInfo={start:n.cues[0].startTime,end:n.cues[n.cues.length-1].endTime}}else{n.timingInfo={start:n.startOfSegment,end:n.startOfSegment+n.duration}}if(n.isSyncRequest){this.trigger("syncinfoupdate");this.pendingSegment_=null;this.state="READY";return}n.byteLength=n.bytes.byteLength;this.mediaSecondsLoaded+=s.duration;n.cues.forEach(e=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new tv.VTTCue(e.startTime,e.endTime,e.text):e)});dm(this.subtitlesTrack_);this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(t){let e;let i=false;if(typeof tv.WebVTT!=="function"){throw new zm}if(typeof tv.TextDecoder==="function"){e=new tv.TextDecoder("utf8")}else{e=tv.WebVTT.StringDecoder();i=true}const n=new tv.WebVTT.Parser(tv,tv.vttjs,e);t.cues=[];t.timestampmap={MPEGTS:0,LOCAL:0};n.oncue=t.cues.push.bind(t.cues);n.ontimestampmap=e=>{t.timestampmap=e};n.onparsingerror=e=>{S.log.warn("Error encountered when parsing cues: "+e.message)};if(t.segment.map){let e=t.segment.map.bytes;if(i){e=Hm(e)}n.parse(e)}let s=t.bytes;if(i){s=Hm(s)}n.parse(s);n.flush()}updateTimeMapping_(e,t,i){const n=e.segment;if(!t){return}if(!e.cues.length){n.empty=true;return}const s=e.timestampmap;const r=s.MPEGTS/ih-s.LOCAL+t.mapping;e.cues.forEach(e=>{e.startTime+=r;e.endTime+=r});if(!i.syncInfo){const a=e.cues[0].startTime;const o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(a,o-n.duration)}}}}const Wm=function(e,t){const i=e.cues;for(let e=0;e=n.adStartTime&&t<=n.adEndTime){return n}}return null};const Km=function(t,i,e=0){if(!t.segments){return}let n=e;let s;for(let e=0;e{if(i!==Infinity){const r={time:0,segmentIndex:0,partIndex:null};return r}return null}},{name:"ProgramDateTime",run:(n,s,e,t,r)=>{if(!Object.keys(n.timelineToDatetimeMappings).length){return null}let a=null;let o=null;const l=Th(s);r=r||0;for(let i=0;i{let r=null;let a=null;s=s||0;const o=Th(i);for(let t=0;t=c){a=c;r={time:u,segmentIndex:l.segmentIndex,partIndex:l.partIndex}}}}return r}},{name:"Discontinuity",run:(i,n,e,t,s)=>{let r=null;s=s||0;if(n.discontinuityStarts&&n.discontinuityStarts.length){let t=null;for(let e=0;e=d){t=d;r={time:l.time,segmentIndex:a,partIndex:null}}}}}return r}},{name:"Playlist",run:(e,t,i,n,s)=>{if(t.syncInfo){const r={time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null};return r}return null}}];class Qm extends S.EventTarget{constructor(e={}){super();this.timelines=[];this.discontinuities=[];this.timelineToDatetimeMappings={};this.logger_=rh("SyncController")}getSyncPoint(e,t,i,n){const s=this.runStrategies_(e,t,i,n);if(!s.length){return null}return this.selectSyncPoint_(s,{key:"time",value:n})}getExpiredTime(e,t){if(!e||!e.segments){return null}const i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length){return null}const n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});if(n.segmentIndex>0){n.time*=-1}return Math.abs(n.time+jh({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))}runStrategies_(t,i,n,s){const r=[];for(let e=0;eXm){S.log.warn(`Not saving expired segment info. Media sequence gap ${n} is too large.`);return}for(let e=n-1;e>=0;e--){const s=t.segments[e];if(s&&typeof s.start!=="undefined"){i.syncInfo={mediaSequence:t.mediaSequence+e,time:s.start};this.logger_(`playlist refresh sync: [time:${i.syncInfo.time},`+` mediaSequence: ${i.syncInfo.mediaSequence}]`);this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){this.timelineToDatetimeMappings={};if(e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0];const i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const i=this.calculateSegmentTimeMapping_(e,e.timingInfo,t);const n=e.segment;if(i){this.saveDiscontinuitySyncInfo_(e);if(!e.playlist.syncInfo){e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:n.start}}}const s=n.dateTimeObject;if(n.discontinuity&&t&&s){this.timelineToDatetimeMappings[n.timeline]=-(s.getTime()/1e3)}}timestampOffsetForTimeline(e){if(typeof this.timelines[e]==="undefined"){return null}return this.timelines[e].time}mappingForTimeline(e){if(typeof this.timelines[e]==="undefined"){return null}return this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,i){const n=e.segment;const s=e.part;let r=this.timelines[e.timeline];let a;let o;if(typeof e.timestampOffset==="number"){r={time:e.startOfSegment,mapping:e.startOfSegment-t.start};if(i){this.timelines[e.timeline]=r;this.trigger("timestampoffset");this.logger_(`time mapping for timeline ${e.timeline}: `+`[time: ${r.time}] [mapping: ${r.mapping}]`)}a=e.startOfSegment;o=t.end+r.mapping}else if(r){a=t.start+r.mapping;o=t.end+r.mapping}else{return false}if(s){s.start=a;s.end=o}if(!n.start||ao){let e;if(a<0){e=n.start-jh({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:t.mediaIndex,endIndex:s})}else{e=n.end+jh({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:t.mediaIndex+1,endIndex:s})}this.discontinuities[r]={time:e,accuracy:o}}}}}dispose(){this.trigger("dispose");this.off()}}class Jm extends S.EventTarget{constructor(){super();this.pendingTimelineChanges_={};this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null;this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:i}){if(typeof t==="number"&&typeof i==="number"){this.pendingTimelineChanges_[e]={type:e,from:t,to:i};this.trigger("pendingtimelinechange")}return this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:i}){if(typeof t==="number"&&typeof i==="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:i};delete this.pendingTimelineChanges_[e];this.trigger("timelinechange")}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose");this.pendingTimelineChanges_={};this.lastTimelineChanges_={};this.off()}}const Zm=tp(ip(function(){var e=function(){function e(){this.listeners={}}var t=e.prototype;t.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};t.off=function e(t,i){if(!this.listeners[t]){return false}var n=this.listeners[t].indexOf(i);this.listeners[t]=this.listeners[t].slice(0);this.listeners[t].splice(n,1);return n>-1};t.trigger=function e(t){var i=this.listeners[t];if(!i){return}if(arguments.length===2){var n=i.length;for(var s=0;s>7)*283)^r]=r}for(a=o=0;!n[a];a^=u||1,o=d[o]||1){f=o^o<<1^o<<2^o<<3^o<<4;f=f>>8^f&255^99;n[a]=f;s[f]=a;h=l[c=l[u=l[a]]];m=h*16843009^c*65537^u*257^a*16843008;p=l[f]*257^f*16843008;for(r=0;r<4;r++){t[r][a]=p=p<<24^p>>>8;i[r][f]=m=m<<24^m>>>8}}for(r=0;r<5;r++){t[r]=t[r].slice(0);i[r]=i[r].slice(0)}return e};let c=null;class g{constructor(e){if(!c){c=u()}this._tables=[[c[0][0].slice(),c[0][1].slice(),c[0][2].slice(),c[0][3].slice(),c[0][4].slice()],[c[1][0].slice(),c[1][1].slice(),c[1][2].slice(),c[1][3].slice(),c[1][4].slice()]];let t;let i;let n;const s=this._tables[0][4];const r=this._tables[1];const a=e.length;let o=1;if(a!==4&&a!==6&&a!==8){throw new Error("Invalid aes key size")}const l=e.slice(0);const d=[];this._key=[l,d];for(t=a;t<4*a+28;t++){n=l[t-1];if(t%a===0||a===8&&t%a===4){n=s[n>>>24]<<24^s[n>>16&255]<<16^s[n>>8&255]<<8^s[n&255];if(t%a===0){n=n<<8^n>>>24^o<<24;o=o<<1^(o>>7)*283}}l[t]=l[t-a]^n}for(i=0;t;i++,t--){n=l[i&3?t:t-4];if(t<=4||i<4){d[i]=n}else{d[i]=r[0][s[n>>>24]]^r[1][s[n>>16&255]]^r[2][s[n>>8&255]]^r[3][s[n&255]]}}}decrypt(e,t,i,n,s,r){const a=this._key[1];let o=e^a[0];let l=n^a[1];let d=i^a[2];let u=t^a[3];let c;let h;let f;const p=a.length/4-2;let m;let g=4;const v=this._tables[1];const y=v[0];const b=v[1];const _=v[2];const T=v[3];const S=v[4];for(m=0;m>>24]^b[l>>16&255]^_[d>>8&255]^T[u&255]^a[g];h=y[l>>>24]^b[d>>16&255]^_[u>>8&255]^T[o&255]^a[g+1];f=y[d>>>24]^b[u>>16&255]^_[o>>8&255]^T[l&255]^a[g+2];u=y[u>>>24]^b[o>>16&255]^_[l>>8&255]^T[d&255]^a[g+3];g+=4;o=c;l=h;d=f}for(m=0;m<4;m++){s[(3&-m)+r]=S[o>>>24]<<24^S[l>>16&255]<<16^S[d>>8&255]<<8^S[u&255]^a[g++];c=o;o=l;l=d;d=u;u=c}}}class d extends e{constructor(){super(e);this.jobs=[];this.delay=1;this.timeout_=null}processJob_(){this.jobs.shift()();if(this.jobs.length){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}else{this.timeout_=null}}push(e){this.jobs.push(e);if(!this.timeout_){this.timeout_=setTimeout(this.processJob_.bind(this),this.delay)}}}const v=function(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24};const r=function(e,t,i){const n=new Int32Array(e.buffer,e.byteOffset,e.byteLength>>2);const s=new g(Array.prototype.slice.call(t));const r=new Uint8Array(e.byteLength);const a=new Int32Array(r.buffer);let o;let l;let d;let u;let c;let h;let f;let p;let m;o=i[0];l=i[1];d=i[2];u=i[3];for(m=0;m{const t=i[e];if(s(t)){n[e]={bytes:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}}else{n[e]=t}});return n};self.onmessage=function(e){const i=e.data;const t=new Uint8Array(i.encrypted.bytes,i.encrypted.byteOffset,i.encrypted.byteLength);const n=new Uint32Array(i.key.bytes,i.key.byteOffset,i.key.byteLength/4);const s=new Uint32Array(i.iv.bytes,i.iv.byteOffset,i.iv.byteLength/4);new h(t,n,s,function(e,t){self.postMessage(o({source:i.source,decrypted:t}),[t.buffer])})}}));var eg=ep(Zm);const tg=e=>{let t=e.default?"main":"alternative";if(e.characteristics&&e.characteristics.indexOf("public.accessibility.describes-video")>=0){t="main-desc"}return t};const ig=(e,t)=>{e.abort();e.pause();if(t&&t.activePlaylistLoader){t.activePlaylistLoader.pause();t.activePlaylistLoader=null}};const ng=(e,t)=>{t.activePlaylistLoader=e;e.load()};const sg=(o,l)=>()=>{const{segmentLoaders:{[o]:e,main:t},mediaTypes:{[o]:i}}=l;const n=i.activeTrack();const s=i.getActiveGroup();const r=i.activePlaylistLoader;const a=i.lastGroup_;if(s&&a&&s.id===a.id){return}i.lastGroup_=s;i.lastTrack_=n;ig(e,i);if(!s||s.isMainPlaylist){return}if(!s.playlistLoader){if(r){t.resetEverything()}return}e.resyncLoader();ng(s.playlistLoader,i)};const rg=(i,n)=>()=>{const{segmentLoaders:{[i]:e},mediaTypes:{[i]:t}}=n;t.lastGroup_=null;e.abort();e.pause()};const ag=(u,c)=>()=>{const{mainPlaylistLoader:e,segmentLoaders:{[u]:t,main:i},mediaTypes:{[u]:n}}=c;const s=n.activeTrack();const r=n.getActiveGroup();const a=n.activePlaylistLoader;const o=n.lastTrack_;if(o&&s&&o.id===s.id){return}n.lastGroup_=r;n.lastTrack_=s;ig(t,n);if(!r){return}if(r.isMainPlaylist){if(!s||!o||s.id===o.id){return}const l=c.vhs.playlistController_;const d=l.selectPlaylist();if(l.media()===d){return}n.logger_(`track change. Switching main audio from ${o.id} to ${s.id}`);e.pause();i.resetEverything();l.fastQualityChange_(d);return}if(u==="AUDIO"){if(!r.playlistLoader){i.setAudio(true);i.resetEverything();return}t.setAudio(true);i.setAudio(false)}if(a===r.playlistLoader){ng(r.playlistLoader,n);return}if(t.track){t.track(s)}t.resetEverything();ng(r.playlistLoader,n)};const og={AUDIO:(l,d)=>()=>{const{segmentLoaders:{[l]:e},mediaTypes:{[l]:t},excludePlaylist:i}=d;ig(e,t);const n=t.activeTrack();const s=t.activeGroup();const r=(s.filter(e=>e.default)[0]||s[0]).id;const a=t.tracks[r];if(n===a){i({error:{message:"Problem encountered loading the default audio track."}});return}S.log.warn("Problem encountered loading the alternate audio track."+"Switching back to default.");for(const o in t.tracks){t.tracks[o].enabled=t.tracks[o]===a}t.onTrackChanged()},SUBTITLES:(n,s)=>()=>{const{segmentLoaders:{[n]:e},mediaTypes:{[n]:t}}=s;S.log.warn("Problem encountered loading the subtitle track."+"Disabling subtitle track.");ig(e,t);const i=t.activeTrack();if(i){i.mode="disabled"}t.onTrackChanged()}};const lg={AUDIO:(e,t,i)=>{if(!t){return}const{tech:n,requestOptions:s,segmentLoaders:{[e]:r}}=i;t.on("loadedmetadata",()=>{const e=t.media();r.playlist(e,s);if(!n.paused()||e.endList&&n.preload()!=="none"){r.load()}});t.on("loadedplaylist",()=>{r.playlist(t.media(),s);if(!n.paused()){r.load()}});t.on("error",og[e](e,i))},SUBTITLES:(e,t,i)=>{const{tech:n,requestOptions:s,segmentLoaders:{[e]:r},mediaTypes:{[e]:a}}=i;t.on("loadedmetadata",()=>{const e=t.media();r.playlist(e,s);r.track(a.activeTrack());if(!n.paused()||e.endList&&n.preload()!=="none"){r.load()}});t.on("loadedplaylist",()=>{r.playlist(t.media(),s);if(!n.paused()){r.load()}});t.on("error",og[e](e,i))}};const dg={AUDIO:(i,n)=>{const{vhs:s,sourceType:r,segmentLoaders:{[i]:e},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[i]:{groups:l,tracks:d,logger_:u}},mainPlaylistLoader:c}=n;const h=Hh(c.main);if(!o[i]||Object.keys(o[i]).length===0){o[i]={main:{default:{default:true}}};if(h){o[i].main.default.playlists=c.main.playlists}}for(const f in o[i]){if(!l[f]){l[f]=[]}for(const p in o[i][f]){let e=o[i][f][p];let t;if(h){u(`AUDIO group '${f}' label '${p}' is a main playlist`);e.isMainPlaylist=true;t=null}else if(r==="vhs-json"&&e.playlists){t=new hf(e.playlists[0],s,a)}else if(e.resolvedUri){t=new hf(e.resolvedUri,s,a)}else if(e.playlists&&r==="dash"){t=new Yf(e.playlists[0],s,a,c)}else{t=null}e=P({id:p,playlistLoader:t},e);lg[i](i,e.playlistLoader,n);l[f].push(e);if(typeof d[p]==="undefined"){const m=new S.AudioTrack({id:p,kind:tg(e),enabled:false,language:e.language,default:e.default,label:p});d[p]=m}}}e.on("error",og[i](i,n))},SUBTITLES:(i,n)=>{const{tech:s,vhs:r,sourceType:a,segmentLoaders:{[i]:e},requestOptions:o,main:{mediaGroups:l},mediaTypes:{[i]:{groups:d,tracks:u}},mainPlaylistLoader:c}=n;for(const h in l[i]){if(!d[h]){d[h]=[]}for(const f in l[i][h]){if(!r.options_.useForcedSubtitles&&l[i][h][f].forced){continue}let e=l[i][h][f];let t;if(a==="hls"){t=new hf(e.resolvedUri,r,o)}else if(a==="dash"){const p=e.playlists.filter(e=>e.excludeUntil!==Infinity);if(!p.length){return}t=new Yf(e.playlists[0],r,o,c)}else if(a==="vhs-json"){t=new hf(e.playlists?e.playlists[0]:e.resolvedUri,r,o)}e=P({id:f,playlistLoader:t},e);lg[i](i,e.playlistLoader,n);d[h].push(e);if(typeof u[f]==="undefined"){const m=s.addRemoteTextTrack({id:f,kind:"subtitles",default:e.default&&e.autoselect,language:e.language,label:f},false).track;u[f]=m}}}e.on("error",og[i](i,n))},"CLOSED-CAPTIONS":(t,e)=>{const{tech:i,main:{mediaGroups:n},mediaTypes:{[t]:{groups:s,tracks:r}}}=e;for(const a in n[t]){if(!s[a]){s[a]=[]}for(const o in n[t][a]){const l=n[t][a][o];if(!/^(?:CC|SERVICE)/.test(l.instreamId)){continue}const d=i.options_.vhs&&i.options_.vhs.captionServices||{};let e={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(d[e.instreamId]){e=P(e,d[e.instreamId])}if(e.default===undefined){delete e.default}s[a].push(P({id:o},l));if(typeof r[o]==="undefined"){const u=i.addRemoteTextTrack({id:e.instreamId,kind:"captions",default:e.default,language:e.language,label:e.label},false).track;r[o]=u}}}}};const ug=(t,i)=>{for(let e=0;et=>{const{mainPlaylistLoader:e,mediaTypes:{[o]:{groups:i}}}=l;const n=e.media();if(!n){return null}let s=null;if(n.attributes[o]){s=i[n.attributes[o]]}const r=Object.keys(i);if(!s){if(o==="AUDIO"&&r.length>1&&Hh(l.main)){for(let e=0;ee.id===t.id)[0]||null};const hg={AUDIO:(i,n)=>()=>{const{mediaTypes:{[i]:{tracks:e}}}=n;for(const t in e){if(e[t].enabled){return e[t]}}return null},SUBTITLES:(i,n)=>()=>{const{mediaTypes:{[i]:{tracks:e}}}=n;for(const t in e){if(e[t].mode==="showing"||e[t].mode==="hidden"){return e[t]}}return null}};const fg=(t,{mediaTypes:i})=>()=>{const e=i[t].activeTrack();if(!e){return null}return i[t].activeGroup(e)};const pg=t=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{dg[e](e,t)});const{mediaTypes:i,mainPlaylistLoader:e,tech:n,vhs:s,segmentLoaders:{["AUDIO"]:r,main:a}}=t;["AUDIO","SUBTITLES"].forEach(e=>{i[e].activeGroup=cg(e,t);i[e].activeTrack=hg[e](e,t);i[e].onGroupChanged=sg(e,t);i[e].onGroupChanging=rg(e,t);i[e].onTrackChanged=ag(e,t);i[e].getActiveGroup=fg(e,t)});const o=i.AUDIO.activeGroup();if(o){const d=(o.filter(e=>e.default)[0]||o[0]).id;i.AUDIO.tracks[d].enabled=true;i.AUDIO.onGroupChanged();i.AUDIO.onTrackChanged();const u=i.AUDIO.getActiveGroup();if(!u.playlistLoader){a.setAudio(true)}else{a.setAudio(false);r.setAudio(true)}}e.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(e=>i[e].onGroupChanged())});e.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(e=>i[e].onGroupChanging())});const l=()=>{i.AUDIO.onTrackChanged();n.trigger({type:"usage",name:"vhs-audio-change"})};n.audioTracks().addEventListener("change",l);n.remoteTextTracks().addEventListener("change",i.SUBTITLES.onTrackChanged);s.on("dispose",()=>{n.audioTracks().removeEventListener("change",l);n.remoteTextTracks().removeEventListener("change",i.SUBTITLES.onTrackChanged)});n.clearTracks("audio");for(const c in i.AUDIO.tracks){n.audioTracks().addTrack(i.AUDIO.tracks[c])}};const mg=()=>{const t={};["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Dm,activeTrack:Dm,getActiveGroup:Dm,onGroupChanged:Dm,onTrackChanged:Dm,lastTrack_:null,logger_:rh(`MediaGroups[${e}]`)}});return t};const gg=10;let vg;const yg=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"];const bg=function(e){return this.audioSegmentLoader_[e]+this.mainSegmentLoader_[e]};const _g=function({currentPlaylist:e,buffered:t,currentTime:i,nextPlaylist:n,bufferLowWaterLine:s,bufferHighWaterLine:r,duration:a,bufferBasedABR:o,log:l}){if(!n){S.log.warn("We received no playlist to switch to. Please check your stream.");return false}const d=`allowing switch ${e&&e.id||"null"} -> ${n.id}`;if(!e){l(`${d} as current playlist is not set`);return true}if(n.id===e.id){return false}const u=Boolean(uh(t,i).length);if(!e.endList){if(!u&&typeof e.partTargetDuration==="number"){l(`not ${d} as current playlist is live llhls, but currentTime isn't in buffered.`);return false}l(`${d} as current playlist is live`);return true}const c=bh(t,i);const h=o?R.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:R.MAX_BUFFER_LOW_WATER_LINE;if(ap)&&c>=s){let e=`${d} as forwardBuffer >= bufferLowWaterLine (${c} >= ${s})`;if(o){e+=` and next bandwidth > current bandwidth (${f} > ${p})`}l(e);return true}l(`not ${d} as no switching criteria met`);return false};class Tg extends S.EventTarget{constructor(e){super();const{src:t,withCredentials:i,tech:s,bandwidth:n,externVhs:r,useCueTags:a,playlistExclusionDuration:o,enableLowInitialPlaylist:l,sourceType:d,cacheEncryptionKeys:u,bufferBasedABR:c,leastPixelDiffSelector:h,captionServices:f}=e;if(!t){throw new Error("A non-empty playlist URL or JSON manifest string is required")}let{maxPlaylistRetries:p}=e;if(p===null||typeof p==="undefined"){p=Infinity}vg=r;this.bufferBasedABR=Boolean(c);this.leastPixelDiffSelector=Boolean(h);this.withCredentials=i;this.tech_=s;this.vhs_=s.vhs;this.sourceType_=d;this.useCueTags_=a;this.playlistExclusionDuration=o;this.maxPlaylistRetries=p;this.enableLowInitialPlaylist=l;if(this.useCueTags_){this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues");this.cueTagsTrack_.inBandMetadataTrackDispatchType=""}this.requestOptions_={withCredentials:i,maxPlaylistRetries:p,timeout:null};this.on("error",this.pauseLoading);this.mediaTypes_=mg();this.mediaSource=new tv.MediaSource;this.handleDurationChange_=this.handleDurationChange_.bind(this);this.handleSourceOpen_=this.handleSourceOpen_.bind(this);this.handleSourceEnded_=this.handleSourceEnded_.bind(this);this.mediaSource.addEventListener("durationchange",this.handleDurationChange_);this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_);this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_);this.seekable_=D();this.hasPlayed_=false;this.syncController_=new Qm(e);this.segmentMetadataTrack_=s.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},false).track;this.decrypter_=new eg;this.sourceUpdater_=new Vm(this.mediaSource);this.inbandTextTracks_={};this.timelineChangeController_=new Jm;const m={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,calculateTimestampOffsetForEachSegment:e.calculateTimestampOffsetForEachSegment,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:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Yf(t,this.vhs_,P(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new hf(t,this.vhs_,P(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)}));this.setupMainPlaylistLoaderListeners_();this.mainSegmentLoader_=new xm(P(m,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e);this.audioSegmentLoader_=new xm(P(m,{loaderType:"audio"}),e);this.subtitleSegmentLoader_=new Gm(P(m,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((e,t)=>{function i(){s.off("vttjserror",n);e()}function n(){s.off("vttjsloaded",i);t()}s.one("vttjsloaded",i);s.one("vttjserror",n);s.addWebVttScript_()})}),e);this.setupSegmentLoaderListeners_();if(this.bufferBasedABR){this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_());this.tech_.on("pause",()=>this.stopABRTimer_());this.tech_.on("play",()=>this.startABRTimer_())}yg.forEach(e=>{this[e+"_"]=bg.bind(this,e)});this.logger_=rh("pc");this.triggeredFmp4Usage=false;if(this.tech_.preload()==="none"){this.loadOnPlay_=()=>{this.loadOnPlay_=null;this.mainPlaylistLoader_.load()};this.tech_.one("play",this.loadOnPlay_)}else{this.mainPlaylistLoader_.load()}this.timeToLoadedData__=-1;this.mainAppendsToLoadedData__=-1;this.audioAppendsToLoadedData__=-1;const g=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(g,()=>{const e=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-e;this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends;this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_();const t=this.audioAppendsToLoadedData_();if(e===-1||t===-1){return-1}return e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();if(t&&this.shouldSwitchToMedia_(t)){this.switchMedia_(t,e)}}switchMedia_(e,t,i){const n=this.media();const s=n&&(n.id||n.uri);const r=e.id||e.uri;if(s&&s!==r){this.logger_(`switch media ${s} -> ${r} from ${t}`);this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,i)}startABRTimer_(){this.stopABRTimer_();this.abrTimer_=tv.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){if(this.tech_.scrubbing&&this.tech_.scrubbing()){return}tv.clearInterval(this.abrTimer_);this.abrTimer_=null}getAudioTrackPlaylists_(){const t=this.main();const e=t&&t.playlists||[];if(!t||!t.mediaGroups||!t.mediaGroups.AUDIO){return e}const i=t.mediaGroups.AUDIO;const n=Object.keys(i);let s;if(Object.keys(this.mediaTypes_.AUDIO.groups).length){s=this.mediaTypes_.AUDIO.activeTrack()}else{const a=i.main||n.length&&i[n[0]];for(const o in a){if(a[o].default){s={label:o};break}}}if(!s){return e}const r=[];for(const l in i){if(i[l][s.label]){const d=i[l][s.label];if(d.playlists&&d.playlists.length){r.push.apply(r,d.playlists)}else if(d.uri){r.push(d)}else if(t.playlists.length){for(let e=0;e{const e=this.mainPlaylistLoader_.media();const t=e.targetDuration*1.5*1e3;if(Fh(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=t}if(e.endList&&this.tech_.preload()!=="none"){this.mainSegmentLoader_.playlist(e,this.requestOptions_);this.mainSegmentLoader_.load()}pg({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)});this.triggerPresenceUsage_(this.main(),e);this.setupFirstPlay();if(!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()){this.trigger("selectedinitialmedia")}else{this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}});this.mainPlaylistLoader_.on("loadedplaylist",()=>{if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}let t=this.mainPlaylistLoader_.media();if(!t){this.excludeUnsupportedVariants_();let e;if(this.enableLowInitialPlaylist){e=this.selectInitialPlaylist()}if(!e){e=this.selectPlaylist()}if(!e||!this.shouldSwitchToMedia_(e)){return}this.initialMedia_=e;this.switchMedia_(this.initialMedia_,"initial");const i=this.sourceType_==="vhs-json"&&this.initialMedia_.segments;if(!i){return}t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)});this.mainPlaylistLoader_.on("error",()=>{const e=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:e.playlist,error:e})});this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort();this.mainSegmentLoader_.pause()});this.mainPlaylistLoader_.on("mediachange",()=>{const e=this.mainPlaylistLoader_.media();const t=e.targetDuration*1.5*1e3;if(Fh(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())){this.requestOptions_.timeout=0}else{this.requestOptions_.timeout=t}this.mainPlaylistLoader_.load();this.mainSegmentLoader_.playlist(e,this.requestOptions_);this.mainSegmentLoader_.load();this.tech_.trigger({type:"mediachange",bubbles:true})});this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if(e.lastExcludeReason_==="playlist-unchanged"){return}const t=this.stuckAtPlaylistEnd_(e);if(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"})})}handleUpdatedMediaPlaylist(e){if(this.useCueTags_){this.updateAdCues_(e)}this.mainSegmentLoader_.playlist(e,this.requestOptions_);this.updateDuration(!e.endList);if(!this.tech_.paused()){this.mainSegmentLoader_.load();if(this.audioSegmentLoader_){this.audioSegmentLoader_.load()}}}triggerPresenceUsage_(e,t){const i=e.mediaGroups||{};let n=true;const s=Object.keys(i.AUDIO);for(const r in i.AUDIO){for(const a in i.AUDIO[r]){const o=i.AUDIO[r][a];if(!o.uri){n=false}}}if(n){this.tech_.trigger({type:"usage",name:"vhs-demuxed"})}if(Object.keys(i.SUBTITLES).length){this.tech_.trigger({type:"usage",name:"vhs-webvtt"})}if(vg.Playlist.isAes(t)){this.tech_.trigger({type:"usage",name:"vhs-aes"})}if(s.length&&Object.keys(i.AUDIO[s[0]]).length>1){this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"})}if(this.useCueTags_){this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_;const i=this.tech_.currentTime();const n=this.bufferLowWaterLine();const s=this.bufferHighWaterLine();const r=this.tech_.buffered();return _g({buffered:r,currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:s,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate");this.tech_.trigger("bandwidthupdate")});this.mainSegmentLoader_.on("timeout",()=>{if(this.bufferBasedABR){this.mainSegmentLoader_.load()}});if(!this.bufferBasedABR){this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")})}this.mainSegmentLoader_.on("error",()=>{const e=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:e.playlist,error:e})});this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_;this.trigger("error")});this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()});this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})});this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()});this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_;this.trigger("error")});this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended");this.onEndOfStream()});this.mainSegmentLoader_.on("earlyabort",e=>{if(this.bufferBasedABR){return}this.delegateLoaders_("all",["abort"]);this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete "+"the request without rebuffering."},playlistExclusionDuration:gg})});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers()){return this.tryToCreateSourceBuffers_()}const e=this.getCodecsOrExclude_();if(!e){return}this.sourceUpdater_.addOrChangeSourceBuffers(e)};this.mainSegmentLoader_.on("trackinfo",e);this.audioSegmentLoader_.on("trackinfo",e);this.mainSegmentLoader_.on("fmp4",()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:"usage",name:"vhs-fmp4"});this.triggeredFmp4Usage=true}});this.audioSegmentLoader_.on("fmp4",()=>{if(!this.triggeredFmp4Usage){this.tech_.trigger({type:"usage",name:"vhs-fmp4"});this.triggeredFmp4Usage=true}});this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended");this.onEndOfStream()})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.load()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.load()}}fastQualityChange_(e=this.selectPlaylist()){if(e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality");this.resetMainLoaderReplaceSegments()}resetMainLoaderReplaceSegments(){const e=this.tech_.buffered();const t=e.end(e.length-1);this.mainSegmentLoader_.replaceSegmentsUntil=t;this.mainSegmentLoader_.resetLoaderProperties();this.mainSegmentLoader_.resetLoader()}play(){if(this.setupFirstPlay()){return}if(this.tech_.ended()){this.tech_.setCurrentTime(0)}if(this.hasPlayed_){this.load()}const e=this.tech_.seekable();if(this.tech_.duration()===Infinity){if(this.tech_.currentTime(){})}}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_){return}const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length){return}const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===Infinity?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();if(!t||t.hasVideo){e=e&&this.audioSegmentLoader_.ended_}else{e=this.audioSegmentLoader_.ended_}}if(!e){return}this.stopABRTimer_();this.sourceUpdater_.endOfStream()}stuckAtPlaylistEnd_(e){const t=this.seekable();if(!t.length){return false}const i=this.syncController_.getExpiredTime(e,this.duration());if(i===null){return false}const n=vg.Playlist.playlistEnd(e,i);const s=this.tech_.currentTime();const r=this.tech_.buffered();if(!r.length){return n-s<=lh}const a=r.end(r.length-1);return a-s<=lh&&n-a<=lh}excludePlaylist({playlistToExclude:n=this.mainPlaylistLoader_.media(),error:e={},playlistExclusionDuration:t}){n=n||this.mainPlaylistLoader_.media();t=t||e.playlistExclusionDuration||this.playlistExclusionDuration;if(!n){this.error=e;if(this.mediaSource.readyState!=="open"){this.trigger("error")}else{this.sourceUpdater_.endOfStream("network")}return}n.playlistErrors_++;const s=this.mainPlaylistLoader_.main.playlists;const i=s.filter(Lh);const r=i.length===1&&i[0]===n;if(s.length===1&&t!==Infinity){S.log.warn(`Problem encountered with playlist ${n.id}. `+"Trying again since it is the only playlist.");this.tech_.trigger("retryplaylist");return this.mainPlaylistLoader_.load(r)}if(r){let i=false;s.forEach(e=>{if(e===n){return}const t=e.excludeUntil;if(typeof t!=="undefined"&&t!==Infinity){i=true;delete e.excludeUntil}});if(i){S.log.warn("Removing other playlists from the exclusion list because the last "+"rendition is about to be excluded.");this.tech_.trigger("retryplaylist")}}let a;if(n.playlistErrors_>this.maxPlaylistRetries){a=Infinity}else{a=Date.now()+t*1e3}n.excludeUntil=a;if(e.reason){n.lastExcludeReason_=e.reason}this.tech_.trigger("excludeplaylist");this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const o=this.selectPlaylist();if(!o){this.error="Playback cannot continue. No available working or supported playlists.";this.trigger("error");return}const l=e.internal?this.logger_:S.log.warn;const d=e.message?" "+e.message:"";l(`${e.internal?"Internal problem":"Problem"} encountered with playlist ${n.id}.`+`${d} Switching to playlist ${o.id}.`);if(o.attributes.AUDIO!==n.attributes.AUDIO){this.delegateLoaders_("audio",["abort","pause"])}if(o.attributes.SUBTITLES!==n.attributes.SUBTITLES){this.delegateLoaders_("subtitle",["abort","pause"])}this.delegateLoaders_("main",["abort","pause"]);const u=o.targetDuration/2*1e3||5*1e3;const c=typeof o.lastRequest==="number"&&Date.now()-o.lastRequest<=u;return this.switchMedia_(o,"exclude",r||c)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]);this.stopABRTimer_()}delegateLoaders_(i,e){const n=[];const t=i==="all";if(t||i==="main"){n.push(this.mainPlaylistLoader_)}const s=[];if(t||i==="audio"){s.push("AUDIO")}if(t||i==="subtitle"){s.push("CLOSED-CAPTIONS");s.push("SUBTITLES")}s.forEach(e=>{const t=this.mediaTypes_[e]&&this.mediaTypes_[e].activePlaylistLoader;if(t){n.push(t)}});["main","audio","subtitle"].forEach(e=>{const t=this[`${e}SegmentLoader_`];if(t&&(i===e||i==="all")){n.push(t)}});n.forEach(t=>e.forEach(e=>{if(typeof t[e]==="function"){t[e]()}}))}setCurrentTime(e){const t=uh(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())){return 0}if(!this.mainPlaylistLoader_.media().segments){return 0}if(t&&t.length){return e}this.mainSegmentLoader_.resetEverything();if(this.mediaTypes_.AUDIO.activePlaylistLoader){this.audioSegmentLoader_.resetEverything()}if(this.mediaTypes_.SUBTITLES.activePlaylistLoader){this.subtitleSegmentLoader_.resetEverything()}this.load()}duration(){if(!this.mainPlaylistLoader_){return 0}const e=this.mainPlaylistLoader_.media();if(!e){return 0}if(!e.endList){return Infinity}if(this.mediaSource){return this.mediaSource.duration}return vg.Playlist.duration(e)}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_){return}let t=this.mainPlaylistLoader_.media();if(!t){return}let i=this.syncController_.getExpiredTime(t,this.duration());if(i===null){return}const n=this.mainPlaylistLoader_.main;const s=vg.Playlist.seekable(t,i,vg.Playlist.liveEdgeDelay(n,t));if(s.length===0){return}if(this.mediaTypes_.AUDIO.activePlaylistLoader){t=this.mediaTypes_.AUDIO.activePlaylistLoader.media();i=this.syncController_.getExpiredTime(t,this.duration());if(i===null){return}e=vg.Playlist.seekable(t,i,vg.Playlist.liveEdgeDelay(n,t));if(e.length===0){return}}let r;let a;if(this.seekable_&&this.seekable_.length){r=this.seekable_.end(0);a=this.seekable_.start(0)}if(!e){this.seekable_=s}else if(e.start(0)>s.end(0)||s.start(0)>e.end(0)){this.seekable_=s}else{this.seekable_=D([[e.start(0)>s.start(0)?e.start(0):s.start(0),e.end(0)0){i=Math.max(i,t.end(t.length-1))}if(this.mediaSource.duration!==i){this.sourceUpdater_.setDuration(i)}}dispose(){this.trigger("dispose");this.decrypter_.terminate();this.mainPlaylistLoader_.dispose();this.mainSegmentLoader_.dispose();if(this.loadOnPlay_){this.tech_.off("play",this.loadOnPlay_)}["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const i in t){t[i].forEach(e=>{if(e.playlistLoader){e.playlistLoader.dispose()}})}});this.audioSegmentLoader_.dispose();this.subtitleSegmentLoader_.dispose();this.sourceUpdater_.dispose();this.timelineChangeController_.dispose();this.stopABRTimer_();if(this.updateDuration_){this.mediaSource.removeEventListener("sourceopen",this.updateDuration_)}this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_);this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_);this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_);this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader;const t=!!this.mainSegmentLoader_.getCurrentMediaInfo_();const i=!e?true:!!this.audioSegmentLoader_.getCurrentMediaInfo_();if(!t||!i){return false}return true}getCodecsOrExclude_(){const i={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};const n=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();i.video=i.main;const e=qp(this.main(),n);const s={};const t=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(i.main.hasVideo){s.video=e.video||i.main.videoCodec||so}if(i.main.isMuxed){s.video+=`,${e.audio||i.main.audioCodec||no}`}if(i.main.hasAudio&&!i.main.isMuxed||i.audio.hasAudio||t){s.audio=e.audio||i.main.audioCodec||i.audio.audioCodec||no;i.audio.isFmp4=i.main.hasAudio&&!i.main.isMuxed?i.main.isFmp4:i.audio.isFmp4}if(!s.audio&&!s.video){this.excludePlaylist({playlistToExclude:n,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:Infinity});return}const r=(e,t)=>e?to(t):io(t);const a={};let o;["video","audio"].forEach(function(e){if(s.hasOwnProperty(e)&&!r(i[e].isFmp4,s[e])){const t=i[e].isFmp4?"browser":"muxer";a[t]=a[t]||[];a[t].push(s[e]);if(e==="audio"){o=t}}});if(t&&o&&n.attributes.AUDIO){const l=n.attributes.AUDIO;this.main().playlists.forEach(e=>{const t=e.attributes&&e.attributes.AUDIO;if(t===l&&e!==n){e.excludeUntil=Infinity}});this.logger_(`excluding audio group ${l} as ${o} does not support codec(s): "${s.audio}"`)}if(Object.keys(a).length){const d=Object.keys(a).reduce((e,t)=>{if(e){e+=", "}e+=`${t} does not support codec(s): "${a[t].join(",")}"`;return e},"")+".";this.excludePlaylist({playlistToExclude:n,error:{internal:true,message:d},playlistExclusionDuration:Infinity});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const u=[];["video","audio"].forEach(e=>{const t=(Ya(this.sourceUpdater_.codecs[e]||"")[0]||{}).type;const i=(Ya(s[e]||"")[0]||{}).type;if(t&&i&&t.toLowerCase()!==i.toLowerCase()){u.push(`"${this.sourceUpdater_.codecs[e]}" -> "${s[e]}"`)}});if(u.length){this.excludePlaylist({playlistToExclude:n,error:{message:`Codec switching not supported: ${u.join(", ")}.`,internal:true},playlistExclusionDuration:Infinity});return}}return s}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()){return}if(!this.areMediaTypesKnown_()){return}const e=this.getCodecsOrExclude_();if(!e){return}this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const s=this.main().playlists;const r=[];Object.keys(s).forEach(e=>{const t=s[e];if(r.indexOf(t.id)!==-1){return}r.push(t.id);const i=qp(this.main,t);const n=[];if(i.audio&&!io(i.audio)&&!to(i.audio)){n.push(`audio codec ${i.audio}`)}if(i.video&&!io(i.video)&&!to(i.video)){n.push(`video codec ${i.video}`)}if(i.text&&i.text==="stpp.ttml.im1t"){n.push(`text codec ${i.text}`)}if(n.length){t.excludeUntil=Infinity;this.logger_(`excluding ${t.id} for unsupported: ${n.join(", ")}`)}})}excludeIncompatibleVariants_(e){const o=[];const l=this.main().playlists;const t=Bp(Ya(e));const d=Fp(t);const u=t.video&&Ya(t.video)[0]||null;const c=t.audio&&Ya(t.audio)[0]||null;Object.keys(l).forEach(e=>{const t=l[e];if(o.indexOf(t.id)!==-1||t.excludeUntil===Infinity){return}o.push(t.id);const i=[];const n=qp(this.mainPlaylistLoader_.main,t);const s=Fp(n);if(!n.audio&&!n.video){return}if(s!==d){i.push(`codec count "${s}" !=="${d}"`)}if(!this.sourceUpdater_.canChangeType()){const r=n.video&&Ya(n.video)[0]||null;const a=n.audio&&Ya(n.audio)[0]||null;if(r&&u&&r.type.toLowerCase()!==u.type.toLowerCase()){i.push(`video codec "${r.type}" !=="${u.type}"`)}if(a&&c&&a.type.toLowerCase()!==c.type.toLowerCase()){i.push(`audio codec "${a.type}" !=="${c.type}"`)}}if(i.length){t.excludeUntil=Infinity;this.logger_(`excluding ${t.id}: ${i.join(" && ")}`)}})}updateAdCues_(e){let t=0;const i=this.seekable();if(i.length){t=i.start(0)}Km(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime();const t=R.GOAL_BUFFER_LENGTH;const i=R.GOAL_BUFFER_LENGTH_RATE;const n=Math.max(t,R.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*i,n)}bufferLowWaterLine(){const e=this.tech_.currentTime();const t=R.BUFFER_LOW_WATER_LINE;const i=R.BUFFER_LOW_WATER_LINE_RATE;const n=Math.max(t,R.MAX_BUFFER_LOW_WATER_LINE);const s=Math.max(t,R.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*i,this.bufferBasedABR?s:n)}bufferHighWaterLine(){return R.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){om(this.inbandTextTracks_,"com.apple.streaming",this.tech_);am({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,i){const n=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();om(this.inbandTextTracks_,e,this.tech_);nm({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:n,videoDuration:i})}}const Sg=(s,r,a)=>e=>{const t=s.main.playlists[r];const i=Ph(t);const n=Lh(t);if(typeof e==="undefined"){return n}if(e){delete t.disabled}else{t.disabled=true}if(e!==n&&!i){a();if(e){s.trigger("renditionenabled")}else{s.trigger("renditiondisabled")}}return e};class Eg{constructor(e,t,i){const{playlistController_:n}=e;const s=n.fastQualityChange_.bind(n);if(t.attributes){const r=t.attributes.RESOLUTION;this.width=r&&r.width;this.height=r&&r.height;this.bandwidth=t.attributes.BANDWIDTH;this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=qp(n.main(),t);this.playlist=t;this.id=i;this.enabled=Sg(e.playlists,t.id,s)}}const wg=function(i){i.representations=()=>{const e=i.playlistController_.main();const t=Hh(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;if(!t){return[]}return t.filter(e=>!Ph(e)).map((e,t)=>new Eg(i,e,e.id))}};const Ig=["seeking","seeked","pause","playing","error"];class kg{constructor(e){this.playlistController_=e.playlistController;this.tech_=e.tech;this.seekable=e.seekable;this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow;this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta;this.media=e.media;this.consecutiveUpdates=0;this.lastRecordedTime=null;this.checkCurrentTimeTimeout_=null;this.logger_=rh("PlaybackWatcher");this.logger_("initialize");const t=()=>this.monitorCurrentTime_();const i=()=>this.monitorCurrentTime_();const n=()=>this.techWaiting_();const s=()=>this.resetTimeUpdate_();const r=this.playlistController_;const a=["main","subtitle","audio"];const o={};a.forEach(e=>{o[e]={reset:()=>this.resetSegmentDownloads_(e),updateend:()=>this.checkSegmentDownloads_(e)};r[`${e}SegmentLoader_`].on("appendsdone",o[e].updateend);r[`${e}SegmentLoader_`].on("playlistupdate",o[e].reset);this.tech_.on(["seeked","seeking"],o[e].reset)});const l=t=>{["main","audio"].forEach(e=>{r[`${e}SegmentLoader_`][t]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{if(this.fixesBadSeeks_()){this.consecutiveUpdates=0;this.lastRecordedTime=this.tech_.currentTime();l("off")}};this.clearSeekingAppendCheck_=()=>l("off");this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_();l("on")};this.tech_.on("seeked",this.clearSeekingAppendCheck_);this.tech_.on("seeking",this.watchForBadSeeking_);this.tech_.on("waiting",n);this.tech_.on(Ig,s);this.tech_.on("canplay",i);this.tech_.one("play",t);this.dispose=()=>{this.clearSeekingAppendCheck_();this.logger_("dispose");this.tech_.off("waiting",n);this.tech_.off(Ig,s);this.tech_.off("canplay",i);this.tech_.off("play",t);this.tech_.off("seeking",this.watchForBadSeeking_);this.tech_.off("seeked",this.clearSeekingAppendCheck_);a.forEach(e=>{r[`${e}SegmentLoader_`].off("appendsdone",o[e].updateend);r[`${e}SegmentLoader_`].off("playlistupdate",o[e].reset);this.tech_.off(["seeked","seeking"],o[e].reset)});if(this.checkCurrentTimeTimeout_){tv.clearTimeout(this.checkCurrentTimeTimeout_)}this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_();if(this.checkCurrentTimeTimeout_){tv.clearTimeout(this.checkCurrentTimeTimeout_)}this.checkCurrentTimeTimeout_=tv.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];if(this[`${e}StalledDownloads_`]>0){this.logger_(`resetting possible stalled download count for ${e} loader`)}this[`${e}StalledDownloads_`]=0;this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_;const i=t[`${e}SegmentLoader_`];const n=i.buffered_();const s=vh(this[`${e}Buffered_`],n);this[`${e}Buffered_`]=n;if(s){this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++;this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:i.playlist_&&i.playlist_.id,buffered:gh(n)});if(this[`${e}StalledDownloads_`]<10){return}this.logger_(`${e} loader stalled download exclusion`);this.resetSegmentDownloads_(e);this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`});if(e==="subtitle"){return}t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:Infinity})}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking()){return}const e=this.tech_.currentTime();const t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+lh>=t.end(t.length-1))){return this.techWaiting_()}if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime){this.consecutiveUpdates++;this.waiting_()}else if(e===this.lastRecordedTime){this.consecutiveUpdates++}else{this.consecutiveUpdates=0;this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){const e=this.tech_.seeking();if(!e){return false}const t=this.seekable();const i=this.tech_.currentTime();const n=this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let s;if(n){const f=t.end(t.length-1);s=f}if(this.beforeSeekableWindow_(t,i)){const p=t.start(0);s=p+(p===t.end(0)?0:lh)}if(typeof s!=="undefined"){this.logger_(`Trying to seek outside of seekable at time ${i} with `+`seekable range ${ph(t)}. Seeking to `+`${s}.`);this.tech_.setCurrentTime(s);return true}const r=this.playlistController_.sourceUpdater_;const a=this.tech_.buffered();const o=r.audioBuffer?r.audioBuffered():null;const l=r.videoBuffer?r.videoBuffered():null;const d=this.media();const u=d.partTargetDuration?d.partTargetDuration:(d.targetDuration-oh)*2;const c=[o,l];for(let e=0;e ${i.end(0)}]. Attempting to resume `+"playback by seeking to the current time.");this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable();const t=this.tech_.currentTime();if(this.tech_.seeking()){return true}if(this.beforeSeekableWindow_(e,t)){const a=e.end(e.length-1);this.logger_(`Fell out of live window at time ${t}. Seeking to `+`live point (seekable end) ${a}`);this.resetTimeUpdate_();this.tech_.setCurrentTime(a);this.tech_.trigger({type:"usage",name:"vhs-live-resync"});return true}const i=this.tech_.vhs.playlistController_.sourceUpdater_;const n=this.tech_.buffered();const s=this.videoUnderflow_({audioBuffered:i.audioBuffered(),videoBuffered:i.videoBuffered(),currentTime:t});if(s){this.resetTimeUpdate_();this.tech_.setCurrentTime(t);this.tech_.trigger({type:"usage",name:"vhs-video-underflow"});return true}const r=ch(n,t);if(r.length>0){this.logger_(`Stopped at ${t} and seeking to ${r.start(0)}`);this.resetTimeUpdate_();this.skipTheGap_(t);return true}return false}afterSeekableWindow_(e,t,i,n=false){if(!e.length){return false}let s=e.end(e.length-1)+lh;const r=!i.endList;const a=typeof i.partTargetDuration==="number";if(r&&(a||n)){s=e.end(e.length-1)+i.targetDuration*3}if(t>s){return true}return false}beforeSeekableWindow_(e,t){if(e.length&&e.start(0)>0&&t2){return{start:n,end:s}}}return null}}const Cg={errorInterval:30,getSource(e){const t=this.tech({IWillNotUseThisInPlugins:true});const i=t.currentSource_||this.currentSource();return e(i)}};const Ag=function(t,e){let i=0;let n=0;const s=P(Cg,e);t.ready(()=>{t.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const r=function(){if(n){t.currentTime(n)}};const a=function(e){if(e===null||e===undefined){return}n=t.duration()!==Infinity&&t.currentTime()||0;t.one("loadedmetadata",r);t.src(e);t.trigger({type:"usage",name:"vhs-error-reload"});t.play()};const o=function(){if(Date.now()-i{Object.defineProperty(O,t,{get(){S.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`);return R[t]},set(e){S.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`);if(typeof e!=="number"||e<0){S.log.warn(`value of Vhs.${t} must be greater than or equal to 0`);return}R[t]=e}})});const Lg="videojs-vhs";const Ng=function(t,e){const i=e.media();let n=-1;for(let e=0;e{t.addQualityLevel(e)});Ng(t,e.playlists)};O.canPlaySource=function(){return S.log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};const Ug=(e,t,i)=>{if(!e){return e}let n={};if(t&&t.attributes&&t.attributes.CODECS){n=Bp(Ya(t.attributes.CODECS))}if(i&&i.attributes&&i.attributes.CODECS){n.audio=i.attributes.CODECS}const s=eo(n.video);const r=eo(n.audio);const a={};for(const o in e){a[o]={};if(r){a[o].audioContentType=r}if(s){a[o].videoContentType=s}if(t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh){a[o].pssh=t.contentProtection[o].pssh}if(typeof e[o]==="string"){a[o].url=e[o]}}return P(e,a)};const Bg=(e,i)=>{return e.reduce((e,n)=>{if(!n.contentProtection){return e}const t=i.reduce((e,t)=>{const i=n.contentProtection[t];if(i&&i.pssh){e[t]={pssh:i.pssh}}return e},{});if(Object.keys(t).length){e.push(t)}return e},[])};const Fg=({player:n,sourceKeySystems:e,audioMedia:t,mainPlaylists:i})=>{if(!n.eme.initializeMediaKeys){return Promise.resolve()}const s=t?i.concat([t]):i;const r=Bg(s,Object.keys(e));const a=[];const o=[];r.forEach(e=>{o.push(new Promise((e,t)=>{n.tech_.one("keysessioncreated",e)}));a.push(new Promise((t,i)=>{n.eme.initializeMediaKeys({keySystems:e},e=>{if(e){i(e);return}t()})}))});return Promise.race([Promise.all(a),Promise.race(o)])};const qg=({player:e,sourceKeySystems:t,media:i,audioMedia:n})=>{const s=Ug(t,i,n);if(!s){return false}e.currentSource().keySystems=s;if(s&&!e.eme){S.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin");return false}return true};const Vg=()=>{if(!tv.localStorage){return null}const e=tv.localStorage.getItem(Lg);if(!e){return null}try{return JSON.parse(e)}catch(e){return null}};const Hg=e=>{if(!tv.localStorage){return false}let t=Vg();t=t?P(t,e):e;try{tv.localStorage.setItem(Lg,JSON.stringify(t))}catch(e){return false}return t};const $g=e=>{if(e.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0){return JSON.parse(e.substring(e.indexOf(",")+1))}return e};const zg=(e,t)=>{if(!e._requestCallbackSet){e._requestCallbackSet=new Set}e._requestCallbackSet.add(t)};const Gg=(e,t)=>{if(!e._responseCallbackSet){e._responseCallbackSet=new Set}e._responseCallbackSet.add(t)};const Wg=(e,t)=>{if(!e._requestCallbackSet){return}e._requestCallbackSet.delete(t);if(!e._requestCallbackSet.size){delete e._requestCallbackSet}};const Kg=(e,t)=>{if(!e._responseCallbackSet){return}e._responseCallbackSet.delete(t);if(!e._responseCallbackSet.size){delete e._responseCallbackSet}};O.supportsNativeHls=function(){if(!iv||!iv.createElement){return false}const t=iv.createElement("video");if(!S.getTech("Html5").isSupported()){return false}const e=["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"];return e.some(function(e){return/maybe|probably/i.test(t.canPlayType(e))})}();O.supportsNativeDash=function(){if(!iv||!iv.createElement||!S.getTech("Html5").isSupported()){return false}return/maybe|probably/i.test(iv.createElement("video").canPlayType("application/dash+xml"))}();O.supportsTypeNatively=e=>{if(e==="hls"){return O.supportsNativeHls}if(e==="dash"){return O.supportsNativeDash}return false};O.isSupported=function(){return S.log.warn("VHS is no longer a tech. Please remove it from "+"your player's techOrder.")};O.xhr.onRequest=function(e){zg(O.xhr,e)};O.xhr.onResponse=function(e){Gg(O.xhr,e)};O.xhr.offRequest=function(e){Wg(O.xhr,e)};O.xhr.offResponse=function(e){Kg(O.xhr,e)};const Xg=S.getComponent("Component");class Yg extends Xg{constructor(e,t,i){super(t,i.vhs);if(typeof i.initialBandwidth==="number"){this.options_.bandwidth=i.initialBandwidth}this.logger_=rh("VhsHandler");if(t.options_&&t.options_.playerId){const n=S.getPlayer(t.options_.playerId);this.player_=n}this.tech_=t;this.source_=e;this.stats={};this.ignoreNextSeekingEvent_=false;this.setOptions_();if(this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks){t.overrideNativeAudioTracks(true);t.overrideNativeVideoTracks(true)}else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks)){throw new Error("Overriding native VHS requires emulated tracks. "+"See https://git.io/vMpjB")}this.on(iv,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],e=>{const t=iv.fullscreenElement||iv.webkitFullscreenElement||iv.mozFullScreenElement||iv.msFullscreenElement;if(t&&t.contains(this.tech_.el())){this.playlistController_.fastQualityChange_()}else{this.playlistController_.checkABR_()}});this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=false;return}this.setCurrentTime(this.tech_.currentTime())});this.on(this.tech_,"error",function(){if(this.tech_.error()&&this.playlistController_){this.playlistController_.pauseLoading()}});this.on(this.tech_,"play",this.play)}setOptions_(){this.options_.withCredentials=this.options_.withCredentials||false;this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions===false?false:true;this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||false;this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage!=="undefined"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||false;this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||false;this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||false;this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||false;this.options_.calculateTimestampOffsetForEachSegment=this.options_.calculateTimestampOffsetForEachSegment||false;this.options_.customTagParsers=this.options_.customTagParsers||[];this.options_.customTagMappers=this.options_.customTagMappers||[];this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||false;this.options_.llhls=this.options_.llhls===false?false:true;this.options_.bufferBasedABR=this.options_.bufferBasedABR||false;if(typeof this.options_.playlistExclusionDuration!=="number"){this.options_.playlistExclusionDuration=60}if(typeof this.options_.bandwidth!=="number"){if(this.options_.useBandwidthFromLocalStorage){const e=Vg();if(e&&e.bandwidth){this.options_.bandwidth=e.bandwidth;this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})}if(e&&e.throughput){this.options_.throughput=e.throughput;this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"})}}}if(typeof this.options_.bandwidth!=="number"){this.options_.bandwidth=R.INITIAL_BANDWIDTH}this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===R.INITIAL_BANDWIDTH;["withCredentials","useDevicePixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","calculateTimestampOffsetForEachSegment","exactManifestTimings","leastPixelDiffSelector"].forEach(e=>{if(typeof this.source_[e]!=="undefined"){this.options_[e]=this.source_[e]}});this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions;this.useDevicePixelRatio=this.options_.useDevicePixelRatio}src(e,t){if(!e){return}this.setOptions_();this.options_.src=$g(this.source_.src);this.options_.tech=this.tech_;this.options_.externVhs=O;this.options_.sourceType=oo(t);this.options_.seekTo=e=>{this.tech_.setCurrentTime(e)};this.playlistController_=new Tg(this.options_);const i=P({liveRangeSafeTimeDelta:lh},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new kg(i);this.playlistController_.on("error",()=>{const e=S.players[this.tech_.options_.playerId];let t=this.playlistController_.error;if(typeof t==="object"&&!t.code){t.code=3}else if(typeof t==="string"){t={message:t,code:3}}e.error(t)});const n=this.options_.bufferBasedABR?O.movingAverageBandwidthSelector(.55):O.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):n.bind(this);this.playlistController_.selectInitialPlaylist=O.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(e){this.playlistController_.selectPlaylist=e.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(e){this.playlistController_.mainSegmentLoader_.throughput.rate=e;this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let e=this.playlistController_.mainSegmentLoader_.bandwidth;const t=tv.navigator.connection||tv.navigator.mozConnection||tv.navigator.webkitConnection;const i=1e7;if(this.options_.useNetworkInformationApi&&t){const n=t.downlink*1e3*1e3;if(n>=i&&e>=i){e=Math.max(e,n)}else{e=n}}return e},set(e){this.playlistController_.mainSegmentLoader_.bandwidth=e;this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const e=1/(this.bandwidth||1);let t;if(this.throughput>0){t=1/this.throughput}else{t=0}const i=Math.floor(1/(e+t));return i},set(){S.log.error('The "systemBandwidth" property is read-only')}}});if(this.options_.bandwidth){this.bandwidth=this.options_.bandwidth}if(this.options_.throughput){this.throughput=this.options_.throughput}Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:true},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:true},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:true},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:true},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:true},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:true},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:true},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:true},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:true},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:true},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:true},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:true},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:true},buffered:{get:()=>gh(this.tech_.buffered()),enumerable:true},currentTime:{get:()=>this.tech_.currentTime(),enumerable:true},currentSource:{get:()=>this.tech_.currentSource_,enumerable:true},currentTech:{get:()=>this.tech_.name_,enumerable:true},duration:{get:()=>this.tech_.duration(),enumerable:true},main:{get:()=>this.playlists.main,enumerable:true},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:true},seekable:{get:()=>gh(this.tech_.seekable()),enumerable:true},timestamp:{get:()=>Date.now(),enumerable:true},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:true}});this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_));this.tech_.on("bandwidthupdate",()=>{if(this.options_.useBandwidthFromLocalStorage){Hg({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}});this.playlistController_.on("selectedinitialmedia",()=>{wg(this)});this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()});this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")});this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=true});this.setupQualityLevels_();if(!this.tech_.el()){return}this.mediaSourceUrl_=tv.URL.createObjectURL(this.playlistController_.mediaSource);this.tech_.src(this.mediaSourceUrl_)}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation");Fg({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session");this.playlistController_.sourceUpdater_.initializedEme()}).catch(e=>{this.logger_("error while creating EME key session",e);this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions");this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;const t=qg({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});this.player_.tech_.on("keystatuschange",e=>{if(e.status!=="output-restricted"){return}const t=this.playlistController_.main();if(!t||!t.playlists){return}const i=[];t.playlists.forEach(e=>{if(e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height>=720){if(!e.excludeUntil||e.excludeUntil{Mg(this.qualityLevels_,this)});this.playlists.on("mediachange",()=>{Ng(this.qualityLevels_,this.playlists)})}static version(){return{"@videojs/http-streaming":xg,"mux.js":Dg,"mpd-parser":Rg,"m3u8-parser":Og,"aes-decrypter":Pg}}version(){return this.constructor.version()}canChangeType(){return Vm.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){if(this.playbackWatcher_){this.playbackWatcher_.dispose()}if(this.playlistController_){this.playlistController_.dispose()}if(this.qualityLevels_){this.qualityLevels_.dispose()}if(this.tech_&&this.tech_.vhs){delete this.tech_.vhs}if(this.mediaSourceUrl_&&tv.URL.revokeObjectURL){tv.URL.revokeObjectURL(this.mediaSourceUrl_);this.mediaSourceUrl_=null}if(this.tech_){this.tech_.off("waitingforkey",this.handleWaitingForKey_)}super.dispose()}convertToProgramTime(e,t){return Mf({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,i=true,n=2){return Uf({programTime:e,playlist:this.playlistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{zg(this.xhr,e)};this.xhr.onResponse=e=>{Gg(this.xhr,e)};this.xhr.offRequest=e=>{Wg(this.xhr,e)};this.xhr.offResponse=e=>{Kg(this.xhr,e)};this.player_.trigger("xhr-hooks-ready")}}const Qg={name:"videojs-http-streaming",VERSION:xg,canHandleSource(e,t={}){const i=P(S.options,t);return Qg.canPlayType(e.type,i)},handleSource(e,t,i={}){const n=P(S.options,i);t.vhs=new Yg(e,t,n);t.vhs.xhr=vf();t.vhs.setupXhrHooks_();t.vhs.src(e.src,e.type);return t.vhs},canPlayType(e,t){const i=oo(e);if(!i){return""}const n=Qg.getOverrideNative(t);const s=O.supportsTypeNatively(i);const r=!s||n;return r?"maybe":""},getOverrideNative(e={}){const{vhs:t={}}=e;const i=!(S.browser.IS_ANY_SAFARI||S.browser.IS_IOS);const{overrideNative:n=i}=t;return n}};const Jg=()=>{return to("avc1.4d400d,mp4a.40.2")};if(Jg()){S.getTech("Html5").registerSourceHandler(Qg,0)}S.VhsHandler=Yg;S.VhsSourceHandler=Qg;S.Vhs=O;if(!S.use){S.registerComponent("Vhs",O)}S.options.vhs=S.options.vhs||{};if(!S.getPlugin||!S.getPlugin("reloadSourceOnError")){S.registerPlugin("reloadSourceOnError",jg)}return S})})(P);var L=P.exports;var h=O(L);var k="2.1.1";function w(){w=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&arguments[1]!==undefined?arguments[1]:null;a.remove();a.srcObject=null;clearTimeout(d);n({result:t,error:i})};if(l!==undefined){l.then(function(){return u(true)}).catch(function(e){return u(false,e)})}else{u(true)}})}function F(e){e=U(e);return B(e,function(){return{element:iv.createElement("video"),source:URL.createObjectURL(M)}})}function q(e){e=U(e);return B(e,function(){return{element:iv.createElement("audio"),source:URL.createObjectURL(N)}})}var $={audio:q,video:F};const z=[{inline:false,muted:false},{inline:true,muted:false},{inline:false,muted:true},{inline:true,muted:true}];function G(e){const t=e.filter(e=>e.passed)[0];if(!t){return{always:false,sometimes:false,never:true,inline:false,muted:false}}const{inline:i,muted:n}=t;const s=!i&&!n;return{always:s,sometimes:!s,never:false,inline:i,muted:n}}function W(e){let t;if(tv.cast&&tv.cast.receiver){t={always:true,sometimes:false,never:false,inline:false,muted:false}}if(e.ANDROID_VERSION||e.IS_IOS){t={always:false,sometimes:true,never:false,inline:false,muted:true};if(e.IS_IPHONE){t.inline=true}}if(t){return Promise.resolve(t)}}function K(e,t){if(e!=="video"&&e!=="audio"){throw new Error(`invalid autoplay type: ${e}`)}const i=W(t.browser);if(i){return i}const n=z.map(t=>{return $[e](t).then(({result:e})=>{return w({passed:e},t)})});return Promise.all(n).then(e=>{return G(e)})}const i=tv.performance;const X={};["memory","navigation","timing"].forEach(e=>{X[e]=i&&i[e]||{}});["clearMarks","clearMeasures","clearResourceTimings","getEntries","getEntriesByName","getEntriesByType","mark","measure","now","setResourceTimingBufferSize","toJSON"].forEach(t=>{X[t]=(...e)=>{if(i&&i[t]){return i[t](...e)}}});function Y(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var Q=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"};function r(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}}function J(i,n,s,e){n=n||"&";s=s||"=";if(i===null){i=undefined}if(typeof i==="object"){return Z(ee(i),function(e){var t=encodeURIComponent(r(e))+s;if(Q(i[e])){return Z(i[e],function(e){return t+encodeURIComponent(r(e))}).join(n)}else{return t+encodeURIComponent(r(i[e]))}}).join(n)}if(!e)return"";return encodeURIComponent(r(e))+s+encodeURIComponent(r(i))}function Z(e,t){if(e.map)return e.map(t);var i=[];for(var n=0;n0&&o>a){o=a}for(var l=0;l=0){c=d.substr(0,u);h=d.substr(u+1)}else{c=d;h=""}f=decodeURIComponent(c);p=decodeURIComponent(h);if(!Y(s,f)){s[f]=p}else if(Q(s[f])){s[f].push(p)}else{s[f]=[s[f],p]}}return s}var ie={encode:J,stringify:J,decode:te,parse:te};function ne(e=tv&&tv.location||{}){let t;let i;try{t=ie.parse((e.hash||"#").substr(1))}catch(e){t={}}try{i=ie.parse((e.search||"?").substr(1))}catch(e){i={}}return w({hash:t,search:i},ie)}const n={isArr(e){return Array.isArray(e)},isFn(e){return typeof e==="function"},isNil(e){return e===null||e===undefined},isNum(e){return typeof e==="number"&&e===e},isNonEmptyStr(e){return typeof e==="string"&&/\S/.test(e)},isObj(e){return Object.prototype.toString.call(e)==="[object Object]"}};const se=(e,t)=>{if(e){const i=Number(e.substring(0,e.indexOf(".")));if(i){return i>=t}h.log.warn("Plugin VERSION string format does not conform to semantic versioning standards and cannot be checked.")}return false};const re=e=>{return e==="application/vnd.apple.mpegurl"||e==="application/x-mpegURL"};const ae=(e,t)=>{const i=e&&e.encryption&&e.encryption.method;if(typeof i==="string"){return i.toLowerCase()==="aes-128"}const n=t.url.parseUrl(e.src);return n.hostname.indexOf("boltdns.net")!==-1&&n.pathname.indexOf("/aes128/")!==-1};const oe=(t,e)=>{const i=["audio","video"];let n;for(let e=0;e{const{mediainfo:t,liveTracker:i}=e;const n=t&&t.duration||e.duration();return i&&i.isLive()||n===Infinity};var ue={isLive:de};const ce=()=>{const e=tv.GestureEvent;return!!(e&&tv.WebKitMediaKeys&&tv.WebKitMediaKeys.isTypeSupported("com.apple.fps.1_0","video/mp4"))};const he=e=>{return e.browser.IS_EDGE&&/Chrome/i.test(tv.navigator.userAgent)};const fe=e=>{return tv.navigator.requestMediaKeySystemAccess&&!e.browser.IS_IOS&&(e.browser.IS_FIREFOX||e.browser.IS_CHROME||he(e))};const pe=e=>{return tv.SourceBuffer&&tv.SourceBuffer.prototype&&typeof tv.SourceBuffer.prototype.changeType==="function"};const me=()=>{return tv.MediaSource&&tv.MediaSource.isTypeSupported&&tv.MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L60.90"')};const ge=e=>{return e.isSecureContext||!/^http:/.test(e.location.href)};let s;const ve=()=>{s=undefined};const ye=e=>{if(s!==undefined){return s}const t=iv.createElement("video");const i=e.options.hls&&e.options.hls.overrideNative;if(t&&t.canPlayType){s=!i&&/probably|maybe/i.test(t.canPlayType("application/vnd.apple.mpegurl"))}else{s=false}return s};var be={isSafariWithFairplaySupport:ce,isChromiumEdge:he,isBrowserWithWidevineSupport:fe,isCodecSwitchingSupported:pe,isHevcSupported:me,preferHttps:ge,isNativeHlsSupported:ye,clearCachedIsNativeHlsSupported:ve};var _e=function(){function e(){this.listeners={}}var t=e.prototype;t.on=function e(t,i){if(!this.listeners[t]){this.listeners[t]=[]}this.listeners[t].push(i)};t.off=function e(t,i){if(!this.listeners[t]){return false}var n=this.listeners[t].indexOf(i);this.listeners[t]=this.listeners[t].slice(0);this.listeners[t].splice(n,1);return n>-1};t.trigger=function e(t){var i=this.listeners[t];if(!i){return}if(arguments.length===2){var n=i.length;for(var s=0;s-1;t=this.buffer.indexOf("\n")){this.trigger("data",this.buffer.substring(0,t));this.buffer=this.buffer.substring(t+1)}}}const we=String.fromCharCode(9);const Ie=function(e){const t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||"");const i={};if(t[1]){i.length=parseInt(t[1],10)}if(t[2]){i.offset=parseInt(t[2],10)}return i};const ke=function(){const e="[^=]*";const t='"[^"]*"|[^,]*';const i="(?:"+e+")=(?:"+t+")";return new RegExp("(?:^|,)("+i+")")};const u=function(e){const t={};if(!e){return t}const i=e.split(ke());let n=i.length;let s;while(n--){if(i[n]===""){continue}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");t[s[0]]=s[1]}return t};class Ce extends _e{constructor(){super();this.customParsers=[];this.tagMappers=[]}push(n){let l;let d;n=n.trim();if(n.length===0){return}if(n[0]!=="#"){this.trigger("data",{type:"uri",uri:n});return}const e=this.tagMappers.reduce((e,t)=>{const i=t(n);if(i===n){return e}return e.concat([i])},[n]);e.forEach(t=>{for(let e=0;ee}this.customParsers.push(e=>{const t=i.exec(e);if(t){this.trigger("data",{type:"custom",data:s(e),customType:n,segment:r});return true}})}addTagMapper({expression:t,map:i}){const e=e=>{if(t.test(e)){return i(e)}return e};this.tagMappers.push(e)}}const Ae=e=>e.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase());const g=function(t){const i={};Object.keys(t).forEach(function(e){i[Ae(e)]=t[e]});return i};const je=function(e){const{serverControl:t,targetDuration:i,partTargetDuration:n}=e;if(!t){return}const s="#EXT-X-SERVER-CONTROL";const r="holdBack";const a="partHoldBack";const o=i&&i*3;const l=n&&n*2;if(i&&!t.hasOwnProperty(r)){t[r]=o;this.trigger("info",{message:`${s} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})}if(o&&t[r]{if(r.uri||!r.parts&&!r.preloadHints){return}if(!r.map&&s){r.map=s}if(!r.key&&o){r.key=o}if(!r.timeline&&typeof h==="number"){r.timeline=h}this.manifest.preloadSegment=r});this.parseStream.on("data",function(a){let t;let i;({tag(){({version(){if(a.version){this.manifest.version=a.version}},"allow-cache"(){this.manifest.allowCache=a.allowed;if(!("allowed"in a)){this.trigger("info",{message:"defaulting allowCache to YES"});this.manifest.allowCache=true}},byterange(){const e={};if("length"in a){r.byterange=e;e.length=a.length;if(!("offset"in a)){a.offset=f}}if("offset"in a){r.byterange=e;e.offset=a.offset}f=e.offset+e.length},endlist(){this.manifest.endList=true},inf(){if(!("mediaSequence"in this.manifest)){this.manifest.mediaSequence=0;this.trigger("info",{message:"defaulting media sequence to zero"})}if(!("discontinuitySequence"in this.manifest)){this.manifest.discontinuitySequence=0;this.trigger("info",{message:"defaulting discontinuity sequence to zero"})}if(a.duration>0){r.duration=a.duration}if(a.duration===0){r.duration=.01;this.trigger("info",{message:"updating zero segment duration to a small value"})}this.manifest.segments=n},key(){if(!a.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(a.attributes.METHOD==="NONE"){o=null;return}if(!a.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(a.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:a.attributes};return}if(a.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.microsoft.playready"]={uri:a.attributes.URI};return}if(a.attributes.KEYFORMAT===c){const e=["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"];if(e.indexOf(a.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(a.attributes.METHOD==="SAMPLE-AES-CENC"){this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"})}if(a.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(a.attributes.KEYID&&a.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{};this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:a.attributes.KEYFORMAT,keyId:a.attributes.KEYID.substring(2)},pssh:Se(a.attributes.URI.split(",")[1])};return}if(!a.attributes.METHOD){this.trigger("warn",{message:"defaulting key method to AES-128"})}o={method:a.attributes.METHOD||"AES-128",uri:a.attributes.URI};if(typeof a.attributes.IV!=="undefined"){o.iv=a.attributes.IV}},"media-sequence"(){if(!isFinite(a.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+a.number});return}this.manifest.mediaSequence=a.number},"discontinuity-sequence"(){if(!isFinite(a.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+a.number});return}this.manifest.discontinuitySequence=a.number;h=a.number},"playlist-type"(){if(!/VOD|EVENT/.test(a.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+a.playlist});return}this.manifest.playlistType=a.playlistType},map(){s={};if(a.uri){s.uri=a.uri}if(a.byterange){s.byterange=a.byterange}if(o){s.key=o}},"stream-inf"(){this.manifest.playlists=n;this.manifest.mediaGroups=this.manifest.mediaGroups||u;if(!a.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}if(!r.attributes){r.attributes={}}w(r.attributes,a.attributes)},media(){this.manifest.mediaGroups=this.manifest.mediaGroups||u;if(!(a.attributes&&a.attributes.TYPE&&a.attributes["GROUP-ID"]&&a.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const e=this.manifest.mediaGroups[a.attributes.TYPE];e[a.attributes["GROUP-ID"]]=e[a.attributes["GROUP-ID"]]||{};t=e[a.attributes["GROUP-ID"]];i={default:/yes/i.test(a.attributes.DEFAULT)};if(i.default){i.autoselect=true}else{i.autoselect=/yes/i.test(a.attributes.AUTOSELECT)}if(a.attributes.LANGUAGE){i.language=a.attributes.LANGUAGE}if(a.attributes.URI){i.uri=a.attributes.URI}if(a.attributes["INSTREAM-ID"]){i.instreamId=a.attributes["INSTREAM-ID"]}if(a.attributes.CHARACTERISTICS){i.characteristics=a.attributes.CHARACTERISTICS}if(a.attributes.FORCED){i.forced=/yes/i.test(a.attributes.FORCED)}t[a.attributes.NAME]=i},discontinuity(){h+=1;r.discontinuity=true;this.manifest.discontinuityStarts.push(n.length)},"program-date-time"(){if(typeof this.manifest.dateTimeString==="undefined"){this.manifest.dateTimeString=a.dateTimeString;this.manifest.dateTimeObject=a.dateTimeObject}r.dateTimeString=a.dateTimeString;r.dateTimeObject=a.dateTimeObject},targetduration(){if(!isFinite(a.duration)||a.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+a.duration});return}this.manifest.targetDuration=a.duration;je.call(this,this.manifest)},start(){if(!a.attributes||isNaN(a.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:a.attributes["TIME-OFFSET"],precise:a.attributes.PRECISE}},"cue-out"(){r.cueOut=a.data},"cue-out-cont"(){r.cueOutCont=a.data},"cue-in"(){r.cueIn=a.data},skip(){this.manifest.skip=g(a.attributes);this.warnOnMissingAttributes_("#EXT-X-SKIP",a.attributes,["SKIPPED-SEGMENTS"])},part(){l=true;const e=this.manifest.segments.length;const t=g(a.attributes);r.parts=r.parts||[];r.parts.push(t);if(t.byterange){if(!t.byterange.hasOwnProperty("offset")){t.byterange.offset=p}p=t.byterange.offset+t.byterange.length}const i=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${i} for segment #${e}`,a.attributes,["URI","DURATION"]);if(this.manifest.renditionReports){this.manifest.renditionReports.forEach((e,t)=>{if(!e.hasOwnProperty("lastPart")){this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${t} lacks required attribute(s): LAST-PART`})}})}},"server-control"(){const e=this.manifest.serverControl=g(a.attributes);if(!e.hasOwnProperty("canBlockReload")){e.canBlockReload=false;this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})}je.call(this,this.manifest);if(e.canSkipDateranges&&!e.hasOwnProperty("canSkipUntil")){this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})}},"preload-hint"(){const t=this.manifest.segments.length;const i=g(a.attributes);const e=i.type&&i.type==="PART";r.preloadHints=r.preloadHints||[];r.preloadHints.push(i);if(i.byterange){if(!i.byterange.hasOwnProperty("offset")){i.byterange.offset=e?p:0;if(e){p=i.byterange.offset+i.byterange.length}}}const n=r.preloadHints.length-1;this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${n} for segment #${t}`,a.attributes,["TYPE","URI"]);if(!i.type){return}for(let e=0;e{e(o,(e,t)=>{if(e||t.statusCode!==200||!t.body){const i=t.statusCode||"";const n=e&&e.message?e.message:"";const s=new Error(`downloadManifest: xhr for manifest at ${o} failed ${i?"with status: "+i:""} ${n}.`);return a(s)}r(t.body)})})}function Re(e){const t=new xe;t.push(e);t.end();return t.manifest}var Oe={downloadManifest:De,parseHlsManifest:Re};function Pe(e,a){const o={};class t{constructor(){Object.values(o).forEach(e=>{this.manageProperty(e)})}reset(){Object.getOwnPropertyNames(o).forEach(e=>{o[e].value.set(this,undefined)})}manageProperty(e){const t=e&&e.name;const i=e&&e.validation;const n=i&&i.validator;const s=i&&i.message;let r;if(!t||!i||!n||!s){throw new Error("unable to add managed property",e)}if(o.hasOwnProperty(t)&&typeof Object.getOwnPropertyDescriptor(this,t)!=="undefined"){h.log.warn(`property ${t} is already managed`);return}if(typeof o[t]==="undefined"){o[t]=w(e,{value:new WeakMap})}if(this.hasOwnProperty(t)){r=this[t];delete this[t]}Object.defineProperty(this,t,{get:()=>o[t].value.get(this),set:e=>{if(n(e)){o[t].value.set(this,e);return}throw new Error(`could not set ${t} to ${e}: ${s}`)},enumerable:true});if(a){Object.defineProperty(this,`${a}${t}`,{get:()=>this[t],enumerable:true})}if(typeof r!=="undefined"){this[t]=r}}}if(!Array.isArray(e)||!e.length){throw new Error("ManagedDataStore needs to be initialised with properties to manage")}e.forEach(e=>{o[e.name]=w(e,{value:new WeakMap})});return new t}var Le={managedDataStore:Pe};const V={perf:X,qs:ne,isValidVersion:se,assign(...e){return w(...e)},get(e,t,i){let n=e;const s=t.split(".");if(!n){return i}for(let e=0;e!n.isNil(e)).map(V.withoutNilValues)}else if(n.isObj(t)){i={};Object.keys(t).forEach(e=>{if(!n.isNil(t[e])){i[e]=V.withoutNilValues(t[e])}})}return i},debounce(n,s,r,a=tv){let o;return function(){const e=this;const t=arguments;let i=function(){o=null;i=null;if(!r){n.apply(e,t)}};if(!o&&r){n.apply(e,t)}a.clearTimeout(o);o=a.setTimeout(i,s)}},throttle(i,n){let s=Date.now();return function(...e){const t=Date.now();if(t-s>=n){i(...e);s=t}}}};V.assign(V,n,le,ue,be,Oe,Le);V.VERSION="n/a";const Ne="bc-style-vjs";function Me(e,t,i){const{classNames:n}=e;if(!t&&!i&&t!==0&&i!==0){return}let s=iv.querySelector("."+n.playerInstanceDimensions);if(!s){s=iv.createElement("style");s.className=n.playerInstanceDimensions;const a=iv.querySelector("."+n.playerStyle)||iv.querySelector("."+Ne);if(a){a.parentNode.insertBefore(s,a.nextSibling)}else{iv.head.appendChild(s)}}else if(s.innerText){if(!t&&t!==0){const o=/width:(\d+)px;/g.exec(s.innerText);if(o&&o[1]){t=tv.parseInt(o[1],10)}}else if(!i&&i!==0){const o=/height:(\d+)px;/g.exec(s.innerText);if(o&&o[1]){i=tv.parseInt(o[1],10)}}}let r="."+n.playerInstance+"{";if(t||t===0){r+="width:"+tv.parseInt(t,10)+"px;"}if(i||i===0){r+="height:"+tv.parseInt(i,10)+"px;"}r+="}";s.innerText=r}const Ue=3;const Be=50;const Fe=t=>{const i=iv.body;const n=iv.createElement("div");n.className="ads ad adsbox doubleclick ad-placement carbon-ads adglare pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text_ads_2 text-ads text-ad-links";n.innerHTML=" ";n.setAttribute("style","height:10px!important;font-size:20px;color:transparent;position:fixed;bottom:0;left:-10000px");let s=0;const r=()=>{s++;const e=n.offsetHeight===0||!i.contains(n)||n.style.display==="none"||n.style.visibility==="hidden";if(e||s===Ue){if(n.parentNode){n.parentNode.removeChild(n)}return t(e)}tv.setTimeout(r,Be)};i.appendChild(n);r()};let qe=null;let Ve;function H(e){if(e||!Ve){Ve=new Promise(e=>{if(iv.readyState==="complete"||iv.readyState!=="loading"&&!iv.documentElement.doScroll){Fe(e)}else{iv.addEventListener("DOMContentLoaded",()=>{Fe(e)})}})}return Ve.then(e=>{qe=e;return e})}Object.defineProperties(H,{VERSION:{enumerable:true,value:"n/a"},lastResult:{enumerable:true,get(){return qe}},mightBe:{enumerable:true,get(){return qe!==false}},mightNotBe:{enumerable:true,get(){return qe!==true}}});const He=function(e){const t=tv.matchMedia("(hover)");let i=true;if(t.media!=="not all"){i=t.matches}return i||e.browser.IS_FIREFOX&&e.browser.IS_WINDOWS};const $e="vjs-waiting-for-autoplay";function ze(e,t,i,n){return e.hasAttribute("data-debug")||t.debug!==undefined||i.debug||n.debug}function Ge(t,e,i,n){const{settings:s,environment:r}=e;const{embedId:a,playerId:o}=s;const{isInBcFrame:l,queryString:d,urlHash:u}=r;const c=`bc-player-${o}_${a}`;const h=`${c}-index-${s.playerIndex}`;V.perf.mark("bcInitStart");s.classNames={player:c,playerStyle:`bc-style-${o}-${a}`,playerInstance:h,playerInstanceDimensions:`${h}-video-dimensions`};s.embedState={controls:i.hasAttribute("controls")||i.hasAttribute("data-controls"),loop:i.hasAttribute("loop"),muted:i.hasAttribute("muted"),playsinline:i.hasAttribute("playsinline"),poster:i.hasAttribute("poster"),sources:!!i.querySelector("source"),tracks:!!i.querySelector("track")};n.debug=ze(i,d,n,s);if(i.hasAttribute("data-vttjs")&&V.isNonEmptyStr(i.getAttribute("data-vttjs"))){n["vtt.js"]=i.getAttribute("data-vttjs")}else if(d.vttjs&&V.isNonEmptyStr(d.vttjs)){n["vtt.js"]=d.vttjs}else if(n.hasOwnProperty("vtt.js")||n.hasOwnProperty("vttjs")){n["vtt.js"]=n["vtt.js"]||n.vttjs}else if(s["vtt.js"]||s.vttjs){n["vtt.js"]=s["vtt.js"]||s.vttjs}else{n["vtt.js"]="https://players.brightcove.net/videojs-vtt.js/0.15.4/vtt.global.min.js"}if(s.playButton){const{hover:I,shape:k,position:C}=s.playButton;if(I==="glow"){t.dom.addClass(i,"vjs-play-button-hover-glow")}else if(I==="darken"){t.dom.addClass(i,"vjs-play-button-hover-darken")}if(k==="square"){t.dom.addClass(i,"vjs-play-button-shape-square")}else if(k==="rectangle"){t.dom.addClass(i,"vjs-play-button-shape-rectangle")}if(C==="topRight"){t.dom.addClass(i,"vjs-play-button-position-top-right")}else if(C==="topLeft"){t.dom.addClass(i,"vjs-play-button-position-top-left")}}if(d.crossorigin!==undefined||s.media&&s.media.tracks&&t.browser.IS_ANY_SAFARI){s.crossorigin=true}if(s.crossorigin){i.setAttribute("crossorigin","anonymous")}if(s.audioPosterMode){n.audioPosterMode=s.audioPosterMode}if(s.audioOnlyMode){n.audioOnlyMode=s.audioOnlyMode}const f=u.t||d.t||i.getAttribute("data-start-time");if(/^[\d]+$/.test(f)){s.startTime=Number(f)}else if(/^(\d+h)?(\d+m)?(\d+s)?$/.test(f)){s.startTime=f}const p=d.adConfigId;const m=i.getAttribute("data-ad-config-id");if(V.isNonEmptyStr(p)){s.adConfigId=p}else if(V.isNonEmptyStr(m)){s.adConfigId=m}if(typeof s.adConfigId==="string"){s.adConfigId=s.adConfigId.trim()}if(!V.isNonEmptyStr(s.adConfigId)){s.adConfigId=null}if(s.usingAdFailover&&!H.mightBe){s.adConfigId=null}const g=d.deliveryConfigId;const v=i.getAttribute("data-delivery-config-id");if(V.isNonEmptyStr(g)){s.deliveryConfigId=g}else if(V.isNonEmptyStr(v)){s.deliveryConfigId=v}if(typeof s.deliveryConfigId==="string"){s.deliveryConfigId=s.deliveryConfigId.trim()}if(!V.isNonEmptyStr(s.deliveryConfigId)){s.deliveryConfigId=null}s.applicationId=d.applicationId||i.getAttribute("data-application-id")||s.applicationId;const y=V.qs();if(i.hasAttribute("autoplay")){n.autoplay=true}else if(l&&y.search.hasOwnProperty("autoplay")){if(y.search.autoplay==="true"||!y.search.autoplay){n.autoplay=true}else if(y.search.autoplay==="false"){n.autoplay=false}else{n.autoplay=y.search.autoplay}}else if(!n.hasOwnProperty("autoplay")){n.autoplay=s.autoplay||false}if(n.autoplay){t.dom.addClass(i,$e)}if(d.preload){n.preload=d.preload}else if(!n.hasOwnProperty("preload")&&s.preload){n.preload=s.preload}n.height=i.getAttribute("height")||undefined;n.width=i.getAttribute("width")||undefined;if(!l&&i&&(n.width||n.height)){Me(s,n.width,n.height)}["loop","muted","playsinline"].forEach(function(e){if(d[e]!==undefined&&d[e]!=="false"||s[e]||s.embedState[e]||n[e]){n[e]=true}else{n[e]=false}});if(n.autoplay){n.playsinline=true}if(n.playsinline){i.setAttribute("playsinline","playsinline")}if(n.muted){i.setAttribute("muted","muted");i.muted=true}if(l){if(d.language){n.language=d.language}else if(V.isNonEmptyStr(iv.documentElement.lang)){n.language=iv.documentElement.lang}else{n.language=tv.navigator.language}iv.documentElement.lang=n.language}else if(i.hasAttribute("language")){n.language=i.getAttribute("language");t.log.warn("Use of the language attribute on the video embed is invalid. Please use the lang attribute instead.")}else if(!n.hasOwnProperty("language")&&V.isNonEmptyStr(s.language)){n.language=s.language}const b=i.getAttribute("data-bumper-id");const _=d.bumperId;const T=s.videoCloud?s.videoCloud.bumper:undefined;if(b||_||T){s.videoCloud=s.videoCloud||{};s.videoCloud.bumper=T&&typeof T==="object"?T:{};const A=b||_||T.id||T;if(typeof A==="string"){s.videoCloud.bumper.id=A}else{t.log.error("Bumper id must be a string")}}const{media:S}=s;if(S&&S.poster&&S.poster.highres&&!i.poster){if(/(https?:)?\/\//.test(S.poster.highres)){n.poster=S.poster.highres}else{n.poster=e.environment.scriptBaseUrl+"/"+S.poster.highres}if(t.browser.IS_IPHONE){i.poster=n.poster}}if(S&&S.tracks){S.tracks.forEach(function(e){i.appendChild(t.dom.createEl("track",{},{default:e.default?e.default:"",label:e.label?e.label:"",kind:"captions",src:e.src,srclang:e.srclang}))})}if(S&&S.src){n.sources=[S.src]}else if(S&&S.sources){n.sources=S.sources}n.runtime_=e;n.html5=n.html5||{};if(!(t.browser.IS_ANY_SAFARI||t.browser.IS_IOS)){n.html5.nativeCaptions=false}if(s.vhs!==false){if(!n.flash){n.flash={}}if(!n.flash.swf){n.flash.swf=`${s.playersCDN}/videojs-flashls-source-handler/1.4.8/video-js.swf`}}t.options.vhs=t.options.vhs||{};n.html5=n.html5||{};n.html5.vhs=n.html5.vhs||{};if(s.vhs&&typeof s.vhs==="object"){n.html5.vhs=s.vhs}if(t.browser.IS_ANDROID&&t.options.vhs.enableLowInitialPlaylist===undefined&&n.html5.vhs.enableLowInitialPlaylist===undefined){n.html5.vhs.enableLowInitialPlaylist=true}if(!(t.browser.IS_ANY_SAFARI||t.browser.IS_IOS)&&t.options.vhs.overrideNative===undefined&&n.html5.vhs.overrideNative===undefined){n.html5.vhs.overrideNative=true}if(t.options.vhs.experimentalLLHLS===undefined&&n.html5.vhs.experimentalLLHLS===undefined){n.html5.vhs.experimentalLLHLS=true}if(t.options.vhs.experimentalBufferBasedABR===undefined&&n.html5.vhs.experimentalBufferBasedABR===undefined){n.html5.vhs.experimentalBufferBasedABR=true}n.html5.initialBandwidth=typeof n.html5.initialBandwidth==="number"?n.html5.initialBandwidth:s.initialBandwidth;n.inactivityTimeout=5e3;if(!He(t)){n.inactivityTimeout=0}n.controls=l?true:s.embedState.controls;n.persistTextTrackSettings=true;n.sourceOrder=true;n.userActions={hotkeys:{}};if(s.fullscreenControl===false){n.userActions.doubleClick=false}const E=e.environment.userAgent.match(/applewebkit\/(\d*).*Version\/(\d*.\d*)/i);n.nativeControlsForTouch=t.browser.IS_ANDROID&&t.browser.ANDROID_VERSION<5&&E&&E[2]>0;const w=t.getPluginVersion("ima3");n.normalizeAutoplay=w?V.isValidVersion(w,4):true;["controlBar","flash","liveui","playbackRates","responsive","suppressNotSupportedError","techOrder"].forEach(e=>{if(s.hasOwnProperty(e)){n[e]=s[e]}});return n}const We=h.getComponent("MenuItem");class Ke extends We{handleClick(e){super.handleClick();this.options_.listener();tv.setTimeout(()=>{this.player().contextmenuUI.menu.dispose()},1)}}const Xe=h.getComponent("Menu");const Ye=h.dom||h;class Qe extends Xe{constructor(i,e){super(i,e);this.dispose=this.dispose.bind(this);e.content.forEach(e=>{let t=function(){};if(typeof e.listener==="function"){t=e.listener}else if(typeof e.href==="string"){t=()=>tv.open(e.href)}this.addItem(new Ke(i,{label:e.label,listener:t.bind(i)}))})}createEl(){const e=super.createEl();Ye.addClass(e,"vjs-contextmenu-ui-menu");e.style.left=this.options_.position.left+"px";e.style.top=this.options_.position.top+"px";return e}}function Je(e){let t;if(e.getBoundingClientRect&&e.parentNode){t=e.getBoundingClientRect()}if(!t){return{left:0,top:0}}const i=iv.documentElement;const n=iv.body;const s=i.clientLeft||n.clientLeft||0;const r=tv.pageXOffset||n.scrollLeft;const a=t.left+r-s;const o=i.clientTop||n.clientTop||0;const l=tv.pageYOffset||n.scrollTop;const d=t.top+l-o;return{left:Math.round(a),top:Math.round(d)}}function Ze(e,t){const i={};const n=Je(e);const s=e.offsetWidth;const r=e.offsetHeight;const a=n.top;const o=n.left;let l=t.pageY;let d=t.pageX;if(t.changedTouches){d=t.changedTouches[0].pageX;l=t.changedTouches[0].pageY}i.y=Math.max(0,Math.min(1,(a-l+r)/r));i.x=Math.max(0,Math.min(1,(d-o)/s));return i}var et="7.0.0";function tt(e){return e.hasOwnProperty("contextmenuUI")&&e.contextmenuUI.hasOwnProperty("menu")&&e.contextmenuUI.menu.el()}function it(e){const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"}function nt(e,t){return{left:Math.round(t.width*e.x),top:Math.round(t.height-t.height*e.y)}}function st(e){if(tt(this)){this.contextmenuUI.menu.dispose();return}if(this.contextmenuUI.options_.excludeElements(e.target)){return}const t=Ze(this.el(),e);const i=this.el().getBoundingClientRect();const n=nt(t,i);const s=h.browser.IS_FIREFOX?iv.documentElement:iv;e.preventDefault();const r=this.contextmenuUI.menu=new Qe(this,{content:this.contextmenuUI.content,position:n});this.contextmenuUI.closeMenu=()=>{h.log.warn("player.contextmenuUI.closeMenu() is deprecated, please use player.contextmenuUI.menu.dispose() instead!");r.dispose()};r.on("dispose",()=>{h.off(s,["click","tap"],r.dispose);this.removeChild(r);delete this.contextmenuUI.menu});this.addChild(r);const a=r.el_.getBoundingClientRect();const o=iv.body.getBoundingClientRect();if(this.contextmenuUI.keepInside||a.right>o.width||a.bottom>o.height){r.el_.style.left=Math.floor(Math.min(n.left,this.player_.currentWidth()-r.currentWidth()))+"px";r.el_.style.top=Math.floor(Math.min(n.top,this.player_.currentHeight()-r.currentHeight()))+"px"}h.on(s,["click","tap"],r.dispose)}function rt(e){const t={keepInside:true,excludeElements:it};e=h.obj.merge(t,e);if(!Array.isArray(e.content)){throw new Error('"content" required')}if(tt(this)){this.contextmenuUI.menu.dispose();this.off("contextmenu",this.contextmenuUI.onContextMenu);delete this.contextmenuUI}const i=this.contextmenuUI=function(){rt.apply(this,arguments)};i.onContextMenu=st.bind(this);i.content=e.content;i.keepInside=e.keepInside;i.options_=e;i.VERSION=et;this.on("contextmenu",i.onContextMenu);this.ready(()=>this.addClass("vjs-contextmenu-ui"))}h.registerPlugin("contextmenuUI",rt);rt.VERSION=et;const at=function(e){e.registerPlugin("urlparams",function(r){r=r||{};var e=function(e){var t=0,i;e=(e||"").replace(/^\s+|\s+$/g,"");if(!e||!/^(\d+h)?(\d+m)?(\d+s)?$/.test(e)){return-1}i=e.match(/^(\d+)h/);if(i){t+=parseFloat(i[1])*3600;e=e.replace(/^(\d+)h/,"")}i=e.match(/^(\d+)m/);if(i){t+=parseFloat(i[1])*60;e=e.replace(/^(\d+)m/,"")}i=e.match(/^(\d+)s/);if(i){t+=parseFloat(i[1])}return t},n=.9,a=function(e,t){var i=e-t;if(isNaN(i)){return false}return Math.abs(i)0){(function(){var e=r.delay||250,t,i=false,n=function(){if(i||a(l.currentTime(),d)){i=true;s()}else{l.one("canplay",function(){l.currentTime(d)});t=l.setTimeout(n,e)}},s=function(){l.clearTimeout(t);l.off("timeupdate",s);if(!i){l.currentTime(d)}};l.on("timeupdate",s);o(n)})()}})};var ot=(t,e,i={})=>{e.forEach(e=>{if(t[e]!==undefined){i[e]=t[e]}});return i};const lt=r=>{const a=(i,n=[])=>{let s={};Object.keys(i).forEach(e=>{const t=i[e];n.push(e);if(V.isObj(t)){s=r.obj.merge(s,a(t,n))}else{s[n.join(".")]=t}n.pop()});return s};return a};const dt=e=>e.charAt(0).toUpperCase()+e.slice(1);const ut=(e,t)=>`${e}x${t}`;const ct={memory:["jsHeapSizeLimit","usedJSHeapSize","totalJSHeapSize"],navigation:["redirectCount","type","directedMigration"],timing:["loadEventEnd","loadEventStart","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","responseEnd","responseStart","requestStart","secureConnectionStart","connectEnd","connectStart","domainLookupEnd","domainLookupStart","fetchStart","redirectEnd","redirectStart","unloadEventEnd","unloadEventStart","navigationStart"]};const ht={bitrate:"bitrates",event:"events"};const ft=s=>{const t=lt(s);class e{constructor(){this.data_={bitrates:{bitrates:[],playlists:[],rendered:[],throughput:[]},events:[],mr:0,locked:0,performance:{},content:{},player:{dimensions:[],pixelratio:[],screendimensions:[]},frames:{}}}keys(){return Object.keys(this.data_)}append(e,...t){e=ht.hasOwnProperty(e)?ht[e]:e;if(!this.data_.hasOwnProperty(e)){throw new Error(`"${e}" is not a known QosBuffer key`)}this[`append${dt(e)}_`](...t)}flush(...t){if(!t.length){t=this.keys()}for(let e=0;ethis[`flush${dt(e)}_`]());const i=s.obj.merge(...e);const n=V.qs().stringify(i).length;if(n>3e3&&i["qos.bitrates"]){i["qos.bitrates"]=JSON.stringify({bitrates:[],playlists:[],rendered:[],throughput:[]})}return i}appendBitrates_(t){if(typeof t.playlists!=="undefined"){this.data_.bitrates.playlists.push([Date.now(),t.bitrates,t.playlists]);delete t.bitrates;delete t.playlists}Object.keys(t).forEach(e=>{this.data_.bitrates[e].push([Date.now(),t[e]])})}appendMr_(e){this.data_.mr=e?1:null}appendLocked_(e){this.data_.locked=e?1:null}appendPerformance_(e){const i=tv.performance;if(V.isNil(i)){return}Object.keys(ct).forEach(e=>{if(!V.isNil(i[e])){this.data_.performance[e]=ot(i[e],ct[e])}});if(V.isFn(i.measure)){["bcParse","bcInit"].forEach(t=>{i.getEntriesByName(t,"measure").forEach(e=>{this.data_.performance[t]=e.duration})})}if(this.data_.performance.navigation){this.data_.performance.navigation.directedMigration=e?V.qs().parse(e).directedMigration==="true":false}}appendFrames_(e){this.data_.frames={dropped:e.droppedVideoFrames,corrupted:e.corruptedVideoFrames,total:e.totalVideoFrames}}appendPlayer_(e,t=Date.now()){this.data_.player.dimensions.push([t,ut(e.width,e.height),ut(e.computedWidth,e.computedHeight)]);this.data_.player.pixelratio.push([t,tv.devicePixelRatio]);this.data_.player.screendimensions.push([t,ut(tv.screen.width,tv.screen.height)])}appendEvents_(...e){this.data_.events.push({type:e.join("."),time:Date.now()})}appendContent_(e){this.data_.content={sourceMimeType:e.sourceMimeType}}flushBitrates_(){const e=this.data_.bitrates;const t={};if(e.bitrates.length||e.playlists.length||e.rendered.length||e.throughput.length){t["qos.bitrates"]=JSON.stringify(e)}e.bitrates.length=0;e.playlists.length=0;e.rendered.length=0;e.throughput.length=0;return t}flushEvents_(){const e=this.data_.events;const s={};e.forEach(e=>{const{time:t,type:i}=e;const n=`qos.events.${i}`;if(Array.isArray(s[n])){s[n].push(t)}else if(s.hasOwnProperty(n)){s[n]=[s[n],t]}else{s[n]=t}});Object.keys(s).forEach(e=>{if(Array.isArray(s[e])){s[e]=JSON.stringify(s[e])}});e.length=0;return s}flushMr_(){return{"qos.mr":this.data_.mr}}flushLocked_(){return{"qos.locked":this.data_.locked}}flushFrames_(){const e=t(this.data_.frames,["qos","frames"]);this.data_.frames={};return e}flushPerformance_(){return t(this.data_.performance,["qos","performance"])}flushPlayer_(){const i=this.data_.player;const n={};Object.keys(i).forEach(e=>{const t=i[e];if(t.length){n[`qos.player.${e}`]=JSON.stringify(t);t.length=0}});return n}flushContent_(){return t(this.data_.content,["qos","content"])}}return e};const pt=["ad-playback","ads-ready?","postroll?","preroll?"];const mt=e=>e.usingPlugin("ads")?e.ads.state:undefined;const gt=e=>e.usingPlugin("ads")&&!!e.adonly;const vt=e=>pt.indexOf(e)>-1;const yt=e=>e.usingPlugin("ads")&&V.isFn(e.ads.inAdBreak);const I=e=>{if(!e.usingPlugin("ads")){return false}if(gt(e)){return true}if(yt(e)){return e.ads.isInAdMode()}return vt(e.ads.state)};const bt=e=>{if(!e.usingPlugin("ads")){return false}return e.ads.isContentResuming()&&!e.ads.isWaitingForAdBreak()};const _t=(e,t)=>{if(yt(t)&&e&&e.type==="loadstart"){return true}return!I(t)};const Tt=e=>{const t={};if(e.ima3){const i=e.ima3.currentAdEventInfo;t.plugin="ima3";if(V.isFn(e.ima3)){return t}t.pluginVersion=e.ima3.VERSION||e.ima3.version;t.adTech=e.ima3.adTech;t.requestMode=e.ima3.settings.requestMode;t.timeout=e.ima3.settings.timeout;if(i){ot(i,["adType","adPodLength","adPodId","creativeFormat","creativeLength","creativeId","creativeIndex","advertiserName","wrapperCreativeIds","dealId","adId","adTitle","adSystem","creativeAdId"],t);const n=i.creativeIndex;if(n&&n.length){t.firstPlayedAdIndex=n[0]}t.startedInAdPod=i.started;t.completedInAdPod=i.completed}}else if(e.FreeWheelPlugin){t.plugin="freewheel";if(V.isFn(e.FreeWheelPlugin)){return t}t.pluginVersion=e.FreeWheelPlugin.VERSION||e.FreeWheelPlugin.getVersion()}return t};const St=e=>{e.adBreakIndex=null;e.hasAdBreakStarted=false;e["ads-request"]=null;e["ads-response-received"]=null;e["ads-loading"]=[];e["ads-ad-started"]=[];e["ads-ad-ended"]=[]};const Et=()=>{const e={};St(e);return e};const wt=(e,t,i)=>{const n=e.currentAdSequence_;const s=["ads-loading","ads-ad-started","ads-ad-ended"];if(t==="ads-request"){St(n)}else if(t==="adstart"||t==="ads-loading"){if(!n.hasAdBreakStarted){if(n.adBreakIndex===null){n.adBreakIndex=0}else{n.adBreakIndex++}n.hasAdBreakStarted=true;s.forEach(e=>{n[e].push([])})}}else if(t==="adend"){n.hasAdBreakStarted=false}if(s.indexOf(t)>-1){n[t][n.adBreakIndex].push(i)}else if(t==="ads-request"||t==="ads-response-received"){n[t]=i}};const e={NUMBER_GTE_0:{validator:e=>typeof e==="number"&&e>=0,message:"must be a number equal or greater than 0"},NON_EMPTY_STRING:{validator:V.isNonEmptyStr,message:"must be a non-empty string"},NUMERIC_BOOL:{validator:e=>e===0||e===1,message:"must be 0 or 1"}};const It=[{name:"index",validation:e.NUMBER_GTE_0},{name:"deal_id",validation:e.NON_EMPTY_STRING},{name:"wrapper_systems",validation:e.NON_EMPTY_STRING},{name:"system",validation:e.NON_EMPTY_STRING},{name:"skip_time_offset",validation:e.NUMBER_GTE_0},{name:"start_ms",validation:e.NUMBER_GTE_0},{name:"advertiser",validation:e.NON_EMPTY_STRING},{name:"content_type",validation:e.NON_EMPTY_STRING},{name:"isci",validation:e.NON_EMPTY_STRING},{name:"creative_id",validation:e.NON_EMPTY_STRING},{name:"duration",validation:e.NUMBER_GTE_0},{name:"title",validation:e.NON_EMPTY_STRING},{name:"media_url_domain",validation:e.NON_EMPTY_STRING},{name:"audible_duration",validation:e.NUMBER_GTE_0},{name:"play_duration",validation:e.NUMBER_GTE_0},{name:"skipped",validation:e.NUMERIC_BOOL},{name:"interaction",validation:e.NUMERIC_BOOL}];const kt=[{name:"index",validation:{validator:e=>typeof e==="number"&&(e>=0||e===-1),message:"must be a number equal or greater than 0 or exactly -1"}},{name:"ad_count",validation:e.NUMBER_GTE_0},{name:"duration",validation:e.NUMBER_GTE_0},{name:"host",validation:e.NON_EMPTY_STRING},{name:"type",validation:{validator:e=>e==="pre"||e==="mid"||e==="post",message:'must be one of "pre"|"mid"|"post"'}},{name:"request_mode",validation:{validator:e=>e==="onload"||e==="onplay"||e==="ondemand"||e==="oncue",message:'must be one of "onload"|"onplay"|"ondemand"|"oncue"'}},{name:"time_offset",validation:e.NUMBER_GTE_0},{name:"request_ms",validation:e.NUMBER_GTE_0}];const Ct=V.managedDataStore(It,"ads_ad_");const At=V.managedDataStore(kt,"ads_pod_");const jt=["progress","seeking","suspend","timeupdate"];const xt=["seek","stable","unstable"];const Dt=["adend","adscanceled","adserror","adskip","adsready","adstart","adtimeout","contentplayback","contentupdate","nopostroll","nopreroll","readyforpreroll"];const Rt=e=>{return[].concat(e.getTech("Html5").Events)};const Ot=e=>{return Rt(e).filter(e=>jt.indexOf(e)===-1)};const Pt=["ads-request","ads-response-received","adstart","ads-loading","ads-ad-started","ads-ad-ended","adend"];const Lt=["ad_begin","ad_complete","ad_hard_timeout","ad_mode_begin","ad_mode_complete","ad_timeout","ad_viewable_impression","catalog_request","catalog_request_error","catalog_response","error","play_request","player_init","player_load","video_complete","video_engagement","video_impression","video_resumed","video_view"];const Nt=["catalog_request","catalog_request_error","catalog_response"];const Mt="sendBeacon"in tv.navigator;const{Set:Ut}=tv;const Bt="lbu";const Ft=4e3;const qt=new Ut(["account","domain","event","player"]);const Vt=new Ut(["account","delivery_type","destination","domain","dropped_frames","error_code","event","feature","file_size_bytes","forward_buffer_seconds","load_time_ms","measured_bps","media_type","platform","platform_version","player","player_height","player_name","player_width","range","rebuffering_count","rebuffering_seconds","rendition_height","rendition_indicated_bps","rendition_mime_type","rendition_width","response_time_ms","session","start_time_ms","source","time","video","video_duration","video_name","video_seconds_viewed"]);const Ht=(e,t)=>{const i=V.qs();Object.keys(t).forEach(e=>{if(V.isNil(t[e])){delete t[e]}});let n=e+"?"+i.stringify(t);if(n.length<=Ft){return n}Object.keys(t).forEach(e=>{if(!Vt.has(e)){delete t[e]}});t.usage=Bt;n=e+"?"+i.stringify(t);return n};const $t=t=>{qt.forEach(e=>{if(V.isNil(t[e])){throw new Error(`the "${e}" param is required`)}})};const zt=a=>{const o=ft(a);class e{constructor(e,t,i,n,s={}){this.baseUrl_=i;this.log=n.createLogger("Client");this.stateAgent_=t;this.player_=e;this.currentAdSequence_=Et();this.beacons_=[];this.beaconsUnsent_=[];this.playerId=s.playerId;this.embedId=s.embedId;this.applicationId=s.applicationId;this.playerUrl_=null;this.user(s.user||null);this.device(s.device||null);const r=e.options_&&e.options_.runtime_||{};const a=r.environment&&r.environment.queryString||{};if(s.requiresConsent){if(typeof tv.BC_ANALYTICS_CONSENT==="boolean"){this.setConsent(tv.BC_ANALYTICS_CONSENT,{silent:true});this.disableSetConsent()}else if(a.hasOwnProperty("analyticsConsent")||e.el().hasAttribute("data-analytics-consent")){this.setConsent(true,{silent:true});this.disableSetConsent()}else{this.setConsent(false,{silent:true})}}else{this.setConsent(true,{silent:true});this.disableSetConsent()}if(s.corpCommsApp){this.log.warn("The `corpCommsApp` option is deprecated. Please use `application` instead.")}this.application(s.application||s.corpCommsApp||null);this.defaultParams_={domain:"videocloud",platform:"video-js",session:""};for(let e=0;e<3;e++){this.defaultParams_.session+=(Math.random()*4294967295>>>0).toString(16)}this.qos=new o(this);this.stateAgent_.resetTimesOf();this.subscribeToAnalyticsEvents_(e)}beacons(){return this.beacons_.map(a.obj.merge)}defaultParams(e){if(e){if(e.player){this.playerUrl_=e.player}e=V.isFn(e)?e():e;this.defaultParams_=a.obj.merge(this.defaultParams_,e)}return this.defaultParams_}getSession(){return this.defaultParams_.session}user(e){if(e!==undefined){if(e===null||V.isNonEmptyStr(e)||V.isNum(e)){this.user_=e}else{this.log.warn("user() must be given a non-empty string, number, or null")}if(this.player_.usingPlugin("chinaMetrics")){this.log.warn("user() cannot be set when using China Delivery");this.user_=null}}return this.user_}setUser(e){this.log.warn("setUser(id) is deprecated, use user(id) instead");this.user(e)}getUser(){this.log.warn("getUser() is deprecated, use user() instead");return this.user()}setConsent(e,t={}){if(typeof e==="boolean"&&this.consent_!==e){this.consent_=e;if(!t.silent){this.player_.trigger({consent:e,type:"analytics-consent-changed"})}}}disableSetConsent(){Object.defineProperty(this,"setConsent",{value:()=>{},configurable:false,enumerable:true,writable:false})}getConsent(){return this.consent_}application(e){if(e===null||V.isNonEmptyStr(e)||V.isNum(e)){this.application_=e}return this.application_}corpCommsApp(e){if(e===null||V.isNonEmptyStr(e)||V.isNum(e)){this.application_=e;this.log.warn("The corpCommsApp() method is deprecated. Please use application() instead.")}return this.application_}device(e){if(e===null||V.isNonEmptyStr(e)||V.isNum(e)){this.device_=e}return this.device_}player(e){if(e===null||V.isNonEmptyStr(e)){this.defaultParams_.player=e;this.playerUrl_=e}return this.playerUrl_||this.defaultParams_.player}subscribeToAnalyticsEvents_(){this.player_.on("analytics-beacon",({params:e})=>{this.send(e)})}send(e={}){const{event:t}=e;if(!Lt.includes(t)){return null}const i=this.stateAgent_.getOptions(t);const n=this.sendRequest_(e,i);const s={video_view:"timeOfView",video_impression:"timeOfImpression"};if(n&&s.hasOwnProperty(t)){this.stateAgent_.state[s[t]]=Number(n.params.time)}return n}sendRequest_(e,t={}){if(this.getConsent()){const i=e.analyticsBcovAuthToken;delete e.analyticsBcovAuthToken;const n=Ht(this.baseUrl_,e);if(Lt.indexOf(e.event)>-1){if(t.useSendBeaconOnly){if(Mt){tv.navigator.sendBeacon(n)}else{return null}}else if(!!i&&e.event==="video_view"){const s={};s.Authorization="Bearer "+i;a.xhr({method:"GET",headers:s,url:n},function(e,t,i){if(e){a.log.debug("Problem sending video_view beacon",e)}})}else{const r=iv.createElement("img");r.src=n}}return{params:e,url:n}}this.beaconsUnsent_.push({params:e,options:t});return null}sendAllUnsent(){const e=this.beaconsUnsent_.slice();this.beaconsUnsent_=[];return e.map(({params:e,options:t})=>{return this.sendRequest_(e,t)})}}return e};const Gt=(e,t)=>Math.floor(e)+".."+(Math.floor(t)-1);const Wt=(e,t,i,n)=>{let s=`players.brightcove.com/${e}/${t}_${i}`;if(n){s+=`/${n}`}return s};const Kt=e=>{let t=e.preload();if(typeof t!=="string"){t=e.el().getAttribute("preload")}if(typeof t==="string"&&t.length===0){t="auto"}if(t){return t}};const Xt=(e,t,i,n,s)=>{let r=t-e;if(s!==undefined&&st){n=t}r-=n-i}return r};const Yt=(e,t,...i)=>{const n=e.obj.merge(t.params||{},...i);delete t.params;return n};const Qt=(e,t)=>{const i=e.mediainfo;const n=i&&i.duration||e.duration();if(i){if(t.video===undefined){t.video=i.id}if(t.video_name===undefined){t.video_name=i.name}if(t.reference_id===undefined){t.reference_id=i.referenceId}if(t.custom_fields===undefined){t.custom_fields=i.customFields}if(t.video_data===undefined){t.video_data=i}if(t.video_ads_supported===undefined){t.video_ads_supported=i.economics==="AD_SUPPORTED"}if(t.tags===undefined){t.tags=i.tags}}if(V.isNum(n)&&t.video_duration===undefined){t.video_duration=Math.floor(n);if(t.video_duration<1||t.video_duration===Infinity){t.video_duration=null}}t.media_url=e.currentSrc();return t};const a=["ads_ad_index","ads_ad_deal_id","ads_ad_wrapper_systems","ads_ad_system","ads_ad_skip_time_offset","ads_ad_start_ms","ads_ad_advertiser","ads_ad_content_type","ads_ad_isci","ads_ad_creative_id","ads_ad_duration","ads_ad_title","ads_ad_media_url_domain","ads_pod_index"];const Jt=["ads_ad_audible_duration","ads_ad_play_duration","ads_ad_skipped","ads_ad_interaction"];const Zt=["ads_pod_ad_count","ads_pod_duration","ads_pod_host","ads_pod_type","ads_pod_request_ms","ads_pod_request_mode","ads_pod_time_offset"];const ei=["ad_mode_begin","ad_mode_complete"];const ti=(e,t={})=>{const i={};for(const n of e){if(t[n]!==undefined){i[n]=t[n]}}return i};const ii={triggerAdBegin:{event:"ad_begin",params:a},triggerAdComplete:{event:"ad_complete",params:[...a,...Jt]},triggerAdModeBegin:{event:"ad_mode_begin",params:[...a,...Zt]},triggerAdModeComplete:{event:"ad_mode_complete",params:[...a,...Zt]},triggerVideoResumed:{event:"video_resumed"},triggerAdViewableImpression:{event:"ad_viewable_impression",params:a}};function ni(e){return{adBegin:()=>{e.triggerAdBegin()},adComplete:()=>{e.triggerAdComplete()},adModeBegin:()=>{e.triggerAdModeBegin()},adModeComplete:()=>{e.triggerAdModeComplete()},videoResumed:()=>{e.triggerVideoResumed()},adViewableImpression:()=>{e.triggerAdViewableImpression()}}}const si=o=>{class e{constructor(e,t,i,n,s){this.player_=e;this.client_=t;this.history_=i;this.stateAgent_=n;this.log=s.createLogger("Emitter");this.eventCount_=0;this.streamCount_=-1;this.addInsightsTriggers()}addInsightsTriggers(){Object.keys(ii).forEach(e=>{const t=ii[e].event;const i=ii[e].params;const n=Object.getPrototypeOf(this);n[e]=this.createInsightsTrigger(t,i)})}createInsightsTrigger(r,a){return(e={})=>{let t={event:r};if(a&&this.player_.ads&&this.player_.ads.ad){const{ad:i,pod:n}=this.player_.ads;const{merge:e}=o.obj;const s=ei.includes(r)&&n?e(i,n):i;t=e(t,ti(a,s))}this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,t))}}emitAnalyticsEvents_(e,t){e.trigger({params:t,type:"analytics-beacon"});const i=String(t.event).replace(/\_/g,"-");e.trigger({params:t,type:`analytics-beacon-${i}`})}refineClientParams_(t,e){if(this.client_.user()){t.user=this.client_.user()}if(this.client_.application()){t.application=this.client_.application();t.user=this.client_.user()||this.client_.device()}if(V.isNil(t.time)){t.time=Date.now()}t.autoplay=this.player_.autoplay();e.qos=Array.isArray(e.qos)?e.qos:[];e.qos.push("mr");e.qos.push("locked");t=o.obj.merge(this.client_.defaultParams_,t,this.client_.qos.flush(...e.qos));t.seq=""+this.eventCount_;if(Lt.indexOf(t.event)>-1){this.eventCount_++}if("streamCount"in e){t.seq+="_"+e.streamCount}if(typeof this.player_.getAccountId==="function"){const i=this.player_.getAccountId();const n=t.account;let e="";if(V.isNonEmptyStr(i)){e=i}else if(V.isNonEmptyStr(n)){e=n}t.account=e;t.player=this.client_.playerUrl_||Wt(t.account,this.client_.playerId,this.client_.embedId,this.client_.applicationId)}if(t.event&&t.event.startsWith("ad_")){if(this.player_.ads&&this.player_.ads.pod){const s=this.player_.ads.pod.index;if(s!==undefined){t.ads_pod_index=s}}}$t(t);return{params:t,options:e}}resolveData_(e,t){const i=["player_init","player_load",...Nt];const{params:n,options:s}=this.refineClientParams_(i.includes(t.event)?Yt(o,e,t):Qt(this.player_,Yt(o,e,t)),e);if(Nt.includes(t.event)){const{error:r,xhr:a}=s;if(r){n.error=JSON.stringify(a?w(r,{status:a.status}):r)}}this.client_.beacons_.push(n);this.log.debug(n.event,n);this.stateAgent_.setOptions(n.event,s);return n}triggerAdError(e={}){const t=this.player_.ads&&this.player_.ads.ad;const i=o.obj.merge({event:"ad_error"},ti(a,t));this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,i))}triggerFullscreenEnabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"fullscreen_enabled"}))}triggerFullscreenDisabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"fullscreen_disabled"}))}triggerShareOverlay(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_overlay"}))}triggerShareSocialClicked(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_social_clicked"}))}triggerShareLinkCopied(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_link_copied"}))}triggerShareEmbedCopied(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"share_embed_copied"}))}triggerEnterPIP(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"pip_enabled"}))}triggerLeavePIP(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"pip_disabled"}))}triggerMuteEnabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"mute_enabled"}))}triggerMuteDisabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"mute_disabled"}))}triggerVolumeChange(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"volume_change"}))}triggerVideoPause(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"video_pause"}))}triggerVideoResume(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"video_resume"}))}triggerTextTrackEnabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"text_track_enabled"}))}triggerTextTrackDisabled(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"text_track_disabled"}))}triggerVideoImpression(e={}){const t=V.isNonEmptyStr(this.player_.currentSrc());if(!t||this.stateAgent_.state.timeOfImpression){this.log.debug("skipped video_impression",{reason:!t&&"there is no source"||`already sent at ${this.stateAgent_.state.timeOfImpression}`});return}this.streamCount_++;e.streamCount=this.streamCount_;const i=this.player_.currentType();if(V.isNonEmptyStr(i)){this.client_.qos.append("content",{sourceMimeType:i});e.qos=e.qos||["content"];const a=this.player_.audioOnlyMode_||this.player_.audioPosterMode_||this.player_.isAudio_;this.client_.defaultParams({media_type:V.getSimpleType(i,a)})}const n=this.resolveData_(e,{event:"video_impression"});const s=Tt(this.player_);const r=Kt(this.player_);if(Object.keys(s).length>0){n.web_ad_info=JSON.stringify(s)}if(r){n.preload=r}this.emitAnalyticsEvents_(this.player_,n)}triggerVideoView(e={}){const t=V.isNonEmptyStr(this.player_.currentSrc());const{timeOfView:i,timeOfImpression:n}=this.stateAgent_.state;if(!t||i||!n){this.log.debug("skipped video_view",{reason:!t&&"there is no source"||i&&`already sent at ${i}`||'"video_impression" not sent'});return}e.streamCount=this.streamCount_;const s=this.resolveData_(e,{event:"video_view"});const r=this.history_;const a=r.first("canplay");const o=r.first("loadstart");const l=r.first("play",true);if(a){s.load_time_ms=a-n}s.start_time_ms=Xt(l||o,s.time,r.first("adstart",true),r.first("adend",true),r.first("adtimeout",true));if(this.player_.usingPlugin("pluginDev")){s.feature="iris"}this.emitAnalyticsEvents_(this.player_,s)}triggerVideoEngagement(t,e,i={}){const{buffered:n,duration:s,playbackEndTime:r,height:a,mediainfo:o,rebufferingCount:l,rendition:d,renditionWidth:u,renditionHeight:c,playbackStartTime:h,rangeStart:f,rangeEnd:p,rebuffering:m,rebufferingTime:g,rebufferingStart:v,stats:y,width:b}=e;const _=r-h;i.qos=i.qos||["bitrates","events","player","frames"];i.streamCount=this.streamCount_;t.length=t.end-t.start;this.log.debug("video_engagement requested",{rawOptions:i,period:t,playbackStartTime:h,playbackLength:_,playbackEndTime:r});let T=g;if(m&&v>0){const w=(Date.now()-v)/1e3;T=parseFloat(g+w).toFixed(1)}if(_<1&&T<=0){this.log.debug("video_engagement skipped; no rebuffering detected and playback duration too short");return null}const S=this.resolveData_(i,{event:"video_engagement"});S.player_height=a;S.player_width=b;S.video_duration=s;S.rendition_width=u;S.rendition_height=c;if(o){S.video=o.id;S.video_name=o.name}if(d){S.rendition_url=d.url;S.rendition_indicated_bps=d.indicatedBPS;S.rendition_mime_type=d.mimeType;S.rendition_height=d.height;S.rendition_width=d.width}if(y){if(!V.isNil(y.mediaRequests)){S.media_requests=y.mediaRequests}if(!V.isNil(y.mediaTransferDuration)){S.media_transfer_duration=y.mediaTransferDuration}if(!V.isNil(y.mediaBytesTransferred)){S.media_bytes_transferred=y.mediaBytesTransferred}if(!V.isNil(y.bandwidth)){S.measured_bps=y.bandwidth}if(!V.isNil(y.mediaSecondsLoaded)){S.media_seconds_loaded=y.mediaSecondsLoaded}}if(l>0){S.rebuffering_count=l}if(T>0){S.rebuffering_seconds=T}if(n){let t=0;for(let e=0;e=I&&r<=k){t=k-r;break}}S.forward_buffer_seconds=t}const E=this.history_.filter(e=>e.name==="licenserequestattempted"&&e.time>=t.start&&e.time=1){S["qos.derived_range"]=Gt(h,r);S.range=`${f}..${p}`}this.emitAnalyticsEvents_(this.player_,S);return S}sendError(e={}){const t=this.player_.error();if(!t){this.log.debug("skipped error event emission because there was no player error");return}e.streamCount=this.streamCount_;const i=this.resolveData_(e,{event:"error"});const n=V.isFn(this.player_.errors)&&V.isFn(this.player_.errors.getAll)&&this.player_.errors.getAll()||{unknown:{type:"MEDIA_ERR_UNKNOWN"}};if(t&&n.hasOwnProperty(String(t.code))){i.error_code=n[String(t.code)].type}else if(t.type!==undefined){i.error_code=t.type}else{i.error_code=n.unknown.type}this.emitAnalyticsEvents_(this.player_,i)}triggerCatalogRequest(e,t={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(t,{event:"catalog_request",url:e}))}triggerCatalogRequestError(e,t={}){if(t.error){t.error=ot(t.error,["code","message","type"])}const i=this.resolveData_(t,{event:"catalog_request_error",url:e});this.emitAnalyticsEvents_(this.player_,i)}triggerCatalogResponse(e,t={}){const i=this.resolveData_(t,{event:"catalog_response",url:e});i.response_time_ms=i.time-this.history_.last("catalog_request");this.emitAnalyticsEvents_(this.player_,i)}triggerAdHardTimeout(e={}){e.streamCount=this.streamCount_;this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"ad_hard_timeout"}))}triggerAdModeBegin(e={}){const t=this.player_.ads&&this.player_.ads.pod;const i=o.obj.merge({event:"ad_mode_begin"},ti(Zt,t));this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,i))}triggerAdModeComplete(e={}){const t=this.player_.ads&&this.player_.ads.pod;const i=o.obj.merge({event:"ad_mode_complete"},ti(Zt,t));this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,i))}triggerAdTimeout(e={}){e.streamCount=this.streamCount_;this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"ad_timeout"}))}triggerPlayRequest(e={}){if(this.stateAgent_.state.timeOfPlayRequest){return}this.client_.defaultParams({delivery_type:V.isLive(this.player_)?"live":"ondemand"});e.streamCount=this.streamCount_;const t=this.resolveData_(e,{event:"play_request"});this.emitAnalyticsEvents_(this.player_,t);this.stateAgent_.state.timeOfPlayRequest=Number(t.time)}triggerPlayerInit(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"player_init"}))}triggerPlayerLoad(e={}){this.emitAnalyticsEvents_(this.player_,this.resolveData_(e,{event:"player_load"}))}}return e};class ri{constructor(){this.optionsQueue_=[];this.state={};this.resetTimesOf()}setOptions(e,t){this.optionsQueue_.push({event:e,options:t})}getOptions(t){const e=this.optionsQueue_.findIndex(({event:e})=>e===t);if(e>-1){const{options:i}=this.optionsQueue_[e];this.optionsQueue_.splice(e,1);return i}}resetTimesOf(){this.state.timeOfImpression=null;this.state.timeOfView=null;this.state.timeOfPlayRequest=null}}const ai=e=>typeof e==="number"&&!isNaN(e)&&e>=0&&ee.map(e=>Math.floor(e)).reduce((e,t)=>{const i=e[e.length-1];if(t!==i){e.push(t)}return e},[]);const li=e=>e.reduce((e,t)=>{const i=e[e.length-1];if(i){if(i.end+1===t){i.end=t}else{e.push({start:t,end:t})}}else{e.push({start:t,end:t})}return e},[]);const di=e=>e.map(e=>{const{start:t,end:i}=e;const n=i-t;if(n>0){return{start:t,end:i-1,remainder:i}}return{start:t,end:i,remainder:i}});const ui=t=>{const i=[];let{start:n,end:s,remainder:r}=t.shift()||{};while(ai(n)&&ai(s)&&ai(r)&&n===s&&n===r){({start:n,end:s,remainder:r}=t.shift()||{})}if(t.length===0){i.push(r)}for(let e=0;eui(di(li(oi(e))));let hi=1;function fi(){return hi++}const l=[];const pi=function(t,e,i,n,s=true){const r=[].concat(i).sort();if(e!=="removeEventListener"){t.off(r,n)}else{r.forEach(function(e){t.removeEventListener(e,n)})}if(!s){return}let a=l.length;while(a--){const o=l[a];if(o.context===t&&(o.fn.guid===n.guid||o.fn===n)&&r.every((e,t)=>o.events[t])){l.splice(a,1);break}}};const mi=function(){let e=l.length;while(e--){const{context:t,mode:i,events:n,fn:s}=l.shift();let e="off";if(i==="addEventListener"){e="removeEventListener"}pi(t,e,n,s,false)}};const C=function(e,t,i,n){const s=[].concat(i).sort();const r={events:s,fn:n,mode:t,context:e};if(t==="one"||t==="onePerSrc"){r.fn=function(...e){let t="off";if(r.mode==="addEventListener"){t="removeEventListener"}pi(r.context,t,r.events,r.fn);return n.apply(this,e)};if(!n.guid){n.guid=fi()}r.fn.guid=n.guid}l.push(r);if(t==="addEventListener"){r.events.forEach(e=>{r.context.addEventListener(e,r.fn)})}else{r.context[r.mode](r.events,r.fn)}};const gi=function(){const e=l.slice(0);mi();e.forEach(({context:e,mode:t,events:i,fn:n})=>{C(e,t,i,n)})};const vi=1e4;const yi=e=>Boolean(e.onceux&&e.onceux.currentTime&&e.onceux.timeline);const bi=g=>{class e extends g.EventTarget{constructor(e,t){super();this.player_=e;this.log=t.createLogger("Engager");this.stateBySrc_={};this.lastStateRecord_=0;this.disposed_=false}stateBySrc(e=this.player_.currentSrc()){if(!this.stateBySrc_.hasOwnProperty(e)){this.stateBySrc_[e]={buffered:null,duration:0,end:0,height:0,mediainfo:null,playbackRate:1,rebufferingCount:0,src:e,start:0,width:0,playbackStartTime:0,playbackEndTime:0,stats:null,rebuffering:false,rebufferingEnd:0,rebufferingTime:0,rebufferingStart:0,rendition:null,videoPlaybackQuality:null,times:[]}}const t=this.player_.tech_&&this.player_.tech_.vhs;this.stateBySrc_[e].stats=t&&t.stats||null;return this.stateBySrc_[e]}clearStateBySrc(e=this.player_.currentSrc()){this.log.debug("cleared",this.stateBySrc_[e]);delete this.stateBySrc_[e]}updateState(e=this.player_.currentSrc(),t){const{isObj:i}=V;if(!i(t)){g.log.warn("Engager.updateState: requires update arg to be an object");return this.stateBySrc(e)}const n=g.obj.merge(this.stateBySrc(e),t);this.stateBySrc_[e]=n;return n}recordState(){const e=this.player_;const t=this.stateBySrc();t.mediainfo=e.mediainfo;t.playbackEndTime=e.currentTime();t.times.push(t.playbackEndTime);if(yi(e)){t.duration=e.onceux.timeline.contentDuration}else{t.duration=e.duration()}t.buffered=e.buffered();t.playbackRate=e.playbackRate()}isTracking(){return!!this.timerId_}start(e={}){if(this.disposed_){return}let{reason:t,src:i}=e;if(!i){i=this.player_.currentSrc()}const n=this.stateBySrc(i);n.playbackStartTime=n.playbackEndTime=this.player_.currentTime();if(yi(this.player_)){n.duration=this.player_.onceux.timeline.contentDuration}else{n.duration=this.player_.duration()}n.rebufferingCount=0;n.rebufferingEnd=0;n.rebufferingTime=0;if(e.isRebuffering){n.rebuffering=true;n.rebufferingStart=Date.now()}else{n.rebufferingStart=0}this.player_.clearTimeout(this.timerId_);this.timerCreatedAt_=Date.now();this.timerId_=this.player_.setTimeout(()=>this.stop({src:i,reason:"engagement timer fired"}),vi);this.log.debug("started",{reason:t,time:this.timerCreatedAt_});return this}prepareState_(e){const t=this.player_;const i=this.stateBySrc(e);const{isNativeHlsSupported:n}=V;const s=t.currentType();i.height=Math.round(t.currentHeight());i.width=Math.round(t.currentWidth());const r=t.tech_&&t.tech_.vhs;if(r&&r.playlists&&r.playlists.media()){const e=r.playlists.media();const u=i.rendition={url:e.resolvedUri,mimeType:s};if(e.attributes){u.indicatedBPS=e.attributes.BANDWIDTH;if(e.attributes.RESOLUTION){u.height=e.attributes.RESOLUTION.height;u.width=e.attributes.RESOLUTION.width}}}if(n(g)&&s==="application/vnd.apple.mpegurl"){const c=this.stateBySrc_[this.player_.currentSrc()].parsedManifest||{playlists:[]};const{playlists:h}=c;const f=this.inferRenditions_(h);const p=()=>{if(!f.length){return{url:null,bandwidth:null}}if(f.length>1){return{url:"multiple",bandwidth:"multiple"}}return{url:f[0].uri,bandwidth:f[0].attributes.BANDWIDTH}};const m=p();i.rendition=g.obj.merge(i.rendition,{mimeType:"application/x-mpegurl",height:Math.round(t.videoHeight()),width:Math.round(t.videoWidth()),url:m.url,indicatedBPS:m.bandwidth})}i.videoPlaybackQuality=t.getVideoPlaybackQuality();i.times.push(t.currentTime());const{start:a,end:o,remainders:l,ranges:d}=ci(i.times);i.times=l;return g.obj.merge({rangeExtras:d,rangeStart:a,rangeEnd:o},i)}inferRenditions_(e){if(!e||!Array.isArray(e)||!e.length){return[]}const d=this.player_.videoWidth();const u=new Set(e.map(e=>e.attributes.RESOLUTION.width).sort((e,t)=>e-t));const c=(e=d,t=Array.from(u))=>{const i=Math.floor((t.length-1)/2);const n=t.slice(0,i+1);const s=t.slice(i+1);const r=n[n.length-1];const a=s[0];if(r===e||a===e){return[e]}if(t.length===1){return t}if(re){const o=Math.abs(r-e);const l=Math.abs(a-e);if(o===l){return[r,a]}return Math.min(o,l)===o?[r]:[a]}if(r>e){return c(e,n)}if(a{i=[...i,...e.filter(e=>e.attributes.RESOLUTION.width===t)]});return i}stop(e={}){if(!e.src){e.src=this.player_.currentSrc()}if(this.isTracking()){this.player_.clearTimeout(this.timerId_);this.timerId_=null;const t=this.stateBySrc(e.src);const i=(t.duration-t.playbackEndTime)*1e3;if(!this.player_.ended()&&i>0&&i<1500){this.timerId_=true;this.log.debug("delayed",{msFromEnd:i});C(this.player_,"one","ended",()=>{this.recordState();this.stop({reason:"content ended after we delayed the engager"})});return this}e.state=this.prepareState_(e.src);e.period=e.period||{};e.period.start=e.period.start||this.timerCreatedAt_;e.period.end=e.period.end||Date.now();this.log.debug("stopped",e);this.trigger({type:"engagement",engagement:e})}return this}dispose(){this.disposed_=true;this.stop({ignoreAdState:true,reason:"player disposed"});this.off();return this}}return e};const _i=s=>{class e{constructor(e,t){this.log=t;this.player_=e;this.events_=[]}add(e,t=Date.now(),i){const n=s.obj.merge(i,{name:e,time:t});this.events_.push(n);this.log.debug(`saw "${e}" at`,t,i);return t}record(e){const t=Date.now();this.add(e,t,{adState:mt(this.player_),isInAdState:I(this.player_)});return t}reset(){this.events_.length=0}filter(t){if(!V.isFn(t)){return this.events_.filter(e=>e.name===t)}return this.events_.filter(t)}map(e){return this.events_.map(e)}names(){return this.map(e=>e.name)}first(t,i){for(let e=0;e=this.visThreshold}_createVisibilityChangeHandler(){const e=function(e){if(this._isConsideredVisible(e)){if(!this.timeout){this._startTimeout()}}else if(this.timeout){this._stopTimeout()}};return e.bind(this)}_startTimeout(){this.timeout=this.player.setTimeout(()=>{this.callback();this.shutdown()},this.duration)}_stopTimeout(){tv.clearTimeout(this.timeout);this.timeout=null}initialize(){if(this._isConsideredVisible(this._getVisState())){this._startTimeout()}this._startListening()}shutdown(){this._stopTimeout();this._stopListening()}}const wi={production:"https://metrics.brightcove.com/v2/tracker",qa:"https://metrics.juju.qa.brightcove.com/v2/tracker",staging:"https://metrics.juju.staging.brightcove.com/v2/tracker"};const Ii=(t,i,n)=>{Object.keys(n).forEach(e=>{i[e]=String(i[e]||"");if(e==="accountId"&&!V.isNonEmptyStr(i[e])){i[e]=String(i.account||"")}if(!V.isNonEmptyStr(i[e])){i[e]=t.getAttribute(`data-${n[e]}`)||""}});return i};const ki=(e,t)=>{const{accountId:i,applicationId:n,embedId:s,playerId:r}=Ii(e.el(),t,{accountId:"account",applicationId:"application-id",embedId:"embed",playerId:"player",playerName:"name",usage:"usage"});if(!V.isNonEmptyStr(t.player)){if(tv.location.hostname==="players.api.brightcove.com"){t.player=`players.api.brightcove.com/${r}_${s}`;return}t.player=Wt(i,r,s);if(n){t.player+="/"+n}}if(n){if(V.isNonEmptyStr(t.playerName)){t.playerName+=" - "+n}else{t.playerName=n}}};const Ci=e=>({computedHeight:e.currentHeight(),computedWidth:e.currentWidth(),height:e.height(),width:e.width()});const Ai=(e,t)=>{if(typeof e==="boolean"){t.warn("The __iframe__ option should only be used in tests!");return e}try{return tv.parent!==tv.self}catch(e){return true}};const ji=b=>{const _=Ot(b);const T=zt(b);const S=si(b);const E=bi(b);const w=_i(b);const e=function(c={}){let r=false;let a=false;const o={};let e;c=b.obj.merge(c);c.env=wi.hasOwnProperty(c.env)?c.env:"production";ki(this,c);const l=this.log.createLogger("analytics");const h=new E(this,l);const d=new w(this,l);const u=new ri;const f=new Ti;const t=V.isNonEmptyStr(c.usage)?c.usage.split(","):[];t.forEach(function(e){f.put(e)});const p=new T(this,u,V.isNonEmptyStr(c.analyticsUrl)?c.analyticsUrl:wi[c.env],l,{user:c.user,corpCommsApp:c.corpCommsApp,application:c.application,device:c.device,playerId:c.playerId,embedId:c.embedId,applicationId:c.applicationId,requiresConsent:c.requiresConsent});const m=new S(this,p,d,u,l);const i=ni(m);p.defaultParams(()=>{const t={account:c.accountId||null,destination:tv.location.href,platform_version:c.platformVersion,player:c.player,player_name:c.playerName,source:iv.referrer};if(Ai(c.__iframe__,l)){t.destination=iv.referrer;if(V.isNonEmptyStr(c.referrer)){t.source=c.referrer}else{try{t.source=tv.parent.document.referrer}catch(e){t.source=null}}}return t});C(this,"on","pluginsetup:ads",gi);const n=t=>{[l,p.log,h.log,d.log,m.log].forEach(e=>{if(t){e.level("debug");e.history.enable()}else{e.level("warn");e.history.disable()}})};c.debug=Boolean(c.debug);n(c.debug);this.on("debugon",()=>n(true));this.on("debugoff",()=>n(false));const s=e=>{if(e!==null&&!V.isNonEmptyStr(e)){b.log.warn("Authorization Token must be a valid string or null");return}this.analyticsBcovAuthToken_=e};this.bcAnalytics={client:p,emitter:m,engager:h,history:d,setBcovAuthToken:s,settings:c,insightsBeacons:i,VERSION:k};C(this,"on","usage",e=>{if(!e.name){return l.warn("Ignored usage event without a `name` parameter")}f.put(e.name)});const g=function(){f.put("pagehide");h.stop({fromUnload:true,ignoreAdState:true,reason:"pagehide called"})};C(tv,"addEventListener","pagehide",g);const v=e=>{if(!e.usingPlugin("bcAirplay")){return false}if(e.isConnectingToAirplay){e.isConnectingToAirplay=false;return true}};const y=e=>{l.debug(e?`workflow saw "${e.type}"`:"workflow called manually");if(!_t(e,this)){l.debug("workflow bailing because player is in an ad state");return}let t=d.first("loadstart",yt(this));let i=d.first("play");let n=d.last("playing");l.debug("workflow checking history",{loadstart:t,play:i,playing:n});if(e&&e.type==="playing"&&d.last("pause")){m.triggerVideoResume()}if((i||n)&&!h.isTracking()&&!this.paused()){h.start({period:{start:i||n},reason:"workflow detected that it is playing",isRebuffering:h.stateBySrc().rebuffering})}if(u.state.timeOfImpression&&u.state.timeOfView){return}o.workflow=o.workflow||this.setTimeout(()=>{o.workflow=null;t=d.first("loadstart",yt(this));i=d.first("play");n=d.last("playing");if((t||i)&&!u.state.timeOfImpression){m.triggerVideoImpression({params:{time:Math.min(t||Infinity,i||Infinity)}})}if(t&&n&&!u.state.timeOfView){l.debug("workflow complete",{order:d.names()});m.triggerVideoView({params:{time:n,analyticsBcovAuthToken:this.analyticsBcovAuthToken_}})}},1)};if(typeof this.ads==="function"){this.adDataStore={adData:Ct,podData:At}}h.on("engagement",e=>{const{fromUnload:t,ignoreAdState:i,period:n,restartAlways:s,state:r}=e.engagement;const a=I(this);const o={useSendBeaconOnly:t,params:{time:n.end}};if(r.rangeExtras>=2){f.put("disco-engmnt")}const l=f.peek();if(l&&l.length){o.params.usage=l.map(tv.encodeURIComponent).sort().join(",")}if(!a||i){p.qos.append("frames",r.videoPlaybackQuality);const d=m.triggerVideoEngagement(n,r,o);if(s||d&&!this.paused()){if(a){return}f.flush();h.start({reason:"sent engagement and still playing",isRebuffering:h.stateBySrc().rebuffering})}}});C(this,"on","dispose",()=>{mi();f.put("disposed");h.dispose()});C(this,"on",_.concat(Dt,xt).concat("sourceunstable"),e=>{d.record(e.type)});C(this,"on",_.concat("ads-ad-started"),e=>{p.qos.append("event",I(this)?"ad":"content",e.type)});C(this,"on",["loadedmetadata","resize"],()=>{p.qos.append("player",Ci(this))});C(this,"on","fullscreenchange",()=>{const e=Date.now();o.fullscreen=this.setTimeout(()=>{o.fullscreen=null;if(this.isFullscreen()){m.triggerFullscreenEnabled()}else{m.triggerFullscreenDisabled()}p.qos.append("player",Ci(this),e)},500)});C(this,"on","mediachange",()=>{if(this.tech_.vhs){const e=this.tech_.vhs.playlists.media();p.qos.append("bitrate",{bitrates:this.tech_.vhs.bandwidth,playlists:e&&e.attributes&&e.attributes.BANDWIDTH})}});C(this,"on","ratechange",()=>{const e=this.playbackRate().toFixed(2);f.put("pr:"+e)});C(this,"on","pipactive",()=>{m.triggerEnterPIP()});C(this,"on","pipinactive",()=>{m.triggerLeavePIP()});C(this,"on","texttrackchange",t=>{const i=this.textTracks();if(d.last(t.type)){const e=d.filter(t.type);const n=e[e.length-1].text_track_index;m.triggerTextTrackDisabled({params:{text_track_kind:i[n].kind,text_track_language:i[n].language}})}for(let e=0;e{if(this.muted()&&!e){e=true;m.triggerMuteEnabled()}if(!this.muted()&&e){e=false;m.triggerMuteDisabled()}if(!this.muted()){m.triggerVolumeChange({params:{volume:this.volume()}})}});C(this,"on","ready",()=>{e=this.muted();C(this.tech_,"on","usage",e=>{if(!e.name){return l.warn("Ignored usage event without a `name` parameter")}f.put(e.name)});C(this.tech_,"on","bandwidthupdate",()=>{p.qos.append("bitrate",{bitrates:this.tech_.vhs.bandwidth,throughput:Math.round(this.tech_.vhs.throughput)})});C(this.tech_,"on","liveresync",()=>{this.trigger({type:"usage",name:"hls-live-resync"})});C(this.tech_,"on","videounderflow",()=>{this.trigger({type:"usage",name:"hls-video-underflow"})});C(this.tech_,"on","licenserequestattempted",()=>{d.add("licenserequestattempted")});C(this,"on","loadedmetadata",()=>{const n=this.player_.currentSrc();const e=b.url.parseUrl(n);const t=e.hostname.indexOf("boltdns.net")===-1;const i=Boolean(h.stateBySrc(n)&&h.stateBySrc(n).parsedManifest);const s=this.currentType();const{isHlsType:r,isNativeHlsSupported:a}=V;const o=typeof c.nativeQoe==="boolean"?c.nativeQoe:!t;if(a(b)&&r(s)&&o&&!i){const{downloadManifest:e,parseHlsManifest:i}=V;const d=e(n);d.then(e=>{const t=i(e);h.updateState(n,{parsedManifest:t})},e=>{b.log.error(e)})}const l=this.textTracks();for(let e=0;e{const e=u.activeCues[0];if(e){const t=this.tech_.vhs.playlists.main.playlists[e.value.playlist];if(i!==t.uri){if(t.attributes&&t.attributes.BANDWIDTH){p.qos.append("bitrate",{rendered:t.attributes.BANDWIDTH})}if(i!==undefined){h.stop({reason:"rendition on screen changed",restartAlways:true})}}i=t.uri}})}}if(this.usingPlugin("social")){C(this.socialButton,"on","click",()=>{m.triggerShareOverlay()});C(this.socialOverlay,"on","click",e=>{if(e.target.classList.contains("vjs-social-share-link")){m.triggerShareSocialClicked({params:{share_network:e.target.getAttribute("title").toLowerCase()}})}});C(this.socialOverlay,"on","copy",e=>{if(e.target.parentElement.classList.contains("vjs-social-direct-link")){m.triggerShareLinkCopied({params:{link_url:this.socialOverlay.getDirectLink()}})}else if(e.target.parentElement.classList.contains("vjs-social-embed-code")){m.triggerShareEmbedCopied({params:{embed_code:this.socialOverlay.getEmbedCode()}})}})}if(V.isLive(this.player_)&&this.player_.liveTracker){C(this.player_.liveTracker,"on","liveedgechange",()=>{p.defaultParams({delivery_type:this.player_.liveTracker.behindLiveEdge()?"dvr":"live"})})}})});C(this,"on","waiting",e=>{const t=this.currentTime()===0&&!this.paused();if(!a&&!t&&!I(this)&&!h.stateBySrc().rebuffering){h.stateBySrc().rebuffering=true;h.stateBySrc().rebufferingCount++;h.stateBySrc().rebufferingStart=Date.now()}C(this,"one",["playing","pause"],()=>{if(h.stateBySrc().rebuffering){h.stateBySrc().rebufferingEnd=Date.now();const e=(h.stateBySrc().rebufferingEnd-h.stateBySrc().rebufferingStart)/1e3;const t=h.stateBySrc().rebufferingTime+e;const i=parseFloat(t.toFixed(1));h.stateBySrc().rebufferingTime=i;h.stateBySrc().rebuffering=false}})});C(this,"on","sourcechanged",(e,t)=>{const i=t.interimEvents;const n=i[0].event;const s=()=>{if(!a&&!I(this)){h.recordState()}};l.debug("sourcechanged",{by:n.type,interim:i.map(e=>e.event.type),from:t.from,to:t.to});if(t.from){h.stop({reason:"changing sources",period:{end:i[0].time},ignoreAdState:true,src:t.from});h.clearStateBySrc(t.from)}r=false;a=false;u.resetTimesOf();d.reset();i.forEach(e=>d.add(e.event.type,e.time));y();C(this,"onPerSrc","timeupdate",s);C(this,"onePerSrc","sourceunstable",()=>{if(mt(this)==="content-resuming"){return}const e=this.currentSrc();h.stop({ignoreAdState:true,reason:"sourceunstable",src:e});if(!I(this)){pi(this,"off","timeupdate",s)}});C(this,"onPerSrc",["loadstart","play","playing"],y);C(this,"onPerSrc",["pause","ratechange"],e=>{if(e.type==="pause"){d.record(e.type);m.triggerVideoPause()}if(!a&&!I(this)&&!this.ended()){h.stop({reason:`saw "${e.type}"`});if(this.paused()){C(this,"onePerSrc","playing",()=>{h.start({reason:"playback began after a pause",isRebuffering:h.stateBySrc().rebuffering})})}else if(e.type==="ratechange"){o.ratechange=this.setTimeout(()=>{o.ratechange=null;h.start({reason:"the playback rate changed",isRebuffering:h.stateBySrc().rebuffering})},1)}}});C(this,"onPerSrc","unstable",()=>{if(!a&&!I(this)){a=true;h.stop({reason:"seeking"})}});C(this,"onPerSrc","seek",()=>{if(a&&!I(this)){a=false;h.start({reason:"stopped seeking",isRebuffering:h.stateBySrc().rebuffering})}});C(this,"onePerSrc","adstart",()=>{if(!gt(this)){m.triggerVideoImpression({params:{time:d.last("adstart",true)-100}})}});C(this,"onPerSrc","adstart",()=>{r=this.ended();h.stop({ignoreAdState:true,period:{end:d.last("adstart",true)},reason:"saw adstart"})});C(this,"onePerSrc","adend",()=>{if(!this.paused()&&!this.ended()){y()}});C(this,"onPerSrc","adend",()=>{if(!r){h.start({reason:'saw "adend"'})}})});C(this,"on","catalog_request",e=>{d.record(e.type);m.triggerCatalogRequest(e.url)});C(this,"on","catalog_request_error",e=>{d.record(e.type);m.triggerCatalogRequestError(e.url,{error:e.error,xhr:e.response})});C(this,"on","catalog_response",e=>{d.record(e.type);m.triggerCatalogResponse(e.url,{xhr:e.response})});C(this,"on","play",e=>{if(bt(this)||v(this)||d.first("play")!==d.last("play")){return}const t={params:{time:Date.now()}};if(this.perSourceBehaviors.isSrcStable()){m.triggerPlayRequest(t)}else{C(this,"one","sourcechanged",()=>{m.triggerPlayRequest(t)})}});C(this,"on","error",()=>{if(!I(this)){m.sendError()}});C(this,"on","adstart",()=>{m.triggerAdModeBegin();o.perSrcDisable=this.setTimeout(()=>{o.perSrcDisable=null;this.perSourceBehaviors.disable()},1);this.one("playing",function(){const e=d.filter(e=>e.name==="playing").length;if(e>1){m.triggerVideoResumed()}})});C(this,"on","adend",()=>{m.triggerAdModeComplete();if(o.perSrcDisable){this.clearTimeout(o.perSrcDisable)}else{this.perSourceBehaviors.enable()}});C(this,"on","adserror",e=>{m.triggerAdError({params:{ad_error:e.errorCode}})});C(this,"on","adtimeout",()=>{m.triggerAdTimeout()});C(this,"on","ad-hard-timeout",()=>{m.triggerAdHardTimeout()});C(this,"on",Pt,e=>{wt(p,e.type,Date.now())});C(this,"on","ads-ad-started",e=>{const t=new Ei({player:this,visThreshold:.5,duration:2e3,callback:()=>{this.bcAnalytics.insightsBeacons.adViewableImpression()}});t.initialize();this.any(["ads-ad-ended","adend","adtimeout","adserror"],()=>{t.shutdown()})});p.qos.append("mr",c.mr);p.qos.append("locked",c.playerVersionLocked);if(V.isFn(c.beforeFirstBeacon)){c.beforeFirstBeacon(this)}m.triggerPlayerInit();m.sendError();C(this,"on","ready",()=>{p.defaultParams({feature:gt(this)?"adonly":null,autoplay:this.autoplay(),ads_enabled:this.ads!==undefined});p.qos.append("performance",(tv.location.href||"").split("?")[1]);p.qos.append("player",Ci(this));if("hidden"in iv&&"visibilityState"in iv){if(iv.hidden){this.trigger({type:"usage",name:"document-hidden"})}const e=()=>{this.trigger({type:"usage",name:"document-"+iv.visibilityState})};C(iv,"addEventListener","visibilitychange",e)}if(iv.querySelector(".bc-iframe")){this.trigger({type:"usage",name:"iframe-embed"})}else{this.trigger({type:"usage",name:"inpage-embed"})}m.triggerPlayerLoad({qos:p.qos.keys(),params:{usage:f.flush()}})})};e.VERSION=k;b.registerPlugin("bcAnalytics",e);return e};const A="video";const j="playlist";const x="search";const xi="lazySequence";const Di="related";const d=[{attr:"data-video-id",query:"videoId",config:"videoId",type:A},{attr:"data-playlist-id",query:"playlistId",config:"playlistId",type:j},{attr:"data-catalog-search",query:"catalogSearch",config:"search",type:x},{attr:"data-catalog-sequence",query:"catalogSequence",config:"sequence",type:xi}];const Ri=(t,i,n)=>{for(let e=0;e{const e=(n,e,t)=>{const i=e.options_;const s=Boolean(e.el().ownerDocument.querySelector(".bc-iframe"));const r=V.qs();t=t?r.parse(t):r.search;d.concat({query:"playlistVideoId"}).forEach(({query:e})=>{if(Array.isArray(t[e])){t[e]=t[e].pop()}});if(d.filter(e=>!!n[e.config]).length>1||d.filter(e=>!!i[e.attr]).length>1){e.error({headline:"Bad Request: Multiple catalog media queries provided. Please only provide one",type:"PLAYER_ERR_CONFLICTING_DATA",code:-3,message:"Too many catalog media parameters were provided in this player. "+"Please use only one of the following: videoId, playlistId, catalogSequence, or catalogSearch."});return}const a=s&&Ri("query",t,t.playlistVideoId)||Ri("attr",i,i["data-playlist-video-id"]||t.playlistVideoId)||Ri("config",n,t.playlistVideoId||n.playlistVideoId);if(!a){return}if(typeof a.id==="string"&&(a.type===x||a.type===xi)){const o=a.id;try{a.id=JSON.parse(o)}catch(e){if(a.type===xi){l.log.error("sequence must be valid JSON or an object",e);return}}if(!V.isObj(a.id)&&!Array.isArray(a.id)){a.id=o}}["adConfigId","deliveryConfigId","bumper"].forEach(t=>{const i=t==="bumper"?n[t]&&n[t].id:n[t];if(!V.isNonEmptyStr(i)){return}if(V.isObj(a.id)){a.id[t]=i}else if(Array.isArray(a.id)){a.id.forEach(e=>{e[t]=i})}else{a[t]=n[t]}});return a};return e};const c={VIDEO_CLOUD_ERR_ACCOUNT_NOT_FOUND:{headline:"The Video Cloud account was not found."},VIDEO_CLOUD_ERR_RESOURCE_NOT_FOUND:{headline:"The Video Cloud resource was not found."},VIDEO_CLOUD_ERR_NOT_PLAYABLE:{headline:"The Video Cloud video is not playable."},VIDEO_CLOUD_ERR_AD_CONFIG_ID_NOT_FOUND:{headline:"The Video Cloud SSAI ad config id was not found."},VIDEO_CLOUD_ERR_VIDEO_NOT_FOUND:{headline:"The Video Cloud video was not found."},VIDEO_CLOUD_ERR_DUPLICATE_PARAMETERS:{headline:"Invalid Request: Duplicate Parameter",message:"The same parameter name was provided more than once in the request."},VIDEO_CLOUD_ERR_TOKEN_REQUIRED:{headline:"Access Denied: Missing Token",message:"Video cannot be played without a token."},VIDEO_CLOUD_ERR_TOKEN_INVALID:{headline:"Access Denied: Invalid Token",message:"Video cannot be played without a valid token."},VIDEO_CLOUD_ERR_UNKNOWN:{headline:"The Playback API request failed for an unknown reason",message:"Unknown catalog request error."},PLAYER_ERR_DOMAIN_RESTRICTED:{headline:"Playback Denied: Domain Restricted",message:"Video is not playable on this domain."},PLAYER_ERR_IP_RESTRICTED:{headline:"Playback Denied: IP",message:"Your IP address does not have access to this video."},PLAYER_ERR_GEO_RESTRICTED:{headline:"Playback Denied: Location",message:"Video is unavailable from your current location."},PLAYER_ERR_OFFER_RESTRICTED:{headline:"Playback Denied: Offer Restricted",message:"Video is not playable with your entitlements."},PLAYER_ERR_TAG_RESTRICTED:{headline:"Playback Denied: Tags",message:"Video does not have tags required for playback."},PLAYER_ERR_ACCOUNT_ID:{headline:"Playback Denied: Account ID",message:"Account ID missing or invalid."},PLAYER_ERR_DEVICE_RESTRICTED:{headline:"Playback Denied: Device",message:"Device does not have access to this resource."},VIDEO_CLOUD_ERR_VIDEO_NOT_PLAYABLE:{headline:"Playback Denied: Unavailable",message:"Video is not currently available for playback."},VIDEO_CLOUD_ERR_PLAYLIST_NOT_PLAYABLE:{headline:"Playback Denied: Unavailable",message:"Playlist is not currently available for playback."},VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE:{code:"DENIED_BY_STREAM_LIMIT_CREATE",headline:"Stream Limiting: New Viewers",message:"Limited stream has reached the maximum number of viewers."},VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW:{code:"DENIED_BY_STREAM_LIMIT_RENEW",headline:"Stream Limiting: Existing Viewers",message:"Limited stream is already being watched by the maximum number of viewers."},VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING:{code:"DENIED_BY_STREAM_LIMITING",headline:"Stream Limiting: New Viewers",message:"Limited stream has reached the maximum number of viewers."},VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING:{code:"DENIED_BY_DEVICE_LIMITING",headline:"Device Limiting: New Viewers",message:"Maximum number of streams has been reached on this device."},VIDEO_CLOUD_ERR_PLAYLIST_NOT_FOUND:{headline:"Playlist Unavailable: Not Found",message:"Playlist cannot be found."},VIDEO_CLOUD_ERR_METHOD_NOT_ALLOWED:{headline:"API: Method not allowed."},VIDEO_CLOUD_ERR_SERVER:{headline:"Server: Internal server error",message:"An internal server error prevented playback."},VIDEO_CLOUD_ERR_VIDEO_RETRIEVE_FAILURE:{headline:"Server Error: Video",message:"Video unavailable."},VIDEO_CLOUD_ERR_ACCOUNT_RETRIEVE_FAILURE:{headline:"Server Error: Account",message:"Account unavailable."},VIDEO_CLOUD_ERR_VIDEO_URLS_RETRIEVE_FAILURE:{headline:"Server Error: Video URLs",message:"Stream URLs unavailable."},VIDEO_CLOUD_ERR_PLAYLIST_RETRIEVE_FAILURE:{headline:"Server Error: Playlist",message:"Video playlist unavailable."},VIDEO_CLOUD_ERR_PLAYBACK_RIGHT_RETRIEVE_FAILURE:{headline:"Server Error: Playback Rights",message:"Entitlements unavailable."},VIDEO_CLOUD_ERR_PLAYLIST_VIDEOS_RETRIEVE_FAILURE:{headline:"Server Error: Playlist Videos",message:"Playlist videos unavailable."},VIDEO_CLOUD_ERR_LICENSE_RETRIEVE_FAILURE:{headline:"Server Error: License",message:"Stream license unavailable."},VIDEO_CLOUD_ERR_OFFERS_RETRIEVE_FAILURE:{headline:"Server Error: Offers",message:"Stream offers unavailable."},VIDEO_CLOUD_ERR_RIGHTS_RETRIEVE_FAILURE:{headline:"Server Error: Rights",message:"Stream rights unavailable."},VIDEO_CLOUD_ERR_SERVICE_UNAVAILABLE:{headline:"Server Error: Unavailable",message:"The server is currently unavailable. Please try again later."},VIDEO_CLOUD_ERR_SERVICE_TIMEOUT:{headline:"Server Error: Timeout",message:"Recevied a timeout from the server. Please try again later."},GSC_ERR_DENIED_BY_CONCURRENCY_LIMITING:{headline:"Session Limiting: New Sessions",message:"Maximum number of sessions have been reached for this video",dismiss:false},GSC_TOKEN_REQUIRED:{headline:"Invalid Request: JWT is required",message:"Please provide a valid token",dismiss:false},GSC_INVALID_TOKEN:{headline:"Invalid Request: Invalid JWT",message:"Please provide a valid token",dismiss:false},GSC_MISSING_FIELD_ACCOUNT_ID:{headline:"Invalid Request: AccountID is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_UID:{headline:"Invalid Request: UID in JWT is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_SESSION_ID:{headline:"Invalid Request: SID in JWT is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_CLIMIT:{headline:"Invalid Request: CLIMIT in JWT is required",message:"Please provide required information",dismiss:false},GSC_MISSING_FIELD_VIDEO_ID:{headline:"Invalid Request: videoId is required",message:"Please provide required information",dismiss:false},GSC_SESSION_STOPPED:{headline:"Stream Limiting: Session stopped",message:"Stream session no longer available",dismiss:false},GSC_SESSION_EXPIRED:{headline:"Stream Limiting: Session expired",message:"Stream session no longer available",dismiss:false},GSC_PLAYBACK_RESTRICTIONS:{headline:"Playback Restrictions: Not Met",message:"Playback restrictions requirements have not been met",dismiss:false},GSC_SESSION_NOT_FOUND:{headline:"Not found",message:"Playback session not found",dismiss:false},GSC_VIDEO_NOT_FOUND:{headline:"Not found",message:"Video cannot be found or does not exist",dismiss:false}};const Pi=(e,t)=>{const i=e.error();if(t===null&&i&&(i.headline===c.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE.headline||i.headline===c.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW.headline||i.headline===c.VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING.headline||i.headline===c.VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING.headline||i.headline===c.GSC_ERR_DENIED_BY_CONCURRENCY_LIMITING.headline)){return i}if(t&&t.code===5&&/Denied by stream limiting \(create\)/.test(t.cause)){return c.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE}if(t&&t.code===5&&/Denied by stream limiting \(renew\)/.test(t.cause)){return c.VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW}if(t&&t.code===5&&/Denied by stream limiting/.test(t.cause)){return c.VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING}if(t&&t.code===5&&/Denied by device limiting: [1-9] devices in use/.test(t.cause)){return c.VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING}return t};const Li=e=>{const t=()=>e.errors.extend(c);const i=V.isFn(e.usingPlugin)?e.usingPlugin("errors"):V.isFn(e.errors)&&V.isFn(e.errors.extend);if(!i){e.on("pluginsetup:errors",t);e.on("dispose",()=>{e.off("pluginsetup:errors",t)});return}t()};const Ni={400:{AD_CONFIG_NOT_FOUND:"VIDEO_CLOUD_ERR_AD_CONFIG_ID_NOT_FOUND",DUPLICATE_PARAMETERS:"VIDEO_CLOUD_ERR_DUPLICATE_PARAMETERS"},401:{TOKEN_REQUIRED:"VIDEO_CLOUD_ERR_TOKEN_REQUIRED",TOKEN_VALIDATION:"VIDEO_CLOUD_ERR_TOKEN_INVALID"},403:{ACCESS_DENIED:{DOMAIN:"PLAYER_ERR_DOMAIN_RESTRICTED",CLIENT_IP:"PLAYER_ERR_IP_RESTRICTED",CLIENT_GEO:"PLAYER_ERR_GEO_RESTRICTED",OFFERS:"PLAYER_ERR_OFFER_RESTRICTED",TAGS:"PLAYER_ERR_TAG_RESTRICTED",ACCOUNT_ID:"PLAYER_ERR_ACCOUNT_ID",DEVICE:"PLAYER_ERR_DEVICE_RESTRICTED"},VIDEO_NOT_PLAYABLE:"VIDEO_CLOUD_ERR_VIDEO_NOT_PLAYABLE",PLAYLIST_NOT_PLAYABLE:"VIDEO_CLOUD_ERR_PLAYLIST_NOT_PLAYABLE",DENIED_BY_STREAM_LIMITING_CREATE:"VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_CREATE",DENIED_BY_STREAM_LIMITING_RENEW:"VIDEO_CLOUD_DENIED_BY_STREAM_LIMIT_RENEW",DENIED_BY_STREAM_LIMITING:"VIDEO_CLOUD_DENIED_BY_STREAM_LIMITING",DENIED_BY_DEVICE_LIMITING:"VIDEO_CLOUD_DENIED_BY_DEVICE_LIMITING"},404:{ACCOUNT_NOT_FOUND:"VIDEO_CLOUD_ERR_ACCOUNT_NOT_FOUND",RESOURCE_NOT_FOUND:"VIDEO_CLOUD_ERR_RESOURCE_NOT_FOUND",VIDEO_NOT_FOUND:"VIDEO_CLOUD_ERR_VIDEO_NOT_FOUND",PLAYLIST_NOT_FOUND:"VIDEO_CLOUD_ERR_PLAYLIST_NOT_FOUND"},405:{METHOD_NOT_ALLOWED:"VIDEO_CLOUD_ERR_METHOD_NOT_ALLOWED"},500:{SERVER_ERROR:"VIDEO_CLOUD_ERR_SERVER"},502:{VIDEO_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_VIDEO_RETRIEVE_FAILURE",VIDEO_URLS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_VIDEO_URLS_RETRIEVE_FAILURE",PLAYLIST_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_PLAYLIST_RETRIEVE_FAILURE",PLAYLIST_VIDEOS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_PLAYLIST_VIDEOS_RETRIEVE_FAILURE",ACCOUNT_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_ACCOUNT_RETRIEVE_FAILURE",PLAYBACK_RIGHT_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_PLAYBACK_RIGHT_RETRIEVE_FAILURE",LICENSE_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_LICENSE_RETRIEVE_FAILURE",OFFERS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_OFFERS_RETRIEVE_FAILURE",RIGHTS_RETRIEVE_FAILURE:"VIDEO_CLOUD_ERR_RIGHTS_RETRIEVE_FAILURE"},503:{SERVICE_UNAVAILABLE:"VIDEO_CLOUD_ERR_SERVICE_UNAVAILABLE"},504:{SERVER_TIMEOUT:"VIDEO_CLOUD_ERR_SERVICE_TIMEOUT"}};const Mi=(e,t)=>{const i=t.shift();if(V.isNonEmptyStr(e[i])){return e[i]}if(!i||!e[i]){return"VIDEO_CLOUD_ERR_UNKNOWN"}return Mi(e[i],t)};const Ui=(e,t)=>{t=Array.isArray(t)?t[0]:t||{};return{code:Mi(Ni,[e,t.error_code,t.error_subcode])}};const Bi=(i,n)=>{return(e,t)=>{if(e){e.data=t;i.catalog.error=e;i.error(Ui(e.status,t));return i.trigger("bc-catalog-error")}i.ready(()=>i.catalog.load(n(t)))}};const Fi=a=>{const o=(e,t,i)=>{if(i.embedHasPoster){e.poster=t.options_.poster}if(i.embedHasSources){e.sources=t.options_.sources}if(i.embedHasTracks){e.textTracks=t.options_.tracks}if(e.textTracks&&e.textTracks.length>0&&a.browser.IS_ANY_SAFARI){t.$(".vjs-tech").setAttribute("crossorigin","anonymous")}return e};const e=(n,s,r)=>{if(n===A){return Bi(s,e=>o(e,s,r))}return Bi(s,t=>{const e=o({},s,r);if(Array.isArray(t.videos)){const i=t.videos[0]||{};t.videos[0]=a.obj.merge(i,e,{rawItem:i})}else{t.videos=[e]}if(r.playlistVideoId&&n===j){for(let e=0;eNumber.MAX_SAFE_INTEGER||Math.pow(2,53)-2;const Vi=(e,t)=>{const i=e.cuePoints;const n=i[t];let s;for(t++;tn.time){s=i[t];break}}const r=isFinite(e.duration)?e.duration:qi();n.startTime=n.time;if(s&&s.time{const i=t.remoteTextTracks();if(i){let e=i.length;while(e--){t.removeRemoteTextTrack(i[e])}}const n=t.textTracks();if(n){let e=n.length;while(e--){const s=n[e];if(s.kind==="metadata"&&s.cues){let e=s.cues.length;while(e--){s.removeCue(s.cues[e])}}s.mode="disabled"}}};const $i=(e,t)=>{Hi(e);if(!t.cuePoints){return}const i=e.mediaCuePointsTrack();const n=tv.VTTCue||tv.vttjs&&tv.vttjs.VTTCue||tv.TextTrackCue;for(let e=0;e0){return zi(e,i,e[0]).src}}D.windowLocationProtocol=function(){return tv.location.protocol};const t=(e,t)=>`https://${e}.api.${t?t+".":""}brightcove.com/playback/v1/`;const Gi={production:{papi:t("edge"),epa:t("edge-auth")},qa:{papi:t("edge","qa"),epa:t("edge-auth","qa")},staging:{papi:t("edge","staging"),epa:t("edge-auth","staging")}};const Wi=e=>tv.encodeURIComponent(e);const Ki=e=>typeof e==="string"&&/^BCpk/.test(e);const Xi=i=>{const n={ad_config_id:"adConfigId",config_id:"deliveryConfigId"};const e=["ad_config_id","config_id","tveToken"];if(i.type!==A){e.push("limit");e.push("offset")}if(i.type===x){e.push("q");e.push("sort")}const s={};e.forEach(e=>{const t=n[e]||e;if(i[t]){s[e]=i[t]}});const t=V.qs().stringify(s);return t?"?"+t:""};const Yi=(e,t)=>{let{env:i,type:n}=t;if(!i){i="production"}let s;if(V.isNonEmptyStr(t.baseUrl)){s=t.baseUrl}else if(Ki(t.policyKey)){s=Gi[i].papi}else{s=Gi[i].epa}if(s.slice(-1)==="/"){s=s.slice(0,-1)}let r;r=`${s}/accounts/${Wi(e)}/${n===j?"playlists":"videos"}`;if(n!==x){r+="/"+Wi(t.id)}if(n===Di){r+="/related"}r+=Xi(t);return r};const Qi=v=>{const e=function(i,n,e,s=()=>{}){const{deliveryConfigId:r,adConfigId:a,id:o,bcovAuthToken:t,policyKey:l,q:d,type:u}=e;if(!n||!u){return s(new Error("accountId and type are required"))}if(u===x&&!d){return s(new Error("q is required when performing a search"))}else if(u!==x&&!o){return s(new Error("id is required when getting a video or playlist"))}const c=Yi(n,e);const h=(e,t)=>{i.trigger(V.assign({type:`catalog_${e}`,accountId:n,deliveryConfigId:r,adConfigId:a,playlistId:u===j?o:undefined,related:u===Di?o:undefined,search:u===x?d:undefined,url:c,videoId:u===A?o:undefined},t))};const f=(e,t,i)=>h("request_error",{error:e,response:t,body:i});h("request");const p={};if(Ki(l)){p.Accept="application/json;pk="+l}else if(t){p.Authorization="Bearer "+t}const m=v.xhr({headers:p,json:true,url:c},(e,t,i)=>{if(e){f(e,m,i);return s(e,i)}if(m.status>=400){f(new Error("Request Failed"),m,i);return s(m,i)}h("response",{response:m});s(null,i)});const g=m.onabort.bind(m);m.onabort=()=>{const e=new Error("Request Aborted");g();f(e,m,null);return s(e,null)};return m};return e};const Ji="https://fps.brightcove.com/v1/application_certificate";const Zi="com.apple.fps.1_0";const en=e=>{return tv.btoa(String.fromCharCode.apply(null,e))};const tn=e=>{return String.fromCharCode.apply(null,new Uint16Array(e.buffer))};const nn=({source:e,publisherId:t,applicationId:i})=>{const n=e.key_systems[Zi].certificate_url;if(n){return n}if(i&&t){return`${Ji}/${t}/${i}`}return null};const sn=n=>{const e=(e,i)=>{const t=nn({source:e.source,publisherId:e.publisherId,applicationId:e.applicationId});n.xhr({uri:t,responseType:"arraybuffer"},n.xhr.httpHandler((e,t)=>{if(e){i(e);return}i(null,new Uint8Array(t))}))};return e};const rn=(e,t)=>{if(typeof t==="string"){return t.split("//")[1]}return tn(t).split("//")[1]};const an=d=>{const e=(o,l)=>{return(e,t,i,n)=>{const s=t.split("&").filter(e=>/^renditionType/.test(e))[0]||"";const r=s.split("=")[1];const a={"Content-Type":"application/json",Accept:"application/octet-stream"};if(e.emeHeaders&&e.emeHeaders["BCOV-Auth"]){a["BCOV-Auth"]=e.emeHeaders["BCOV-Auth"]}if(r&&l){o=l[r]}d.xhr({uri:o,method:"POST",responseType:"arraybuffer",json:{publisher_id:e.publisherId,application_id:e.applicationId,key_id:t.split("/")[3],server_playback_context:en(i)},headers:a},d.xhr.httpHandler(n,true))}};return e};var f={getCertificateUri:nn,initGetCertificate:sn,getContentId:rn,initCreateGetLicenseFunc:an,base64EncodeUint8Array:en,FAIRPLAY_KEY_SYSTEM:Zi};const on=(e=[])=>e.filter(e=>e.keySystems&&e.keySystems[f.FAIRPLAY_KEY_SYSTEM]);const ln=(e,t,s)=>{const i=on(t);if(!i.length||!e.eme){s();return}const n=e.eme.options||{};let r=0;const a=[];const o={};for(let e=0;e{if(e){a.push({message:"Unable to resolve FairPlay certificate",error:e})}else{const t=o[d];for(let e=0;e{t(null,i)}}}r--;if(!r){if(a.length){s(a);return}s()}})}};const dn=(e,t)=>{const i=f.initCreateGetLicenseFunc(t);const n=f.initGetCertificate(t);if(!V.isHlsType(e.type)||!e.key_systems||!e.key_systems[f.FAIRPLAY_KEY_SYSTEM]){return null}const s=e.key_systems[f.FAIRPLAY_KEY_SYSTEM];const r=s.key_request_url;const a={};a[f.FAIRPLAY_KEY_SYSTEM]={getCertificate:n,getLicense:i(r,s.key_request_urls),getContentId:f.getContentId};return a};const un=t=>{const e=e=>{return dn(e,t)};return e};var cn={initGetKeySystemOptions:un,getFairPlaySources:on,resolveFairPlayCertificates:ln};const hn=(e,t)=>{t=t||e&&e.mediainfo||{};return e&&e.hasPlugin&&e.hasPlugin("vr")&&t&&t.projection};const fn=50*1024*1024;const pn=3*1024*1024;const mn=.5*1024*1024;const gn={http:{nativeHls:{http:{"application/vnd.apple.mpegurl":1,"video/mp4":5,"application/dash+xml":3},https:{"application/vnd.apple.mpegurl":2,"video/mp4":6,"application/dash+xml":4}},noNativeHls:{http:{"application/vnd.apple.mpegurl":1,"video/mp4":5,"application/dash+xml":3},https:{"application/vnd.apple.mpegurl":2,"video/mp4":6,"application/dash+xml":4}},preferMp4:{http:{"application/vnd.apple.mpegurl":3,"video/mp4":1,"application/dash+xml":5},https:{"application/vnd.apple.mpegurl":4,"video/mp4":2,"application/dash+xml":6}}},https:{nativeHls:{http:{"application/vnd.apple.mpegurl":2,"video/mp4":6,"application/dash+xml":5},https:{"application/vnd.apple.mpegurl":1,"video/mp4":4,"application/dash+xml":3}},noNativeHls:{http:{"application/vnd.apple.mpegurl":5,"video/mp4":4,"application/dash+xml":6},https:{"application/vnd.apple.mpegurl":1,"video/mp4":3,"application/dash+xml":2}},preferMp4:{http:{"application/vnd.apple.mpegurl":5,"video/mp4":4,"application/dash+xml":6},https:{"application/vnd.apple.mpegurl":2,"video/mp4":1,"application/dash+xml":3}}},codecs:{switching:{hevc:{combined:1,hevc:2,avc:3},nohevc:{combined:5,hevc:6,avc:4}},noswitching:{hevc:{combined:3,hevc:5,avc:2},nohevc:{combined:4,hevc:6,avc:1}}}};const vn={1:3,2:3.2,3:4.2,4:5,5:6,6:7,7:8};const yn=(e,t)=>{return t.type==="application/vnd.apple.mpegurl"&&t.key_systems&&V.isSafariWithFairplaySupport()&&e.eme&&e.eme.options};const bn=(e,t,i)=>{return t.type==="application/vnd.apple.mpegurl"&&t.key_systems&&V.isBrowserWithWidevineSupport(i)&&e.eme&&e.eme.options};const _n=function(e,t,i,n,s){t.priority=9999;if(!t.src){return 9999}if(t.type==="application/vnd.apple.mpegurl"&&t.key_systems&&(t.key_systems["com.apple.fps.1_0"]&&!yn(i,t)||t.key_systems["com.widevine.alpha"]&&!bn(i,t,s))){return 9999}if(t.profiles&&t.profiles.match(/hbbtv/i)){return 9999}if(s.browser.IS_IOS&&t.type==="application/vnd.apple.mpegurl"&&vn[t.ext_x_version]>parseFloat(s.browser.IOS_VERSION)){return 9999}e=e[/^[^:]*/.exec(t.src)];if(!e){return 9999}if(e[t.type]){t.priority=e[t.type]}const r=t.codecs&&t.codecs.indexOf("avc1")!==-1;const a=t.codecs&&t.codecs.indexOf("hvc1")!==-1;const o=r&&a;let l;if(o){l=n.combined}else if(a){l=n.hevc}else if(r){l=n.avc}else{l=0}return t.priority+l};const R=g=>{const v=function(e,t,i,n,s){let r=R.preferHttps()?gn.https:gn.http;let a;if(hn(e,t)){a=fn}else if(g.browser.IS_IOS||g.browser.IS_ANDROID){a=mn}else{a=pn}if(R.preferMp4(e,t)){r=r.preferMp4}else if(R.supportsNativeHls()){r=r.nativeHls}else{r=r.noNativeHls}let o=_n(r,n,e,i,g)-_n(r,s,e,i,g);const l=n.type==="application/vnd.apple.mpegurl"&&n.codecs&&n.ext_x_version||s.type==="application/vnd.apple.mpegurl"&&s.codecs&&s.ext_x_version;const d=n.codecs&&s.codecs?false:true;if(l&&d){o=n.priority-s.priority}delete n.priority;delete s.priority;if(o){return o}if(n.type==="video/mp4"&&s.type==="video/mp4"){if(n.avg_bitrate&&s.avg_bitrate){return Math.abs(n.avg_bitrate-a)-Math.abs(s.avg_bitrate-a)}if(n.avg_bitrate||s.avg_bitrate){o=n.avg_bitrate?-1:1}}if(n.type==="application/vnd.apple.mpegurl"&&s.type==="application/vnd.apple.mpegurl"){if(n.ext_x_version&&s.ext_x_version){return s.ext_x_version-n.ext_x_version}if(n.ext_x_version||s.ext_x_version){o=n.ext_x_version?-1:1}}return o};function e(t,e,i={}){const n=cn.initGetKeySystemOptions(g);const s=e.sources||[];const r=[];let{bcovAuthToken:a,policyKey:o,watermarkingToken:l,allowPlayreadyInChromiumEdge:d}=i;const u=!!a&&o===null;if(a&&!V.isNonEmptyStr(a)){g.log.error("The bcovAuthToken catalog property must be a string");a=null}if(l&&!V.isNonEmptyStr(l)){g.log.error("The watermarking token catalog property must be a string");l=null}for(let e=0;e1){delete p.key_systems["com.microsoft.playready"]}else{s.splice(e,1);e--;continue}}if(a&&p.key_systems){p.emeHeaders={"BCOV-Auth":a}}if(l){p.src=p.src.replace("{WMT}",l)}if(p.src&&p.container==="MP4"){p.type="video/mp4"}else if(p.src&&(p.container==="M2TS"||V.isHlsType(p.type))){p.type="application/vnd.apple.mpegurl";if(yn(t,p)){p.keySystems=n(p)}if(V.isEncryptedHls(p,g)&&a){if(p.vmap&&t.hasPlugin("ssai")){p.bcovAuthToken=a}else{const m=g.url.parseUrl(p.src);let e="bcov_auth="+a;if(!m.search){e="?"+e}else if(!(m.search[m.search.length-1]==="&")){e="&"+e}p.src+=e}}}r.push(p)}const c=R.supportsSwitchingCodecs(t)?"switching":"noswitching";const h=R.supportsHEVC()?"hevc":"nohevc";const f=gn.codecs[c][h];return r.sort(v.bind(null,t,e,f))}R.supportsNativeHls=function(){return V.isNativeHlsSupported(g)};R.preferHttps=function(){return V.preferHttps(tv)};R.supportsHEVC=function(){return V.isHevcSupported()};R.supportsSwitchingCodecs=function(e){return V.isCodecSwitchingSupported(e)};R.preferMp4=function(e,t){return g.browser.IS_ANDROID&&g.browser.ANDROID_VERSION<5||hn(e,t)};return e};class Tn{constructor(){this.defaults_={}}normalize(e,t,i){const n=V.assign({},this.defaults_);if(e&&!V.isObj(e)){n.id=e}else{V.assign(n,e);if(V.isObj(e.id)){V.assign(n,e.id);if(!e.id.hasOwnProperty("id")){delete n.id}}}if(typeof t==="string"){n.type=t}if(n.type===x){if(!n.q){n.q=n.id}delete n.id}if(typeof e.deliveryConfigId==="string"){n.deliveryConfigId=e.deliveryConfigId}if(typeof i==="string"){n.adConfigId=i}if((n.type===j||n.type===x)&&n.limit===undefined){n.limit="100"}return n}setDefaults(e){if(e===null){this.defaults_={}}else{V.assign(this.defaults_,e)}}getDefault(e){return V.isObj(this.defaults_)&&this.defaults_[e]||undefined}getDefaults(){return V.isObj(this.defaults_)&&V.assign({},this.defaults_)||{}}}function Sn(c){const e=c.options_.runtime_.settings;const h=e.videoCloud&&e.videoCloud.bumper;let f=false;let p;return{setSource(e,t){const n=c.usingPlugin("playlist")&&c.playlist().length>0;const s=n&&c.playlist.currentItem()>-1?c.playlist()[c.playlist.currentItem()]:c.mediainfo;const i=c.bcPlaylistUi&&c.bcPlaylistUi().options.autoadvance;const r=s.id;const a=s.manifestExpiresAt;c.catalog.isCurrentSourceBumper_=h&&(h.id===s.id||h.id===`ref:${s.referenceId}`);const o=()=>{const e=c.paused();c.catalog.get({id:r,type:"video"}).then(i=>{c.catalog.load(i);if(n){s.manifestExpiresAt=i.manifestExpiresAt;s.sources.forEach((e,t)=>{e.src=i.sources[t].src})}c.one("canplay",()=>{if(!e){c.play()}})}).catch(e=>{c.log.warn(e)})};if(Date.now()>a){o();return}c.one("play",()=>{if(Date.now()>a){o();return}});const l=()=>{c.one("play",()=>c.trigger("bumper-play"));c.one("ended",()=>{c.trigger("bumper-ended");f=true})};const d=()=>{c.one("bumper-ended",()=>{c.bigPlayButton.hide();c.posterImage.hide();if(p){p.poster="";c.catalog.load(p);if(i){c.playlist.autoadvance(i)}}})};if(h){if(c.catalog.isCurrentSourceBumper_);else{p=n?s:p||c.mediainfo}if(!f&&!c.catalog.isCurrentSourceBumper_){const u=n&&c.playlist.currentItem()>0?true:false;c.catalog.get({id:h.id,type:"video"}).then(e=>{e.economics="FREE";e.poster=p.poster;c.catalog.bumper_=w(h,{video:e});c.catalog.load(e)});if(u){c.one("loadedmetadata",()=>{c.play()})}}else if(!f&&c.catalog.isCurrentSourceBumper_){l();d()}else if(f&&!c.catalog.isCurrentSourceBumper_){c.one("loadedmetada",()=>{c.play();if(n){f=false}})}}t(null,e)}}}const En={production:"https://edge-gsc.api.brightcove.com",staging:"https://edge-gsc.api.staging.brightcove.com",qa:"https://edge-gsc.api.qa.brightcove.com"};const wn={maxRetry:3,intervalRetry:6e4,interval:null};const p={MAX_CONCURRENCY:"MAX_CONCURRENCY",TOKEN_REQUIRED:"TOKEN_REQUIRED",INVALID_TOKEN:"INVALID_TOKEN",ACCOUNT_ID:"ACCOUNT_ID",UID:"UID",SESSION_ID:"SESSION_ID",CLIMIT:"CLIMIT",VIDEO_ID:"VIDEO_ID",SESSION_STOPPED:"SESSION_STOPPED",SESSION_EXPIRED:"SESSION_EXPIRED",PLAYBACK_RESTRICTIONS:"PLAYBACK_RESTRICTIONS",TOKEN_VALIDATION:"TOKEN_VALIDATION",SESSION_NOT_FOUND:"SESSION_NOT_FOUND",VIDEO_NOT_FOUND:"VIDEO_NOT_FOUND"};const In=(e,t)=>{if(!t){t="production"}return`${En[t]}/api/v1/accounts/${e}/sessions`};const kn=(e,t)=>{const{statusCode:i,body:n}=e;let s=null;if(i<400||i>499){return s}const{error:r}=n;const a=r.sub_code||r.code;switch(a){case p.MAX_CONCURRENCY:s={code:"GSC_ERR_DENIED_BY_CONCURRENCY_LIMITING"};t.log.error("GSC heartbeat max concurrency limit.",e);break;case p.TOKEN_REQUIRED:s={code:"GSC_TOKEN_REQUIRED"};t.log.error("GSC JWT is required.",e);break;case p.INVALID_TOKEN:s={code:"GSC_INVALID_TOKEN"};t.log.error("GSC JWT is required.",e);break;case p.ACCOUNT_ID:s={code:"GSC_MISSING_FIELD_ACCOUNT_ID"};t.log.error("GSC AccountID is required.",e);break;case p.UID:s={code:"GSC_MISSING_FIELD_UID"};t.log.error("GSC UID is required in JWT.",e);break;case p.SESSION_ID:s={code:"GSC_MISSING_FIELD_SESSION_ID"};t.log.error("GSC SID is required in JWT.",e);break;case p.CLIMIT:s={code:"GSC_MISSING_FIELD_CLIMIT"};t.log.error("GSC CLIMIT is required in JWT.",e);break;case p.VIDEO_ID:s={code:"GSC_MISSING_FIELD_VIDEO_ID"};t.log.error("GSC videoId is required.",e);break;case p.SESSION_STOPPED:s={code:"GSC_SESSION_STOPPED"};t.log.error("GSC session stopped.",e);break;case p.SESSION_EXPIRED:s={code:"GSC_SESSION_EXPIRED"};t.log.error("GSC session expired.",e);break;case p.PLAYBACK_RESTRICTIONS:s={code:"GSC_PLAYBACK_RESTRICTIONS"};t.log.error("GSC playback restrictions not met.",e);break;case p.SESSION_NOT_FOUND:s={code:"GSC_SESSION_NOT_FOUND"};t.log.error("GSC session not found.",e);break;case p.VIDEO_NOT_FOUND:s={code:"GSC_VIDEO_NOT_FOUND"};t.log.error("GSC video not found",e);break}return s};const Cn=d=>{class e{constructor(e,t={}){this.player=e;this.timerId=null;this.interval=null;this.sid=null;this.retryCount=0;this.options=d.obj.merge(wn,t);this.shouldReInit=true;this.player.on("ended",()=>this.stop());this.player.on("dispose",()=>this.stop(null,true));this.player.on("play",()=>{if(this.shouldReInit){return this.init()}})}init(){this.onTimerTick()}onTimerTick(){this.send(e=>{const{statusCode:t,body:i}=e;if(t>=500){this.player.log.error("GSC Heartbeat failed to contact server");this.retry();return}if(t===204){this.player.log.warn("Stream Concurrency feature has not been enabled for this account");return}const n=kn(e,d);if(n){return this.terminatePlayback(n)}this.interval=i.heartbeat_interval;if(!this.timerId){this.timerId=this.player.setInterval(()=>this.onTimerTick(),this.interval);this.retryCount=0}this.shouldReInit=false;this.sid=i.sid})}terminatePlayback(e){this.clear();this.player.one("playerreset",()=>this.player.error(e));this.player.reset()}retry(){const{maxRetry:e,intervalRetry:t}=this.options;if(this.retryCount>=e){this.terminatePlayback({code:"GSC_SESSION_STOPPED"});return}this.clear();this.retryCount++;this.player.setTimeout(()=>this.onTimerTick(),t)}send(i){const{catalog:e}=this.player;const t=e.getCatalogParamDefault_("accountId");const n=e.getCatalogParamDefault_("bcovAuthToken");const s=e.getCatalogParamDefault_("env");const r={Authorization:"Bearer "+n};const a={url:In(t,s),method:"POST",json:true,headers:r,body:{video:this.player.mediainfo?this.player.mediainfo.id||"":""}};d.xhr(a,(e,t)=>{if(e){d.log.error("GSC Heartbeat failed to perform request.",e);this.retry();return}i(t)})}clear(){if(!this.timerId){return}this.player.clearInterval(this.timerId);this.timerId=null;this.interval=null;this.sid=null}stop(s=false,r=false){this.isCasting=s;d.log.debug("GSC: about to stop and clear heartbeat");const{catalog:e}=this.player;const t=e.getCatalogParamDefault_("accountId");const i=e.getCatalogParamDefault_("bcovAuthToken");const n=e.getCatalogParamDefault_("env");const a=In(t,n);const o={Authorization:"Bearer "+i};const l={url:a,method:"DELETE",json:true,headers:o};this.clear();d.xhr(l,(e,t,i)=>{if(e){d.log.error("GSC failed request for stop session.",e)}if(r){return}const n=kn(t,d);if(n){this.player.error(n)}if(!s){this.player.one("play",()=>this.init())}})}getSessionId(){return this.sid||""}}return e};const An=/([A-Za-z0-9])_([A-Za-z0-9])/g;const jn=e=>e.replace(An,(e,t,i)=>t+i.toUpperCase());const xn=(e,t)=>{return(e.type==="application/vnd.apple.mpegurl"||e.type==="application/dash+xml")&&t.toLowerCase()==="html5"};const Dn=(e,t)=>{if(!t){return e}let i=e;if(t.preferMp4){i=e.filter(e=>e.container&&e.container.toLowerCase()==="mp4");if(Array.isArray(t.preferMp4)){const[s,r]=t.preferMp4;i=i.sort((e,t)=>{const i=e.hasOwnProperty(s)?e[s]:null;const n=t.hasOwnProperty(s)?t[s]:null;if(i===null||n===null||!V.isNum(i)||!V.isNum(n)){return 0}if(V.isNonEmptyStr(r)&&r.toLowerCase()==="asc"){return i-n}return n-i})}}return i};const Rn=v=>{const y=Oi(v);const b=Fi(v);const _=R(v);const T=Qi(v);const S=Cn(v);const E=e=>{const t=v.obj.merge(e);Object.keys(t).filter(e=>e.match(An)).forEach(e=>{t[jn(e)]=t[e]});return t};const w=(e,t)=>{if(!t){return}e.mediainfo=E(t);const i=Boolean(e.el().ownerDocument.querySelector(".bc-iframe"));const n=e.mediainfo.name;if(i&&n){iv.title=n}};const I=(e,t)=>{if(!t){return}e.playlistinfo=E(t);delete e.playlistinfo.videos};function e(r){const d=this;const n=e=>{if(e&&e.accountId){d.trigger({type:"usage",name:"catalog-get-account-id"});return e.accountId}if(typeof d.getAccountId==="function"){return d.getAccountId()}return r.accountId||d.options_["data-account"]};const u=new Tn;let s={};let a;const i={policyKey:d.options_["data-policy-key"],bcovAuthToken:d.options_["data-bcov-auth-token"],watermarkingToken:d.options_["data-watermarking-token"]};const t=Object.keys(i).reduce((e,t)=>{if(i[t]){e[t]=i[t]}return e},{});["adConfigId","allowPlayreadyInChromiumEdge","baseUrl","bcovAuthToken","deliveryConfigId","env","policyKey","sourceSelectionRules","watermarkingToken"].forEach(e=>{if(r.hasOwnProperty(e)){t[e]=r[e]}});let e=null;if(r.streamConcurrency){e=new S(d,r)}u.setDefaults(t);v.hook("beforeerror",Pi);Li(d);d.on("loadstart",()=>{if(!d.usingPlugin("playlist")||!d.playlist()||!d.playlist().length){return}w(d,d.playlist()[d.playlist.indexOf(d.currentSrc())])});d.on("dispose",()=>Hi(d));const o=(e,t)=>{const i=cn.getFairPlaySources(e);if(!i.length){t();return}cn.resolveFairPlayCertificates(d,i,e=>{if(e){v.log("Unable to resolve FairPlay certificates",e)}t()})};const l=e=>{if(!d.hasPlugin||!d.hasPlugin("ssai")||!e){return e}return e.map(function(e){if(e.vmap){e.type=v.getPlugin("ssai").MIME_TYPE;e.originalHlsSource=e.src;e.src=e.vmap}return e})};const c=e=>{if(!e.variants){return e}const{name:t,description:i,longDescription:n,customFields:s}=e;const r=null;const a={name:t,description:i,longDescription:n,language:r};a.customFields=v.obj.merge(s);const o=e.variants.map(E);e.variants=[...o,a];return e};const h=e=>{if(!e){return}if(Array.isArray(e)){a=e.map(e=>c(E(e)))}else{a=c(E(e))}};const f=(e,t)=>{if(!e||!e.variants){return v.obj.merge(e)}let i=null;let n=null;if(typeof t==="string"){i=t.toLowerCase();n=i.split("-")[0]}const s=()=>e.variants.find(e=>typeof e.language==="string"&&e.language.toLowerCase()===i);const r=()=>e.variants.find(e=>typeof e.language==="string"&&e.language.toLowerCase()===n);const a=()=>e.variants.find(e=>e.language===null);const o=s()||r()||a();return v.obj.merge(e,o)};const p=a=>{const e=()=>{let t=false;w(d,a);h(a);if(hn(d)){const e=d.el().querySelector("video");e.setAttribute("crossorigin","anonymous")}d.el().setAttribute("data-video-id",a.id);if(tv.bc&&!tv.bc.disposedAfterPreroll_){d.poster(a.poster)}if(a.sources){for(let e=0;e0&&v.browser.IS_ANY_SAFARI||v.browser.IS_IOS){d.crossOrigin("anonymous")}}};o(a.sources,e)};const m=i=>{if(!d.usingPlugin("playlist")){d.log.warn("A playlist was loaded from the Playback API, but this player is not using the playlist plugin. The first video in the playlist will be loaded instead!");p(i[0]);return}const e=()=>{d.on("beforeplaylistitem",(e,t)=>$i(d,t));d.on("playlistchange",()=>h(d.playlist()));for(let e=0;e0){i[e].textTracks=t.filter(e=>e.label!=="thumbnails")}}const e=i.startingIndex||0;h(i);w(d,i[e]);I(d,d.catalog.data);if(hn(d)){const e=d.el().querySelector("video");e.setAttribute("crossorigin","anonymous")}d.playlist(i,e)};const t=i.filter(e=>e.sources).reduce((e,t)=>e.concat(t.sources),[]);o(t,e)};const g=(e,t={})=>{let i;const n=E(e);if(n.sources){n.rawSources_=n.sources;n.sources=(r.getSources||_)(d,n,t);if(t.sourceSelectionRules){n.sources=Dn(n.sources,t.sourceSelectionRules)}i=d.selectSource(n.sources)}if(n.posterSources){n.poster=D(n.posterSources)}if(n.thumbnailSources){n.thumbnail=D(n.thumbnailSources)}if(n.textTracks){const s=i&&xn(i.source,i.tech);n.textTracks=n.textTracks.filter(e=>{return!(s&&e.in_band_metadata_track_dispatch_type!==undefined)}).map(e=>{if(e.sources){e.src=D(e.sources)}return e})}if(n.duration){n.duration=n.duration*.001}if(n.cuePoints){for(let e=0;e{e=T(d,n(a),a,(e,t)=>{d.catalog.loading--;if(a.type===x&&t&&(!t.videos||!t.videos.length)){e=new Error("No videos returned from search")}if(e){e.data=t;d.catalog.error=e;return r(e)}if(!t){return s(null)}d.catalog.data=v.obj.merge({},t);if(a.adConfigId){d.catalog.data.adConfigId=a.adConfigId}const i=["allowPlayreadyInChromiumEdge","bcovAuthToken","policyKey","sourceSelectionRules"].reduce((e,t)=>{if(a.hasOwnProperty(t)){e[t]=a[t]}return e},{});if(a.watermarkingToken){i.watermarkingToken=a.watermarkingToken}if(a.type===A){d.catalog.sources=t.sources;d.catalog.poster=t.poster;return s(g(t,i))}const n=t.videos.filter(e=>!e.hasOwnProperty("errors")).map(e=>g(e,i));if(n.length){return s(n)}return r(new Error("No videos returned from playlist"))})});if(!V.isFn(t)){return i}i.then(e=>{t(null,e)}).catch(e=>{t(e,e.data)});return e},getVideo(e,t=()=>{},i){return this.get(u.normalize(e,A,i),t)},getSequence(r,a=()=>{},e){if(!Array.isArray(r)){r=[r]}if(!d.usingPlugin("playlist")){throw new Error("getSequence requires the playlist plugin")}r=r.filter(e=>{if(!/^(search|video|playlist)$/i.test(e.type)){v.log.error("invalid sequence type, please use search, video, or playlist. for:",e);return false}return true});if(!r.length){a(new Error("No valid sequences"),null);return}let o=r.length;const l=new Array(r.length);return r.map((n,s)=>{return this.get(u.normalize(n,n.type,e),(e,t)=>{o--;if(e){v.log.error("failed to request sequence",n);v.log.error("with error",e)}else if(t){if(!Array.isArray(t)){t=[t]}l[s]=t}if(o===0){d.catalog.data=l;const i=l.reduce((e,t)=>t&&e.concat(t),[]);if(!i.length){a(new Error("No data was loaded for the sequence "+JSON.stringify(r),null))}else{a(null,i)}}},e)})},getLazySequence(n,e=()=>{},t){if(!Array.isArray(n)){n=[n]}if(!d.usingPlugin("playlist")){throw new Error("getLazySequence requires the playlist plugin")}const s=i=>{return this.getSequence(n.shift(),(e,t)=>{if((e||!t)&&n&&n.length){return s(i)}i(e,t)},t)};const r=()=>{if(!n.length){d.off("playlistitem",r);return}const e=d.playlist;const i=e.currentIndex&&e.currentIndex()||e.currentItem&&e.currentItem()||0;const t=e.lastIndex&&e.lastIndex()||e().length-1||0;if(i!==t){return}s((e,t)=>{if(e||!t){return}d.playlist(d.playlist().concat(t),i)})};d.on("playlistitem",r);return s(e)},getSearch(e,t=()=>{},i){return this.get(u.normalize(e,x,i),t)},getPlaylist(e,t=()=>{},i){return this.get(u.normalize(e,j,i),t)},load(e){if(Array.isArray(e)){m(e)}else{p(e)}},autoFindAndLoadMedia(e){const t=y(e,d);if(!t){return}e.playlistVideoId=t.playlistVideoId;const i=b(t.type,d,e);if(t.type===xi){this.getLazySequence(t.id,i)}else{this.get(u.normalize(t),i)}return t},setBcovAuthToken(e){if(e!==null&&!V.isNonEmptyStr(e)){v.log.warn("Authorization Token must be a valid string or null");return}u.setDefaults({bcovAuthToken:e})},setPolicyKey(e){if(e!==null&&!V.isNonEmptyStr(e)){v.log.warn("Policy key must be a valid string or null");return}u.setDefaults({policyKey:e})},setWatermarkingToken(e){if(e!==null&&!V.isNonEmptyStr(e)){v.log.warn("Watermarking token must be a valid string or null");return}u.setDefaults({watermarkingToken:e})},getWatermarkingToken(){return u.getDefault("watermarkingToken")},getCatalogParamDefault_(e){if(e==="accountId"){return n()}return u.getDefault(e)},getLastParams(){return v.obj.merge(s)},getLastData(){return v.obj.merge(d.catalog.data)},getMetadata(e){const{type:t,lang:i}=e?e:{};if(!a){v.log.debug("getMetadata() called with no cached metadata");return t===j?[]:{}}const n=d.usingPlugin("playlist")?d.playlist():[];if(t===j&&n.length){return a.map(e=>f(e,i))}if(n.length&&Array.isArray(a)){const s=d.playlist.indexOf(d.currentSrc());if(s===-1){return{}}return f(a[s],i)}return f(a,i)},getHeartbeat(){return e},bumper(){return this.bumper_||null},isCurrentSourceBumper(){return this.isCurrentSourceBumper_},loading:0}}if(!v.getPlugin("catalog")){v.use("*",Sn);v.registerPlugin("catalog",e);e.VERSION=k}};const On={activeCues:null,cues:null,id:"",inBandMetadataTrackDispatchType:undefined,kind:"metadata",label:"",language:"",mode:"",oncuechange:undefined};const Pn=["activeCues","cues","id","inBandMetadataTrackDispatchType","kind","label","language"];const Ln=["mode"];const Nn=function(e,t){if(e==="media"&&t.kind==="metadata"&&t.label==="media-cues"){return true}if(e==="id3"&&typeof t.inBandMetadataTrackDispatchType==="string"&&t.inBandMetadataTrackDispatchType.trim().length>0){return true}return false};const Mn=e=>{class t extends e.EventTarget{constructor(e,t,i=()=>{}){super();const n=this;n.player_=e;n.reTriggerEvent_=n.reTriggerEvent_.bind(n);n.update_=n.update_.bind(n);n.type_=t;n.logger_=i;Pn.concat(Ln).forEach(t=>{const e={get:()=>n.track_&&n.track_[t]||On[t],enumerable:true};if(Ln.indexOf(t)!==-1){e.set=function(e){if(!n.track_){return}n.track_[t]=e}}Object.defineProperty(n,t,e)});n.update_();const s=e.textTracks();const r=e=>{if(!n.track_){n.update_(e)}else if(n.track_.mode!=="hidden"){n.track_.mode="hidden";n.logger_(`timeupdate -> type:${n.type_}${n.track_?`,mode:${n.track_.mode}`:""} -> track was set to hidden`)}};["addtrack","removetrack"].forEach(e=>s.addEventListener(e,n.update_));n.player_.on("timeupdate",r);return n}addCue(){const e=arguments;if(!this.track_){this.one("trackexists",()=>this.addCue.apply(this,e));return}return this.track_.addCue.apply(this.track_,e)}removeCue(){const e=arguments;if(!this.track_){return this.one("trackexists",()=>this.removeCue.apply(this,e))}return this.track_.removeCue.apply(this.track_,e)}reTriggerEvent_(e){this.trigger(e)}update_(t={}){let i;if(t.type==="removetrack"&&t.track&&t.track===this.track_){i=null}else if(t.type==="addtrack"&&t.track&&!this.track_&&Nn(this.type_,t.track)){i=t.track}else{const n=this.player_.textTracks();let e=n.length;while(e--){if(Nn(this.type_,n[e])){i=n[e];break}}}const e=(...e)=>{if(t.type==="timeupdate"){return}this.logger_(...e)};e(`update -> type:${this.type_}, mode:${i?i.mode:"?"} -> event:${t.type||"constructor"}`);if(this.track_===i){e(`update -> type:${this.type_}, mode:${i?i.mode:"?"} -> ${i?"already proxied":"no track to proxy"}`);return}if(this.track_){this.track_.removeEventListener("cuechange",this.reTriggerEvent_)}this.track_=i;if(!this.track_){e(`update -> type:${this.type_}, mode:${i?i.mode:"?"} -> track changed, but no new track exists`);return}if(this.track_.mode!=="hidden"){this.track_.mode="hidden"}this.track_.addEventListener("cuechange",this.reTriggerEvent_);this.trigger("trackexists");e(`update -> type:${this.type_}, mode:${i?i.mode:"?"} -> track exists`)}}t.prototype.allowedEvents_={cuechange:"cuechange"};return t};const Un=e=>{const i=Mn(e);const s={id3CuePointsTrack(e){let t=this.proxyTracks_.id3;if(!t){t=this.proxyTracks_.id3=new i(this,"id3",e)}return t},mediaCuePointsTrack(e){let t=this.proxyTracks_.media;if(t){return t}t=this.proxyTracks_.media=new i(this,"media",e);if(t.track_){return t}this.addTextTrack("metadata","media-cues");t.update_();return t}};function t(t={}){this.proxyTracks_={};let n=e.createLogger("proxyTracks");if(!t.debug){n=()=>{}}n("initialized");Object.keys(s).forEach(e=>{this[e]=()=>s[e].call(this,n)});this.ready(()=>{Object.keys(s).forEach(e=>{const i=this[e]();if(t.debug){i.on("cuechange",()=>{for(let e=0;e cuechange -> activeCues[${e}]: ${t.value&&t.value.key||t.frame&&t.frame.id}`)}})}})})}e.registerPlugin("proxyTracks",t);t.VERSION=k};const Bn=function(e,t){const i=e.encryptedWatcher().encryptedSeen();if(!t||!i||t.code!==-2||e.currentTime()>.1){return t}let n;const s=e.currentSource();if(!e.hasPlugin("eme")){n="DRM/EME plugin is not included!"}else if(e.hasPlugin("eme")&&!e.usingPlugin("eme")){n="DRM/EME plugin is included but not initialized!"}else if(!s.keySystems||!Object.keys(s.keySystems).length){n="DRM (keySystems) was not provided!"}if(n){return{code:5,message:`DRM configuration issue prevented playback: ${n}`}}return t};const Fn=e=>{const t=e.getPlugin("plugin");class i extends t{constructor(e,t){super(e,t);this.player_=e;this.reset();this.handleEncrypted_=this.handleEncrypted_.bind(this);this.reset=this.reset.bind(this);this.player_.ready(()=>{this.player_.tech_.on("encrypted",this.handleEncrypted_);this.player_.tech_.on("webkitneedkey",this.handleEncrypted_);this.player_.tech_.on("msneedkey",this.handleEncrypted_);this.player_.tech_.on("loadstart",this.reset)},true)}handleEncrypted_(){this.encryptedSeen_=true}encryptedSeen(){return this.encryptedSeen_}reset(){this.encryptedSeen_=false}dispose(){this.reset();this.player_.tech_.off("encrypted",this.handleEncrypted_);this.player_.tech_.off("webkitneedkey",this.handleEncrypted_);this.player_.tech_.off("msneedkey",this.handleEncrypted_);this.player_.tech_.off("loadstart",this.reset)}}const n=e.hooks("beforeerror");if(n.indexOf(Bn)===-1){e.hook("beforeerror",Bn)}e.registerPlugin("encryptedWatcher",i)};const qn={verbose:false,maxSavedSeekEvents:10,debounceTimeout:1e3,playbackRateTolerance:1.5,stableTimeUpdateCount:3,minInterval:1};const Vn=function(e){if(e.isDisposed_){return}e.trigger("seek")};const Hn=function(_){const e=function(e){const t=_.obj.merge(qn,e);let i;let n=false;let s;let r;let a;let o;let l=0;const d=[];let u=0;const c={};const h={};const f=t.verbose?(...e)=>_.log.call(_,"seek-events:",...e):()=>{};const p=function(){c.seek=this.seekEvents.last().seekEnd;n=false;f("event seekStart: ",this.seekEvents.last().seekStart);f("event seekEnd: ",this.seekEvents.last().seekEnd)};const m=function(){f("stable");this.seekEvents.stable=true};const g=function(){f("unstable");this.seekEvents.stable=false};const v=function(e){c.seek=this.currentTime();c.clock=e.timeStamp||Date.now();h.seek=c.seek;h.clock=c.clock};const y=V.debounce(Vn,t.debounceTimeout);const b=function(e){s=this.currentTime();r=e.timeStamp||+new Date;a=s-h.seek;if(r===h.clock||s===c.seek){return}o=Math.abs(a)/(Math.abs(r-h.clock)*.001);if(o/this.playbackRate()>this.seekEvents.playbackRateTolerance){if(Math.abs(s-c.seek)>=this.seekEvents.minInterval){this.trigger("unstable");l=0;if(!n){u=Number(c.seek)}d.push({timeStamp:r,seekStart:u,seekEnd:s,seekInterval:s-u});if(d.length>t.maxSavedSeekEvents){d.shift()}n=true;y(this)}}else{l++;if(l>=this.seekEvents.stableTimeUpdateCount&&!this.seekEvents.stable&&!n){this.trigger("stable")}c.seek=s}h.seek=s;h.clock=r};this.seekEvents={stableTimeUpdateCount:t.stableTimeUpdateCount,playbackRateTolerance:t.playbackRateTolerance,debounceTimeout:t.debounceTimeout,minInterval:t.minInterval,stable:false,enabled(){return i},enable:function(){if(i){return}i=true;c.seek=0;c.clock=Date.now();h.seek=0;h.clock=c.clock;this.on("seek",p);this.on("stable",m);this.on("unstable",g);this.on(["loadstart","playing","adplaying"],v);this.on(["timeupdate","adtimeupdate"],b)}.bind(this),disable:function(){if(!i){return}i=false;this.off("seek",p);this.off("stable",m);this.off("unstable",g);this.off(["loadstart","playing","adplaying"],v);this.off(["timeupdate","adtimeupdate"],b)}.bind(this),last(){return d[d.length-1]},all(){return d}};this.seekEvents.enable()};e.VERSION=k;_.registerPlugin("seekEvents",e)};const $n=function(e){e.registerPlugin("touchActive",function(){if(!e.browser.TOUCH_ENABLED){return}const t=this;let i=false;const n=function(){if(!i){t.userActive(false)}};t.one("play",function(){const e=t.options_.inactivityTimeout>0?t.options_.inactivityTimeout:5e3;t.el().className+=" vjs-user-active";t.one(["click","tap"],function(){i=true});t.setTimeout(n,e)})})};const zn={"com.widevine.alpha":"Widevine","com.microsoft.playready":"PlayReady","com.apple.fps":"FairPlay"};const Gn={'video/ogg; codecs="theora"':"Ogg",'video/mp4; codecs="avc1.42E01E"':"H.264",'video/mp4; codecs="hvc1"':"HEVC",'video/webm; codecs="vp8, vorbis"':"WebM",'video/webm; codecs="vp9"':"VP9",'application/x-mpegURL; codecs="avc1.42E01E"':"HLS","application/dash+xml":"DASH",'video/mp4; codecs="mp4a.40.2"':"AAC",'video/mp4; codecs="mp4a.6B"':"MP3",'video/mp4; codecs="ac-3"':"Dolby Digital/AC-3",'video/mp4; codecs="mp4a.a6"':"Dolby Digital Plus/EC-3/E-AC-3"};let Wn=iv.createElement("video");const Kn={eme:Object.keys(zn).reduce((e,t)=>{e[t]={name:zn[t],persistentState:false,support:false};return e},{support:Boolean(tv.navigator.requestMediaKeySystemAccess||tv.MSMediaKeys&&tv.MSMediaKeys.isTypeSupported||tv.WebKitMediaKeys&&tv.WebKitMediaKeys.isTypeSupported)}),formats:Object.keys(Gn).reduce((e,t)=>{const i=Gn[t];let n=Wn.canPlayType(t);if(n){n=n.charAt(0).toUpperCase()+n.slice(1)}else{n="Not supported"}e[i]=n;return e},{}),mse:"MediaSource"in tv};Wn=null;if(!tv.navigator.requestMediaKeySystemAccess){const ta=tv.MSMediaKeys&&tv.MSMediaKeys.isTypeSupported||tv.WebKitMediaKeys&&tv.WebKitMediaKeys.isTypeSupported||(()=>false);tv.navigator.requestMediaKeySystemAccess=function(i,t){let n;let s;tv.setTimeout(()=>{const e=t.some(e=>{let t=[];if(e.audioCapabilities){t=t.concat(e.audioCapabilities)}if(e.videoCapabilities){t=t.concat(e.videoCapabilities)}return t.some(e=>{return!ta(i,e.contentType)})});if(e){s()}else{n()}});return{then(e){n=e;return this},catch(e){s=e;return this}}}}const Xn={"com.widevine.alpha":{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"',robustness:"SW_SECURE_CRYPTO"}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"',robustness:"SW_SECURE_CRYPTO"}]},"com.microsoft.playready":{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]},"com.apple.fps":{initDataTypes:["sinf"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]}};const Yn=(n,s={})=>{Object.keys(Xn).forEach(t=>{const e=JSON.parse(JSON.stringify(Xn[t]));if(s.persistentState){e.persistentState=s.persistentState}const i=e=>{Kn.eme[t][n]=false};try{tv.navigator.requestMediaKeySystemAccess(t,[e]).then(()=>{Kn.eme[t][n]=true}).catch(i)}catch(e){i()}})};Yn("support");Yn("persistentState",{persistentState:"required"});function Qn(e){return e.obj.merge(Kn)}const{get:m}=V;const v="unknown";const Jn=l=>{const e=l.getComponent("ModalDialog");const{dom:d}=l;const n={adonly:"Ad-Only",ampSupport:"AMP Support",bcAa:"Adobe Analytics",bcGa:"Google Analytics",bcGtm:"Google Tag Manager",bcPlaylistUi:"Brightcove Playlist UI",bcTealium:"Tealium",chromecastReceiver:"Chromecast Receiver",customEndscreen:"Custom Endscreen",dash:"DASH",dvrux:"Live DVRUX",FreeWheelPlugin:"FreeWheel",ima3:"IMA3",kollective:"Kollective",onceux:"OnceUX",pip:"Picture-in-Picture",qualityMenu:"Quality Menu",social:"Social",ssai:"SSAI",thumbnails:"Thumbnails",vr:"VR"};const a=(e,t="vjs-two")=>{return d.createEl("table",{className:t},{},d.createEl("tbody",{},{},e))};const o=(...e)=>{const t=e.map(e=>d.createEl("td",{},{},String(e)));return d.createEl("tr",{},{},t)};class t extends e{buildCSSClass(){return`vjs-player-info-modal ${super.buildCSSClass()}`}dataForPlugins_(){return Object.keys(n).filter(l.getPlugin).sort().map(e=>{const t=this.player();let i=l.getPluginVersion(e)||m(t,`${e}.VERSION`,v);if(e==="eme"&&i===v&&l.drm&&l.drm.VERSION){i=l.drm.VERSION}return{active:t.usingPlugin(e),displayName:n[e],version:i}})}dataForSource_(){const e=this.player();const t=e.currentSource()||{};const i=e.tech(true);return{keySystem:i?i.el().keySystem:null,mediainfo:e.mediainfo,tech:e.techName_,type:t.type,url:t.src}}dataForVhs_(){const e=this.player();const t=e.tech(true);const i=t?t.vhs:null;if(!i){return null}const n={bandwidth:m(i,"stats.bandwidth",v),mediaBytesTransferred:m(i,"stats.mediaBytesTransferred",v),mediaTransferDuration:m(i,"stats.mediaTransferDuration",v),mediaRequests:m(i,"stats.mediaRequests",v),versions:i.version()};const s=m(i,"playlists",{media:()=>{}}).media();if(s){n.rendition={height:m(s,"attributes.RESOLUTION.height",v),width:m(s,"attributes.RESOLUTION.width",v)}}return n}data(){const e=this.player();const t=d.getAttributes(e.el());const i=m(e,"bcinfo.accountId",m(t,"data-account",v));const n=m(e,"bcinfo.playerId",m(t,"data-player",v));const s=m(e,"bcinfo.embedId",m(t,"data-embed",v));const r=m(e,"bcinfo.applicationId",m(t,"data-application-id","-"));const a=m(tv,`bc.${n}_${s}.VERSION`,m(tv,"bc.VERSION",v));const o=m(tv,`bc.${n}_${s}.videojs.VERSION`,m(tv,"videojs.VERSION",v));return{capabilities:Qn(l),player:{accountId:i,playerId:n,embedId:s,applicationId:r,playerVersion:a,videojsVersion:o,language:e.language()},plugins:this.dataForPlugins_(),source:this.dataForSource_(),vhs:this.dataForVhs_()}}contentForPlayer_(e){const{player:t}=e;const i=[o("Brightcove Player Version",t.playerVersion),o("Video.js Version",t.videojsVersion),o("Account ID",t.accountId),o("Player ID",t.playerId),o("Embed ID",t.embedId),o("Application ID",t.applicationId)];return a(i)}contentForPlugins_(e){const t=e.plugins.map(e=>{return o(e.displayName,e.version,e.active?"Yes":"No")});if(!t.length){t.push(d.createEl("tr",{innerHTML:'No plugins available.'}))}const i=a(t);const n=d.createEl("thead",{innerHTML:` NameVersionActive? `.trim()});i.insertBefore(n,i.querySelector("tbody"));return i}contentForSource_(e){const{keySystem:t,mediainfo:i,type:n}=e.source;const s=[o("Current Media Type",n),o("DRM Key System",t||"n/a")];if(i){if(i.id){s.push(o("Video ID",i.id))}if(i.name){s.push(o("Video Name",i.name))}}return a(s)}contentForVhs_(e){const{vhs:t}=e;const i=[];if(t){if(V.isObj(t.versions)){i.push(d.createEl("tr",{innerHTML:'Library Versions'}));Object.keys(t.versions).forEach(e=>{i.push(o(e,t.versions[e]))})}i.push(d.createEl("tr",{innerHTML:'Statistics'}),o("Current Bandwidth",t.bandwidth),o("Media Bytes Transferred",t.mediaBytesTransferred),o("Media Requests",t.mediaRequests),o("Media Transfer Duration",t.mediaTransferDuration));if(t.rendition){i.push(o("Rendition Width",t.rendition.width),o("Rendition Height",t.rendition.height))}}else{i.push(d.createEl("tr",{innerHTML:'Using native playback engine.'}))}return a(i)}contentForCapabilities_(e){const{eme:s,mse:t}=e.capabilities;const r=[o("Media Source Extensions",t?"Yes":"No"),o("Encrypted Media Extensions",s.support?"Yes":"No")];Object.keys(s).forEach(e=>{if(e==="support"){return}const{name:t,persistentState:i,support:n}=s[e];r.push(o(t,n?"Yes":"No"));if(n){r.push(o(`${t} with persistentState`,i?"Yes":"No"))}});return a(r)}contentForFormats_(e){const{formats:t}=e.capabilities;const i=Object.keys(t).map(e=>{return o(e,t[e])});return a(i)}content(){const e=this.data();return[d.createEl("div",{className:"vjs-pi-section"},{},[d.createEl("h2",{},{},"Player Information"),this.contentForPlayer_(e),d.createEl("h2",{},{},"Media Information"),this.contentForSource_(e),d.createEl("h2",{},{},"Player Plugins"),this.contentForPlugins_(e)]),d.createEl("div",{className:"vjs-pi-section"},{},[d.createEl("h2",{},{},"Playback Engine"),this.contentForVhs_(e),d.createEl("h2",{},{},"Device Capabilities"),this.contentForCapabilities_(e),d.createEl("h2",{},{},"Device Format Support"),this.contentForFormats_(e)])]}}l.registerComponent("PlayerInfoModal",t);return t};const Zn=e=>{Jn(e);function t(){if(this.playerInfo.modal){this.playerInfo.modal.dispose()}this.playerInfo=function(){t.apply(this,arguments)};this.ready(()=>{this.addClass("vjs-player-info");this.playerInfo.modal=this.addChild("playerInfoModal",{fillAlways:true,label:this.localize("Player Information Dialog"),temporary:false});this.playerInfo.modal.on("dispose",()=>{delete this.playerInfo})})}e.registerPlugin("playerInfo",t);t.VERSION=k};const es=e=>{const n=(e,t)=>{if(typeof e.usingPlugin==="function"){return e.usingPlugin(t)}return!!e[t]};const i=e=>{e.postrollFinished=false;e.postrollTimedOut=false;e.sawNoPostrollEvent=false};const s=e=>{if(!n(e,"ads")){return false}const t=e.endscreenState_;if(t.sawNoPostrollEvent){return false}return!t.postrollFinished&&!t.postrollTimedOut};const r=e=>{if(!n(e,"playlist")){return false}const t=e.playlist;const i=t();if(t.autoadvance_.delay!==0||!i.length){return false}return t.repeat()||t.currentItem()!==i.length-1};const t=function(){if(this.endscreenState_){return}const t=this.endscreenState_={};const e=()=>{this.trigger("endscreen")};i(t);this.on("adstart",()=>{const e=this.ended();if(this.ads.adType==="postroll"){t.isPostroll=true}t.postrollFinished=!e});this.on("adend",()=>{t.postrollFinished=this.ended()});this.on("adtimeout",()=>{t.postrollTimedOut=this.ended()});this.on(["endscreen","loadstart"],()=>{this.off("adend",e);i(t)});this.on("nopostroll",()=>{t.sawNoPostrollEvent=true});this.on("ended",()=>{if(r(this)){return}if(s(this)){this.one("adend",()=>{if(t.isPostroll){e()}});return}e()})};t.VERSION=k;if(!e.getPlugin("endscreen")){e.registerPlugin("endscreen",t)}};function ts(){ts=Object.assign||function(e){for(var t=1;t=400&&t.statusCode<=599){var n=i;if(r){n=String.fromCharCode.apply(null,new Uint8Array(i))}s({cause:n});return}s(null,i)}}}var ds=function e(t){var i=String.fromCharCode.apply(null,new Uint16Array(t));var n=(new tv.DOMParser).parseFromString(i,"application/xml");var s=n.getElementsByTagName("HttpHeaders")[0];var r={};if(s){var a=s.getElementsByTagName("name");var o=s.getElementsByTagName("value");for(var l=0;l{const t=tv.atob(e);const i=new Uint8Array(t.length);for(let e=0;e{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let i="";let n;let s;let r;let a;let o;let l;let d;let u=0;while(u>2;o=(n&3)<<4|s>>4;l=(s&15)<<2|r>>6;d=r&63;if(isNaN(s)){l=d=64}else if(isNaN(r)){d=64}i+=t.charAt(a)+t.charAt(o)+t.charAt(l)+t.charAt(d)}return i};const Vs=u=>(e,t,i)=>{if(e){return u(e)}const n=new tv.DOMParser;const s=n.parseFromString(i,"text/xml");if(t.statusCode>=400){const l=s.getElementsByTagName("Error");let e=`License call failed with status code ${t.statusCode}.`;if(l.length>0){const d=s.getElementsByTagName("Message");if(d.length>0){e+=" "+d[0].childNodes[0].nodeValue}}return u(e)}let r="";const a=s.getElementsByTagName("ckc");if(a.length>0){r=a[0].childNodes[0].nodeValue}const o=T(r);u(null,o)};const Hs=o=>{return{"com.apple.fps.1_0":{overrideOptions:{getLicense:(e,t,i,n)=>{const s=e.keySystems["com.apple.fps.1_0"].licenseUri;const r=tv.btoa(String.fromCharCode.apply(null,i));const a=Vs(n);o.xhr({uri:s,method:"POST",body:`spc=${r}`,headers:{"Content-type":"application/x-www-form-urlencoded"}},a)}}}}};const $s="utf-16";const zs="utf-8";const Gs="http://schemas.xmlsoap.org/soap/envelope/";function Ws(e,t){const i=t===$s?new Uint16Array(e):new Uint8Array(e);const n=String.fromCharCode.apply(null,i);const s=new tv.DOMParser;const r=s.parseFromString(n,"application/xml");return r}function Ks(e,t=zs){const i=Ws(e,t);let n="";let s="";let r="";let a=-1;let o=-1;const l=i?i.getElementsByTagNameNS(Gs,"Envelope")[0]:null;const d=l?l.getElementsByTagNameNS(Gs,"Body")[0]:null;const u=d?d.getElementsByTagNameNS(Gs,"Fault")[0]:null;const c=u?u.getElementsByTagName("detail")[0]:null;const h=c?c.getElementsByTagName("Exception")[0]:null;let f=null;if(!u){return null}f=u.getElementsByTagName("faultstring")[0].firstChild;n=f?f.nodeValue:null;if(h!==null){f=h.getElementsByTagName("StatusCode")[0];s=f?f.firstChild.nodeValue:null;f=h.getElementsByTagName("Message")[0];r=f?f.firstChild.nodeValue:null;a=r?r.lastIndexOf("[")+1:-1;o=r?r.indexOf("]"):-1;r=r?r.substring(a,o):""}let p=`code: ${s}, name: ${n}`;if(r){p+=`, message: ${r}`}return p}function Xs(e,t=$s){const i=Ws(e,t);const n={"Content-Type":`text/xml; charset=${t}`};let s=e;const r=i.querySelector("PlayReadyKeyMessage");if(!r){return{headers:n,body:s}}const a=r.querySelectorAll("name");const o=r.querySelectorAll("value");for(let e=0;eString.fromCharCode.apply(null,new Uint16Array(e));const ir=n=>(e,t,i)=>{if(e){return n(e)}return n(null,new Uint8Array(i))};const nr=(e,t)=>{const i=t.buffer?t.buffer:t;const n=tr(i);const s="skd://drmtoday?";const r=n.indexOf(s);if(r>-1){return n.substring(r+s.length).replace(/assetid/gi,"assetId").replace(/variantid/gi,"variantId")}return""};const sr=e=>e.customDataIsB64?e.customData:tv.btoa(e.customData);const rr=(e,s)=>e.xhr.httpHandler((e,t)=>{if(e){return s(e)}let i=t.trim();if(i.substr(0,5)===""&&i.substr(-6)===""){i=i.slice(5,-6)}const n=T(i);s(null,n)});const ar=l=>{return{"com.apple.fps.1_0":{overrideOptions:{getCertificate:(e,t)=>{const i=ir(t);const n=e.keySystems["com.apple.fps.1_0"];const{options:s}=n.vendor;l.xhr({uri:n.certificateUri||er,method:"GET",responseType:"arraybuffer",headers:{"x-dt-auth-token":s.authToken,"x-dt-custom-data":sr(s),Pragma:"Cache-Control: no-cache","Cache-Control":"max-age=0"}},l.xhr.httpHandler(i))},getContentId:nr,getLicense:(e,t,i,n)=>{const s=rr(l,n);const r=encodeURIComponent(qs(i));const a=e.keySystems["com.apple.fps.1_0"];const{options:o}=a.vendor;l.xhr({uri:a.licenseUri||Zs,method:"POST",responseType:"text",body:`spc=${r}&${t}`,headers:{"x-dt-auth-token":o.authToken,"x-dt-custom-data":sr(o),"Content-type":"application/x-www-form-urlencoded"}},s)}}},"com.widevine.alpha":{overrideOptions:{getLicense(e,t,s){const i=e.keySystems["com.widevine.alpha"];const{options:n}=i.vendor;l.xhr({uri:i.licenseUri||Qs,method:"POST",responseType:"json",body:new Uint8Array(t),headers:{"x-dt-auth-token":n.authToken,"x-dt-custom-data":sr(n)}},l.xhr.httpHandler((e,t,i)=>{if(e){s(e);return}const n=T(i.license);s(null,n)}))}}},"com.microsoft.playready":{overrideOptions:{getLicense(e,t,n){const i=e.keySystems["com.microsoft.playready"];const{options:s}=i.vendor;const r=Xs(t);r.headers["x-dt-auth-token"]=s.authToken;r.headers["x-dt-custom-data"]=sr(s);l.xhr({uri:i.licenseUri||Js,method:"POST",body:r.body,headers:r.headers,responseType:"arraybuffer"},l.xhr.httpHandler((e,t,i)=>{e=e||Ks(i);if(e){n(e);return}n(null,i)}))}}}}};const or=e=>{return{azure:Hs(e),castlabs:ar(e)}};const lr=(e,t,i)=>{const n=or(e);if(n[t]){const s=n[t][i];if(s){return s}}return null};const dr=(e,t,i,n)=>{const{getLicense:s,getContentId:r,getCertificate:a}=lr(e,i,n).overrideOptions;if(!t.getLicense&&s){t.getLicense=s}if(!t.getContentId&&r){t.getContentId=r}if(!t.getCertificate&&a){t.getCertificate=a}return t};const ur=n=>{const e=function(i){const e=Object.keys(i);e.forEach(function(e){const t=i[e];if(t.vendor&&lr(n,t.vendor.name,e)){i[e]=dr(n,i[e],t.vendor.name,e)}});return i};return e};const cr="CsECCAMSEBcFuRfMEgSGiwYzOi93KowYgrSCkgUijgIwggEKAoIBAQCZ7Vs7Mn2rXiTvw7YqlbWYUgrVvMs3UD4GRbgU2Ha430BRBEGtjOOtsRu4jE5yWl5KngeVKR1YWEAjp+GvDjipEnk5MAhhC28VjIeMfiG/+/7qd+EBnh5XgeikX0YmPRTmDoBYqGB63OBPrIRXsTeo1nzN6zNwXZg6IftO7L1KEMpHSQykfqpdQ4IY3brxyt4zkvE9b/tkQv0x4b9AsMYE0cS6TJUgpL+X7r1gkpr87vVbuvVk4tDnbNfFXHOggrmWEguDWe3OJHBwgmgNb2fG2CxKxfMTRJCnTuw3r0svAQxZ6ChD4lgvC2ufXbD8Xm7fZPvTCLRxG88SUAGcn1oJAgMBAAE6FGxpY2Vuc2Uud2lkZXZpbmUuY29tEoADrjRzFLWoNSl/JxOI+3u4y1J30kmCPN3R2jC5MzlRHrPMveoEuUS5J8EhNG79verJ1BORfm7BdqEEOEYKUDvBlSubpOTOD8S/wgqYCKqvS/zRnB3PzfV0zKwo0bQQQWz53ogEMBy9szTK/NDUCXhCOmQuVGE98K/PlspKkknYVeQrOnA+8XZ/apvTbWv4K+drvwy6T95Z0qvMdv62Qke4XEMfvKUiZrYZ/DaXlUP8qcu9u/r6DhpV51Wjx7zmVflkb1gquc9wqgi5efhn9joLK3/bNixbxOzVVdhbyqnFk8ODyFfUnaq3fkC3hR3f0kmYgI41sljnXXjqwMoW9wRzBMINk+3k6P8cbxfmJD4/Paj8FwmHDsRfuoI6Jj8M76H3CTsZCZKDJjM3BQQ6Kb2m+bQ0LMjfVDyxoRgvfF//M/EEkPrKWyU2C3YBXpxaBquO4C8A0ujVmGEEqsxN1HX9lu6c5OMm8huDxwWFd7OHMs3avGpr7RP7DUnTikXrh6X0";const hr=T(cr);const fr=iv.createElement("video");const pr=tv.navigator.requestMediaKeySystemAccess||fr.msSetMediaKeys;const mr=e=>{return/manifest.prod.boltdns.net\/license/i.test(e)||/wvlic.brightcove.com\/proxy/i.test(e)};const gr=i=>{i=Object.keys(i).reduce(function(e,t){e[t]={url:i[t].license_url};return e},{});const e=i["com.widevine.alpha"];if(e&&mr(e.url)){e.getCertificate=(e,t)=>{t(null,hr)}}return i};const vr=e=>{return e.reduce((e,t)=>{e[t.name]=t.options;const i=e[t.name].serverCertificate;if(i){e[t.name].getCertificate=(e,t)=>{t(null,T(i))};delete e[t.name].serverCertificate}return e},{})};const yr=n=>{const e=function(e){let t=e;if(!n.browser.IS_SAFARI){const i=!tv.shaka&&e.key_systems&≺if(i){t=n.obj.merge(e,{keySystems:gr(e.key_systems)});if(e.keySystemOptions){t=n.obj.merge(t,{keySystems:vr(e.keySystemOptions)})}}if(!pr){let e="Cannot use keys for a DRM-protected source because the EME API is unavailable.";if(tv.isSecureContext===false){e+=" The player is not running in a secure context, e.g. an HTTPS domain."}n.log.warn(e)}}return t};return e};const br=e=>{const i=yr(e);const n=ur(e);e.use("*",function(e){return{setSource(e,t){e=i(e);if(e.keySystems){e.keySystems=n(e.keySystems)}return t(null,e)}}})};const _r=iv.documentElement;const Tr=iv.body;const Sr=()=>{return{top:0,left:0,right:_r.clientWidth||Tr.clientWidth,width:_r.clientWidth||Tr.clientWidth,bottom:_r.clientHeight||Tr.clientHeight,height:_r.clientHeight||Tr.clientHeight}};const Er=(e,t)=>{const i=Math.max(e.top,t.top);const n=Math.min(e.bottom,t.bottom);const s=Math.max(e.left,t.left);const r=Math.min(e.right,t.right);const a=r-s;const o=n-i;return a>=0&&o>=0&&{top:i,bottom:n,left:s,right:r,width:a,height:o}};const wr=e=>{const t=h.dom.getBoundingClientRect(e);const i=Sr();const n=Er(i,t);const s=t.width*t.height;const r=n.width*n.height;if(s){return r/s}return 0};class Ir{constructor(i,e,n,t){this.el_=i;this.callback_=n;this.supportsIO_=t;this.observing_=false;if(t===undefined){this.supportsIO_="IntersectionObserver"in tv&&"IntersectionObserverEntry"in tv&&"intersectionRatio"in tv.IntersectionObserverEntry.prototype}if(this.supportsIO_){this.io_=new tv.IntersectionObserver(t=>{for(let e=0;ethis.checkForIntersection_(e),500)}}observe(){if(this.observing_){return}this.observing_=true;if(this.supportsIO_){this.io_.observe(this.el_)}else{h.on(tv,"resize",this.boundCheckForIntersection_);h.on(iv,"scroll",this.boundCheckForIntersection_)}}unobserve(){if(!this.observing_){return}this.observing_=false;if(this.supportsIO_){this.io_.unobserve(this.el_)}else{h.off(tv,"resize",this.boundCheckForIntersection_);h.off(iv,"scroll",this.boundCheckForIntersection_)}}dispose(){this.unobserve();this.io_=null;this.el_=null;this.callback_=null}checkForIntersection_(){if(tv.getComputedStyle(this.el_).display==="none"){return}const e=wr(this.el_);this.callback_(e)}}const kr={viewabilityThreshold:.6,minDurationForViewableImpression:2e3,thresholdPercentageIncrement:5,delayAutoplayIfNotViewable:false,delayAutoplayOnMobileOnly:false,pauseWhenNotViewable:false,useIntersectionObserver_:undefined,pauseInBackgroundTab:false};const Cr=s=>{const e=s.getPlugin("plugin");class t extends e{constructor(e,t){super(e);this.options=s.obj.merge(kr,t);this.log=e.log.createLogger("viewability");this.log.level(this.options.debug?"debug":"off");this.log.debug("init",this.options);this.adImpressionTimeout_=null;this.player.ready(()=>{if(this.shouldDelayAutoplay_()){this.delayAutoplayIfNotViewable_()}else{this.pauseWhenNotViewable_()}this.player.addClass("vjs-viewability");if(this.player.usingPlugin("ads")){this.setupViewableAdImpression_()}if(this.options.pauseInBackgroundTab){this.enablePauseInBackgroundTab_()}this.observe_()});this.adImpressionViewabilityChangeHandler_=this.adImpressionViewabilityChangeHandler_.bind(this);this.onVisibilityChange_=this.onVisibilityChange_.bind(this);iv.addEventListener("visibilitychange",this.onVisibilityChange_)}shouldDelayAutoplay_(){const{delayAutoplayIfNotViewable:e,delayAutoplayOnMobileOnly:t}=this.options;const{IS_ANDROID:i,IS_IOS:n}=s.browser;if(!e||!this.player.autoplay()){return false}return!t||i||n}buildThresholdArray_(){let e=0;const t=[];while(e<100){t.push((e+=this.options.thresholdPercentageIncrement)/100)}return t}observe_(){const e=this.player.el();if(!this.vo_){this.vo_=new Ir(e,this.buildThresholdArray_(),e=>this.onViewableChange_(e),this.options.useIntersectionObserver_)}this.vo_.observe()}onViewableChange_(e){if(!this.state){return}const t=Math.ceil(e*100)/100;const i=t>=this.options.viewabilityThreshold;const n=this.state.viewable===undefined||this.state.viewable&&!i||!this.state.viewable&&i;if(n){const s=i?"viewable":"not-viewable";this.player.trigger({type:"usage",name:s});this.player.trigger({type:"usage",name:`${s}-${t}`})}this.setState({viewablePercent:t,viewable:i});this.log.debug("viewability changed",{viewable:i,viewablePercent:t});this.player.trigger({type:o,viewable:i,viewablePercent:t});if(n){this.player.trigger({type:Si,viewable:i,viewablePercent:t})}}delayAutoplayIfNotViewable_(){const e=this.options.delayAutoplayIfNotViewable;if(!e){return}this.log.debug("delaying autoplay until viewable");const t=this.player.autoplay();const i=e=>{if(e.viewable){this.player.addClass("vjs-waiting-for-autoplay");this.player.autoplay(t);this.player.off(o,i)}};this.player.autoplay(false);this.player.removeClass("vjs-waiting-for-autoplay");this.player.on(o,i);this.player.one("play",()=>{this.player.removeClass("vjs-ima3-not-playing-yet");this.player.off(o,i);this.pauseWhenNotViewable_()})}pauseWhenNotViewable_(){if(!this.options.pauseWhenNotViewable){return}this.autoPaused_=false;const e=e=>{const t=this.player.paused();if(e.viewable&&t&&this.autoPaused_){this.player.play()}else if(!e.viewable&&!t){this.player.pause();this.autoPaused_=true;this.player.one("play",()=>{this.autoPaused_=false})}};this.player.on(Si,e)}onVisibilityChange_(){const e=iv.visibilityState;if(e==="hidden"&&this.state&&this.state.viewablePercent!==0){this.viewablePercent=this.state.viewablePercent;this.onViewableChange_(0)}else if(e==="visible"&&this.viewablePercent!==undefined){this.onViewableChange_(this.viewablePercent)}}startAdImpressionTimeout_(){this.adImpressionTimeout_=this.player.setTimeout(()=>{this.player.trigger("viewable-ad-impression");this.log.debug("viewable-ad-impression");this.player.trigger({type:"usage",name:"viewable-ad-impression"});this.player.trigger({type:"usage",name:`viewable-ad-impression-${this.state.viewablePercent}`});this.adImpressionTimeout_=null;this.player.off(o,this.adImpressionViewabilityChangeHandler_)},this.options.minDurationForViewableImpression)}stopAdImpressionTimeout_(){tv.clearTimeout(this.adImpressionTimeout_);this.adImpressionTimeout_=null}adImpressionViewabilityChangeHandler_(e){if(e.viewable){if(!this.adImpressionTimeout_){this.startAdImpressionTimeout_()}}else if(this.adImpressionTimeout_){this.stopAdImpressionTimeout_()}}setupViewableAdImpression_(){this.player.on("ads-ad-started",()=>{if(this.state.viewable){this.startAdImpressionTimeout_()}this.player.on(o,this.adImpressionViewabilityChangeHandler_);this.player.any(["adend","adtimeout","adserror"],()=>{this.player.off(o,this.adImpressionViewabilityChangeHandler_)})})}enablePauseInBackgroundTab_(){this.pausedInBackground_=false;const e=()=>{const e=this.player.paused();const t=iv.visibilityState;if(t==="hidden"&&!e&&!this.pausedInBackground_){this.player.pause();this.pausedInBackground_=true}else if(t==="visible"&&e&&this.pausedInBackground_){this.player.play();this.pausedInBackground_=false}};this.player.on("VIEWABLE_CHANGE",e)}}t.defaultState={viewable:undefined,viewablePercent:undefined};s.registerPlugin("viewability",t)};const S={hidden:"hidden",off:"off",ready:"ready"};const Ar=(e,t)=>{const i=e.name||e.id;if(!i){return t==="mp4"?"video":"videoTranscript"}return i.replace(/[^0-9a-z-A-Z]/g,"")};const jr=(e,t,i)=>{const n=i==="mp4"?"mp4":"txt";const s=iv.createElement("a");s.href=e;s.target="_blank";s.download=`${t}.${n}`;iv.body.appendChild(s);s.click();iv.body.removeChild(s)};const xr=(e,t,i)=>{t.removeClass("has-icon-downloading");t.addClass("has-icon-file-download");e.removeClass("vjs-video-downloading");const n=`Download ${i==="mp4"?"Video":"Transcript"}`;t.setAttribute("aria-label",t.localize(n));t.controlText(n)};const Dr=(i,n,e,s,r)=>{fetch(e).then(e=>e.blob()).then(e=>{const t=URL.createObjectURL(e);jr(t,s,r);xr(i,n,r);i.trigger({name:s,type:"download-finished"});URL.revokeObjectURL(t)}).catch(e=>{xr(i,n,r);i.trigger({err:e,type:"download-failed"})})};const Rr=(e,t)=>{if(e.hasClass("vjs-video-downloading")){return}const i=t.options();const n=i.source;const s=i.type;const r=Ar(e.mediainfo,s);e.addClass("vjs-video-downloading");t.removeClass("has-icon-file-download");t.addClass("has-icon-downloading");t.setAttribute("aria-label",t.localize("Downloading"));t.controlText("Downloading");e.trigger("download-started");Dr(e,t,n,r,s)};const Or=h.getComponent("Button");class Pr extends Or{constructor(e,t={}){super(e,t);const i={[S.hidden]:this.onHiddenState,[S.off]:this.onOffState,[S.ready]:this.onReadyState};const n=i[t.state];n.call(this,e,t.type)}onHiddenState(e){this.addClass("vjs-hidden");e.trigger("download-hidden")}onReadyState(e,t){const i=`Download ${t==="mp4"?"Video":"Transcript"}`;this.el_.setAttribute("aria-label",this.localize(i));this.controlText(i);this.addClass("has-icon-file-download");e.trigger("download-ready")}onOffState(e){this.el_.setAttribute("aria-label",this.localize("No downloadable item available"));this.controlText("No downloadable item available");this.addClass("has-icon-file-download-off");this.disable();e.trigger("download-disabled")}handleClick(){Rr(this.player(),this)}buildWrapperCSSClass(){return`vjs-download-button-wrapper ${super.buildWrapperCSSClass()}`}buildCSSClass(){return`vjs-download-button ${super.buildCSSClass()}`}}h.registerComponent("DownloadButton",Pr);function Lr(e){if(typeof e!=="string"){return false}let t={};try{t=new URL(e)}catch(e){}return t.protocol==="https:"}function Nr(){const t=V.preferHttps(tv);return e=>t?Lr(e.src):!Lr(e.src)}const Mr=(e,t)=>{let i;const n=e.language()||"en";const s=t.filter(Nr());i=s.find(e=>e.src_lang===n);if(!i){i=s.find(e=>{return e.src_lang&&e.src_lang.slice(0,2)===n.slice(0,2)})}if(!i&&s.length){i=s[0]}return i};const Ur=(e,t)=>{let i;let n;const s=e.mediainfo.sources||[];const r=e.mediainfo.transcripts||[];if(t==="mp4"){i=s.filter(Nr()).filter(e=>e.container==="MP4"&&e.hasOwnProperty("src")&&e.hasOwnProperty("size")).sort((e,t)=>t.size-e.size);n=i[0]&&i[0].src}if(t==="transcript"){const a=Mr(e,r);n=a&&a.src}return n};const Br=(e,t)=>{const i=Ur(e,t.type);const n=Array.isArray(e.mediainfo.tags)&&e.mediainfo.tags.find(e=>e==="downloadable");if(!n){return S.hidden}if(!i){return S.off}return S.ready};const Fr=(e,t)=>{e.addClass("vjs-download-video");t.source=Ur(e,t.type);t.state=Br(e,t);const i=e.getChild("controlBar");const n=i.addChild("DownloadButton",t,i.children_.length-2);return function(){e.removeClass("vjs-download-video");i.removeChild(n);n.dispose()}};const qr=e=>{function t(e={}){if(typeof this.downloadButton==="undefined"){return}let t=()=>{};this.ready(()=>{t=Fr(this,e);this.on("loadstart",()=>{t();t=Fr(this,e)});this.downloadButton=()=>{};this.downloadButton.source=e.source;this.downloadButton.state=e.state})}e.registerPlugin("downloadButton",t);t.VERSION=k};const Vr=new tv.Blob([new Uint8Array([0,0,0,28,102,116,121,112,105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,109,112,52,49,0,0,0,8,102,114,101,101,0,0,2,239,109,100,97,116,33,16,5,32,164,27,255,192,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,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,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,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,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,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,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,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,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,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,55,167,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,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,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,0,0,0,0,0,0,0,0,0,0,0,112,33,16,5,32,164,27,255,192,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,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,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,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,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,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,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,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,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,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,55,167,128,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,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,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,0,0,0,0,0,0,0,0,0,0,0,112,0,0,2,194,109,111,111,118,0,0,0,108,109,118,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,232,0,0,0,47,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,0,0,0,3,0,0,1,236,116,114,97,107,0,0,0,92,116,107,104,100,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,0,0,1,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,0,0,0,0,0,0,0,0,0,0,0,36,101,100,116,115,0,0,0,28,101,108,115,116,0,0,0,0,0,0,0,1,0,0,0,47,0,0,0,0,0,1,0,0,0,0,1,100,109,100,105,97,0,0,0,32,109,100,104,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,172,68,0,0,8,0,85,196,0,0,0,0,0,45,104,100,108,114,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,0,0,1,15,109,105,110,102,0,0,0,16,115,109,104,100,0,0,0,0,0,0,0,0,0,0,0,36,100,105,110,102,0,0,0,28,100,114,101,102,0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1,0,0,0,211,115,116,98,108,0,0,0,103,115,116,115,100,0,0,0,0,0,0,0,1,0,0,0,87,109,112,52,97,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,0,16,0,0,0,0,172,68,0,0,0,0,0,51,101,115,100,115,0,0,0,0,3,128,128,128,34,0,2,0,4,128,128,128,20,64,21,0,0,0,0,1,244,0,0,1,243,249,5,128,128,128,2,18,16,6,128,128,128,1,2,0,0,0,24,115,116,116,115,0,0,0,0,0,0,0,1,0,0,0,2,0,0,4,0,0,0,0,28,115,116,115,99,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,2,0,0,0,1,0,0,0,28,115,116,115,122,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1,115,0,0,1,116,0,0,0,20,115,116,99,111,0,0,0,0,0,0,0,1,0,0,0,44,0,0,0,98,117,100,116,97,0,0,0,90,109,101,116,97,0,0,0,0,0,0,0,33,104,100,108,114,0,0,0,0,0,0,0,0,109,100,105,114,97,112,112,108,0,0,0,0,0,0,0,0,0,0,0,0,45,105,108,115,116,0,0,0,37,169,116,111,111,0,0,0,29,100,97,116,97,0,0,0,1,0,0,0,0,76,97,118,102,53,54,46,52,48,46,49,48,49])],{type:"video/mp4"});const Hr=URL.createObjectURL(Vr);const $r=["perSourceBehaviors","contextmenu","contextmenuUI","bcAnalytics","errors","catalog","downloadButton","playerInfo","plugin","reloadSourceOnError","playlist","endscreen","proxyTracks","seekEvents","touchActive","urlparams","encryptedWatcher","viewability"];const zr=function(s,l,e){const i=e.settings;const t={};const n=Boolean(l.options_.debug);const r={chromecastReceiver:{debug:n},ima3:{debugContribAds:n},ssai:{debug:n},vr:{debug:n}};l.on("pluginsetup",(e,t)=>{const{name:i}=t;if($r.indexOf(i)!==-1){return}l.trigger({type:"usage",name:`${i}!${s.getPluginVersion(i)}`})});const a=function(t,e={}){const i=r[t]||{};if(!l.hasPlugin(t)){s.log.error(`Plugin "${t}" is missing. Please check your player configuration.`);return}if(l.usingPlugin(t)){return}const n=s.obj.merge(i,e);try{l[t](n)}catch(e){s.log.error(`Unable to initialize "${t}" plugin:`,e)}};if(i.usingAdFailover&&i.usingIMAPrerollWithSSAI){s.log.warn("Ad failover is not compatible with SSAI and client-side preroll. "+"Please configure only one. This player will use ad failover behavior.");delete i.usingIMAPrerollWithSSAI}if(i.usingAdFailover){l.trigger({type:"usage",name:"ad-failover"});const{name:h,options:f}=l.usingAdBlocker.mightBe?i.serverSideAdPlugin:i.clientSideAdPlugin;a(h,f)}else if(i.usingIMAPrerollWithSSAI){if(tv.bc.disposedAfterPreroll_){const p=i.serverSideAdPlugin.name;const m=i.serverSideAdPlugin.options;const g=i.clientSideAdPlugin.name;s.deregisterPlugin(g);s.registerPlugin(p,tv.bc.ssaiPluginCache_);a(p,m)}else{l.trigger({type:"usage",name:"ssai-with-ima-preroll"});const g=i.clientSideAdPlugin.name;const v=i.clientSideAdPlugin.options;const p=i.serverSideAdPlugin.name;tv.bc.ssaiPluginCache_=s.getPlugin("ssai");s.deregisterPlugin(p);a(g,v);const y=l.tagAttributes;l.one(["adend","adtimeout","adserror"],function(o){l.one("playing",function(){let t=l.volume();let i=l.muted();if(o.type==="adend"){if(l.ima3&&l.ima3.adPlayer){t=l.ima3.adPlayer.volume();i=l.ima3.adPlayer.muted()}else{t=l.ima3.player.volume();i=l.ima3.player.muted()}}const e=l.el();const n=e.parentNode;const s=iv.createElement("div");n.replaceChild(s,e);l.dispose();tv.bc.disposedAfterPreroll_=true;const r=iv.createElement("video-js");Object.keys(y).forEach(e=>{r.setAttribute(e,y[e])});n.replaceChild(r,s);const a=tv.bc(y.id);a.bigPlayButton.hide();a.ready(function(){a.one("playing",()=>{tv.bc.disposedAfterPreroll_=false});const e=a.play();if(e.then){e.catch(()=>{a.bigPlayButton.show()})}a.volume(t);a.muted(i)})})})}}i.plugins.forEach(function({autoInit:e,name:t,options:n={}}){if(!e){return}const s=i.videoCloud&&i.videoCloud.bumper;if(t==="catalog"&&s&&s.id){let{showControls:e,progressBarColor:t,preventSeeking:i}=s;e=e&&Boolean(e)||true;i=Boolean(i);n.bumper=w(s,{showControls:e,progressBarColor:t,preventSeeking:i})}a(t,n)});const{media:o,videoCloud:d}=i;const u=o&&!!(o.sources||o.length&&o[0].sources);if(d&&d.policyKey&&!u){const b={embedHasPoster:i.embedState.poster,embedHasSources:i.embedState.sources,embedHasTracks:i.embedState.tracks,adConfigId:i.adConfigId,deliveryConfigId:i.deliveryConfigId,bumper:i.videoCloud&&i.videoCloud.bumper};if(d.playlist){l.trigger({type:"usage",name:"catalog-playlist"});b.playlistId=d.playlist}if(d.video){l.trigger({type:"usage",name:"catalog-video"});b.videoId=d.video}if(d.search){l.trigger({type:"usage",name:"catalog-search"});b.search=d.search}if(d.sequence){l.trigger({type:"usage",name:"catalog-sequence"});b.sequence=d.sequence}let e;if(i.usingIMAPrerollWithSSAI&&!tv.bc.disposedAfterPreroll_){l.src({src:Hr,type:"video/mp4"})}else if(d.autoLoad!==false){e=t.catalogMedia=l.catalog.autoFindAndLoadMedia(b)}if(e&&e.type==="video"){if(/^[\d]+$/.test(e.id)){l.mediainfo.id=e.id}else{l.mediainfo.referenceId=l.mediainfo.reference_id=e.id}}l.on("loadstart",()=>{if(l.language()&&l.catalog.getMetadata({lang:l.language()})){l.trigger({type:"usage",name:"variant:"+l.language()})}})}if(l.usingPlugin("bcAnalytics")){const _=function(){return(new Date).toISOString().split("T")[0]+":"+l.bcAnalytics.client.getSession()};l.ready(function(){V.perf.mark("bcInitEnd");V.perf.measure("bcInit","bcInitStart","bcInitEnd");if(l.usingPlugin("playerInfo")){l.playerInfo.modal.on("modalfill",function(){const e=_();const t=l.playerInfo.modal.$(".vjs-pi-section tbody");if(!e||!t){return}const i=iv.createElement("tr");const n=iv.createElement("tr");i.innerHTML=""+l.localize("Session ID")+""+e+"";t.appendChild(i);n.innerHTML=""+l.localize("Player Element ID")+""+l.id()+"";t.appendChild(n)})}});if(l.usingPlugin("errors")){l.errorDisplay.on("modalfill",function(){const e=_();const t=l.errorDisplay.$(".vjs-errors-content-container");if(!e||!t){return}t.appendChild(s.dom.createEl("div",{className:"vjs-errors-ref-id",innerHTML:""+l.localize("Session ID:")+" "+e+" "+""+l.localize("Player Element ID:")+" "+l.id()}))})}}if(l.usingPlugin("playerInfo")){l.on("contextmenu",function(){if(l.playerInfo.modal){l.playerInfo.modal.close()}})}const c=l.getChild("TitleBar");if(c&&i.hasTitleBar!==false){const T=o&&(o[0]&&o[0].title||o.title)||"";const S=o&&(o[0]&&o[0].description||o.description)||"";const E=function(){if(l.controls()){const{mediainfo:t}=l;const i=l.language()||"";let e;if(l.usingPlugin("catalog")){e=l.catalog.getMetadata({lang:i})}c.update({title:e&&e.name||t&&t.name||T,description:e&&e.description||t&&t.description||S})}};E();l.on(["loadstart","loadedmetadata","languagechange"],E)}return t};const Gr=/["'&<>]/;const Wr=e=>{const t=""+e;const i=Gr.exec(t);if(!i){return t}let n;let s="";let r=0;let a=0;for(r=i.index;r{if(typeof e!=="string"){return null}const t=e.toLowerCase();return t==="production"||t==="qa"||t==="staging"?t:null};class Xr{constructor(e,t){this.runtime_=t;const i={};Object.keys(V).forEach(e=>{const t=V[e];Object.defineProperty(i,e,{enumerable:true,value:t,writable:false})});Object.defineProperty(this,"util",{enumerable:true,value:i,writable:false})}getRuntime(){return this.runtime_}}const Yr="vjs-waiting-for-autoplay";function Qr(n,e,a,t){const i=a.options_;const{settings:s,environment:r}=e;const{accountId:o,applicationId:l,css:d,embedId:u,playerId:c,videoCloud:h,analytics:f,chinaProxyDomain:p,version:N,viewability:m,playerVersionLocked:M}=s;const g=Kr(s.env);const U=Wr(s.playerName);a.brightcove=new Xr(a,e);let v;a.mediainfo={accountId:o,account_id:o};a.bcinfo={accountId:o,applicationId:l,css:d,embedId:u,playerId:c,scriptUrl:r.scriptUrl,scriptBaseUrl:r.scriptBaseUrl};Object.defineProperty(a,"usingAdBlocker",{enumerable:true,value:H});Object.defineProperty(a,"getAutoplayConditions",{enumerable:true,value:e=>t.getAutoplayConditions(e)});Object.defineProperty(a,"getAccountId",{enumerable:true,value(){return t.runtime.settings.accountId}});if(e.settings.allowAccountOverride){Object.defineProperty(a,"setAccountId",{enumerable:true,value(e){if(V.isNil(e)){n.log.warn("account ID must be a string or number");return}t.runtime.settings.accountId=e;this.bcinfo.accountId=e;this.mediainfo.accountId=this.mediainfo.account_id=e}})}H().then(function(e){if(e){a.trigger({type:"usage",name:"using-ad-blocker"})}});if(s.classNames&&s.classNames.player){a.addClass(s.classNames.player)}if(s.classNames&&s.classNames.playerInstance){a.addClass(s.classNames.playerInstance)}const B=a.dimension.bind(a);a.dimension=function(e,t){if(e==="width"){Me(s,t,null)}else if(e==="height"){Me(s,null,t)}return B(e,t)};a.ready(function(){if(!i.autoplay){return}function e(){a.removeClass(Yr)}if(!a.currentSrc()&&!v){e()}else{a.any(["autoplay-success","autoplay-failure","error"],e)}});if(s.fullscreenControl===false&&a.controls()){a.on("canplay",function(){if(!a.controlBar){return}const t=a.controlBar.children();if(!t||!t.length){return}for(let e=t.length-1;e>0;e--){if(t[e].hasClass("vjs-menu-button-popup")&&!t[e].hasClass("vjs-hidden")){t[e].addClass("vjs-menu-popup-last-visible");break}}})}if(n.browser.IS_IPHONE){a.on("fullscreenchange",function(){const e=a.$(".vjs-tech");if(e.hasAttribute("controls")){e.removeAttribute("controls")}});if(s.embedState.playsinline&&s.embedState.muted){a.addClass("vjs-iphone")}}if(i.autoplay&&n.browser.IS_IOS&&n.browser.IS_ANY_SAFARI){const A=a.$(".vjs-tech");if(!A.autoplay){A.autoplay=true}}if(n.browser.IS_IOS&&s.embedState.muted){a.addClass("vjs-ios")}if(a.controls()){a.one("play",function(){if(!a.controlBar||!a.controls()){return}const t=a.controlBar.children();if(!t||!t.length){return}const i=["Enter","ArrowDown","ArrowUp","Up","Down"," ","Spacebar"];for(let e=0;e=0){a.controlBar.addClass("vjs-control-bar-visible")}})}}});if(a.controlBar){const j=a.controlBar.el();let t;const x=function(){const e=iv.activeElement;if(t!==e){t=e;a.controlBar.toggleClass("vjs-focus-within",j.contains(e))}};const D=function(){j.removeEventListener("focus",x,true);j.removeEventListener("blur",x,true)};j.addEventListener("focus",x,true);j.addEventListener("blur",x,true);a.on("dispose",D);a.controlBar.on("dispose",D)}}a.one("beforepluginsetup:ads",function(){const e=a.getChild("controlBar");if(e){e.removeChild("pictureInPictureToggle")}n.getComponent("Component").prototype.fsApi_=a.fsApi_});if(!n.browser.TOUCH_ENABLED){a.addClass("vjs-mouse");if(r.isInBcFrame){n.dom.addClass(iv.documentElement,"vjs-mouse")}}else if(n.browser.IS_IPHONE){a.addClass("vjs-native")}a.requestAnimationFrame(function(){const e=iv.querySelector(".bc-wrap");a.addClass("vjs-plugins-ready");if(e){e.style.opacity=0}});a.on(["mouseenter","ended","touchend"],function(){a.removeClass("vjs-hide-controls")});a.on("mouseleave",function(){a.addClass("vjs-hide-controls");if(!a.controlBar||!a.controlBar.el()){return}if(a.controlBar.hasClass("vjs-control-bar-visible")){a.controlBar.removeClass("vjs-control-bar-visible")}});if(!n.browser.IS_ANY_SAFARI){a.one("loadeddata",function(){if(a.language()!==undefined&&a.catalog&&a.catalog.getMetadata().variants!==undefined){const i=a.language()||"";const n=a.textTracks();if(n){const s=Array.prototype.filter.call(n,e=>(e.kind==="captions"||e.kind==="subtitles")&&e.mode==="showing");let e;let t;if(!s.length){for(t=0;t{if(e){a.addClass("vjs-audio-mode")}else{a.removeClass("vjs-audio-mode")}};const _=e=>{const i=a.getChild("PosterImage").el_.style;const t=()=>{const e=a.getChild("ControlBar");const t=e&&e.currentHeight();i.paddingBottom=`${t}px`;i.backgroundOrigin="content-box"};if(e){a.one("play",t)}else{a.off("play",t);i.paddingBottom="";i.backgroundOrigin=""}};a.on("loadedmetadata",()=>{const e=a.currentSource().type.includes("audio");const t=a.audioPosterMode();const i=a.audioOnlyMode();if(!s.audioPosterMode&&!s.audioOnlyMode&&e&&!y||!t&&!i&&e&&y){a.audioPosterMode(true)}else if(!e&&t&&y){a.audioPosterMode(false)}y=true});a.on("audiopostermodechange",()=>{const e=a.audioPosterMode();const t=a.audioOnlyMode();if(e){_(true);b(true)}else if(!t&&!e){_(false);b(false)}});a.on("audioonlymodechange",()=>{const e=a.audioPosterMode();const t=a.audioOnlyMode();if(t){const i=a.currentHeight();const n=a.getChild("ControlBar");const s=n&&n.getChild("ProgressControl");const r=s?s.currentHeight():0;b(true);a.height(i+r)}else if(!t&&!e){b(false)}});if(s.videoCloud&&s.videoCloud.bumper){const R=a.getChild("ControlBar");const O=R.getChild("ProgressControl");const P=s.videoCloud.bumper;a.on("bumper-play",()=>{if(P.preventSeeking){O.disable()}const e=R.getChild("NextButton");if(e){e.hide()}a.addClass("vjs-bumper-video")});a.on("bumper-ended",()=>{if(P.preventSeeking){O.enable()}const e=R.getChild("NextButton");if(e){e.show()}a.removeClass("vjs-bumper-video")})}const{bcShimDestripeTime:T}=r;if(T!==undefined){if(T>1){a.trigger({type:"usage",name:"sdt-"+(Math.log(T)/Math.LN10).toFixed(1)})}else{a.trigger({type:"usage",name:"sdt-0.0"})}}a.ready(function(){if(a.bcinfo&&a.bcinfo.PLAYER_LOADER||r.brightcovePlayerLoader){a.trigger({type:"usage",name:"player-loader"})}if(a.bcinfo&&a.bcinfo.REACT_PLAYER_LOADER||r.BrightcoveReactPlayerLoader){a.trigger({type:"usage",name:"react-player-loader"})}});const{debug:S}=a.options_;if(S){a.log.level("debug");a.log.history.enable()}else{a.log.level("off");a.log.history.disable()}const E={accountId:o,applicationId:l,embedId:u,mr:Boolean(tv.bc_isManagedRelease),playerId:c,playerName:U,playerVersionLocked:M,platformVersion:N,verbose:Boolean(S)};if(p){E.analyticsUrl=`//${p}/v2/tracker`}if(g){E.env=g}if(f){if(f.analyticsUrl){E.analyticsUrl=f.analyticsUrl}if(f.env){E.env=f.env}if(f.hasOwnProperty("verbose")){E.verbose=Boolean(f.verbose)}if(f.requires_consent){E.requiresConsent=true}if(f.hasOwnProperty("native_qoe")){E.nativeQoe=Boolean(f.native_qoe)}}const w=e.environment&&e.environment.queryString||{};["referrer","usage","user"].forEach(e=>{if(w[e]){E[e]=w[e]}});const I={accountId:o,policyKey:h&&h.policyKey};if(h&&h.streamConcurrency){I.streamConcurrency=h.streamConcurrency;I.maxRetry=h.maxRetry;I.intervalRetry=h.intervalRetry}if(p){I.baseUrl=`//${p}/playback/v1`}else if(h&&h.baseUrl){I.baseUrl=h.baseUrl}if(g){I.env=g}if(h&&h.sourceSelectionRules){I.sourceSelectionRules=h&&h.sourceSelectionRules}if(h&&typeof h.allowPlayreadyInChromiumEdge==="boolean"){I.allowPlayreadyInChromiumEdge=h.allowPlayreadyInChromiumEdge}const k=[{name:"bcAnalytics",register:ji,opts:E},{name:"catalog",register:Rn,opts:I},{name:"proxyTracks",register:Un,opts:{debug:S}},{name:"seekEvents",register:Hn,opts:{verbose:S}},{name:"touchActive",register:$n},{name:"urlparams",register:at,opts:{iframe:r.isInBcFrame,time:s.startTime}},{name:"playerInfo",register:Zn},{name:"endscreen",register:es},{name:"encryptedWatcher",register:Fn}];const C=e.settings.contextMenu;if(C!==false){const L=[{label:a.localize("Player Information"),listener:()=>a.usingPlugin("playerInfo")&&a.playerInfo.modal.open()}];if(V.isObj(C)&&C.brightcoveBranding!==false){L.push({href:"https://www.brightcove.com/en/why-brightcove?utm_type=player",label:a.localize("About Brightcove")})}k.push({name:"contextmenuUI",opts:{content:L}})}if(m!==false){k.push({name:"viewability",register:Cr,opts:m?m:{}})}const F=tv.cast&&tv.cast.receiver;const q=["mp4","transcript"].includes(s.downloadButton);if(q&&!F){k.push({name:"downloadButton",register:qr,opts:{type:s.downloadButton}})}k.forEach(function({name:e,opts:t,register:i}){if(!a.hasPlugin(e)){i(n)}if(!a.usingPlugin(e)){a[e](t)}});br(n);a.eme();({catalogMedia:v}=zr(n,a,e));a.on("dispose",()=>{a=i.runtime_=null;n.log.history.clear()})}function Jr(s,r,a){const{videojs:o}=s;let l=-1;return function e(t){const i=o.getPlayer(t);if(i){i.trigger({type:"usage",name:"bc-used-as-getter"});return i}l++;const n=s.getRuntime({playerIndex:l});o.hookOnce("beforesetup",(e,t)=>{t=Ge(o,n,e,t);if(V.isFn(r)){return r(o,n,e,t)}return t});o.hookOnce("setup",e=>{Qr(o,n,e,s);if(V.isFn(a)){a(o,n,e)}});return o(...arguments)}}const Zr={accountId:"",adConfigId:"",applicationId:"",playsinline:false,loop:false,muted:false,autoplay:false,crossorigin:false,css:{},plugins:[],debug:false,contextMenu:{},deliveryConfigId:"",embedId:"default",misconfiguredWithMultipleAdPlugins:false,playerId:"default",skin:"luna",usingAdFailover:false,usingIMAPrerollWithSSAI:false,version:"0.0.0",videoCloud:null,playerVersionLocked:false};const ea={brightcovePlayerLoader:tv.brightcovePlayerLoader,BrightcoveReactPlayerLoader:tv.BrightcoveReactPlayerLoader,bcShimDestripeTime:tv.bcShimDestripeTime,userAgent:tv.navigator.userAgent};class E{constructor(e={},t={}){const{videojs:i}=E.shared;if(!i){throw new Error("missing videojs")}this.runtime={environment:i.obj.merge(ea,t),settings:i.obj.merge(Zr,e)};if(this.runtime.settings.misconfiguredWithMultipleAdPlugins){i.log.warn('Brightcove Player "'+this.runtime.settings.playerId+'" is mis-configured with multiple ad plugins.')}this.videojs=i;this.util=V;i.bc_=V;this.detectRuntimeEnvironment();this.setupGlobalEnv();V.perf.mark("bcAdBlockDetectStart");H().then(function(e){V.perf.mark("bcAdBlockDetectEnd");V.perf.measure("bcAdBlockDetect","bcAdBlockDetectStart","bcAdBlockDetectEnd")})}getRuntime(e){return this.videojs.obj.merge(this.runtime,{settings:e})}getAutoplayConditions(t="video"){const{environment:i}=this.runtime;if(!i.autoplay){i.autoplay={}}return K(t,this.videojs).then(e=>{i.autoplay[t]=e;return e})}detectRuntimeEnvironment(){const{dom:e}=this.videojs;const{environment:t}=this.runtime;const i=e.hasClass(iv.documentElement,"bc-iframe");const n=V.qs();t.usingRequireJs=V.isFn(tv.define)&&tv.define.amd&&V.isFn(tv.require&&tv.require.toUrl);t.isInAnyFrame=e.isInFrame();t.isInBcFrame=i;t.queryString=i?n.search:{};t.urlHash=i?n.hash:{};this.setScriptUrl();this.setScriptBaseUrl()}setScriptUrl(){const{environment:e}=this.runtime;if(e.isInBcFrame){e.scriptUrl=""}else if(e.usingRequireJs){e.scriptUrl=tv.require.toUrl("bc")}else if(iv.currentScript){e.scriptUrl=iv.currentScript.src}else{const t=iv.getElementsByTagName("script");e.scriptUrl=t.length&&t[t.length-1].src||""}}setScriptBaseUrl(){const{environment:e}=this.runtime;if(e.scriptUrl){e.scriptBaseUrl=e.scriptUrl.split("/").slice(0,-1).join("/")}else{e.scriptBaseUrl="."}}safeSetGlobal(e,t){if(!V.isNil(tv[e])){return this.videojs.log.warn("setting window."+e+" would overwrite an existing global, skipping")}tv[e]=t}setupGlobalEnv(){const{videojs:e}=this;const{environment:t}=this.runtime;const{queryStringToWindow:i}=t;if(!i||!t.isInBcFrame){return}const n=e.obj.merge(t.queryString);if(i.target){this.safeSetGlobal(i.target,n)}if(Array.isArray(i.globals)){i.globals.forEach(e=>{this.safeSetGlobal(e,n[e])})}}createInitializer(e,t){const{videojs:i}=this;const{bc:n}=tv;const{embedId:s,playerId:r,skin:a,version:o}=this.runtime.settings;const l=Jr(this,e,t);l.SKIN=a;l.VERSION=o;l.videojs=i;l[`${r}_${s}`]=l;if(n){Object.keys(n).forEach(e=>{const t=n[e];if(typeof t==="function"&&typeof t.videojs==="function"){l[e]=t;delete n[e]}})}Object.defineProperty(l,"usingAdBlocker",{enumerable:true,value:H});Object.defineProperty(l,"getAutoplayConditions",{enumerable:true,value:e=>this.getAutoplayConditions(e)});tv.bc=l;return l}static dedupeVideojs(t,e){let i=t;E.shared.firstVideojs=e||t;if(e&&e.VERSION===t.VERSION){i=e}else if(tv.bc){const n=Object.keys(tv.bc);for(let e=0;es.indexOf(e)>-1;const l=e=>e.usingPlugin("ads")&&typeof e.ads.inAdBreak==="function";const c=(e,t)=>{if(!e.usingPlugin("ads")){return false}if(l(e)){return e.ads.isInAdMode()&&t.type!=="loadstart"}return r(e.ads.state)};const h=function(){const l=[];let n;let t=false;let s;let r=true;const e=o=>{return function(e,t){if(this.perSourceBehaviors.disabled()){return}const i=arguments.length===2;const n=this.currentSrc();const s=[e];const r=d["default"].bind(i?this:e,arguments[arguments.length-1]);const a=(...e)=>{const t=this.currentSrc()!==n;if(this.perSourceBehaviors.disabled()){return}if(t||o){this.off(...s)}if(!t){r(...e)}};a.guid=r.guid;if(!i){s.push(t)}s.push(a);l.push(s);return this.on(...s)}};this.perSourceBehaviors={disable:d["default"].bind(this,function e(){this.clearTimeout(s);s=null;t=true;return t}),disabled(){return t},enable(){t=false;return t},enabled(){return!t},isSrcStable(){return r},VERSION:i};this.onPerSrc=e();this.onePerSrc=e(true);this.on("dispose",()=>{l.length=0});this.on(o,e=>{if(this.perSourceBehaviors.disabled()||s||c(this,e)){return}if(r&&u.indexOf(e.type)>-1){r=false;this.trigger("sourceunstable")}const t=[];const i=e=>t.push({time:Date.now(),event:e});i(e);this.on(a.Events,i);s=this.setTimeout(()=>{const e=this.currentSrc();r=true;s=null;this.off(a.Events,i);if(e&&e!==n){l.forEach(e=>this.off(...e));l.length=0;this.trigger("sourcechanged",{interimEvents:t,from:n,to:e});n=e}},1)})};h.VERSION=i;n("perSourceBehaviors",h);return h})})();(function(){if(s.getPlugin("errors")){return}(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?module.exports=t(require("video.js")):typeof i==="function"&&i.amd?i(["video.js"],t):(e=typeof globalThis!=="undefined"?globalThis:e||self,e.videojsErrors=t(e.videojs))})(this,function(e){"use strict";function t(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var m=t(e);var g="6.0.0";const v=m["default"].getComponent("Flash");const i=!m["default"].browser.IS_IPHONE;const n=m["default"].registerPlugin||m["default"].plugin;const y={header:"",code:"",message:"",timeout:45*1e3,backgroundTimeout:300*1e3,dismiss:i,errors:{1:{type:"MEDIA_ERR_ABORTED",headline:"The video download was cancelled"},2:{type:"MEDIA_ERR_NETWORK",headline:"The video connection was lost, please confirm you are "+"connected to the internet"},3:{type:"MEDIA_ERR_DECODE",headline:"The video is bad or in a format that cannot be played on your browser"},4:{type:"MEDIA_ERR_SRC_NOT_SUPPORTED",headline:"This video is either unavailable or not supported in this browser"},5:{type:"MEDIA_ERR_ENCRYPTED",headline:"The video you are trying to watch is encrypted and we do not know how "+"to decrypt it"},unknown:{type:"MEDIA_ERR_UNKNOWN",headline:"An unanticipated problem was encountered, check back soon and try again"},"-1":{type:"PLAYER_ERR_NO_SRC",headline:"No video has been loaded"},"-2":{type:"PLAYER_ERR_TIMEOUT",headline:"It looks like you're having playback issues. Reloading the video may help."},PLAYER_ERR_DOMAIN_RESTRICTED:{headline:"This video is restricted from playing on your current domain"},PLAYER_ERR_IP_RESTRICTED:{headline:"This video is restricted at your current IP address"},PLAYER_ERR_GEO_RESTRICTED:{headline:"This video is restricted from playing in your current geographic region"},FLASHLS_ERR_CROSS_DOMAIN:{headline:"The video could not be loaded: crossdomain access denied."}}};const b=function(h,f){let i;let n;let s;const r=[];const t=function(e){f.errors=m["default"].mergeOptions(f.errors,e);Object.keys(f.errors).forEach(e=>{const t=f.errors[e];if(!t.type){t.type=e}})};t();const a=function(){if(h.error()&&h.error().code===-2){h.error(null)}h.clearTimeout(n);h.clearTimeout(i);if(s){s=false;h.removeClass("vjs-waiting")}const e=[Infinity,-1];const t=(e,t)=>e.indexOf(t)!==-1;if(iv.visibilityState==="hidden"&&(h.muted()||t(e,f.backgroundTimeout))||iv.visibilityState==="visible"&&t(e,f.timeout)){return}n=h.setTimeout(function(){if(h.error()||h.paused()||h.ended()){return}s=true;h.addClass("vjs-waiting")},1e3);i=h.setTimeout(function(){if(h.error()||h.paused()||h.ended()){return}h.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},iv.visibilityState==="hidden"?f.backgroundTimeout:f.timeout)};const e=function(){let e;while(r.length){e=r.shift();h.off(e[0],e[1])}h.clearTimeout(i);h.clearTimeout(n)};const o=function(e,t){const i=function(){if(!h.error()){const e=h.$(".vjs-tech");if(e&&e.type==="application/x-shockwave-flash"&&!e.vjs_getProperty){h.error({code:-2,type:"PLAYER_ERR_TIMEOUT"});return}if(h.paused()){return a()}if(h.ended()){return a()}}t.call(this)};h.on(e,i);r.push([e,i])};const p=function(){let t=0;e();a();o(["timeupdate","adtimeupdate"],function(){const e=h.currentTime();if(e!==t){t=e;a()}});h.off(iv,"visibilitychange",p);h.on(iv,"visibilitychange",p)};const l=function(){if(!h.currentSrc()){h.error({code:-1,type:"PLAYER_ERR_NO_SRC"})}};const d=function(){let e="";let t=h.error();const i=iv.createElement("div");let n="";if(!t){return}h.off(iv,"visibilitychange",p);t=m["default"].mergeOptions(t,f.errors[t.code||t.type||0]);if(t.message){e=`
${h.localize("Technical details")} :
${h.localize(t.message)}
`}if(t.code===4&&v&&!v.isSupported()){const l=h.localize("If you are using an older browser please try upgrading or installing Flash.");e+=`${l}`}const s=h.getChild("errorDisplay");i.className="vjs-errors-dialog";const r=`
${this.localize("Error Code")}: ${t.type||t.code}
`;const a=t.code===-2;n=`

${this.localize(t.headline)}

${a?"":r} ${a?"":e}
`;const o=s.closeable(!("dismiss"in t)||t.dismiss);if(a){n+=`
`;i.innerHTML=n;s.fillWith(i);s.getChild("closeButton").hide();const d=s.el().querySelector(".vjs-errors-timeout-button-container > button:first-child");const u=s.el().querySelector(".vjs-errors-timeout-button-container > button:last-child");h.on(d,"click",function(){const e=h.currentSource();h.reset();h.src(e)});h.on(u,"click",function(){s.close()});s.one("modalclose",()=>{h.off(d);h.off(u)})}else if(o){n+=`
`;i.innerHTML=n;s.fillWith(i);s.contentEl().firstChild.appendChild(s.getChild("closeButton").el());const c=s.el().querySelector(".vjs-errors-ok-button");h.on(c,"click",function(){s.close()})}else{i.innerHTML=n;s.fillWith(i)}if(h.currentWidth()<=600||h.currentHeight()<=250){s.addClass("vjs-xs")}s.one("modalclose",()=>h.error(null))};const u=function(){e();h.removeClass("vjs-errors");h.off("play",p);h.off(iv,"visibilitychange",p);h.off("play",l);h.off("dispose",u);h.off(["aderror","error"],d)};const c=function(e){u();b(h,m["default"].mergeOptions(y,e))};c.extend=e=>t(e);c.getAll=()=>m["default"].mergeOptions(f.errors);c.timeout=function(e){if(typeof e==="undefined"){return f.timeout}if(e!==f.timeout){f.timeout=e;if(!h.paused()){p()}}};c.backgroundTimeout=function(e){if(typeof e==="undefined"){return f.backgroundTimeout}if(e!==f.backgroundTimeout){f.backgroundTimeout=e;if(!h.paused()){p()}}};c.disableProgress=()=>{};h.on("play",p);h.on("play",l);h.on("dispose",u);h.on(["aderror","contenterror","error"],d);h.ready(()=>{h.addClass("vjs-errors")});if(!h.paused()){p()}c.VERSION=g;h.errors=c};const s=function(e){b(this,m["default"].mergeOptions(y,e))};["extend","getAll"].forEach(e=>{s[e]=function(){m["default"].log.warn(`The errors.${e}() method is not available until the plugin has been initialized!`)}});s.VERSION=g;n("errors",s);return s})})();(function(){if(s.getPlugin("ima3")){return}(function(e,t){typeof exports==="object"&&typeof module!=="undefined"?t(require("video.js")):typeof i==="function"&&i.amd?i(["video.js"],t):(e=typeof globalThis!=="undefined"?globalThis:e||self,t(e.videojs))})(this,function(N){"use strict";function M(e){return e&&typeof e==="object"&&"default"in e?e:{default:e}}var c=M(N);var e="7.3.2";function U(n){return{disableNextSnapshotRestore:false,_contentEnding:false,_contentHasEnded:false,_hasThereBeenALoadStartDuringPlayerLife:false,_hasThereBeenALoadedData:false,_hasThereBeenALoadedMetaData:false,_inLinearAdMode:false,_shouldBlockPlay:false,_playBlocked:false,_playRequested:false,adType:null,VERSION:e,reset:function e(){n.ads.disableNextSnapshotRestore=false;n.ads._contentEnding=false;n.ads._contentHasEnded=false;n.ads.snapshot=null;n.ads.adType=null;n.ads._hasThereBeenALoadedData=false;n.ads._hasThereBeenALoadedMetaData=false;n.ads._cancelledPlay=false;n.ads._shouldBlockPlay=false;n.ads._playBlocked=false;n.ads.nopreroll_=false;n.ads.nopostroll_=false;n.ads._playRequested=false},startLinearAdMode:function e(){n.ads._state.startLinearAdMode()},endLinearAdMode:function e(){n.ads._state.endLinearAdMode()},skipLinearAdMode:function e(){n.ads._state.skipLinearAdMode()},stitchedAds:function e(t){if(t!==undefined){c["default"].log.warn("Using player.ads.stitchedAds() as a setter is deprecated, "+"it should be set as an option upon initialization of contrib-ads.");this.settings.stitchedAds=!!t}return this.settings.stitchedAds},videoElementRecycled:function e(){if(n.ads.shouldPlayContentBehindAd(n)){return false}if(!this.snapshot){throw new Error("You cannot use videoElementRecycled while there is no snapshot.")}var t=n.tech_.src()!==this.snapshot.src;var i=n.currentSrc()!==this.snapshot.currentSrc;return t||i},isLive:function e(t){if(t===void 0){t=n}if(typeof t.ads.settings.contentIsLive==="boolean"){return t.ads.settings.contentIsLive}else if(t.duration()===Infinity){return true}else if(c["default"].browser.IOS_VERSION==="8"&&t.duration()===0){return true}return false},shouldPlayContentBehindAd:function e(t){if(t===void 0){t=n}if(!t){throw new Error("shouldPlayContentBehindAd requires a player as a param")}else if(!t.ads.settings.liveCuePoints){return false}else{return!c["default"].browser.IS_IOS&&!c["default"].browser.IS_ANDROID&&t.duration()===Infinity}},shouldTakeSnapshots:function e(t){if(t===void 0){t=n}return!this.shouldPlayContentBehindAd(t)&&!this.stitchedAds()},isInAdMode:function e(){return this._state.isAdState()},isWaitingForAdBreak:function e(){return this._state.isWaitingForAdBreak()},isContentResuming:function e(){return this._state.isContentResuming()},isAdPlaying:function e(){return this._state.inAdBreak()},inAdBreak:function e(){return this._state.inAdBreak()},removeNativePoster:function e(){var t=n.$(".vjs-tech");if(t){t.removeAttribute("poster")}},debug:function e(){if(this.settings.debug){for(var t=arguments.length,i=new Array(t),n=0;n "+n.constructor._getName());for(var s=arguments.length,r=new Array(s>1?s-1:0),a=1;a0){t=e.currentTime()-e.seekable().end(0)}else{t=e.currentTime()}}else{t=e.currentTime()}var i=e.$(".vjs-tech");var n=e.textTracks?e.textTracks():[];var s=[];var r={ended:e.ended(),currentSrc:e.currentSrc(),sources:e.currentSources(),src:e.tech_.src(),currentTime:t,type:e.currentType()};if(i){r.style=i.getAttribute("style")}for(var a=0;a0){t=s.seekable().end(0)+r.currentTime}else{t=s.currentTime()}s.currentTime(t)}if(s.paused()){var i=s.play();if(i&&i.catch){i.catch(function(e){c["default"].log.warn("Play promise rejected in IOS snapshot resume",e)})}}}else if(r.ended){s.currentTime(s.duration())}else{s.currentTime(r.currentTime);var n=s.play();if(n&&n.catch){n.catch(function(e){c["default"].log.warn("Play promise rejected in snapshot resume",e)})}}if(s.ads.shouldRemoveAutoplay_){s.autoplay(false);s.ads.shouldRemoveAutoplay_=false}};var d=function e(){s.off("contentcanplay",e);if(g){s.clearTimeout(g)}t=s.el().querySelector(".vjs-tech");if(t.readyState>1){return l()}if(t.seekable===undefined){return l()}if(t.seekable.length>0){return l()}if(i--){s.setTimeout(e,50)}else{try{l()}catch(e){c["default"].log.warn("Failed to resume the content after an advertisement",e)}}};if("style"in r){t.setAttribute("style",r.style||"")}if(s.ads.videoElementRecycled()){s.one("resumeended",function(){delete s.ads.snapshot;e()});s.one("contentloadedmetadata",o);if(c["default"].browser.IS_IOS&&!s.autoplay()){s.autoplay(true);s.ads.shouldRemoveAutoplay_=true}s.src(r.sources);s.one("contentcanplay",d);g=s.setTimeout(d,2e3)}else{o();if(!s.ended()){var u=s.play();if(u&&u.catch){u.catch(function(e){c["default"].log.warn("Play promise rejected in snapshot restore",e)})}}delete s.ads.snapshot;e()}}function ye(e){e.ads.debug("Starting ad break");e.ads._inLinearAdMode=true;e.trigger("adstart");if(e.ads.shouldTakeSnapshots()){e.ads.snapshot=ge(e)}if(e.ads.shouldPlayContentBehindAd(e)){e.ads.preAdVolume_=e.volume();e.volume(0)}e.addClass("vjs-ad-playing");if(e.hasClass("vjs-live")){e.removeClass("vjs-live")}e.ads.removeNativePoster();e.ads.preAdPlaybackRate_=e.playbackRate();e.playbackRate(1);if(e.controlBar&&e.controlBar.playbackRateMenuButton&&e.controlBar.playbackRateMenuButton.playbackRateSupported&&!e.controlBar.playbackRateMenuButton.hasClass("vjs-hidden")){e.controlBar.playbackRateMenuButton.hide();e.ads.showPlaybackMenuOnAdEnd_=true}else{e.ads.showPlaybackMenuOnAdEnd_=false}}function be(e,t){e.ads.debug("Ending ad break");if(t===undefined){t=function e(){}}e.ads.adType=null;e.ads._inLinearAdMode=false;e.trigger("adend");e.removeClass("vjs-ad-playing");if(e.ads.isLive(e)){e.addClass("vjs-live")}if(e.ads.shouldTakeSnapshots()){ve(e,t)}else{e.volume(e.ads.preAdVolume_);t()}e.playbackRate(e.ads.preAdPlaybackRate_);if(e.ads.showPlaybackMenuOnAdEnd_){e.controlBar.playbackRateMenuButton.show()}}var v={start:ye,end:be};var _e=p.getState("AdState");var Te=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}t._getName=function e(){return"Preroll"};var i=t.prototype;i.init=function e(t,i,n){this.waitingForAdBreak=true;t.addClass("vjs-ad-loading");if(n||t.ads.nopreroll_){return this.resumeAfterNoPreroll(t)}var s=t.ads.settings.timeout;if(typeof t.ads.settings.prerollTimeout==="number"){s=t.ads.settings.prerollTimeout}this._timeout=t.setTimeout(function(){t.trigger("adtimeout")},s);if(i){this.handleAdsReady()}else{this.adsReady=false}};i.onAdsReady=function e(t){if(!t.ads.inAdBreak()){t.ads.debug("Received adsready event (Preroll)");this.handleAdsReady()}else{c["default"].log.warn("Unexpected adsready event (Preroll)")}};i.handleAdsReady=function e(){this.adsReady=true;this.readyForPreroll()};i.afterLoadStart=function e(t){var i=this.player;if(i.ads._hasThereBeenALoadStartDuringPlayerLife){t()}else{i.ads.debug("Waiting for loadstart...");i.one("loadstart",function(){i.ads.debug("Received loadstart event");t()})}};i.noPreroll=function e(){var t=this;this.afterLoadStart(function(){t.player.ads.debug("Skipping prerolls due to nopreroll event (Preroll)");t.resumeAfterNoPreroll(t.player)})};i.readyForPreroll=function e(){var t=this.player;this.afterLoadStart(function(){t.ads.debug("Triggered readyforpreroll event (Preroll)");t.trigger("readyforpreroll")})};i.onAdsCanceled=function e(t){var i=this;t.ads.debug("adscanceled (Preroll)");this.afterLoadStart(function(){i.resumeAfterNoPreroll(t)})};i.onAdsError=function e(t){var i=this;c["default"].log("adserror (Preroll)");if(this.inAdBreak()){t.ads.endLinearAdMode()}else{this.afterLoadStart(function(){i.resumeAfterNoPreroll(t)})}};i.startLinearAdMode=function e(){var t=this.player;if(this.adsReady&&!t.ads.inAdBreak()&&!this.isContentResuming()){this.clearTimeout(t);t.ads.adType="preroll";this.waitingForAdBreak=false;v.start(t);t.ads._shouldBlockPlay=false}else{c["default"].log.warn("Unexpected startLinearAdMode invocation (Preroll)")}};i.onAdStarted=function e(t){t.removeClass("vjs-ad-loading")};i.endLinearAdMode=function e(){var t=this.player;if(this.inAdBreak()){t.removeClass("vjs-ad-loading");t.addClass("vjs-ad-content-resuming");this.contentResuming=true;v.end(t)}};i.skipLinearAdMode=function e(){var t=this;var i=this.player;if(i.ads.inAdBreak()||this.isContentResuming()){c["default"].log.warn("Unexpected skipLinearAdMode invocation")}else{this.afterLoadStart(function(){i.trigger("adskip");i.ads.debug("skipLinearAdMode (Preroll)");t.resumeAfterNoPreroll(i)})}};i.onAdTimeout=function e(t){var i=this;this.afterLoadStart(function(){t.ads.debug("adtimeout (Preroll)");i.resumeAfterNoPreroll(t)})};i.onNoPreroll=function e(t){if(t.ads.inAdBreak()||this.isContentResuming()){c["default"].log.warn("Unexpected nopreroll event (Preroll)")}else{this.noPreroll()}};i.resumeAfterNoPreroll=function e(t){this.contentResuming=true;t.ads._shouldBlockPlay=false;this.cleanupPartial(t);if(t.ads._playRequested||t.ads._pausedOnContentupdate){if(t.paused()){t.ads.debug("resumeAfterNoPreroll: attempting to resume playback (Preroll)");var i=t.play();if(i&&i.then){i.then(null,function(e){})}}else{t.ads.debug("resumeAfterNoPreroll: already playing (Preroll)");t.trigger("play");t.trigger("playing")}}};i.cleanup=function e(t){if(!t.ads._hasThereBeenALoadStartDuringPlayerLife){c["default"].log.warn("Leaving Preroll state before loadstart event can cause issues.")}this.cleanupPartial(t)};i.cleanupPartial=function e(t){t.removeClass("vjs-ad-loading");t.removeClass("vjs-ad-content-resuming");this.clearTimeout(t)};i.clearTimeout=function e(t){t.clearTimeout(this._timeout);this._timeout=null};return t}(_e);p.registerState("Preroll",Te);var Se=p.getState("ContentState");var Ee=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}t._getName=function e(){return"BeforePreroll"};var i=t.prototype;i.init=function e(t){this.adsReady=false;this.shouldResumeToContent=false;t.ads._shouldBlockPlay=t.ads.settings.allowVjsAutoplay?!t.autoplay():true};i.onAdsReady=function e(t){t.ads.debug("Received adsready event (BeforePreroll)");this.adsReady=true};i.onPlay=function e(t){var i=p.getState("Preroll");t.ads.debug("Received play event (BeforePreroll)");this.transitionTo(i,this.adsReady,this.shouldResumeToContent)};i.onAdsCanceled=function e(t){t.ads.debug("adscanceled (BeforePreroll)");this.shouldResumeToContent=true};i.onAdsError=function e(){this.player.ads.debug("adserror (BeforePreroll)");this.shouldResumeToContent=true};i.onNoPreroll=function e(){this.player.ads.debug("Skipping prerolls due to nopreroll event (BeforePreroll)");this.shouldResumeToContent=true};i.skipLinearAdMode=function e(){var t=this.player;t.trigger("adskip");t.ads.debug("skipLinearAdMode (BeforePreroll)");this.shouldResumeToContent=true};i.onContentChanged=function e(){this.init(this.player)};return t}(Se);p.registerState("BeforePreroll",Ee);var we=p.getState("AdState");var Ie=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}t._getName=function e(){return"Midroll"};var i=t.prototype;i.init=function e(t){t.ads.adType="midroll";v.start(t);t.addClass("vjs-ad-loading")};i.onAdStarted=function e(t){t.removeClass("vjs-ad-loading")};i.endLinearAdMode=function e(){var t=this.player;if(this.inAdBreak()){this.contentResuming=true;t.addClass("vjs-ad-content-resuming");t.removeClass("vjs-ad-loading");v.end(t)}};i.onAdsError=function e(t){if(this.inAdBreak()){t.ads.endLinearAdMode()}};i.cleanup=function e(t){t.removeClass("vjs-ad-loading");t.removeClass("vjs-ad-content-resuming")};return t}(we);p.registerState("Midroll",Ie);var ke=p.getState("AdState");var Ce=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}t._getName=function e(){return"Postroll"};var i=t.prototype;i.init=function e(t){this.waitingForAdBreak=true;t.ads._contentEnding=true;if(!t.ads.nopostroll_){t.addClass("vjs-ad-loading");var i=t.ads.settings.timeout;if(typeof t.ads.settings.postrollTimeout==="number"){i=t.ads.settings.postrollTimeout}this._postrollTimeout=t.setTimeout(function(){t.trigger("adtimeout")},i)}else{this.resumeContent(t);var n=p.getState("AdsDone");this.transitionTo(n)}};i.startLinearAdMode=function e(){var t=this.player;if(!t.ads.inAdBreak()&&!this.isContentResuming()){t.ads.adType="postroll";t.clearTimeout(this._postrollTimeout);this.waitingForAdBreak=false;v.start(t)}else{c["default"].log.warn("Unexpected startLinearAdMode invocation (Postroll)")}};i.onAdStarted=function e(t){t.removeClass("vjs-ad-loading")};i.endLinearAdMode=function e(){var t=this;var i=this.player;var n=p.getState("AdsDone");if(this.inAdBreak()){i.removeClass("vjs-ad-loading");this.resumeContent(i);v.end(i,function(){t.transitionTo(n)})}};i.skipLinearAdMode=function e(){var t=this.player;if(t.ads.inAdBreak()||this.isContentResuming()){c["default"].log.warn("Unexpected skipLinearAdMode invocation")}else{t.ads.debug("Postroll abort (skipLinearAdMode)");t.trigger("adskip");this.abort(t)}};i.onAdTimeout=function e(t){t.ads.debug("Postroll abort (adtimeout)");this.abort(t)};i.onAdsError=function e(t){t.ads.debug("Postroll abort (adserror)");if(t.ads.inAdBreak()){t.ads.endLinearAdMode()}else{this.abort(t)}};i.onContentChanged=function e(t){if(this.isContentResuming()){var i=p.getState("BeforePreroll");this.transitionTo(i)}else if(!this.inAdBreak()){var n=p.getState("Preroll");this.transitionTo(n)}};i.onNoPostroll=function e(t){if(!this.isContentResuming()&&!this.inAdBreak()){this.abort(t)}else{c["default"].log.warn("Unexpected nopostroll event (Postroll)")}};i.resumeContent=function e(t){this.contentResuming=true;t.addClass("vjs-ad-content-resuming")};i.abort=function e(t){var i=p.getState("AdsDone");this.resumeContent(t);t.removeClass("vjs-ad-loading");this.transitionTo(i)};i.cleanup=function e(t){t.removeClass("vjs-ad-content-resuming");t.clearTimeout(this._postrollTimeout);t.ads._contentEnding=false};return t}(ke);p.registerState("Postroll",Ce);var Ae=p.getState("ContentState");var je=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}t._getName=function e(){return"ContentPlayback"};var i=t.prototype;i.init=function e(t){t.ads._shouldBlockPlay=false};i.onAdsReady=function e(t){t.ads.debug("Received adsready event (ContentPlayback)");if(!t.ads.nopreroll_){t.ads.debug("Triggered readyforpreroll event (ContentPlayback)");t.trigger("readyforpreroll")}};i.onReadyForPostroll=function e(t){var i=p.getState("Postroll");t.ads.debug("Received readyforpostroll event");this.transitionTo(i)};i.startLinearAdMode=function e(){var t=p.getState("Midroll");this.transitionTo(t)};return t}(Ae);p.registerState("ContentPlayback",je);var xe=p.getState("ContentState");var De=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}t._getName=function e(){return"StitchedContentPlayback"};var i=t.prototype;i.init=function e(){this.player.ads._shouldBlockPlay=false};i.onContentChanged=function e(){this.player.ads.debug("Received contentchanged event ("+this.constructor._getName()+")")};i.startLinearAdMode=function e(){var t=p.getState("StitchedAdRoll");this.transitionTo(t)};return t}(xe);p.registerState("StitchedContentPlayback",De);var Re=p.getState("AdState");var Oe=function(e){r(t,e);function t(){return e.apply(this,arguments)||this}t._getName=function e(){return"StitchedAdRoll"};var i=t.prototype;i.init=function e(){this.waitingForAdBreak=false;this.contentResuming=false;this.player.ads.adType="stitched";v.start(this.player)};i.onPlaying=function e(){};i.onContentResumed=function e(){};i.onAdEnded=function e(){this.endLinearAdMode();this.player.trigger("ended")};i.endLinearAdMode=function e(){var t=p.getState("StitchedContentPlayback");v.end(this.player);this.transitionTo(t)};return t}(Re);p.registerState("StitchedAdRoll",Oe);var Pe=t.isMiddlewareMediatorSupported;var Le=c["default"].getTech("Html5").Events;var Ne={timeout:5e3,prerollTimeout:undefined,postrollTimeout:undefined,debug:false,stitchedAds:false,contentIsLive:undefined,liveCuePoints:true,allowVjsAutoplay:c["default"].options.normalizeAutoplay||false};var Me=function e(t){var s=this;var i=c["default"].obj.merge(Ne,t);var n=[];Le.concat(["firstplay","loadedalldata"]).forEach(function(e){if(n.indexOf(e)===-1){n.push(e)}});s.on(n,H);if(!Pe()){ae(s,i.debug)}s.setTimeout(function(){if(!s.ads._hasThereBeenALoadStartDuringPlayerLife&&s.src()!==""){c["default"].log.error("videojs-contrib-ads has not seen a loadstart event 5 seconds "+"after being initialized, but a source is present. This indicates that "+"videojs-contrib-ads was initialized too late. It must be initialized "+"immediately after video.js in the same tick. As a result, some ads will not "+"play and some media events will be incorrect. For more information, see "+"http://videojs.github.io/videojs-contrib-ads/integrator/getting-started.html")}},5e3);s.on("ended",function(){if(!s.hasClass("vjs-has-started")){s.addClass("vjs-has-started")}});s.on("contenttimeupdate",function(){s.removeClass("vjs-waiting")});s.on(["addurationchange","adcanplay"],function(){if(s.ads.settings.stitchedAds){return}if(s.hasStarted()){return}if(s.ads.snapshot&&s.currentSrc()===s.ads.snapshot.currentSrc){return}if(!s.ads.inAdBreak()){return}var e=s.play();if(e&&e.catch){e.catch(function(e){c["default"].log.warn("Play promise rejected when playing ad",e)})}});s.on("nopreroll",function(){s.ads.debug("Received nopreroll event");s.ads.nopreroll_=true});s.on("nopostroll",function(){s.ads.debug("Received nopostroll event");s.ads.nopostroll_=true});s.on("playing",function(){s.ads._cancelledPlay=false;s.ads._pausedOnContentupdate=false});s.on("play",function(){s.ads._playRequested=true});s.one("loadstart",function(){s.ads._hasThereBeenALoadStartDuringPlayerLife=true});s.on("loadeddata",function(){s.ads._hasThereBeenALoadedData=true});s.on("loadedmetadata",function(){s.ads._hasThereBeenALoadedMetaData=true});s.ads=U(s);s.ads.settings=i;i.stitchedAds=!!i.stitchedAds;if(i.stitchedAds){s.ads._state=new(p.getState("StitchedContentPlayback"))(s)}else{s.ads._state=new(p.getState("BeforePreroll"))(s)}s.ads._state.init(s);s.ads.cueTextTracks=f;s.ads.adMacroReplacement=ne.bind(s);$(s);s.on("contentchanged",s.ads.reset);var r=function e(){return!s.ads.shouldPlayContentBehindAd(s)&&s.ads.inAdBreak()&&s.tech_.featuresNativeTextTracks&&c["default"].browser.IS_IOS&&!Array.isArray(s.textTracks())};var a=function e(){var t=s.textTracks();if(r()){for(var i=0;i0&&arguments[0]!==undefined?arguments[0]:{};var t=this;var n=void 0;var s=void 0;var r=0;var a=false;this.contribAds6Shim={VERSION:Ue};t.ads.state=n=s="content-set";Object.defineProperty(t.ads,"state",{get:function e(){if(i.warnOnGetState===true||typeof i.warnOnGetState==="number"&&r "+s)}}});t.on("contentchanged",function(){if(t.paused()){t.ads.state="content-set"}else{t.ads.state="ads-ready?"}});t.on("play",function(){if(s==="content-set"){t.ads.state="ads-ready?"}else if(s==="ads-ready"){t.ads.state="preroll?"}});t.on("adsready",function(){if(s==="content-set"){t.ads.state="ads-ready"}else if(s==="ads-ready?"){t.ads.state="preroll?"}});t.on(["adserror","adtimeout","adskip"],function(){if(s==="ads-ready?"||s==="preroll?"){t.ads.state="content-playback"}});t.on("adstart",function(){t.ads.state="ad-playback"});t.on("adend",function(){t.ads.state="content-resuming"});t.on("playing",function(){if(s!=="content-playback"){t.trigger("contentplayback");if(i.debug){c["default"].log("CA6Shim: Triggered contentplayback")}}t.ads.state="content-playback"});t.on("contentended",function(){if(s==="content-playback"){t.ads.state="postroll?"}});t.on("ended",function(){t.ads.state="content-playback"})};Be("contribAds6Shim",Fe);let y;const qe=function(e,t){const i=t.cues;const n=t.label;const s=t.inBandMetadataTrackDispatchType;const r=t.kind;if(r!=="metadata"){return}if(n==="media-cues"){return true}else if(s&&r==="metadata"){return true}else if(i&&i.length){return e.ima3.cueState_.cueModule.isSupportedAdCue(e,i[0])}return true};const Ve=function(e){let t;if(e&&!e.value||e.value.key!=="TXXX"){return null}try{t=JSON.parse(e.value.data)}catch(e){c["default"].log.error("ERROR: Parsing JSON. Please confirm that JSON is valid.",e.message);return null}if(!t.name){return null}const i=t.name.toLowerCase();if(i!=="adcue"&&i!=="adcancel"){return null}return t};const He=function(e,t){if(t&&t.text&&t.text.toLowerCase()==="ad"){return true}else if(t&&t.name&&t.name.toLowerCase()==="adcue"){return true}return false};const $e=function(e,t,i){const n=Math.abs(i-e.duration());const s=Math.abs(i-e.currentTime());let r;if(i===0){if(!e.ima3.cueState_.prerollPlayed){e.ima3.cueState_.prerollPlayed=true;e.ads.adType="preroll"}else{return}}if(n<=1){if(!e.ima3.cueState_.postrollPlayed){e.ima3.cueState_.postrollPlayed=true}else{return}}if(s>=1){return}if(!e.ima3.settings.useMediaCuePoints&&t.serverUrl){r=t.serverUrl}else{r=e.ima3.settings.serverUrl}r=e.ima3.adMacroReplacement(r);if(t.duration){if(/\?/.test(r)){r+="&breaklength="+t.duration}else{r+="?breaklength="+t.duration}}if(e.ima3.isReady_){e.ima3.log(`Oncue ad request at ${i} seconds`);e.ima3.adrequest(r)}};const b=function(e,t,i,n,s){if(n===0&&e.ima3.cueState_.prerollPlayed){return}else if(s<=1&&e.ima3.cueState_.postrollPlayed){return}$e(e,t,n);e.ima3.cueState_.usedActiveCues[i]=true};const ze=function(e,t,i,n,s){if(n!==0||e.currentTime()!==0){return}else if(e.ima3.cueState_.prerollPlayed||e.ima3.cueState_.prerollHandledEarly){return}if(e.paused()&&!e.ads._playRequested){e.ima3.cueState_.prerollHandledEarly=true;e.ima3.oneUnlessContentUpdate_("play",()=>{b(e,t,i,n,s)})}else if(e.ads.isInAdMode()&&!e.ads.isContentResuming()&&e.ads._playRequested){b(e,t,i,n,s)}};const Ge=function(e){const t=e.mediainfo?Math.max(e.duration(),e.mediainfo.duration):e.duration();return t};const We=function(e,t,i,n){const s=Ge(e);const r=Math.abs(n-s);if(e.ads.isAdPlaying()&&He(e,t)){return}else if(!i){e.ima3.log.error("The cue does not have an ID and cannot be used",t);return}else if(e.ima3.cueState_.usedActiveCues[i]){return}else if(t.name&&t.name.toLowerCase()==="adcancel"){return}if(n===0){ze(e,t,i,n,r)}else if(r<=1&&!e.ima3.cueState_.postrollHandled){e.ima3.cueState_.postrollHandled=true;e.ima3.oneUnlessContentUpdate_("contentended",()=>{b(e,t,i,n,r)})}else if(e.ima3.isReady_&&!e.ads.isInAdMode()){b(e,t,i,n,r)}};const Ke=function(e,t,i,n){if(!e.ima3.settings.useMediaCuePoints&&t.name==="adCancel"&&e.ima3.adsManager&&!e.ima3.cueState_.usedActiveCues[i]){e.ima3.cueState_.usedActiveCues[i]=true;e.ima3.adsManager.stop();e.ima3.log("Cancelling oncue ad at "+n+" seconds")}};const Xe=function(n){return function(){const e=this.activeCues;if(n.scrubbing()){return}if(e&&e.length){const t=e[e.length-1];const i=[t];if(!qe(n,this)){this.removeEventListener("cuechange",n.ima3.cueState_.adCueChangeHandler);return}n.ima3.cueState_.cueModule.processAdTrack(n,i,We,Ke)}}};const Ye=function(t,e){const i=e.cues;let n;let s;if(!qe(t,e)){return}if(i&&i.length!==undefined){for(let e=0;e{Qe(e,t);e.ima3.cueState_.cueModule.setMetadataTrackMode=function(e){e.mode="hidden"};e.ima3.cueState_.cueModule.getCueId=function(e,t){const i=e.ima3.cueState_.cueModule.getSupportedAdCue(e,t);if(!i){return null}return i.id};e.ima3.cueState_.cueModule.isSupportedAdCue=function(e,t){return e.ima3.cueState_.cueModule.getSupportedAdCue(e,t)!==null};e.ima3.cueState_.cueModule.getSupportedAdCue=function(e,t){if(e.ima3.settings.requestMode==="oncue"&&!e.ima3.settings.useMediaCuePoints){return Ve(t)}return null};e.ima3.cueState_.cueModule.processMetadataTracks(e,Ye)};const Ze=(e,t)=>{if(!t.useMediaCuePoints){e.on("loadedmetadata",()=>{e.trigger("nopreroll");y.liveCuePointHandler(e,e.ads.cueTextTracks)})}e.trigger("adsready");e.on("contentchanged",()=>{e.trigger("adsready")})};y={init:Ze,liveCuePointHandler:Je};var et=y;var tt="7.3.2";function it(i){let e=false;let n=false;let t=null;let s=null;const r=()=>{i.tech(true).trigger("durationchange");i.trigger("timeupdate");i.trigger("progress")};i.on("ima3-started",function(){i.removeClass("vjs-ima3-paused");i.trigger("play");e=false;if(i.ads.inAdBreak()&&!i.ads.videoElementRecycled()){t=i.volume();s=i.muted()}});i.on("ads-ad-started",function(){n=true;if(typeof s==="boolean"&&s){i.muted(s)}else if(typeof t==="number"){i.volume(t)}r()});i.on("ima3-resumed",function(){i.removeClass("vjs-ima3-paused");i.trigger("play");e=false});i.on("ima3-paused",function(){i.addClass("vjs-ima3-paused");i.trigger("pause");e=true});i.on(["ima3-complete","ima3-content-resume-requested"],function(){n=false;r()});const a=t=>{return e=>{if(i.usingPlugin("ima3")&&i.ads.isAdPlaying()&&i.ima3.adsManager&&n){return t(e)}return e}};return{currentTime:a(function(){const e=i.duration();if(typeof e!=="number"||!i.ima3.adsManager){return 0}const t=i.ima3.adsManager.getRemainingTime();if(typeof t!=="number"||t<=0||t>e){return 0}return e-t}),duration:a(function(){const e=i.ima3.currentAd;if(!e){return 0}const t=e.getDuration();return t>0?t:0}),buffered:a(function(n){const s=[];const r=i.duration();for(let i=0;ir){continue}else if(t>r){s.push([e,r])}else{s.push([e,t])}}return c["default"].createTimeRanges(s)}),callPause:a(function(){e=true;i.ima3.adsManager.pause();i.trigger("pause");return c["default"].middleware.TERMINATOR}),paused:a(function(){return e}),callPlay:a(function(){e=false;i.ima3.adsManager.resume();i.trigger("play");return c["default"].middleware.TERMINATOR}),setVolume:a(function(e){i.ima3.adsManager.setVolume(e);i.ima3.volume=e;i.trigger("volumechange");return e}),volume:a(function(){return i.ima3.adsManager.getVolume()||i.ima3.volume}),setMuted:a(function(e){i.ima3.adsManager.setVolume(e?0:i.ima3.volume||1);return e}),muted:a(function(){return i.ima3.adsManager.getVolume()===0}),ended:a(function(){return false})}}function _(e){if(typeof e!=="string"){return}const t=e.match(/^([\d]+)\.([\d]+)\.([\d]+)/);if(!t){return}return[Number(t[1]),Number(t[2]),Number(t[3])]}const nt=_(tt);function st(e,t){const i=_(e);const n=t?_(t):nt;if(!n||!i){return false}if(i[0]!==n[0]){return false}if(i[1]n[1]){return true}return i[2]>=n[2]}function rt(e){if(c["default"].getPlugin){return c["default"].getPlugin(e)}return c["default"].getComponent("Player").prototype[e]}function at(e){if(rt("ima3")){return false}const t=rt("ads");if(!st(t.VERSION)){c["default"].log.error(`The IMA plugin depends on contrib-ads version "${nt}", but it saw version "${t.VERSION}". This is not a compatible configuration. The IMA plugin will attempt to continue initializing, but this problem should be addressed. If you are using ad failover, please select compatible versions of the SSAI and IMA plugins.`)}c["default"].use("*",it);const i=c["default"].registerPlugin||c["default"].plugin;i("ima3",e);return true}let T;function ot(e,t){if(typeof getComputedStyle==="function"){return tv.getComputedStyle(e)[t]}return e.currentStyle[t]}function S(e){const t=parseInt(T.computedStyle(e.el(),"width"),10);const i=parseInt(T.computedStyle(e.el(),"height"),10);return{width:t,height:i}}function lt(e){if(+e<0){c["default"].log.error("duration "+e+" can't be a negative number");return"00:00:00.000"}if(+e>=86400){c["default"].log.error("duration "+e+" can't be over 24h");return"00:00:00.000"}const t=e*1e3;let i=parseInt(t%1e3,10);let n=parseInt(t/1e3%60,10);let s=parseInt(t/(1e3*60)%60,10);let r=parseInt(t/(1e3*60*60)%24,10);r=r<10?"0"+r:r;s=s<10?"0"+s:s;n=n<10?"0"+n:n;if(i<10){i="00"+i}else if(i<100){i="0"+i}return r+":"+s+":"+n+"."+i}function dt(e){if(e.ima3.adsManager){e.ima3.log("[util.destroyAdsManager] Call AdsManager.destroy.");e.ima3.adsManager.destroy();e.ima3.adsManager=null}if(e.ima3.managerCleanup){e.ima3.managerCleanup();e.ima3.managerCleanup=null}}function E(t){for(let e=1;et(null);i.onerror=e=>{t(e);i.parentNode.removeChild(i);i=null};n.insertBefore(i,n.firstChild)}const ct=e=>{return typeof e.mediainfo==="object"&&e.mediainfo.economics==="FREE"};const ht=e=>{if(e!==undefined){return e.getContentType()==="application/javascript"}throw new Error("Cannot check if the current ad is a VPAID when there is no ad.")};const ft=e=>{return!!(e&&e.getCuePoints().length===0)};const pt=e=>{return!!(e&&e.getCuePoints().length!==0)};const mt=e=>{return ft(e)||e.getCuePoints().indexOf(0)>=0};const gt=e=>{return e.getCuePoints().indexOf(-1)>=0};const vt=e=>{return e.requestMode==="oncue"&&!e.useMediaCuePoints};const yt=e=>{return e.requestMode==="oncue"&&e.useMediaCuePoints};const bt=e=>{try{const t=new URL(e);return t.hostname.includes("tv.springserve.com")||t.hostname.includes("vid.springserve.com")}catch(e){return false}};const w=e=>e&&typeof e==="object"&&typeof e.trigger==="function";function I(e,t){if(!e||!e.bcAnalytics||!e.bcAnalytics.insightsBeacons||typeof e.bcAnalytics.insightsBeacons[t]!=="function"){return}e.bcAnalytics.insightsBeacons[t]()}const _t=e=>{const{mediainfo:t,liveTracker:i}=e;const n=t&&t.duration||e.duration&&e.duration()||null;return i&&i.isLive()||n===Infinity};const Tt=(e,t,i)=>{if(i){e[t]=i}};T={assignIfTruthy:Tt,computedStyle:ot,getPlayerDimensions:S,secondsToTime:lt,destroyAdsManager:dt,extend:E,loadScript:ut,isEconomicsFree:ct,isLive:_t,isVpaid:ht,isVast:ft,isVmap:pt,includesPreroll:mt,includesPostroll:gt,usingLiveAdCuepoints:vt,usingMediaCuepoints:yt,usingAutoAdvance:w,sendInsightsBeacon:I};var k=T;let C;const St=(e,t)=>{const i=c["default"].ima3.extend;i(t,{linearAdSlotWidth:e.width,linearAdSlotHeight:e.height,nonLinearAdSlotWidth:e.width,nonLinearAdSlotHeight:e.height})};const Et=(e,t,i)=>{if(e.ima3.isReady_){t.adsResponse=i}else{e.ima3.oneUnlessContentUpdate_("ima3-ready",()=>{t.adsResponse=i})}};const wt=(n,e,t)=>{const i=n.ima3.settings.requestMode;const s=n.ima3.settings.useMediaCuePoints;const r=tv.google.ima;if(!r||r&&!r.AdsRequest){throw new Error("An ad request was made before the plugin is ready")}n.ima3.log("[adsRequest] Create ima.AdsRequest.");const a=new r.AdsRequest;C._addPlayerDimensions(k.getPlayerDimensions(n),a);if(i!=="oncue"||!s||!t){a.adTagUrl=e}else{C._addVmap(n,a,t)}n.ima3.adsRequest=a;const o=e=>{const t=n.ima3.settings.omidAccessModeRules||{};e.omidAccessModeRules=n.ima3.adsRequest.omidAccessModeRules||{};for(const i in t){e.omidAccessModeRules[r.OmidAccessMode[i]]=t[i].map(e=>new RegExp(e))}};const l=e=>{const t=!!(e&&e.type==="autoplay-success");a.setAdWillAutoPlay(t);a.setAdWillPlayMuted(n.muted());o(a);n.trigger({type:"ads-before-request",adsRequest:a});n.ima3.adsLoader.requestAds(a);n.trigger("ads-request")};if(n.ima3._contentchangedSeen){const d=n.autoplay()?"autoplay-success":"autoplay-failure";l({type:d})}else if(n.autoplay()===false){l()}else if(n.ima3._autoplayResultEvent){l(n.ima3._autoplayResultEvent)}else{n.any(["autoplay-success","autoplay-failure"],l)}};const It=e=>{e.trigger("nopreroll");e.trigger("nopostroll")};const kt=e=>{const t=e.ima3.settings.requestMode;return t!=="onload"&&t!=="onplay"};const Ct=e=>{return e.ima3.lastSrc_===e.currentSrc()};const At=e=>{e.trigger("adscanceled");e.trigger("nopreroll");e.trigger("nopostroll")};const jt=(i,n,s)=>{const e=()=>{const e=i.ima3.settings.requestMode;let t;if(n!==undefined&&n!==null){t=i.ima3.adMacroReplacement(n)}if(e!=="oncue"&&!t){C._handleMissingAdTagUrl(i);return}C._adsRequest(i,t,s)};i.ads.updateUsPrivacyString(()=>{e()})};const xt=(e,t)=>{if(k.isEconomicsFree(e)){C._handleEconomicsFree(e);return}C._afterServerUrlFunctionCheck(e,t)};const Dt=(t,e,i)=>{const n=t.ima3.settings.useMediaCuePoints;if(k.isEconomicsFree(t)){C._handleEconomicsFree(t);return}if(!n){e=e||t.ima3.settings.serverUrl}if(!n&&typeof e==="function"){e(e=>{C._handleServerUrlFunctionResponse(t,e)})}else{C._afterServerUrlFunctionCheck(t,e,i)}};const Rt=e=>{const t=e.ima3.settings.requestMode;const i=e.ima3.settings.useMediaCuePoints;return(t==="onplay"||t==="oncue"&&i)&&!e.ima3._playSeen&&e.paused()&&!e.ads._pausedOnContentupdate};const Ot=(e,t,i)=>{if(k.isEconomicsFree(e)){C._handleEconomicsFree(e);return}e.ima3._requestAdsOnPlay=()=>{C._afterPlay(e,t,i)};e.one("play",e.ima3._requestAdsOnPlay)};const Pt=(e,t,i)=>{e.ima3.log("[requestAds] Beginning ad request process.");if(C._isRepeatForSource(e)&&!C._isRepeatForSourceAllowed(e)){e.ima3.log("Cancelling repeat adsRequest for "+e.currentSrc());return}if(C._shouldWaitUntilPlay(e)){C._waitUntilPlay(e,t,i)}else{C._afterPlay(e,t,i)}};C={_addPlayerDimensions:St,_addVmap:Et,_adsRequest:wt,_handleEconomicsFree:It,_isRepeatForSourceAllowed:kt,_isRepeatForSource:Ct,_handleMissingAdTagUrl:At,_afterServerUrlFunctionCheck:jt,_handleServerUrlFunctionResponse:xt,_afterPlay:Dt,_shouldWaitUntilPlay:Rt,_waitUntilPlay:Ot,requestAds:Pt};var A=C;const Lt=e=>{e.trigger("nopreroll");e.trigger("nopostroll")};const Nt=(e,t)=>{if(!t.ima3.isReady_){t.ima3.log.error("Cannot make an ad request when the plugin is not ready. Skipping ad...");return}if(t.ads._state.constructor._getName()==="AdsDone"){t.ima3.log("On demand adRequest cannot occur when player.ads is in AdsDone state.");return}if(t.mediainfo&&t.mediainfo.economics==="FREE"){t.ima3.log("On demand adRequest attempted on video with advertising disabled.");return}if(!e){t.ima3.log("On demand adRequest attempted without an adTagUrl.");return}t.ima3.log("Clearing any previous VAST ad data and triggering ondemand adrequest.");t.ads.startLinearAdMode();dt(t);A.requestAds(t,e);t.addClass("ima3-ad-loading")};const j={initSource:Lt,onDemandAdRequest:Nt};class Mt{constructor(e){this.player=e;this.audibleState=this.playerAudibleState(e);this.audibleTracking={totalAudibleSec:0,start:0}}isAudible(e){return e.volume>=.01&&!e.muted}playerAudibleState(e){return{volume:e.volume(),muted:e.muted()}}audibleStateChanged(e,t){if(this.isAudible(e)&&!this.isAudible(t)){return 1}if(!this.isAudible(e)&&this.isAudible(t)){return 2}return 0}handleVolumeChange(){const e=this.audibleStateChanged(this.audibleState,this.playerAudibleState(this.player));if(e===1){this.audibleTracking.totalAudibleSec+=this.player.ads.ad.currentTime-this.audibleTracking.start}if(e===2){this.audibleTracking.start=this.player.ads.ad.currentTime}this.audibleState=this.playerAudibleState(this.player)}handleAdComplete(){if(this.isAudible(this.playerAudibleState(this.player))){this.audibleTracking.totalAudibleSec+=this.player.ads.ad.currentTime-this.audibleTracking.start}this.player.ads.ad.audible_duration=this.audibleTracking.totalAudibleSec}}const Ut={0:"PREROLL","-1":"POSTROLL"};const x=(e,t,i)=>{if(i===""){return}if(!e.currentAdEventInfo[t]){e.currentAdEventInfo[t]=[i]}else{e.currentAdEventInfo[t].push(i)}};const Bt=(e,t)=>{if(t===undefined){return}const i=e.ima3;i.currentAdEventInfo.adPodId=e.ads.pod.id;i.currentAdEventInfo.adPodLength=e.ads.pod.size;i.currentAdEventInfo.adType=e.ads.adType;x(i,"adId",e.ads.ad.id);x(i,"creativeLength",e.ads.ad.duration);x(i,"creativeIndex",e.ads.ad.index);x(i,"creativeId",t.getCreativeId());x(i,"creativeAdId",t.getCreativeAdId());x(i,"creativeFormat",t.getContentType());x(i,"creativeUrl",t.getMediaUrl());x(i,"surveyUrl",t.getSurveyUrl());x(i,"adTitle",t.getTitle());x(i,"wrapperCreativeIds",t.getWrapperCreativeIds());x(i,"advertiserName",t.getAdvertiserName());x(i,"dealId",t.getDealId());x(i,"adSystem",t.getAdSystem());x(i,"wrapperAdSystems",t.getWrapperAdSystems())};function Ft(t,e){const i={0:"pre","-1":"post"};const n=t.ima3.currentAd;const{ad:s,pod:r}=t.ads;const a=n.getAdPodInfo();const o=a.getTimeOffset();const l=n.getWrapperAdSystems();const d=t.ima3.currentAd.getSkipTimeOffset();const u=t.ima3.adsManager?t.ima3.adsManager.getRemainingTime():0;const c=t.ima3.currentAd.getDuration();const h=c-u;if(e==="ima3-started"){if(!k.isLive(t)){t.ads.pod.index=t.ima3.currentAd.getAdPodInfo().getPodIndex()}if(typeof t.on==="function"){const f=new Mt(t);t.on("advolumechange",f.handleVolumeChange.bind(f));t.one(["ima3-complete","ima3-skip"],e=>{t.off("advolumechange",f.handleVolumeChange);f.handleAdComplete.bind(f)()})}}k.assignIfTruthy(s,"deal_id",n.getDealId());k.assignIfTruthy(s,"wrapper_systems",Array.isArray(l)&&l.join(","));k.assignIfTruthy(s,"system",n.getAdSystem());k.assignIfTruthy(s,"advertiser",n.getAdvertiserName());k.assignIfTruthy(s,"content_type",n.getContentType());k.assignIfTruthy(s,"isci",n.getCreativeAdId());k.assignIfTruthy(s,"creative_id",n.getCreativeId());k.assignIfTruthy(s,"title",n.getTitle());try{const{host:p}=new URL(n.getMediaUrl());k.assignIfTruthy(s,"media_url_domain",p)}catch(e){t.ima3.log.error(e)}s.currentTime=h;if(typeof c==="number"&&c>=0&&u<=c){s.play_duration=typeof u==="number"&&u>=0?c-u:c}else if(typeof c==="number"&&c>=0&&u>c){s.play_duration=0}if(d!==-1){s.skip_time_offset=d}r.ad_count=n.getAdPodInfo().getTotalAds();if(typeof o==="number"){r.type=i[o]||"mid"}r.time_offset=o!==-1?o:t.duration();if(typeof n.getAdPodInfo().getPodIndex()==="number"){if(typeof r.durationTracker==="undefined"){r.durationTracker={podIndex:n.getAdPodInfo().getPodIndex(),adIndex:t.ima3.currentAd.getAdPodInfo().getAdPosition(),total:t.ima3.currentAd.getDuration()}}else{const m=r.durationTracker.podIndex;const g=r.durationTracker.adIndex;if(n.getAdPodInfo().getPodIndex()!==m){r.durationTracker.podIndex=n.getAdPodInfo().getPodIndex();r.durationTracker.adIndex=n.getAdPodInfo().getAdPosition();r.durationTracker.total=n.getDuration()}else if(n.getAdPodInfo().getAdPosition()!==g){r.durationTracker.adIndex=n.getAdPodInfo().getAdPosition();r.durationTracker.total=r.durationTracker.total+n.getDuration()}}k.assignIfTruthy(r,"duration",r.durationTracker&&r.durationTracker.total)}}const qt=(e,t)=>{if(e.ima3.currentAd!==undefined){e.ads.ad.id=e.ima3.currentAd.getAdId();e.ads.ad.duration=e.ima3.currentAd.getDuration();e.ads.ad.currentTime=e.ima3.adsManager?e.ima3.currentAd.getDuration()-e.ima3.adsManager.getRemainingTime():e.ima3.currentAd.getDuration();e.ads.ad.timeOffset=e.ima3.currentAd.getAdPodInfo().getTimeOffset();e.ads.ad.index=e.ima3.currentAd.getAdPodInfo().getAdPosition()-1;e.ads.ad.type=Ut[e.ima3.currentAd.getAdPodInfo().getTimeOffset()]||"MIDROLL";e.ads.pod.id=e.ima3.currentAd.getAdPodInfo().getPodIndex();e.ads.pod.size=e.ima3.currentAd.getAdPodInfo().getTotalAds();if(t==="ima3-started"){Bt(e,e.ima3.currentAd);x(e.ima3,"started",e.ads.ad.index)}Ft(e,t)}if(t==="ima3-complete"){x(e.ima3,"completed",e.ads.ad.index)}};const Vt=e=>{const t=new URL(c["default"].dom.isInFrame()?iv.referrer:tv.location.href);const i=t.origin+t.pathname;return{macroNameOverrides:{"{player.width}":"{{WIDTH}}","{player.height}":"{{HEIGHT}}","{player.autoplay}":"{{AUTOPLAY}}","{player.muted}":"{{MUTE}}","{player.language}":"{{LANGUAGE}}","{mediainfo.duration}":"{{DURATION}}","{mediainfo.description}":"{{DESCRIPTION}}","{mediainfo.id}":"r:(\\{\\{)(MEDIA|VIDEO|CONTENT)(_ID)(\\}\\})","{mediainfo.name}":"r:(\\{\\{(ENCODED_VIDEO|CONTENT)_TITLE\\}\\})","{tcf.tcString}":"{{CONSENT}}","{tcf.gdprApplies}":"{{GDPR}}","{random}":"{{CACHEBUSTER}}","{usp.uspString}":"{{US_PRIVACY}}"},"{{DOMAIN}}":t.hostname,"{{ENCODED_URL}}":i,"{{DOUBLE_ENCODED_URL}}":encodeURIComponent(i),"{{CONTENT_LIVESTREAM}}":e.mediainfo&&e.mediainfo.duration===-1?1:0,"{{KEYWORDS}}":Array.isArray(e.mediainfo&&e.mediainfo.tags)?e.mediainfo.tags.join(","):""}};const Ht=(e,t="",i)=>{const n=new URL(c["default"].dom.isInFrame()?iv.referrer:tv.location.href);const s=n.origin+n.pathname;const r=bt(t);const a=r?Vt(e):{};if(e.bcinfo){a["{player.url}"]=e.bcinfo.scriptUrl;a["{player.accountId}"]=e.bcinfo.accountId}if(r&&t.includes("{{URL}}")){t=t.replace("{{URL}}",s)}if(i&&i.metadata&&t.indexOf("{mediainfo.ad_keys}")!==-1){const o=encodeURIComponent(i.metadata);t=t.replace("{mediainfo.ad_keys}",o)}return e.ads.adMacroReplacement(t,true,a)};var D="5.2.4";const $t=(e,t)=>{const i=e.el().querySelector(".vjs-big-play-button");e.el().insertBefore(t,i)};const zt=(e,t,i)=>{e.ima3.oneHandlers_.push({type:t,handler:i});e.one(t,i)};const Gt=(e,i)=>{e.ima3.adsRenderingSettings_=i;if(e.ima3.adsManager){let t;const n=tv.google.ima;if(i instanceof n.AdsRenderingSettings){t=i}else{t=new n.AdsRenderingSettings;const s=Object.keys(i);s.forEach(e=>{t[e]=i[e]})}e.ima3.adsManager.updateAdsRenderingSettings(t)}};const Wt=(n,e)=>{const t=n.el().querySelector(".vjs-tech");const i=n.log.createLogger("IMA3");const s={readyQueue_:[],isReady_:false,player:n,tech:t,settings:e,ready:e=>{if(e){if(n.ima3.isReady_){e.call(n)}else{if(n.ima3.readyQueue_===undefined){n.ima3.readyQueue_=[]}n.ima3.readyQueue_.push(e)}}return n.ima3},adMacroReplacement:e=>Ht(n,e),insertAdContainer:e=>{$t(n,e)},currentAdEventInfo:{},addToCurrentAdEventInfo:(e,t)=>{x(n,e,t)},setAdsRenderingSettings(e){Gt(n,e)},log:i,toggleLogger(e){if(e){i.level("debug");i.history.enable()}else{i.level("warn");i.history.disable()}},oneHandlers_:[],oneUnlessContentUpdate_(e,t){zt(n,e,t)},isVpaid(){return ht(n.ima3.currentAd)},version:D,VERSION:D};n.on("contentupdate",function(){const t=n.ima3.oneHandlers_;for(let e=0;en.ima3.toggleLogger(true));n.on("debugoff",()=>n.ima3.toggleLogger(false));return s};function R(i){const n=i.mediainfo;const s=i.ima3.settings.serverUrl;if(n&&n.economics==="AD_SUPPORTED"&&n.cuePoints.length>0&&n.cuePoints.some(e=>e.type==="AD")){let t='\n';for(let e=0;e\n'}else if(n.duration-n.cuePoints[e].time<1){t+='\n'}else{t+='\n'}const r=Ht(i,s,n.cuePoints[e]);t+=' \n'+'\n'+"\n"+"\n"+"\n"+"\n"}}t+="";return t}return null}const Kt={"ima3-click":"ads-click","ima3-started":"ads-ad-started","ima3-complete":"ads-ad-ended","ima3-first-quartile":"ads-first-quartile","ima3-midpoint":"ads-midpoint","ima3-third-quartile":"ads-third-quartile","ima3-volume-changed":"ads-volumechange","ima3-paused":"ads-pause","ima3-resumed":"ads-play","ima3-skipped":"ads-ad-skipped","ima3-all-ads-completed":"ads-allpods-completed","ads-request":"ads-request","ads-pod-ended":"ads-pod-ended","ads-pod-started":"ads-pod-started","ads-load":"ads-load"};const Xt=(n,s,r,a)=>{const e=function(e){n.trigger({type:a,emitter:s,originalEvent:e});qt(n,a);if(r==="start"){I(n,"adBegin")}if(r==="skip"||r==="complete"){I(n,"adComplete")}const t=Kt[a];if(t){const i={type:t};if(t==="ads-ad-started"||t==="ads-ad-ended"){i.indexInBreak=n.ads.ad.index}n.trigger(i)}};s.addEventListener(r,e,false);return e};const Yt=(t,e,i)=>{const n={};const s=e.ima3._eventMapping.eventTypes;if(i===undefined){i=Xt}for(const r in s){n[r]=i(e,t,r,s[r])}return function(){for(const e in n){t.removeEventListener(e,n[e])}}};const Qt=function(e){return"ima3-"+e.toLowerCase().replace(/_/g,"-")};const Jt=e=>{e._eventMapping={};e.settings.eventMap=Kt;const t=tv.google.ima;const i={};const n=["AdErrorEvent","AdEvent","AdsManagerLoadedEvent"];let s=n.length;while(s--){if(!t[n[s]]||!t[n[s]].Type){continue}const r=t[n[s]].Type;for(const a in r){if(r.hasOwnProperty(a)){i[r[a]]=Qt(a)}}}e._eventMapping.eventTypes=i};const Zt=(e,t,i,n,s,r)=>{const a=S(e);return()=>{if(t===i.ViewMode.FULLSCREEN){e.ima3.adsManager.resize(e.el().offsetWidth,e.el().offsetHeight,t)}else{e.ima3.adsManager.resize(a.width,a.height,t)}if(a.width===s&&a.height===r){return}if(n>=0){setTimeout(Zt(e,t,i,n-1,a.width,a.height),1e3)}}};const ei=e=>{const t=e.textTracks();for(let e=0;e{r.on("fullscreenchange",e=>{const t=tv.google.ima;if(c["default"].IS_ANY_SAFARI){ei(r)}const i=r.hasClass("vjs-fullscreen");if(!r.ima3||!r.ima3.adsManager){return}const n=i?t.ViewMode.FULLSCREEN:t.ViewMode.NORMAL;const s=S(r);if(n===t.ViewMode.FULLSCREEN){r.ima3.adsManager.resize(r.el().offsetWidth,r.el().offsetHeight,n)}else{r.ima3.adsManager.resize(s.width,s.height,n)}setTimeout(Zt(r,n,t,3,s.width,s.height),1e3)});r.on("playerresize",()=>{if(r.ima3.adsManager){const e=S(r);r.ima3.adsManager.resize(e.width,e.height,tv.google.ima.ViewMode.NORMAL)}})};const ii={_enableMetadataTextTracks:ei,init:ti};const ni=t=>{const e=["ima3-ads-manager-loaded","ima3-ready","ima3-loaded","ima3-impression","ima3-viewable-impression","ima3-started","ima3-first-quartile","ima3-midpoint","ima3-third-quartile","ima3-skippable-state-changed","ima3-complete","ima3-all-ads-completed","ima3-ad-error","ima3-click","ima3-paused","ima3-resumed","ima3-content-pause-requested","ima3-content-resume-requested","ima3-skip","ima3-user-closed","ima3-linear-changed","ima3-ad-buffering","ima3-ad-metadata","ima3-interaction"];t.ima3.log("[onPluginInit]");t.on("analytics_request",e=>{t.ima3.log("[onPluginInit.player.on] analytics_request: "+e.params.event+" event triggered.")});t.on(e,e=>{t.ima3.log("[onPluginInit.player.on] IMA SDK Event "+e.type+" received.")});t.on("adstart",e=>{t.ima3.log("[onPluginInit.player.on] adstart: Received adstart event.");if(!t.ads.shouldPlayContentBehindAd(t)){t.ima3.log("[onPluginInit.player.on] adstart: Pause player if not LIVE and playing content behind ad.");t.pause()}t.hasStarted(true);t.ima3.currentAdEventInfo={};if(t.ima3.settings.requestmode!=="oncue"&&t.duration()===Infinity){t.trigger({type:"usage",name:"ima3-live-preroll"})}});t.on("adend",()=>{t.ima3.log("[onPluginInit.player.on] adend: Received adend event.");if(t.duration()===Infinity){t.trigger("playing")}})};const si=e=>{if(e.ima3&&e.ima3.adsManager&&e.ima3.adsManager.skip){e.ima3.adsManager.skip()}e.ima3.log("[postrollAdtimeoutHandler] Call util.destroyAdsManager.");k.destroyAdsManager(e);e.trigger("ad-hard-timeout");e.ima3.log("ima3-hard-timeout")};const ri=(e,t)=>{const i=e.AdError.ErrorCode;for(const n in i){if(i.hasOwnProperty(n)){if(!n.match("COMPANION|NONLINEAR|OVERLAY")&&t.getErrorCode()===i[n]&&t.getType()==="adLoadError"){return true}}}return false};const ai=e=>{const t=e.ima3.adsManager;if(k.isVast(t)){e.ima3.log("[hardTimeout] Call util.destroyAdsManager for VAST ads.");k.destroyAdsManager(e);e.trigger("ad-hard-timeout");e.ima3.log("ima3-hard-timeout")}else if(k.isVmap(t)&&k.includesPreroll(t)){e.ima3.log("[hardTimeout] Call adsManager.discardAdBreak for VMAP.");e.ima3.adsManager.discardAdBreak();e.trigger("ad-hard-timeout");e.ima3.log("ima3-hard-timeout")}};const O=e=>{if(e.ima3.adDisplayContainer&&!e.ima3.adDisplayContainer.initialized){e.ima3.log("[initializeAdDisplayContainer] Call adDisplayContainer.initialize().");e.ima3.adDisplayContainer.initialize();e.ima3.adDisplayContainer.initialized=true}};const oi=t=>{const e=tv.google.ima;const i=k.getPlayerDimensions(t);t.ima3.log("[startAdsManager]");try{if(t.muted()){t.ima3.adsManager.setVolume(0)}O(t);t.trigger("ads-load");t.ima3.log("[startAdsManager] trigger ads-load.");t.ima3.log("[startAdsManager] Call AdsManager.init().");t.ima3.adsManager.init(i.width,i.height,e.ViewMode.NORMAL);t.ima3.log("[startAdsManager] Call AdsManager.start().");t.ima3.adsManager.start()}catch(e){t.ima3.log("[startAdsManager] adError caught, trigger adserror.");t.ima3.log.warn("Error starting ads manager",e);t.trigger("adserror")}};const li=e=>{e.ima3.adsManager.discardAdBreak();e.ima3.adsManager.skip();e.ima3.managerCleanup=null;if(e.ads.inAdBreak()){e.ads.endLinearAdMode()}};const di=(e,t,i,n,s)=>{e.ima3.log("[handleContentChanged]");setTimeout(()=>{i=e.currentSrc();e.ima3.log("[handleContentChanged] Call util.destroyAdsManager on contentchanged event.");k.destroyAdsManager(e);e.ima3._checkedForAdManagerStart=false;e.ima3.lastSrc_=e.ima3.currentSrc_;e.ima3.currentSrc_=e.currentSrc();if(k.isEconomicsFree(e)){e.trigger("adscanceled");e.trigger("nopreroll");e.trigger("nopostroll");return}if(t.requestMode==="ondemand"){j.initSource(e);return}if(i&&i!==""&&t.requestMode!=="ondemand"&&!k.usingLiveAdCuepoints(t)){if(k.usingMediaCuepoints(t)){e.ima3.log("[handleContentChanged] Call mediaCuePoints.createMediaCuepointVmap to check current video cue point data and refresh ad VMAP");n.vmap=R(e)}e.ima3.log(`[handleContentChanged] ${n.vmap?"Call adRequest.requestAds":"No adRequestData.vmap data available, making adRequest.requestAds call"} with adRequestData.vmap =`,n.vmap);s.requestAds(e,null,n.vmap)}},0)};const ui=(e,t,i)=>{e.ima3.log("[handleMediaCuepoints]");if(e.ima3._loadstartSeen&&e.ima3.settings.serverUrl&&e.mediainfo){e.ima3.log("[handleMediaCuepoints] Call createMediaCuepointVmap to set adRequestData.vmap if loadstart was previously seen.");i.vmap=R(e)}else{e.ima3.oneUnlessContentUpdate_("loadstart",()=>{e.ima3.log("[handleMediaCuepoints.oneUnlessContentUpdate.player.on] loadstart: Received loadstart event.");setTimeout(()=>{if(!e.ima3.settings.serverUrl){e.ima3.log.error("[handleMediaCuepoints.oneUnlessContentUpdate_] IMA3 serverUrl isnt provided.")}else{e.ima3.log("[handleMediaCuepoints.oneUnlessContentUpdate_] Call createMediaCuepointVmap to set adRequestData.vmap.");i.vmap=R(e)}},0)})}};const ci=(e,t,i)=>{e.ima3.log("[handleWaitForLoadstart]");if(t.requestMode!=="ondemand"&&!k.usingLiveAdCuepoints(t)){const n=()=>{if(e.mediainfo&&e.mediainfo.economics==="FREE"){e.trigger("adscanceled");e.trigger("nopreroll");e.trigger("nopostroll")}else{e.ima3.log("[handleWaitForLoadstart] Call adsRequest.requestAds with adRequestData.vmap after loadstart.");A.requestAds(e,null,i.vmap)}};if(e.ima3._loadstartSeen){e.ima3.log("[handleWaitForLoadstart] Call afterLoadStart if loadstart was seen.");n()}else{e.one("loadstart",()=>{e.ima3.log("[handleWaitForLoadstart.player.on] loadstart: Received loadstart event.");setTimeout(()=>{e.ima3.log("[handleWaitForLoadstart.setTimeout] Call afterLoadStart on loadstart event.");n()},0)})}}};const hi=(e,t)=>{if(t.ima3SdkSettings){for(const i in t.ima3SdkSettings){const n="set"+i.charAt(0).toUpperCase()+i.slice(1);if(typeof e.settings[n]==="function"){e.settings[n](t.ima3SdkSettings[i])}else{c["default"].log.warn('Invalid ima3SdkSetting: "'+i+'"')}}}};const fi=(e,t,i)=>{const n=tv.google.ima;const s={};e.trigger({type:"ima3-ready",imaSdk:t.requestMode==="ondemand"?n:null});e.ima3.log("[onSdkLoad]");Jt(e.ima3);hi(n,t);if(t.vpaidMode){if(typeof n.ImaSdkSettings.VpaidMode[t.vpaidMode]==="number"){n.settings.setVpaidMode(n.ImaSdkSettings.VpaidMode[t.vpaidMode])}else{throw new Error('Invalid VPAID Mode: "'+t.vpaidMode+'"')}}const r=e.el().querySelector(".vjs-tech");e.ima3.log("[onSdkLoad] Create ima.adDisplayContainer.");e.ima3.adDisplayContainer=new n.AdDisplayContainer(i,r,t.clickTrackingElement);e.ima3.adDisplayContainer.initialized=false;let a="click";if(c["default"].browser.IS_IOS||c["default"].browser.IS_ANDROID){a="touchend"}e.one(a,()=>{O(e)});e.ima3.log("[onSdkLoad] Create ima.AdsLoader.");e.ima3.adsLoader=new n.AdsLoader(e.ima3.adDisplayContainer);if(e.ima3.adsLoader){const u=e.ima3.adsLoader.getVersion();e.ima3.log("[onSdkLoad] IMA SDK Version: "+u)}const o=e.ima3.adsLoader.getSettings();o.setPlayerVersion(e.ima3.version);o.setPlayerType("brightcove/player-html5");e.ima3.loaderCleanup=Yt(e.ima3.adsLoader,e);const l=e.currentSrc();if(k.usingMediaCuepoints(t)){ui(e,t,s)}ci(e,t,s);e.ima3.currentSrc_=e.currentSrc();e.on("dispose",()=>{e.ima3.log("[onSdkLoad.player.on] dispose: Call destroyAdsManager.");k.destroyAdsManager(e);c["default"]._ima3sawDispose=true});e.on("contentchanged",()=>{e.ima3.log("[onSdkLoad.player.on] contentchanged: Call handleContentChanged.");di(e,t,l,s,A)});const d=()=>{si(e)};e.on("contentended",()=>{e.ima3.log("[onSdkLoad.player.on] contentended: Call adsLoader.contentComplete.");e.one("adtimeout",d);e.ima3.adsLoader.contentComplete()});e.on("contentupdate",()=>{e.off("adtimeout",d);e.ima3.log("[onSdkLoad.player.on] contentupdate: Call adsLoader.contentComplete.");e.ima3.adsLoader.contentComplete()});e.on(["contentupdate","adend","ima3-ready"],()=>{if(typeof e.ads.ad.reset==="function"){e.ads.ad.reset()}else{e.ads.ad={}}if(typeof e.ads.pod.reset==="function"){e.ads.pod.reset()}else{e.ads.pod={}}});e.ima3.el=i};const pi=()=>{if(c["default"].use&&!c["default"]._imaMiddlewareSetup){c["default"].log.debug("Setting up IMA middleware");c["default"].use("*",n=>{return{setSource:(e,t)=>{if(n&&n.ads&&typeof n.ads.inAdBreak==="function"&&n.ads.inAdBreak()){n.ima3.adsManager.discardAdBreak();n.ads.disableNextSnapshotRestore=true;n.ads.endLinearAdMode();n.trigger("contentresumed");const i=n.play();if(i&&i.catch){i.catch(()=>{})}}t(null,e)}}});c["default"]._imaMiddlewareSetup=true}};const mi=e=>{const t=e.ima3.adsManager.getCuePoints();const i=t&&t.length>0;const n=e.ima3.adsRequest&&e.ima3.adsRequest.adsResponse?true:false;return k.usingMediaCuepoints(e.ima3.settings)&&i&&!n};const gi=(e,t)=>{e.ima3.log("[onAdsManagerLoaded]");if(e.ima3.managerCleanup){e.ima3.log("[onAdsManagerLoaded] Call destroyAdsManager.");k.destroyAdsManager(e)}const i={currentTime:e.currentTime(),duration:e.duration()};e.on("timeupdate",()=>{i.currentTime=e.currentTime()});const n=t.originalEvent.getAdsManager(i,e.ima3.adsRenderingSettings_);e.ima3.adsManager=n;e.trigger("ads-response-received");const s=e.ima3.settings;if(mi(e)){li(e);e.ima3.log.error("Cancelling VMAP ad because the"+"ad server cannot return a vmap when using cuepoints");return}e.ima3.managerCleanup=Yt(n,e);if(s.requestMode==="ondemand"||s.requestMode==="oncue"){e.ima3.log("[onAdsManagerLoaded] Call startAdsManager if requestMode equals ondemand or oncue.");oi(e)}else{e.trigger("adsready")}if(s.requestMode!=="oncue"){if(!k.includesPreroll(n)){e.trigger("nopreroll")}if(!k.includesPostroll(n)){e.trigger("nopostroll")}}};const vi=(e,t)=>{e.ima3.log("[onContentPauseRequested]");if(t.requestMode!=="ondemand"&&!k.usingLiveAdCuepoints(t)){e.ima3.log("[onContentPauseRequested] Call startLinearAdMode if requestmode not ondemand or not usingLiveAdCuepoints.");e.ads.startLinearAdMode()}if(c["default"]._ima3sawDispose&&!c["default"]._ima3adAfterDispose){e.trigger({type:"usage",name:"ima3-ad-after-dispose"});c["default"]._ima3adAfterDispose=true}};const yi=e=>{e.ima3.log("[onContentResumeRequested]");if(e.ads.inAdBreak()){e.ima3.log("[onContentResumeRequested] Call endLinearAdMode if inAdBreak.");e.ads.endLinearAdMode();e.removeClass("ima3-ad-loading");e.removeClass("vjs-vpaid-playing");e.trigger("ads-pod-ended")}else{e.ima3.log("[onContentResumeRequested] Call skipLinearAdMode if not inAdBreak.");e.ads.skipLinearAdMode()}};const bi=e=>{const t=e.getAdPodInfo();return{id:e.getAdId(),adPodInfo:{adPosition:t.getAdPosition(),isBumper:t.getIsBumper(),maxDuration:t.getMaxDuration(),podIndex:t.getPodIndex(),timeOffset:t.getTimeOffset(),totalAds:t.getTotalAds()},adSystem:e.getAdSystem(),advertiserName:e.getAdvertiserName(),apiFramework:e.getApiFramework(),contentType:e.getContentType(),creativeAdId:e.getCreativeAdId(),creativeId:e.getCreativeId(),dealId:e.getDealId(),description:e.getDescription(),duration:e.getDuration(),height:e.getHeight(),width:e.getWidth(),isLinear:e.isLinear(),mediaUrl:e.getMediaUrl(),minSuggestedDuration:e.getMinSuggestedDuration(),skippable:e.isSkippable(),skipTimeOffSet:e.getSkipTimeOffset(),surveyUrl:e.getSurveyUrl(),title:e.getTitle(),universalAdIdRegistry:e.getUniversalAdIdRegistry(),universalAdIds:e.getUniversalAdIds().map(e=>{return{universalAdRegistry:e.getAdIdRegistry(),universalAdIdValue:e.getAdIdValue()}}),universalAdIdValue:e.getUniversalAdIdValue(),vastMediaBitrate:e.getVastMediaBitrate(),vastMediaHeight:e.getVastMediaHeight(),vastMediaWidth:e.getVastMediaWidth(),wrapperAdIds:e.getWrapperAdIds(),wrapperAdSystems:e.getWrapperAdSystems(),wrapperCreativeIds:e.getWrapperCreativeIds()}};const _i=e=>{let t="Non-fatal error occurred";if(e){const i=e.getErrorCode();const n=e.getMessage();if(i){t+=": AdError "+i}if(n){t+=": "+n}}return t};const Ti=(n,t)=>{const i=iv.createElement("div");i.className="vjs-ima3-ad-container";n.ima3.insertAdContainer(i);n.ima3.adrequest=e=>{j.onDemandAdRequest(e||t.serverUrl,n)};n.on("ima3-content-pause-requested",e=>{n.ima3.log("[onPlayerReady.player.on] ima3-content-pause-requested: Received ON_CONTENT_PAUSE_REQUESTED event.");vi(n,t)});n.on("ima3-content-resume-requested",e=>{n.ima3.log("[onPlayerReady.player.on] ima3-content-resume-requested: Received ON_CONTENT_RESUME_REQUESTED event.");yi(n)});ii.init(n);n.on("ima3-started",e=>{n.ima3.log("[onPlayerReady.player.on] ima3-started: Received STARTED event indicating ad has initiated playback.");n.removeClass("ima3-ad-loading");n.ima3.log("ima3-started")});n.on("ima3-log",e=>{const t=e.originalEvent.getAdData().adError;n.ima3.log("ima3-log:",_i(t))});n.on("ima3-ad-error",e=>{n.ima3.log("[onPlayerReady.player.on] ima3-ad-error: Received AD_ERROR event.");let t={};let i;if(e.originalEvent){t=e.originalEvent.getError();i=t.getErrorCode();n.ima3.log("ima3-ad-error",t.toString());if(ri(tv.google.ima,t)&&n.ima3.settings.requestMode==="onload"||n.ima3.settings.requestMode==="onplay"){n.trigger("nopostroll")}}n.removeClass("ima3-ad-loading");n.trigger({type:"adserror",errorCode:i})});n.on("ima3-all-ads-completed",()=>{if(!n.ended()){n.ima3.log("[onPlayerReady.player.on] ima3-all-ads-completed: Ads completed before postroll");n.trigger("nopostroll")}});if(t.hardTimeouts){n.on("adtimeout",()=>{n.ima3.log("[onPlayerReady.player.on] adtimeout: Received adtimeout event");if(n.ima3.adsManager){ai(n)}else{const t=()=>{ai(n)};n.one("ima3-ads-manager-loaded",t);n.one(["adstart","contentupdate","dispose"],e=>{n.off("ima3-ads-manager-loaded",t)})}})}n.on("ima3-loaded",e=>{n.ima3.log("[onPlayerReady.player.on] ima3-loaded: Received LOADED event indicating ad has loaded.");const t=e.originalEvent.getAd();n.ima3.log("[onPlayerReady.player.on] ima3-loaded: Ad",bi(t));n.trigger("ads-loading");n.removeClass("ima3-ad-loading");if(t&&!t.isLinear()){n.addClass("vjs-ima3-overlay");n.ima3.log("[onPlayerReady.player.on] ima3-sdk-loaded: Call startLinearAdMode.");n.ads.startLinearAdMode();n.ima3.log("[onPlayerReady.player.on] imad-sdk-loaded: Call endLinearAdMode.");n.ads.endLinearAdMode()}});n.on("ima3-complete",e=>{n.ima3.log("[onPlayerReady.player.on] ima3-complete: Received COMPLETED event.");const t=e.originalEvent.getAd();n.ima3.log("ima3-complete");delete n.ima3.currentAd;if(t){if(!t.isLinear()){n.removeClass("vjs-ima3-overlay")}else{n.addClass("ima3-ad-loading")}}});n.on(["readyforpreroll","playing"],e=>{n.ima3.log("[onPlayerReady.player.on] "+e.type+": Received "+e.type+" event");if(c["default"].browser.IS_ANY_SAFARI&&typeof n.autoplay()==="string"&&e.type==="playing"&&!n.ima3._checkedForAdManagerStart&&!n.ima3.adsManager){return}if(n.ima3._checkedForAdManagerStart){return}n.ima3._checkedForAdManagerStart=true;if(n.ima3.adsManager&&!k.usingLiveAdCuepoints(t)&&t.requestMode!=="ondemand"&&!k.isEconomicsFree(n)){n.ima3.log("[onPlayerReady.player.on] "+e.type+": Call startAdsManager for onload or onplay requestmodes.");oi(n)}});n.on("adserror",()=>{n.ima3.log("[onPlayerReady.player.on] adserror: Received ADS_ERROR event.");n.ima3.log("[onPlayerReady.player.on] adserror: Call destroyAdsManager");k.destroyAdsManager(n)});n.on("adscanceled",()=>{n.ima3.log("[onPlayerReady.player.on] adscanceled: Received ADS_CANCELED event.");n.ima3.log("[onPlayerReady.player.on] adscanceled: Call destroyAdsManager.");k.destroyAdsManager(n)});n.on("ima3-ads-manager-loaded",e=>{n.ima3.log("[onPlayerReady.player.on] ima-ads-manager-loaded: Received LOADED event.");gi(n,e)});pi();if(tv.google&&tv.google.ima){fi(n,t,i)}else{k.loadScript(t.sdkurl,e=>{if(e){n.trigger("nopreroll");n.trigger("nopostroll");return n.trigger({type:"adserror",error:e})}fi(n,t,i)})}};const Si={_isAdLoadError:ri,_initializeAdDisplayContainer:O,_cancelVmapAd:li,_applyGlobalSettings:hi,_shouldCancelVmap:mi,_onContentPauseRequested:vi,_onContentResumeRequested:yi,_getMessageForAdError:_i,onPluginInit:ni,onPlayerReady:Ti,createMediaCuepointVmap:R};const P=/^(file|data):/.test(tv.location.protocol)?"http:":tv.location.protocol;const Ei={sdkurl:`${P}//imasdk.googleapis.com/js/sdkloader/ima3.js`,serverUrl:`${P}//pubads.g.doubleclick.net/gampad/ads?sz=400x300&iu=%2F6062%2Fiab_vast_samples&ciu_szs=300x250%2C728x90&gdfp_req=1&env=vp&output=xml_vast2&unviewed_position_start=1&url=[referrer_url]&correlator=[timestamp]&cust_params=iab_vast_samples%3Dlinear`,timeout:4e3,requestMode:"onload",hardTimeouts:true,showVpaidControls:false,debug:false};const wi=(e,t={})=>{const i=E({},Ei,t);e.ima3.defaults=Ei;if(t.useMediaCuePoints&&t.requestMode!=="oncue"){throw new Error(`useMediaCuePoints must be used with requestMode "oncue" rather than the currently set ${t.requestMode}`)}if(i.requestMode==="onplay"&&e.autoplay()){i.requestMode="onload"}if(i.timeout){i.prerollTimeout=i.postrollTimeout=i.timeout}if(i.contribAdsPrerollTimeout){i.prerollTimeout=i.contribAdsPrerollTimeout}if(i.contribAdsPostrollTimeout){i.postrollTimeout=i.contribAdsPostrollTimeout}if(typeof e.debug==="function"&&e.debug()){i.debug=true}if(i.debug&&!t.hasOwnProperty("sdkurl")){i.sdkurl=`${P}//imasdk.googleapis.com/js/sdkloader/ima3_debug.js`}i.liveCuePoints=i.requestMode==="oncue";return i};c["default"].ima3={extend:E};const Ii=e=>{e.ima3._loadstartSeen=false;e.ima3._playSeen=false;e.ima3._adsErrorSeen=false;e.ima3._autoplayResultEvent=undefined;if(e.ima3._requestAdsOnPlay!==undefined){e.off("play",e.ima3._requestAdsOnPlay)}};const L=function(e){const t=wi(this,e);const r=this.getChild("ControlBar");const a=r&&r.getChild("PlaybackRateMenuButton");const o=a&&a.hasClass("vjs-hidden");let l;if(e&&e.hasOwnProperty("asyncAutoplaySupport")){c["default"].log.warn("Brightcove IMA3: The asyncAutoplaySupport option no longer has any effect. We recommend removing it.")}if(this.autoplay()!==false){t.allowVjsAutoplay=true;this.addClass("vjs-ima3-not-playing-yet");this.any(["autoplay-success","autoplay-failure"],e=>{if(e.type==="autoplay-success"&&!this.ima3._adsErrorSeen){this.pause()}this.removeClass("vjs-ima3-not-playing-yet");this.ima3._autoplayResultEvent=e});if(!c["default"].browser.IS_IOS&&!c["default"].browser.IS_ANDROID){this.addClass("vjs-ima3-autoplay")}}if(!t.showVpaidControls){this.addClass("vjs-vpaid-controls-disabled")}this.addClass("vjs-ad-controls");this.on("ima3-content-pause-requested",e=>{this.addClass("ima3-ad-loading");this.trigger("ads-pod-started");if(e.originalEvent.getAd().getContentType()==="application/javascript"){this.addClass("vjs-vpaid-playing")}});this.on("ima3-skipped",()=>{this.ads.ad.skipped=1});this.on("ima3-click",()=>{this.ads.ad.interaction=1});this.on(["ima3-complete","ima3-ad-error","ima3-content-resume-requested"],e=>{const t=r.getChild("ProgressControl");const i=t.getChild("SeekBar");const n=i.getChild("PlayProgressBar");r.removeClass("vjs-ad-control-bar");if(!n.hasClass("vjs-play-progress-resetting")){n.addClass("vjs-play-progress-resetting")}n.el().style.width="0";if(c["default"].browser.IS_IOS){if(a&&!o){a.show()}this.one("contentplayback",()=>{this.one("playing",()=>{if(l){this.playbackRate(l)}})})}});this.on(["ima3-complete","ima3-ad-error","ima3-content-resume-requested","adend"],()=>{const e=this.ima3.el;e.style.removeProperty("pointer-events")});this.on("ads-request",function(){const e=Date.now();this.one("ima3-ads-manager-loaded",function(){this.ads.pod.request_ms=Date.now()-e})});this.on("ima3-loaded",e=>{const t=Date.now();this.one("ima3-started",()=>{const e=Date.now();this.ads.ad.start_ms=e-t})});this.on("ima3-started",e=>{const t=r.getChild("ProgressControl");const i=t.getChild("SeekBar");const n=i.getChild("PlayProgressBar");n.el().style.width="0";if(!r.hasClass("vjs-ad-control-bar")){r.addClass("vjs-ad-control-bar")}n.removeClass("vjs-play-progress-resetting");if(c["default"].browser.IS_IOS){if(a&&!o){a.hide()}if(this.playbackRate()!==1){l=this.playbackRate()}this.playbackRate(1)}this.ima3.currentAd=e.originalEvent.getAd();this.ads.ad.skipped=0;this.ads.ad.interaction=0;if(this.ima3.currentAd.isSkippable()){const s=this.ima3.el;s.style.setProperty("pointer-events","auto")}});this.on(["adstart","adend"],e=>{const{pod:t}=this.ads;const{adTagUrl:i}=this.ima3.adsRequest||{};if(typeof i==="string"){let e="";try{e=new URL(i).host}catch(e){this.ima3.log.error(e)}k.assignIfTruthy(t,"host",e)}k.assignIfTruthy(t,"request_mode",this.ima3.settings&&this.ima3.settings.requestMode);if(a&&!o){if(e.type==="adstart"){a.hide()}else{a.show()}}});this.on("ima3-ad-progress",()=>{this.trigger("timeupdate")});this.on("adserror",()=>{this.ima3._adsErrorSeen=true});this.on(["dispose","contentchanged"],()=>{Ii(this)});this.on("loadstart",()=>{this.ima3._loadstartSeen=true});this.on("play",()=>{this.ima3._playSeen=true});this.on("contentchanged",()=>{this.pause();this.ads.settings.allowVjsAutoplay=false;this.ima3._contentchangedSeen=true;if(this.playlist&&w(this.playlist.autoadvance_)){this.one("adsready",()=>{this.ima3.log("[onAdsReady.player.on] Autoadvance setting detected, calling play() to initiate playback after BeforePreroll state");this.play()})}});this.on("adtimeout",()=>{if(this.playlist&&w(this.playlist.autoadvance_)){this.one("contentchanged",()=>{this.ima3.log("[onAdsReady.player.on] Autoadvance setting detected, calling play() to initiate playback after ad timeout");this.play()})}});this.ads(t);this.ads.ad=this.adDataStore&&this.adDataStore.adData||{};this.ads.ad.skipped=0;this.ads.ad.interaction=0;this.ads.pod=this.adDataStore&&this.adDataStore.podData||{};this.contribAds6Shim(c["default"].mergeOptions({},t.contribAds6Shim||{}));if(t.requestMode==="oncue"){et.init(this,t)}else if(t.requestMode==="ondemand"){j.initSource(this)}this.ima3=Wt(this,t);Si.onPluginInit(this);this.ready(()=>{const e=c["default"].getTech("Html5");if(e&&e.isSupported()){Si.onPlayerReady(this,t);this.addClass("vjs-ima3-html5")}else{throw new Error("Html5 is not available on this platform.")}},true)};L.version=D;L.VERSION=D;at(L)})})();(function(){if(s.getPlugin("integral")){return}var e=function(){var b=function(e){var a=function(){var s,r=function(){var a=function(e){return"undefined"!==typeof e},e=function(){var e="u";try{a(tv.opera)&&a(tv.opera.buildNumber)?e="o":a(tv.mozInnerScreenY)?e="g":a(tv.chrome)&&a(tv.chrome.csi)?e="c":a(tv.msWriteProfilerMark)&&a(tv.crypto)?e="e":a(tv.attachEvent)||a(tv.msCrypto)?e="i":a(tv.WebKitPoint)&&(e="w")}catch(e){}return e}(),t=function(){var s=function(e){for(var t in e)if(e.hasOwnProperty(t)){var i=e[t];""!==i&&"null"!==i&&"undefined"!==i&&null!==i&&a(i)||delete e[t]}return e},r=function(e){var t={},i,n;for(n in e)e.hasOwnProperty(n)&&(i=e[n],a(t[i])?t[i]+=n:t[i]=n);e={};for(n in t)t.hasOwnProperty(n)&&(i=t[n],e[i]=n);return e};return function(){var e=function(){var t={g:"",q:""};try{t.q=tv.parent.parent.parent.parent.parent.parent.parent.parent.parent.parent.location.href}catch(e){var i=e.message,i=i.substring(i.lastIndexOf("<")+1,i.lastIndexOf(">")),n;if(n=a(i))if(n=!1,a(tv.navigator)&&a(tv.navigator.userAgent)){var s=tv.navigator.userAgent.match(/Firefox\/([\.0-9]+)/);null!==s&&2==s.length&&(s=s[1].split("."),3==parseInt(s[0],10)&&6>=parseInt(s[1],10)&&(3==s.length?13>=parseInt(s[2],10)&&(n=!0):n=!0))}n&&(t.g=i)}return t},t={};try{t.a=encodeURIComponent(top.location.href)}catch(e){}try{t.b=encodeURIComponent(parent.location.href)}catch(e){}if(tv!=top){try{t.c=encodeURIComponent(parent.document.referrer)}catch(e){}try{t.e=encodeURIComponent(tv.document.referrer)}catch(e){}}try{t.d=encodeURIComponent(tv.location.href)}catch(e){}try{var i=e();t.g=encodeURIComponent(i.g);t.q=encodeURIComponent(i.q)}catch(e){}var t=s(t),t=r(t),e=[],n;for(n in t)t.hasOwnProperty(n)&&e.push({key:n,val:t[n]});e.sort(function(e,t){return e.val.length>t.val.length?1:e.val.length3;)r.pop();for(;r.length<4;)r.push(0);for(var a=e.split(".");a.length>4;)a.pop();var o,l,d=0;do{o=parseInt(a[d]),l=parseInt(r[d]),d++}while(d"),delete e.id,delete e.width,delete e.height,e)e[i]&&t.push('');return t.push(""),t.join("")},Silverlight.createObjectEx=function(e){var t=e,i=Silverlight.createObject(t.source,t.parentElement,t.id,t.properties,t.events,t.initParams,t.context);if(null==t.parentElement)return i},Silverlight.buildPromptHTML=function(e){var t="",i=Silverlight.fwlinkRoot,n=e.version;return e.alt?t=e.alt:(n||(n=""),t=(t=(t="Get Microsoft Silverlight").replace("{1}",n)).replace("{2}",i+"161376")),t},Silverlight.getSilverlight=function(e){Silverlight.onGetSilverlight&&Silverlight.onGetSilverlight();var t="",i=String(e).split(".");if(i.length>1){var n=parseInt(i[0]);t=isNaN(n)||n<2?"1.0":i[0]+"."+i[1]}var s="";t.match(/^\d+\056\d+$/)&&(s="&v="+t),Silverlight.followFWLink("149156"+s)},Silverlight.followFWLink=function(e){top.location=Silverlight.fwlinkRoot+String(e)},Silverlight.HtmlAttributeEncode=function(e){var t,i="";if(null==e)return null;for(var n=0;n96&&t<123||t>64&&t<91||t>43&&t<58&&47!=t||95==t?i+=String.fromCharCode(t):i=i+"&#"+t+";";return i},Silverlight.default_error_handler=function(e,t){var i=t.ErrorType,n="\nSilverlight error message \n";n+="ErrorCode: "+t.ErrorCode+"\n",n+="ErrorType: "+i+" \n",n+="Message: "+t.ErrorMessage+" \n","ParserError"==i?(n+="XamlFile: "+t.xamlFile+" \n",n+="Line: "+t.lineNumber+" \n",n+="Position: "+t.charPosition+" \n"):"RuntimeError"==i&&(0!=t.lineNumber&&(n+="Line: "+t.lineNumber+" \n",n+="Position: "+t.charPosition+" \n"),n+="MethodName: "+t.methodName+" \n"),alert(n)},Silverlight.__cleanup=function(){for(var e=Silverlight._silverlightCount-1;e>=0;e--)tv["__slEvent"+e]=null;Silverlight._silverlightCount=0,tv.removeEventListener?tv.removeEventListener("unload",Silverlight.__cleanup,!1):tv.detachEvent("onunload",Silverlight.__cleanup)},Silverlight.__getHandlerName=function(e){var t="";if("string"==typeof e)t=e;else if("function"==typeof e){0==Silverlight._silverlightCount&&(tv.addEventListener?tv.addEventListener("unload",Silverlight.__cleanup,!1):tv.attachEvent("onunload",Silverlight.__cleanup)),t="__slEvent"+Silverlight._silverlightCount++,tv[t]=e}else t=null;return t},Silverlight.onRequiredVersionAvailable=function(){},Silverlight.onRestartRequired=function(){},Silverlight.onUpgradeRequired=function(){},Silverlight.onInstallRequired=function(){},Silverlight.IsVersionAvailableOnError=function(e,t){var i=!1;try{8001!=t.ErrorCode||Silverlight.__installationEventFired?8002!=t.ErrorCode||Silverlight.__installationEventFired?5014==t.ErrorCode||2106==t.ErrorCode?Silverlight.__verifySilverlight2UpgradeSuccess(t.getHost())&&(i=!0):i=!0:(Silverlight.onRestartRequired(),Silverlight.__installationEventFired=!0):(Silverlight.onUpgradeRequired(),Silverlight.__installationEventFired=!0)}catch(e){}return i},Silverlight.IsVersionAvailableOnLoad=function(e){var t=!1;try{Silverlight.__verifySilverlight2UpgradeSuccess(e.getHost())&&(t=!0)}catch(e){}return t},Silverlight.__verifySilverlight2UpgradeSuccess=function(e){var t=!1,i=null;try{e.IsVersionSupported("5.1.20125.99")?(i=Silverlight.onRequiredVersionAvailable,t=!0):i=e.IsVersionSupported("5.1.20125.0")?Silverlight.onRestartRequired:Silverlight.onUpgradeRequired,i&&!Silverlight.__installationEventFired&&(i(),Silverlight.__installationEventFired=!0)}catch(e){}return t},function(o,l,d,e){var s=Object.prototype.hasOwnProperty,u=function(e,t,i){for(var n in e)s.call(e,n)&&t.call(i||this,n,e[n])},c=function(e){var t;return e.match(/^https?:\/\//)||((t=d.createElement(t)).innerHTML='x',e=t.firstChild.href),e},r=function(s,r,a){return function(e,t){var i,n;"loadstart"===r&&(n=s.el_,i=o.getComputedStyle?getComputedStyle(n).width:n.currentStyle.width),a&&console.log(r,i),s.trigger(r)}},a=function(i,e){if(i.tech.el_){for(var t=["loadstart","loadedmetadata","loadeddata","canplay","canplaythrough","play","pause","playing","ended","volumechange","durationchange","progress","emptied","ratechange","seeked","seeking","stalled","suspend","waiting","abort","ended"],n=0;n-1;if(void 0===e)return i;e&&i||!e&&!i||(e?this.enabledRepresentationIds.push(n.id):this.enabledRepresentationIds.splice(this.enabledRepresentationIds.indexOf(n.id),1),this.el_.Content.Player.setRepresentations(JSON.stringify(this.enabledRepresentationIds),void 0===t||t))}.bind(this),n}.bind(this))},f.prototype.load=function(){this.el_.Content.Player.load()},f.prototype.unload=function(){this.el_.Content.Player.unload()},f.prototype.poster=function(){return null},f.prototype.setPoster=function(){},f.prototype.buffered=function(){return l.createTimeRange(0,this.el_.Content.Player.buffered)},f.prototype.supportsFullScreen=function(){return!1},f.prototype.onlog=function(e,t){2==t.Type?l.log.warn(t.Message):4==t.Type&&l.log.error(t.Message)},f.minVersion="5.0.0.0",f.isSupported=function(){var e,t=f.browserChecks;for(e=0;eGet Microsoft Silverlight"},i),t&&u(t,function(e,t){void 0!==t&&(n+=e+"="+t+",")}),n=n.slice(0,-1),Silverlight.createObject(e,null,t.id,i,{onError:h,onLoad:a},n,t.id)}}(tv,tv.videojs,iv);var l=function(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(var i=new DataView(e),n=new DataView(t),s=0;s=400&&t.statusCode<=599){var n=i;return r&&(n=String.fromCharCode.apply(null,new Uint8Array(i))),void s({cause:n})}s(null,i)}}});var a=function(e,t,i,n){var s=function(e){var t=String.fromCharCode.apply(null,new Uint16Array(e)),i=(new c.DOMParser).parseFromString(t,"application/xml"),n=i.getElementsByTagName("HttpHeaders")[0],s={};if(n)for(var r=n.getElementsByTagName("name"),a=n.getElementsByTagName("value"),o=0;o=400){var s=n.getElementsByTagName("Error"),r="License call failed with status code "+t.statusCode+".";if(s.length>0){var a=n.getElementsByTagName("Message");a.length>0&&(r+=" "+a[0].childNodes[0].nodeValue)}return u(r)}var o="",l=n.getElementsByTagName("ckc");l.length>0&&(o=l[0].childNodes[0].nodeValue);var d=k(o);u(null,d)}}(n);h.xhr({uri:s,method:"POST",body:"spc="+r,headers:{"Content-type":"application/x-www-form-urlencoded"}},a)}}}},castlabs:{"com.apple.fps.1_0":{overrideOptions:{getCertificate:function(e,t){var i=function(n){return function(e,t,i){return e?n(e):n(null,new Uint8Array(i))}}(t),n=e.keySystems["com.apple.fps.1_0"],s=n.vendor.options;h.xhr({uri:n.certificateUri||"https://lic.drmtoday.com/license-server-fairplay/cert/",method:"GET",responseType:"arraybuffer",headers:{"x-dt-auth-token":s.authToken,"x-dt-custom-data":x(s),Pragma:"Cache-Control: no-cache","Cache-Control":"max-age=0"}},h.xhr.httpHandler(i))},getContentId:function(e,t){var i,n=t.buffer?t.buffer:t,s=(i=n,String.fromCharCode.apply(null,new Uint16Array(i))),r=s.indexOf("skd://drmtoday?");return r>-1?s.substring(r+"skd://drmtoday?".length).replace(/assetid/gi,"assetId").replace(/variantid/gi,"variantId"):""},getLicense:function(e,t,i,n){var s=function(s){return h.xhr.httpHandler(function(e,t){if(e)return s(e);var i=t.trim();""===i.substr(0,5)&&""===i.substr(-6)&&(i=i.slice(5,-6));var n=k(i);s(null,n)})}(n),r=encodeURIComponent(function(e){for(var t,i,n,s,r,a,o,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d="",u=0;u>2,r=(3&t)<<4|(i=u>4,a=(15&i)<<2|(n=u>6,o=63&n,isNaN(i)?a=o=64:isNaN(n)&&(o=64),d+=l.charAt(s)+l.charAt(r)+l.charAt(a)+l.charAt(o);return d}(i)),a=e.keySystems["com.apple.fps.1_0"],o=a.vendor.options;h.xhr({uri:a.licenseUri||"https://lic.drmtoday.com/license-server-fairplay/",method:"POST",responseType:"text",body:"spc="+r+"&"+t,headers:{"x-dt-auth-token":o.authToken,"x-dt-custom-data":x(o),"Content-type":"application/x-www-form-urlencoded"}},s)}}},"com.widevine.alpha":{overrideOptions:{getLicense:function(e,t,s){var i=e.keySystems["com.widevine.alpha"],n=i.vendor.options;h.xhr({uri:i.licenseUri||"https://lic.drmtoday.com/license-proxy-widevine/cenc/",method:"POST",responseType:"json",body:new Uint8Array(t),headers:{"x-dt-auth-token":n.authToken,"x-dt-custom-data":x(n)}},h.xhr.httpHandler(function(e,t,i){if(e)s(e);else{var n=k(i.license);s(null,n)}}))}}},"com.microsoft.playready":{overrideOptions:{getLicense:function(e,t,n){var i=e.keySystems["com.microsoft.playready"],s=i.vendor.options,r=function(e,t){void 0===t&&(t=C);var i={"Content-Type":"text/xml; charset="+t},n=e,s=j(e,t).querySelector("PlayReadyKeyMessage");if(!s)return{headers:i,body:n};for(var r=s.querySelectorAll("name"),a=s.querySelectorAll("value"),o=0;ot[0]||i[0]===t[0]&&i[1]>t[1]||i[0]===t[0]&&i[1]===t[1]&&i[2]>t[2]){a.parentNode.removeChild(a);a=null;h=c.firstChild}})()}if(!a){a=f(t,h);a.className=r;a.setAttribute("data-vjs-version",o.videojs.VERSION)}h=a.nextSibling}if(typeof i!=="undefined"){s=document.querySelector("."+n);if(!s){s=f(i,h);s.className=n}}function v(){var e=[].concat(Array.prototype.slice.call(document.querySelectorAll("video")),Array.prototype.slice.call(document.querySelectorAll("video-js")));for(u=0;u