From ca0e48bf5389cce1e4c38bcd4df4645c503798eb Mon Sep 17 00:00:00 2001 From: jboix Date: Tue, 20 Aug 2024 08:13:40 +0000 Subject: [PATCH] =?UTF-8?q?Deploy=20preview=20for=20PR=2031=20=F0=9F=9B=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pr-preview/pr-31/index.html | 78 +++++++ .../assets/index--PUeqkF2.css | 1 + .../assets/index-iZY42qqK.js | 220 ++++++++++++++++++ .../packages/pillarbox-playlist/index.html | 26 +++ .../skip-button/assets/index-9QwUlAKx.css | 1 + .../skip-button/assets/index-CihQ5nO6.js | 220 ++++++++++++++++++ .../pr-31/packages/skip-button/index.html | 26 +++ 7 files changed, 572 insertions(+) create mode 100644 pr-preview/pr-31/index.html create mode 100644 pr-preview/pr-31/packages/pillarbox-playlist/assets/index--PUeqkF2.css create mode 100644 pr-preview/pr-31/packages/pillarbox-playlist/assets/index-iZY42qqK.js create mode 100644 pr-preview/pr-31/packages/pillarbox-playlist/index.html create mode 100644 pr-preview/pr-31/packages/skip-button/assets/index-9QwUlAKx.css create mode 100644 pr-preview/pr-31/packages/skip-button/assets/index-CihQ5nO6.js create mode 100644 pr-preview/pr-31/packages/skip-button/index.html diff --git a/pr-preview/pr-31/index.html b/pr-preview/pr-31/index.html new file mode 100644 index 0000000..03638c5 --- /dev/null +++ b/pr-preview/pr-31/index.html @@ -0,0 +1,78 @@ + + + + Package Showcase + + + + +
+

Pillarbox Extensions

+
+ + + diff --git a/pr-preview/pr-31/packages/pillarbox-playlist/assets/index--PUeqkF2.css b/pr-preview/pr-31/packages/pillarbox-playlist/assets/index--PUeqkF2.css new file mode 100644 index 0000000..811deb8 --- /dev/null +++ b/pr-preview/pr-31/packages/pillarbox-playlist/assets/index--PUeqkF2.css @@ -0,0 +1 @@ +.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-svg-icon:hover,.vjs-control:focus .vjs-svg-icon{filter:drop-shadow(0 0 .25em #fff)}.vjs-modal-dialog .vjs-modal-dialog-content,.video-js .vjs-modal-dialog,.pillarbox-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-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}.vjs-icon-play,.video-js .vjs-play-control .vjs-icon-placeholder,.pillarbox-js .vjs-play-control .vjs-icon-placeholder,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control .vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{content:""}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:""}.vjs-icon-pause,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.pillarbox-js .vjs-play-control.vjs-playing .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pause:before,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mute,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mute:before,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-low,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-low:before,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mid,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mid:before,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-high,.video-js .vjs-mute-control .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-high:before,.video-js .vjs-mute-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-enter,.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-enter:before,.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-exit,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-fullscreen.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-exit:before,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-fullscreen.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:""}.vjs-icon-subtitles,.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js .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-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.pillarbox-js .vjs-subtitles-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-subtitles:before,.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js .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-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-subtitles-button .vjs-icon-placeholder:before{content:""}.vjs-icon-captions,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-captions-button .vjs-icon-placeholder,.pillarbox-js .vjs-captions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-captions:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-captions-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-captions-button .vjs-icon-placeholder:before{content:""}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:""}.vjs-icon-chapters,.video-js .vjs-chapters-button .vjs-icon-placeholder,.pillarbox-js .vjs-chapters-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-chapters-button .vjs-icon-placeholder:before{content:""}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:""}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:""}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:""}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:""}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:""}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:""}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:""}.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder,.video-js .vjs-volume-level,.pillarbox-js .vjs-volume-level,.video-js .vjs-play-progress,.pillarbox-js .vjs-play-progress{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before,.video-js .vjs-volume-level:before,.pillarbox-js .vjs-volume-level:before,.video-js .vjs-play-progress:before,.pillarbox-js .vjs-play-progress:before{content:""}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:""}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:""}.vjs-icon-cancel,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.pillarbox-js .vjs-control.vjs-close-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cancel:before,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before{content:""}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:""}.vjs-icon-replay,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.pillarbox-js .vjs-play-control.vjs-ended .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay:before,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-5,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-5:before,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-10,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-10:before,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-30,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-30:before,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-5,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-5:before,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-10,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-10:before,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-30,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-30:before,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-audio,.video-js .vjs-audio-button .vjs-icon-placeholder,.pillarbox-js .vjs-audio-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio:before,.video-js .vjs-audio-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-audio-button .vjs-icon-placeholder:before{content:""}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:""}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:""}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:""}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:""}.vjs-icon-picture-in-picture-enter,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-enter:before,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-picture-in-picture-exit,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-picture-in-picture.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-exit:before,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-picture-in-picture.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:""}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:""}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:""}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:""}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:""}.vjs-icon-audio-description,.video-js .vjs-descriptions-button .vjs-icon-placeholder,.pillarbox-js .vjs-descriptions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio-description:before,.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-descriptions-button .vjs-icon-placeholder:before{content:""}.video-js,.pillarbox-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,.pillarbox-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen,.pillarbox-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"],[tabindex="-1"].pillarbox-js{outline:none}.video-js *,.pillarbox-js *,.video-js *:before,.pillarbox-js *:before,.video-js *:after,.pillarbox-js *:after{box-sizing:inherit}.video-js ul,.pillarbox-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-fluid,.vjs-fluid.pillarbox-js,.video-js.vjs-16-9,.vjs-16-9.pillarbox-js,.video-js.vjs-4-3,.vjs-4-3.pillarbox-js,.video-js.vjs-9-16,.vjs-9-16.pillarbox-js,.video-js.vjs-1-1,.vjs-1-1.pillarbox-js{width:100%;max-width:100%}.video-js.vjs-fluid:not(.vjs-audio-only-mode),.vjs-fluid.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.vjs-16-9.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.vjs-4-3.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.vjs-9-16.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-1-1:not(.vjs-audio-only-mode),.vjs-1-1.pillarbox-js:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode),.vjs-16-9.pillarbox-js:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode),.vjs-4-3.pillarbox-js:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode),.vjs-9-16.pillarbox-js:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.vjs-1-1.pillarbox-js:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode),.vjs-fill.pillarbox-js:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech,.pillarbox-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech,.vjs-audio-only-mode.pillarbox-js .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,.vjs-full-window .vjs-fullscreen.pillarbox-js,body.vjs-pip-window .video-js,body.vjs-pip-window .pillarbox-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),.vjs-fullscreen.pillarbox-js:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js,body.vjs-pip-window .pillarbox-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive,.vjs-fullscreen.vjs-user-inactive.pillarbox-js{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:#000000b3;padding:.5em;text-align:center;width:100%}.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text,.vjs-layout-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,.pillarbox-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,.pillarbox-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:#2b333fb3;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:hover .vjs-big-play-button,.pillarbox-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus,.pillarbox-js .vjs-big-play-button:focus{border-color:#fff;background-color:#73859f;background-color:#73859f80;transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button,.vjs-error .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button,.pillarbox-js button{background:none;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,.pillarbox-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog,.pillarbox-js .vjs-modal-dialog{background:#000c;background:linear-gradient(180deg,#000c,#fff0);overflow:auto}.video-js .vjs-modal-dialog>*,.pillarbox-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}.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover,.js-focus-visible .vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:#73859f80}.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover,.js-focus-visible .vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.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,.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.video-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.pillarbox-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.js-focus-visible .vjs-menu *:not(.vjs-selected):focus:not(.focus-visible){background:none}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0em;margin-bottom:1.5em;border-top-color:#2b333fb3}.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:#2b333fb3;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-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu,.vjs-menu-button-popup .vjs-menu.vjs-lock-showing{display:block}.video-js .vjs-menu-button-inline,.pillarbox-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before,.pillarbox-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline:hover,.pillarbox-js .vjs-menu-button-inline:hover,.video-js .vjs-menu-button-inline:focus,.pillarbox-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline.vjs-slider-active,.pillarbox-js .vjs-menu-button-inline.vjs-slider-active{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:hover .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline.vjs-slider-active .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,.pillarbox-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:#2b333fb3}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing,.pillarbox-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-has-started .vjs-control-bar,.vjs-audio-only-mode .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-using-native-controls .vjs-control-bar,.vjs-error .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control,.pillarbox-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,.pillarbox-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:before,.pillarbox-js .vjs-control:focus:before,.video-js .vjs-control:hover:before,.pillarbox-js .vjs-control:hover:before,.video-js .vjs-control:focus,.pillarbox-js .vjs-control:focus{text-shadow:0em 0em 1em white}.video-js *:not(.vjs-visible-text)>.vjs-control-text,.pillarbox-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,.pillarbox-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control,.pillarbox-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,.pillarbox-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,.pillarbox-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder,.pillarbox-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder,.pillarbox-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled,.pillarbox-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-play-progress,.pillarbox-js .vjs-progress-holder .vjs-play-progress,.video-js .vjs-progress-holder .vjs-load-progress,.pillarbox-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.pillarbox-js .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress,.pillarbox-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before,.pillarbox-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,.pillarbox-js .vjs-load-progress{background:#73859f80}.video-js .vjs-load-progress div,.pillarbox-js .vjs-load-progress div{background:#73859fbf}.video-js .vjs-time-tooltip,.pillarbox-js .vjs-time-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip,.pillarbox-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-time-tooltip,.pillarbox-js .vjs-progress-control:hover .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip,.pillarbox-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display,.pillarbox-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,.pillarbox-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display,.vjs-user-inactive.pillarbox-js .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:#000c}.video-js .vjs-slider,.pillarbox-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:#73859f80}.video-js .vjs-slider.disabled,.pillarbox-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus,.pillarbox-js .vjs-slider:focus{text-shadow:0em 0em 1em white;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control,.pillarbox-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control,.pillarbox-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control,.pillarbox-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel,.pillarbox-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control:active,.pillarbox-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-volume-control.vjs-slider-active,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active{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-hover .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.pillarbox-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-volume-control.vjs-slider-active.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.pillarbox-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-volume-control.vjs-slider-active.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only,.pillarbox-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,.pillarbox-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,.pillarbox-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,.pillarbox-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar,.pillarbox-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,.pillarbox-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before,.pillarbox-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:translate(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical,.pillarbox-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,.pillarbox-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:#2b333fb3}.video-js .vjs-volume-horizontal .vjs-menu,.pillarbox-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip,.pillarbox-js .vjs-volume-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-control:hover .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display,.pillarbox-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,.pillarbox-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display,.pillarbox-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display,.vjs-user-inactive.pillarbox-js .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:#000c}.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,.pillarbox-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js:not(.vjs-live) .vjs-live-control,.pillarbox-js:not(.vjs-live) .vjs-live-control,.video-js.vjs-liveui .vjs-live-control,.vjs-liveui.pillarbox-js .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control,.pillarbox-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,.vjs-live.pillarbox-js:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control,.pillarbox-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,.pillarbox-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider,.video-js .vjs-current-time,.pillarbox-js .vjs-current-time,.video-js .vjs-duration,.pillarbox-js .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.video-js .vjs-play-control,.pillarbox-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder,.pillarbox-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,.vjs-controls-disabled.pillarbox-js .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display,.vjs-user-inactive.vjs-playing.pillarbox-js .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track,.pillarbox-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,.vjs-controls-disabled.pillarbox-js video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display,.vjs-user-inactive.vjs-playing.pillarbox-js video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-picture-in-picture-control,.pillarbox-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-audio-only-mode.pillarbox-js .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control,.pillarbox-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-audio-only-mode.pillarbox-js .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate>.vjs-menu-button,.vjs-playback-rate .vjs-playback-rate-value{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:before,.vjs-loading-spinner:after{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:before,.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after{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{to{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}to{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button,.vjs-audio-only-mode.pillarbox-js .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button,.vjs-audio-only-mode.pillarbox-js .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,.pillarbox-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,.pillarbox-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button,.vjs-audio-only-mode.pillarbox-js .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.pillarbox-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,.pillarbox-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,.pillarbox-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,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" ";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.vjs-layout-small.pillarbox-js .vjs-current-time,.video-js.vjs-layout-small .vjs-time-divider,.vjs-layout-small.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-small .vjs-duration,.vjs-layout-small.pillarbox-js .vjs-duration,.video-js.vjs-layout-small .vjs-remaining-time,.vjs-layout-small.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-small .vjs-playback-rate,.vjs-layout-small.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-small .vjs-volume-control,.vjs-layout-small.pillarbox-js .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.vjs-layout-x-small.pillarbox-js .vjs-current-time,.video-js.vjs-layout-x-small .vjs-time-divider,.vjs-layout-x-small.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-duration,.vjs-layout-x-small.pillarbox-js .vjs-duration,.video-js.vjs-layout-x-small .vjs-remaining-time,.vjs-layout-x-small.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-playback-rate,.vjs-layout-x-small.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-volume-control,.vjs-layout-x-small.pillarbox-js .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.vjs-layout-tiny.pillarbox-js .vjs-current-time,.video-js.vjs-layout-tiny .vjs-time-divider,.vjs-layout-tiny.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-duration,.vjs-layout-tiny.pillarbox-js .vjs-duration,.video-js.vjs-layout-tiny .vjs-remaining-time,.vjs-layout-tiny.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-playback-rate,.vjs-layout-tiny.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-volume-control,.vjs-layout-tiny.pillarbox-js .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover{width:auto;width:initial}.video-js.vjs-layout-x-small .vjs-progress-control,.vjs-layout-x-small.pillarbox-js .vjs-progress-control,.video-js.vjs-layout-tiny .vjs-progress-control,.vjs-layout-tiny.pillarbox-js .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer,.vjs-layout-x-small.pillarbox-js .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:#2b333fbf;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-font,.vjs-text-track-settings .vjs-track-settings-controls{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}.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-x-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .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:focus,.vjs-track-settings-controls button:active{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f)}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:#000000e6;background:linear-gradient(180deg,#000000e6,#000000b3 60%,#0000);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-title,.vjs-title-bar-description{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,.pillarbox-js .vjs-skip-forward-5,.video-js .vjs-skip-forward-10,.pillarbox-js .vjs-skip-forward-10,.video-js .vjs-skip-forward-30,.pillarbox-js .vjs-skip-forward-30,.video-js .vjs-skip-backward-5,.pillarbox-js .vjs-skip-backward-5,.video-js .vjs-skip-backward-10,.pillarbox-js .vjs-skip-backward-10,.video-js .vjs-skip-backward-30,.pillarbox-js .vjs-skip-backward-30{cursor:pointer}@media print{.video-js>*:not(.vjs-tech):not(.vjs-poster),.pillarbox-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),.js-focus-visible .pillarbox-js *:focus:not(.focus-visible){outline:none}.video-js *:focus:not(:focus-visible),.pillarbox-js *:focus:not(:focus-visible){outline:none}.pillarbox-js:hover .vjs-big-play-button{background-color:#16161688;transition:background-color .25s ease}.pillarbox-js .vjs-big-play-button{width:2em;height:2em;margin:0;font-size:2.25em;background:#0000;border:.1em solid #fff;border-radius:50%;transform:translate(-50%,-50%);transition:background-color .25s ease}.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{position:initial;display:flex;align-items:center;justify-content:center;font-size:1.75em}.pillarbox-js .vjs-modal-dialog.vjs-text-track-settings{top:50%;left:50%;max-width:25em;max-height:50em;background:#161616f2;border-radius:.5em;box-shadow:2px 2px 3px #0005;transform:translate(-50%,-50%);overscroll-behavior:contain}.pillarbox-js .vjs-text-track-settings .vjs-modal-dialog-content{display:flex;flex-direction:column;padding:1em 1.5em 0}.pillarbox-js .vjs-text-track-settings legend{font-size:1em}.pillarbox-js .vjs-text-track-settings fieldset span{padding-inline:0}.pillarbox-js .vjs-text-track-settings fieldset{display:flex;margin:0 0 1em;padding:0}.pillarbox-js.video-js .vjs-text-track-settings select,.pillarbox-js .vjs-text-track-settings select{margin:.25em 0 0;padding:.5em;color:#fff;background:#3f3f3f;border:none;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.pillarbox-js.video-js .vjs-text-track-settings select:focus-within,.pillarbox-js .vjs-text-track-settings select:focus-within{outline:solid}.pillarbox-js .vjs-track-settings-controls{display:flex;flex-direction:row;gap:1em;justify-content:end}.pillarbox-js .vjs-track-settings-controls button{margin-block:1em;padding:.25em .5em;color:#fff;background:#3f3f3f}.pillarbox-js .vjs-track-settings-controls button:hover{background:#5c5c5c}.pillarbox-js .vjs-track-settings-controls .vjs-default-button{margin-right:0}.pillarbox-js .vjs-control{height:3em}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-control-bar{align-items:flex-end;height:6em;padding-inline:1em;background:linear-gradient(#000,#0000 0%,#000000b3)}.pillarbox-js.vjs-audio-only-mode .vjs-control-bar{background-color:#1e232c}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-custom-control-spacer{display:block;flex:auto}.pillarbox-js .vjs-error-display .vjs-modal-dialog-content{display:flex;align-items:center;justify-content:center}.pillarbox-js.vjs-layout-tiny{font-size:8px}.pillarbox-js.vjs-layout-x-small{font-size:10px}.pillarbox-js.vjs-layout-small{font-size:12px}.pillarbox-js.vjs-layout-medium{font-size:14px}.pillarbox-js.vjs-layout-large{font-size:16px}.pillarbox-js.vjs-layout-x-large{font-size:18px}.pillarbox-js.vjs-layout-huge{font-size:20px}.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-time-divider,.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-current-time,.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-duration{display:block;padding:0;font-weight:700}.pillarbox-js.vjs-layout-tiny .vjs-progress-control,.pillarbox-js.vjs-layout-x-small .vjs-progress-control{display:flex}.pillarbox-js.vjs-layout-x-small.vjs-audio-only-mode .vjs-custom-control-spacer{display:none}.pillarbox-js .vjs-loading-spinner{border:.25em solid rgba(0,0,0,0)}.pillarbox-js .vjs-loading-spinner{display:flex;align-items:center;justify-content:center}@keyframes vjs-spinner-fade{0%{border-top-color:#333}20%{border-top-color:#333}35%{border-top-color:#fff}60%{border-top-color:#333}to{border-top-color:#333}}.pillarbox-js .vjs-menu .vjs-menu-item{border-radius:.25em}.pillarbox-js .vjs-menu .vjs-menu-item:not(.vjs-selected):focus,.pillarbox-js .vjs-menu .vjs-menu-item:not(.vjs-selected):hover{background-color:#3f3f3f}.pillarbox-js .vjs-menu .vjs-menu-item.vjs-texttrack-settings:focus,.pillarbox-js .vjs-menu .vjs-menu-item.vjs-texttrack-settings:hover{background-color:#0000}.pillarbox-js .vjs-menu .vjs-menu-item .vjs-selected{color:#222;background-color:#fff;pointer-events:none}.pillarbox-js .vjs-menu-button-popup.vjs-hover .vjs-menu{display:none}.pillarbox-js .vjs-menu-button-popup .vjs-menu{right:0;bottom:0;left:unset;width:100%;margin:0}.pillarbox-js .vjs-menu-button-popup .vjs-menu .vjs-menu-content{right:50%;bottom:5em;display:grid;gap:.25em;min-width:13em;padding:1em .5em;background:#161616f2;border-radius:.5em;transform:translate(50%);overscroll-behavior:contain}.pillarbox-js .vjs-slider{background-color:#ffffff4d;border-radius:1em}.pillarbox-js .vjs-text-track-display{top:0;right:0;bottom:4em;left:0}.pillarbox-js .vjs-current-time{margin-left:1em}.pillarbox-js .vjs-time-divider{min-width:1em;text-align:center}.pillarbox-js .vjs-remaining-time{display:none}.pillarbox-js.vjs-audio-only-mode .vjs-current-time,.pillarbox-js.vjs-audio-only-mode .vjs-time-divider,.pillarbox-js.vjs-audio-only-mode .vjs-duration{order:1}.pillarbox-js.vjs-audio-only-mode .vjs-duration{margin-right:1em}.pillarbox-js .vjs-title-bar{padding-bottom:2em;background:linear-gradient(rgba(0,0,0,.6) 0%,transparent 100%)}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-progress-control{position:absolute;bottom:3em;width:calc(100% - 2em);height:1em}.pillarbox-js .vjs-progress-holder{margin:0}.pillarbox-js .vjs-load-progress{background:#ffffff4d;border-radius:1em}.pillarbox-js .vjs-load-progress div{background:#0000}.pillarbox-js.vjs-scrubbing .vjs-play-progress .vjs-time-tooltip,.pillarbox-js.vjs-seeking .vjs-play-progress .vjs-time-tooltip{display:none}.pillarbox-js .vjs-play-progress{color:#af001e;background:#af001e;border-radius:1em}.pillarbox-js .vjs-play-progress:before{font-size:0px;text-shadow:0px 0px 1px #000}.pillarbox-js .vjs-progress-control:hover .vjs-play-progress:before{font-size:.9em}.pillarbox-js .vjs-progress-control:hover .vjs-time-tooltip{right:0%!important;transform:translate(50%)}.pillarbox-js .vjs-progress-holder:focus-visible .vjs-play-progress:before{font-size:.9em}.pillarbox-js .vjs-time-tooltip,.pillarbox-js .vjs-mouse-display .vjs-time-tooltip{top:-3em;padding:.4em;color:#fff;font-weight:700;text-shadow:1px 1px 3px #000,1px 1px 2px #000;background-color:#0000}.pillarbox-js .vjs-volume-level{border-radius:1em}.pillarbox-js .vjs-volume-tooltip{top:-2em;padding:.4em;font-weight:700;text-shadow:1px 1px 3px #000;background-color:#0000}.pbw-playlist-button{cursor:pointer}.vjs-modal-dialog.pbw-playlist-dialog{right:0;left:auto;width:100%;max-width:30em}.vjs-modal-dialog.pbw-playlist-dialog .vjs-button{cursor:pointer}.pbw-playlist-dialog .vjs-modal-dialog-content{font-size:1em}.pbw-playlist-dialog .pbw-playlist-items{width:100%;padding-left:0;list-style-position:inside;border-radius:.5em}.pbw-playlist-dialog .vjs-button.pbw-playlist-item-button{width:95%;height:auto;padding:.5em;overflow:hidden;white-space:nowrap;text-align:left;text-overflow:ellipsis;border-radius:.5em}.pbw-playlist-dialog .vjs-selected{color:#000;background-color:#fff}.pbw-playlist-dialog .pbw-playlist-controls{display:flex;justify-content:space-between;margin:1em 0}.pbw-playlist-dialog .pbw-playlist-controls .vjs-button{margin-right:1em;border-radius:.5em}.pbw-playlist-dialog .pbw-repeat-one{position:relative}.pbw-playlist-dialog .pbw-repeat-one:after{position:absolute;right:.5em;bottom:.5em;display:flex;align-items:center;justify-content:center;width:1em;height:1em;font-size:1em;border-radius:50%;content:"1"} diff --git a/pr-preview/pr-31/packages/pillarbox-playlist/assets/index-iZY42qqK.js b/pr-preview/pr-31/packages/pillarbox-playlist/assets/index-iZY42qqK.js new file mode 100644 index 0000000..50a4381 --- /dev/null +++ b/pr-preview/pr-31/packages/pillarbox-playlist/assets/index-iZY42qqK.js @@ -0,0 +1,220 @@ +var pT=Object.defineProperty;var mT=(i,e,t)=>e in i?pT(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Rt=(i,e,t)=>(mT(i,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function t(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(r){if(r.ep)return;r.ep=!0;const n=t(r);fetch(r.href,n)}})();var nn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zt(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Sd(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var r=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return i[s]}})}),t}var Ns;typeof window<"u"?Ns=window:typeof nn<"u"?Ns=nn:typeof self<"u"?Ns=self:Ns={};var In=Ns;const E=Zt(In),gT={},yT=Object.freeze(Object.defineProperty({__proto__:null,default:gT},Symbol.toStringTag,{value:"Module"})),_T=Sd(yT);var Rl=typeof nn<"u"?nn:typeof window<"u"?window:{},vT=_T,Bs;typeof document<"u"?Bs=document:(Bs=Rl["__GLOBAL_DOCUMENT_CACHE@4"],Bs||(Bs=Rl["__GLOBAL_DOCUMENT_CACHE@4"]=vT));var xd=Bs;const F=Zt(xd);var Ja={exports:{}};(function(i,e){function t(l){if(l&&typeof l=="object"){var f=l.which||l.keyCode||l.charCode;f&&(l=f)}if(typeof l=="number")return a[l];var m=String(l),y=s[m.toLowerCase()];if(y)return y;var y=r[m.toLowerCase()];if(y)return y;if(m.length===1)return m.charCodeAt(0)}t.isEventKey=function(f,m){if(f&&typeof f=="object"){var y=f.which||f.keyCode||f.charCode;if(y==null)return!1;if(typeof m=="string"){var T=s[m.toLowerCase()];if(T)return T===y;var T=r[m.toLowerCase()];if(T)return T===y}else if(typeof m=="number")return m===y;return!1}},e=i.exports=t;var s=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};/*! + * Programatically add the following + */for(n=97;n<123;n++)s[String.fromCharCode(n)]=n-32;for(var n=48;n<58;n++)s[n-48]=n;for(n=1;n<13;n++)s["f"+n]=n+111;for(n=0;n<10;n++)s["numpad "+n]=n+96;var a=e.names=e.title={};for(n in s)a[s[n]]=n;for(var o in r)s[o]=r[o]})(Ja,Ja.exports);var TT=Ja.exports;const W=Zt(TT);var bT=ST;function ST(i,e){var t,s=null;try{t=JSON.parse(i,e)}catch(r){s=r}return[s,t]}const xT=Zt(bT);var Lo={exports:{}};function rt(){return rt=Object.assign?Object.assign.bind():function(i){for(var e=1;e=400&&r.statusCode<=599){var a=n;if(t)if(kT.TextDecoder){var o=PT(r.headers&&r.headers["content-type"]);try{a=new TextDecoder(o).decode(n)}catch{}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a});return}e(null,n)}};function PT(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(e,t){var s=t.split("="),r=s[0],n=s[1];return r.trim()==="charset"?n.trim():e},"utf-8")}var LT=IT,Ed=In,OT=CT,RT=AT;xt.httpHandler=LT;/** + * @license + * slighly modified parse-headers 2.0.2 + * Copyright (c) 2014 David Björklund + * Available under the MIT license + * + */var MT=function(e){var t={};return e&&e.trim().split(` +`).forEach(function(s){var r=s.indexOf(":"),n=s.slice(0,r).trim().toLowerCase(),a=s.slice(r+1).trim();typeof t[n]>"u"?t[n]=a:Array.isArray(t[n])?t[n].push(a):t[n]=[t[n],a]}),t};Lo.exports=xt;Lo.exports.default=xt;xt.XMLHttpRequest=Ed.XMLHttpRequest||UT;xt.XDomainRequest="withCredentials"in new xt.XMLHttpRequest?xt.XMLHttpRequest:Ed.XDomainRequest;NT(["get","put","post","patch","head","delete"],function(i){xt[i==="delete"?"del":i]=function(e,t,s){return t=Cd(e,t,s),t.method=i.toUpperCase(),Ad(t)}});function NT(i,e){for(var t=0;t"u")throw new Error("callback argument missing");var e=!1,t=function(M,R,L){e||(e=!0,i.callback(M,R,L))};function s(){o.readyState===4&&setTimeout(a,0)}function r(){var I=void 0;if(o.response?I=o.response:I=o.responseText||FT(o),D)try{I=JSON.parse(I)}catch{}return I}function n(I){return clearTimeout(w),I instanceof Error||(I=new Error(""+(I||"Unknown XMLHttpRequest Error"))),I.statusCode=0,t(I,k)}function a(){if(!f){var I;clearTimeout(w),i.useXDR&&o.status===void 0?I=200:I=o.status===1223?204:o.status;var M=k,R=null;return I!==0?(M={body:r(),statusCode:I,method:y,headers:{},url:m,rawRequest:o},o.getAllResponseHeaders&&(M.headers=MT(o.getAllResponseHeaders()))):R=new Error("Internal XMLHttpRequest Error"),t(R,M,M.body)}}var o=i.xhr||null;o||(i.cors||i.useXDR?o=new xt.XDomainRequest:o=new xt.XMLHttpRequest);var l,f,m=o.url=i.uri||i.url,y=o.method=i.method||"GET",T=i.body||i.data,S=o.headers=i.headers||{},_=!!i.sync,D=!1,w,k={body:void 0,headers:{},statusCode:0,method:y,url:m,rawRequest:o};if("json"in i&&i.json!==!1&&(D=!0,S.accept||S.Accept||(S.Accept="application/json"),y!=="GET"&&y!=="HEAD"&&(S["content-type"]||S["Content-Type"]||(S["Content-Type"]="application/json"),T=JSON.stringify(i.json===!0?T:i.json))),o.onreadystatechange=s,o.onload=a,o.onerror=n,o.onprogress=function(){},o.onabort=function(){f=!0},o.ontimeout=n,o.open(y,m,!_,i.username,i.password),_||(o.withCredentials=!!i.withCredentials),!_&&i.timeout>0&&(w=setTimeout(function(){if(!f){f=!0,o.abort("timeout");var I=new Error("XMLHttpRequest timeout");I.code="ETIMEDOUT",n(I)}},i.timeout)),o.setRequestHeader)for(l in S)S.hasOwnProperty(l)&&o.setRequestHeader(l,S[l]);else if(i.headers&&!BT(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(o.responseType=i.responseType),"beforeSend"in i&&typeof i.beforeSend=="function"&&i.beforeSend(o),o.send(T||null),o}function FT(i){try{if(i.responseType==="document")return i.responseXML;var e=i.responseXML&&i.responseXML.documentElement.nodeName==="parsererror";if(i.responseType===""&&!e)return i.responseXML}catch{}return null}function UT(){}var $T=Lo.exports;const Dd=Zt($T);var wd={exports:{}},Ml=xd,Oo=Object.create||function(){function i(){}return function(e){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return i.prototype=e,new i}}();function Ze(i,e){this.name="ParsingError",this.code=i.code,this.message=e||i.message}Ze.prototype=Oo(Error.prototype);Ze.prototype.constructor=Ze;Ze.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function Ro(i){function e(s,r,n,a){return(s|0)*3600+(r|0)*60+(n|0)+(a|0)/1e3}var t=i.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return t?t[3]?e(t[1],t[2],t[3].replace(":",""),t[4]):t[1]>59?e(t[1],t[2],0,t[4]):e(0,t[1],t[2],t[4]):null}function Vs(){this.values=Oo(null)}Vs.prototype={set:function(i,e){!this.get(i)&&e!==""&&(this.values[i]=e)},get:function(i,e,t){return t?this.has(i)?this.values[i]:e[t]:this.has(i)?this.values[i]:e},has:function(i){return i in this.values},alt:function(i,e,t){for(var s=0;s=0&&e<=100)?(this.set(i,e),!0):!1}};function Fs(i,e,t,s){var r=s?i.split(s):[i];for(var n in r)if(typeof r[n]=="string"){var a=r[n].split(t);if(a.length===2){var o=a[0].trim(),l=a[1].trim();e(o,l)}}}function jT(i,e,t){var s=i;function r(){var o=Ro(i);if(o===null)throw new Ze(Ze.Errors.BadTimeStamp,"Malformed timestamp: "+s);return i=i.replace(/^[^\sa-zA-Z-]+/,""),o}function n(o,l){var f=new Vs;Fs(o,function(m,y){switch(m){case"region":for(var T=t.length-1;T>=0;T--)if(t[T].id===y){f.set(m,t[T].region);break}break;case"vertical":f.alt(m,y,["rl","lr"]);break;case"line":var S=y.split(","),_=S[0];f.integer(m,_),f.percent(m,_)&&f.set("snapToLines",!1),f.alt(m,_,["auto"]),S.length===2&&f.alt("lineAlign",S[1],["start","center","end"]);break;case"position":S=y.split(","),f.percent(m,S[0]),S.length===2&&f.alt("positionAlign",S[1],["start","center","end"]);break;case"size":f.percent(m,y);break;case"align":f.alt(m,y,["start","center","end","left","right"]);break}},/:/,/\s/),l.region=f.get("region",null),l.vertical=f.get("vertical","");try{l.line=f.get("line","auto")}catch{}l.lineAlign=f.get("lineAlign","start"),l.snapToLines=f.get("snapToLines",!0),l.size=f.get("size",100);try{l.align=f.get("align","center")}catch{l.align=f.get("align","middle")}try{l.position=f.get("position","auto")}catch{l.position=f.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},l.align)}l.positionAlign=f.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},l.align)}function a(){i=i.replace(/^\s+/,"")}if(a(),e.startTime=r(),a(),i.substr(0,3)!=="-->")throw new Ze(Ze.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s);i=i.substr(3),a(),e.endTime=r(),a(),n(i,e)}var Aa=Ml.createElement&&Ml.createElement("textarea"),qT={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Nl={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)"},VT={v:"title",lang:"lang"},Bl={rt:"ruby"};function kd(i,e){function t(){if(!e)return null;function _(w){return e=e.substr(w.length),w}var D=e.match(/^([^<]*)(<[^>]*>?)?/);return _(D[1]?D[1]:D[2])}function s(_){return Aa.innerHTML=_,_=Aa.textContent,Aa.textContent="",_}function r(_,D){return!Bl[D.localName]||Bl[D.localName]===_.localName}function n(_,D){var w=qT[_];if(!w)return null;var k=i.document.createElement(w),I=VT[_];return I&&D&&(k[I]=D.trim()),k}for(var a=i.document.createElement("div"),o=a,l,f=[];(l=t())!==null;){if(l[0]==="<"){if(l[1]==="/"){f.length&&f[f.length-1]===l.substr(2).replace(">","")&&(f.pop(),o=o.parentNode);continue}var m=Ro(l.substr(1,l.length-2)),y;if(m){y=i.document.createProcessingInstruction("timestamp",m),o.appendChild(y);continue}var T=l.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!T||(y=n(T[1],T[3]),!y)||!r(o,y))continue;if(T[2]){var S=T[2].split(".");S.forEach(function(_){var D=/^bg_/.test(_),w=D?_.slice(3):_;if(Nl.hasOwnProperty(w)){var k=D?"background-color":"color",I=Nl[w];y.style[k]=I}}),y.className=S.join(" ")}f.push(T[1]),o.appendChild(y),o=y;continue}o.appendChild(i.document.createTextNode(s(l)))}return a}var Fl=[[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 HT(i){for(var e=0;e=t[0]&&i<=t[1])return!0}return!1}function GT(i){var e=[],t="",s;if(!i||!i.childNodes)return"ltr";function r(o,l){for(var f=l.childNodes.length-1;f>=0;f--)o.push(l.childNodes[f])}function n(o){if(!o||!o.length)return null;var l=o.pop(),f=l.textContent||l.innerText;if(f){var m=f.match(/^.*(\n|\r)/);return m?(o.length=0,m[0]):f}if(l.tagName==="ruby")return n(o);if(l.childNodes)return r(o,l),n(o)}for(r(e,i);t=n(e);)for(var a=0;a=0&&i.line<=100))return i.line;if(!i.track||!i.track.textTrackList||!i.track.textTrackList.mediaElement)return-1;for(var e=i.track,t=e.textTrackList,s=0,r=0;ri.left&&this.topi.top};Fe.prototype.overlapsAny=function(i){for(var e=0;e=i.top&&this.bottom<=i.bottom&&this.left>=i.left&&this.right<=i.right};Fe.prototype.overlapsOppositeAxis=function(i,e){switch(e){case"+x":return this.lefti.right;case"+y":return this.topi.bottom}};Fe.prototype.intersectPercentage=function(i){var e=Math.max(0,Math.min(this.right,i.right)-Math.max(this.left,i.left)),t=Math.max(0,Math.min(this.bottom,i.bottom)-Math.max(this.top,i.top)),s=e*t;return s/(this.height*this.width)};Fe.prototype.toCSSCompatValues=function(i){return{top:this.top-i.top,bottom:i.bottom-this.bottom,left:this.left-i.left,right:i.right-this.right,height:this.height,width:this.width}};Fe.getSimpleBoxPosition=function(i){var e=i.div?i.div.offsetHeight:i.tagName?i.offsetHeight:0,t=i.div?i.div.offsetWidth:i.tagName?i.offsetWidth:0,s=i.div?i.div.offsetTop:i.tagName?i.offsetTop:0;i=i.div?i.div.getBoundingClientRect():i.tagName?i.getBoundingClientRect():i;var r={left:i.left,right:i.right,top:i.top||s,height:i.height||e,bottom:i.bottom||s+(i.height||e),width:i.width||t};return r};function WT(i,e,t,s){function r(w,k){for(var I,M=new Fe(w),R=1,L=0;LU&&(I=new Fe(w),R=U),w=new Fe(M)}return I||M}var n=new Fe(e),a=e.cue,o=zT(a),l=[];if(a.snapToLines){var f;switch(a.vertical){case"":l=["+y","-y"],f="height";break;case"rl":l=["+x","-x"],f="width";break;case"lr":l=["-x","+x"],f="width";break}var m=n.lineHeight,y=m*Math.round(o),T=t[f]+m,S=l[0];Math.abs(y)>T&&(y=y<0?-1:1,y*=Math.ceil(T/m)*m),o<0&&(y+=a.vertical===""?t.height:t.width,l=l.reverse()),n.move(S,y)}else{var _=n.lineHeight/t.height*100;switch(a.lineAlign){case"center":o-=_/2;break;case"end":o-=_;break}switch(a.vertical){case"":e.applyStyles({top:e.formatStyle(o,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(o,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(o,"%")});break}l=["+y","-x","+x","-y"],n=new Fe(e)}var D=r(n,l);e.move(D.toCSSCompatValues(t))}function us(){}us.StringDecoder=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};us.convertCueToDOMTree=function(i,e){return!i||!e?null:kd(i,e)};var KT=.05,XT="sans-serif",YT="1.5%";us.processCues=function(i,e,t){if(!i||!e||!t)return null;for(;t.firstChild;)t.removeChild(t.firstChild);var s=i.document.createElement("div");s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin=YT,t.appendChild(s);function r(m){for(var y=0;y")===-1){e.cue.id=a;continue}case"CUE":try{jT(a,e.cue,e.regionList)}catch(m){e.reportOrThrowError(m),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var f=a.indexOf("-->")!==-1;if(!a||f&&(l=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+=` +`),e.cue.text+=a.replace(/\u2028/g,` +`).replace(/u2029/g,` +`);continue;case"BADCUE":a||(e.state="ID");continue}}}catch(m){e.reportOrThrowError(m),e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var i=this;try{if(i.buffer+=i.decoder.decode(),(i.cue||i.state==="HEADER")&&(i.buffer+=` + +`,i.parse()),i.state==="INITIAL")throw new Ze(Ze.Errors.BadSignature)}catch(e){i.reportOrThrowError(e)}return i.onflush&&i.onflush(),this}};var QT=us,JT="auto",ZT={"":1,lr:1,rl:1},eb={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function tb(i){if(typeof i!="string")return!1;var e=ZT[i.toLowerCase()];return e?i.toLowerCase():!1}function Da(i){if(typeof i!="string")return!1;var e=eb[i.toLowerCase()];return e?i.toLowerCase():!1}function Id(i,e,t){this.hasBeenReset=!1;var s="",r=!1,n=i,a=e,o=t,l=null,f="",m=!0,y="auto",T="start",S="auto",_="auto",D=100,w="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s},set:function(k){s=""+k}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(k){r=!!k}},startTime:{enumerable:!0,get:function(){return n},set:function(k){if(typeof k!="number")throw new TypeError("Start time must be set to a number.");n=k,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(k){if(typeof k!="number")throw new TypeError("End time must be set to a number.");a=k,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(k){o=""+k,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return l},set:function(k){l=k,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return f},set:function(k){var I=tb(k);if(I===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");f=I,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return m},set:function(k){m=!!k,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return y},set:function(k){if(typeof k!="number"&&k!==JT)throw new SyntaxError("Line: an invalid number or illegal string was specified.");y=k,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return T},set:function(k){var I=Da(k);I?(T=I,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return S},set:function(k){if(k<0||k>100)throw new Error("Position must be between 0 and 100.");S=k,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return _},set:function(k){var I=Da(k);I?(_=I,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return D},set:function(k){if(k<0||k>100)throw new Error("Size must be between 0 and 100.");D=k,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return w},set:function(k){var I=Da(k);if(!I)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");w=I,this.hasBeenReset=!0}}}),this.displayState=void 0}Id.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var ib=Id,sb={"":!0,up:!0};function rb(i){if(typeof i!="string")return!1;var e=sb[i.toLowerCase()];return e?i.toLowerCase():!1}function ws(i){return typeof i=="number"&&i>=0&&i<=100}function nb(){var i=100,e=3,t=0,s=100,r=0,n=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(o){if(!ws(o))throw new Error("Width must be between 0 and 100.");i=o}},lines:{enumerable:!0,get:function(){return e},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");e=o}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(o){if(!ws(o))throw new Error("RegionAnchorX must be between 0 and 100.");s=o}},regionAnchorX:{enumerable:!0,get:function(){return t},set:function(o){if(!ws(o))throw new Error("RegionAnchorY must be between 0 and 100.");t=o}},viewportAnchorY:{enumerable:!0,get:function(){return n},set:function(o){if(!ws(o))throw new Error("ViewportAnchorY must be between 0 and 100.");n=o}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(o){if(!ws(o))throw new Error("ViewportAnchorX must be between 0 and 100.");r=o}},scroll:{enumerable:!0,get:function(){return a},set:function(o){var l=rb(o);l===!1?console.warn("Scroll: an invalid or illegal string was specified."):a=l}}})}var ab=nb,$t=In,xi=wd.exports={WebVTT:QT,VTTCue:ib,VTTRegion:ab};$t.vttjs=xi;$t.WebVTT=xi.WebVTT;var ob=xi.VTTCue,ub=xi.VTTRegion,lb=$t.VTTCue,cb=$t.VTTRegion;xi.shim=function(){$t.VTTCue=ob,$t.VTTRegion=ub};xi.restore=function(){$t.VTTCue=lb,$t.VTTRegion=cb};$t.VTTCue||xi.shim();var db=wd.exports;const Ul=Zt(db);var Pd={exports:{}};(function(i,e){(function(t){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,f,m){if(m=m||{},l=l.trim(),f=f.trim(),!f){if(!m.alwaysNormalize)return l;var y=o.parseURL(l);if(!y)throw new Error("Error trying to parse base URL.");return y.path=o.normalizePath(y.path),o.buildURLFromParts(y)}var T=o.parseURL(f);if(!T)throw new Error("Error trying to parse relative URL.");if(T.scheme)return m.alwaysNormalize?(T.path=o.normalizePath(T.path),o.buildURLFromParts(T)):f;var S=o.parseURL(l);if(!S)throw new Error("Error trying to parse base URL.");if(!S.netLoc&&S.path&&S.path[0]!=="/"){var _=r.exec(S.path);S.netLoc=_[1],S.path=_[2]}S.netLoc&&!S.path&&(S.path="/");var D={scheme:S.scheme,netLoc:T.netLoc,path:null,params:T.params,query:T.query,fragment:T.fragment};if(!T.netLoc&&(D.netLoc=S.netLoc,T.path[0]!=="/"))if(!T.path)D.path=S.path,T.params||(D.params=S.params,T.query||(D.query=S.query));else{var w=S.path,k=w.substring(0,w.lastIndexOf("/")+1)+T.path;D.path=o.normalizePath(k)}return D.path===null&&(D.path=m.alwaysNormalize?o.normalizePath(T.path):T.path),o.buildURLFromParts(D)},parseURL:function(l){var f=s.exec(l);return f?{scheme:f[1]||"",netLoc:f[2]||"",path:f[3]||"",params:f[4]||"",query:f[5]||"",fragment:f[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(n,"");l.length!==(l=l.replace(a,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};i.exports=o})()})(Pd);var hb=Pd.exports;const $l=Zt(hb);var jl="http://example.com",Ln=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=E.location&&E.location.href||"");var s=typeof E.URL=="function",r=/^\/\//.test(e),n=!E.location&&!/\/\//i.test(e);if(s?e=new E.URL(e,E.location||jl):/\/\//i.test(e)||(e=$l.buildAbsoluteURL(E.location&&E.location.href||"",e)),s){var a=new URL(t,e);return n?a.href.slice(jl.length):r?a.href.slice(a.protocol.length):a.href}return $l.buildAbsoluteURL(e,t)},Mo=function(){function i(){this.listeners={}}var e=i.prototype;return e.on=function(s,r){this.listeners[s]||(this.listeners[s]=[]),this.listeners[s].push(r)},e.off=function(s,r){if(!this.listeners[s])return!1;var n=this.listeners[s].indexOf(r);return this.listeners[s]=this.listeners[s].slice(0),this.listeners[s].splice(n,1),n>-1},e.trigger=function(s){var r=this.listeners[s];if(r)if(arguments.length===2)for(var n=r.length,a=0;a-1;t=this.buffer.indexOf(` +`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const gb=" ",wa=function(i){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(i||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},yb=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},Ye=function(i){const e={};if(!i)return e;const t=i.split(yb());let s=t.length,r;for(;s--;)t[s]!==""&&(r=/([^=]*)=(.*)/.exec(t[s]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e};class _b extends Mo{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,s;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const o=a(e);return o===e?n:n.concat([o])},[e]).forEach(n=>{for(let a=0;an),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:s(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const s=r=>e.test(r)?t(r):r;this.tagMappers.push(s)}}const vb=i=>i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),Wt=function(i){const e={};return Object.keys(i).forEach(function(t){e[vb(t)]=i[t]}),e},ka=function(i){const{serverControl:e,targetDuration:t,partTargetDuration:s}=i;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",o=t&&t*3,l=s&&s*2;t&&!e.hasOwnProperty(n)&&(e[n]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[n]{s.uri||!s.parts&&!s.preloadHints||(!s.map&&r&&(s.map=r),!s.key&&n&&(s.key=n),!s.timeline&&typeof m=="number"&&(s.timeline=m),this.manifest.preloadSegment=s)}),this.parseStream.on("data",function(_){let D,w;({tag(){({version(){_.version&&(this.manifest.version=_.version)},"allow-cache"(){this.manifest.allowCache=_.allowed,"allowed"in _||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const k={};"length"in _&&(s.byterange=k,k.length=_.length,"offset"in _||(_.offset=y)),"offset"in _&&(s.byterange=k,k.offset=_.offset),y=k.offset+k.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),_.title&&(s.title=_.title),_.duration>0&&(s.duration=_.duration),_.duration===0&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=t},key(){if(!_.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(_.attributes.METHOD==="NONE"){n=null;return}if(!_.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(_.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:_.attributes};return}if(_.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:_.attributes.URI};return}if(_.attributes.KEYFORMAT===f){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(_.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(_.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),_.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(_.attributes.KEYID&&_.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:_.attributes.KEYFORMAT,keyId:_.attributes.KEYID.substring(2)},pssh:pb(_.attributes.URI.split(",")[1])};return}_.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:_.attributes.METHOD||"AES-128",uri:_.attributes.URI},typeof _.attributes.IV<"u"&&(n.iv=_.attributes.IV)},"media-sequence"(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+_.number});return}this.manifest.mediaSequence=_.number},"discontinuity-sequence"(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+_.number});return}this.manifest.discontinuitySequence=_.number,m=_.number},"playlist-type"(){if(!/VOD|EVENT/.test(_.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+_.playlist});return}this.manifest.playlistType=_.playlistType},map(){r={},_.uri&&(r.uri=_.uri),_.byterange&&(r.byterange=_.byterange),n&&(r.key=n)},"stream-inf"(){if(this.manifest.playlists=t,this.manifest.mediaGroups=this.manifest.mediaGroups||l,!_.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}s.attributes||(s.attributes={}),rt(s.attributes,_.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(_.attributes&&_.attributes.TYPE&&_.attributes["GROUP-ID"]&&_.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const k=this.manifest.mediaGroups[_.attributes.TYPE];k[_.attributes["GROUP-ID"]]=k[_.attributes["GROUP-ID"]]||{},D=k[_.attributes["GROUP-ID"]],w={default:/yes/i.test(_.attributes.DEFAULT)},w.default?w.autoselect=!0:w.autoselect=/yes/i.test(_.attributes.AUTOSELECT),_.attributes.LANGUAGE&&(w.language=_.attributes.LANGUAGE),_.attributes.URI&&(w.uri=_.attributes.URI),_.attributes["INSTREAM-ID"]&&(w.instreamId=_.attributes["INSTREAM-ID"]),_.attributes.CHARACTERISTICS&&(w.characteristics=_.attributes.CHARACTERISTICS),_.attributes.FORCED&&(w.forced=/yes/i.test(_.attributes.FORCED)),D[_.attributes.NAME]=w},discontinuity(){m+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(t.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=_.dateTimeString,this.manifest.dateTimeObject=_.dateTimeObject),s.dateTimeString=_.dateTimeString,s.dateTimeObject=_.dateTimeObject;const{lastProgramDateTime:k}=this;this.lastProgramDateTime=new Date(_.dateTimeString).getTime(),k===null&&this.manifest.segments.reduceRight((I,M)=>(M.programDateTime=I-M.duration*1e3,M.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(_.duration)||_.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+_.duration});return}this.manifest.targetDuration=_.duration,ka.call(this,this.manifest)},start(){if(!_.attributes||isNaN(_.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:_.attributes["TIME-OFFSET"],precise:_.attributes.PRECISE}},"cue-out"(){s.cueOut=_.data},"cue-out-cont"(){s.cueOutCont=_.data},"cue-in"(){s.cueIn=_.data},skip(){this.manifest.skip=Wt(_.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",_.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;const k=this.manifest.segments.length,I=Wt(_.attributes);s.parts=s.parts||[],s.parts.push(I),I.byterange&&(I.byterange.hasOwnProperty("offset")||(I.byterange.offset=T),T=I.byterange.offset+I.byterange.length);const M=s.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${M} for segment #${k}`,_.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((R,L)=>{R.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${L} lacks required attribute(s): LAST-PART`})})},"server-control"(){const k=this.manifest.serverControl=Wt(_.attributes);k.hasOwnProperty("canBlockReload")||(k.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),ka.call(this,this.manifest),k.canSkipDateranges&&!k.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 k=this.manifest.segments.length,I=Wt(_.attributes),M=I.type&&I.type==="PART";s.preloadHints=s.preloadHints||[],s.preloadHints.push(I),I.byterange&&(I.byterange.hasOwnProperty("offset")||(I.byterange.offset=M?T:0,M&&(T=I.byterange.offset+I.byterange.length)));const R=s.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${R} for segment #${k}`,_.attributes,["TYPE","URI"]),!!I.type)for(let L=0;LL.id===I.id);this.manifest.dateRanges[R]=rt(this.manifest.dateRanges[R],I),S[I.id]=rt(S[I.id],I),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"content-steering"(){this.manifest.contentSteering=Wt(_.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",_.attributes,["SERVER-URI"])}}[_.tagType]||o).call(e)},uri(){s.uri=_.uri,t.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),n&&(s.key=n),s.timeline=m,r&&(s.map=r),T=0,this.lastProgramDateTime!==null&&(s.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=s.duration*1e3),s={}},comment(){},custom(){_.segment?(s.custom=s.custom||{},s.custom[_.customType]=_.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[_.customType]=_.data)}})[_.type].call(e)})}warnOnMissingAttributes_(e,t,s){const r=[];s.forEach(function(n){t.hasOwnProperty(n)||r.push(n)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(` +`),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 yi={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^/},bb=["video","audio","text"],ql=["Video","Audio","Text"],Ld=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,s,r){var n=("00"+Number(s).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+n+"00"+a})},gt=function(e){e===void 0&&(e="");var t=e.split(","),s=[];return t.forEach(function(r){r=r.trim();var n;bb.forEach(function(a){var o=yi[a].exec(r.toLowerCase());if(!(!o||o.length<=1)){n=a;var l=r.substring(0,o[1].length),f=r.replace(l,"");s.push({type:l,details:f,mediaType:a})}}),n||s.push({type:r,details:"",mediaType:"unknown"})}),s},Sb=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var s=e.mediaGroups.AUDIO[t];if(!s)return null;for(var r in s){var n=s[r];if(n.default&&n.playlists)return gt(n.playlists[0].attributes.CODECS)}return null},Od=function(e){return e===void 0&&(e=""),yi.audio.test(e.trim().toLowerCase())},xb=function(e){return e===void 0&&(e=""),yi.text.test(e.trim().toLowerCase())},Ys=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return Ld(n.trim())}),s="video";t.length===1&&Od(t[0])?s="audio":t.length===1&&xb(t[0])&&(s="application");var r="mp4";return t.every(function(n){return yi.mp4.test(n)})?r="mp4":t.every(function(n){return yi.webm.test(n)})?r="webm":t.every(function(n){return yi.ogg.test(n)})&&(r="ogg"),s+"/"+r+';codecs="'+e+'"'}},Zr=function(e){return e===void 0&&(e=""),E.MediaSource&&E.MediaSource.isTypeSupported&&E.MediaSource.isTypeSupported(Ys(e))||!1},Ia=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var s=0;sy&&(m-=y,m-=y,m-=Ie(2))}return Number(m)},Pb=function(e,t){var s={},r=s.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=Ie(e);for(var a=wb(e),o=new Uint8Array(new ArrayBuffer(a)),l=0;l=t.length&&f.call(t,function(m,y){var T=l[y]?l[y]&e[a+y]:e[a+y];return m===T})},Ob=function(e,t,s){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var o=e.mediaGroups[r][n][a];s(o,r,n,a)}})},Rb=function(e){return E.atob?E.atob(e):Buffer.from(e,"base64").toString("binary")};function Mb(i){for(var e=Rb(i),t=new Uint8Array(e.length),s=0;s=0&&i=0){for(var r=e.length-1;s0},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&t[s]===i)return s}e=e.nodeType==Xi?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(i){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i];e=e.nodeType==Xi?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null}};function Xd(i){return i=="<"&&"<"||i==">"&&">"||i=="&"&&"&"||i=='"'&&"""||"&#"+i.charCodeAt()+";"}nr(Ke,ae);nr(Ke,ae.prototype);function Js(i,e){if(e(i))return!0;if(i=i.firstChild)do if(Js(i,e))return!0;while(i=i.nextSibling)}function ar(){this.ownerDocument=this}function Hb(i,e,t){i&&i._inc++;var s=t.namespaceURI;s===Qs.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function Yd(i,e,t,s){i&&i._inc++;var r=t.namespaceURI;r===Qs.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function Fo(i,e,t){if(i&&i._inc){i._inc++;var s=e.childNodes;if(t)s[s.length++]=t;else{for(var r=e.firstChild,n=0;r;)s[n++]=r,r=r.nextSibling;s.length=n,delete s[s.length]}}}function Qd(i,e){var t=e.previousSibling,s=e.nextSibling;return t?t.nextSibling=s:i.firstChild=s,s?s.previousSibling=t:i.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,Fo(i.ownerDocument,i),e}function Gb(i){return i&&(i.nodeType===ae.DOCUMENT_NODE||i.nodeType===ae.DOCUMENT_FRAGMENT_NODE||i.nodeType===ae.ELEMENT_NODE)}function zb(i){return i&&(Ct(i)||Uo(i)||qt(i)||i.nodeType===ae.DOCUMENT_FRAGMENT_NODE||i.nodeType===ae.COMMENT_NODE||i.nodeType===ae.PROCESSING_INSTRUCTION_NODE)}function qt(i){return i&&i.nodeType===ae.DOCUMENT_TYPE_NODE}function Ct(i){return i&&i.nodeType===ae.ELEMENT_NODE}function Uo(i){return i&&i.nodeType===ae.TEXT_NODE}function Kl(i,e){var t=i.childNodes||[];if(Et(t,Ct)||qt(e))return!1;var s=Et(t,qt);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function Xl(i,e){var t=i.childNodes||[];function s(n){return Ct(n)&&n!==e}if(Et(t,s))return!1;var r=Et(t,qt);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function Wb(i,e,t){if(!Gb(i))throw new xe(He,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new xe(zd,"child not in parent");if(!zb(e)||qt(e)&&i.nodeType!==ae.DOCUMENT_NODE)throw new xe(He,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function Kb(i,e,t){var s=i.childNodes||[],r=e.childNodes||[];if(e.nodeType===ae.DOCUMENT_FRAGMENT_NODE){var n=r.filter(Ct);if(n.length>1||Et(r,Uo))throw new xe(He,"More than one element or text in fragment");if(n.length===1&&!Kl(i,t))throw new xe(He,"Element in fragment can not be inserted before doctype")}if(Ct(e)&&!Kl(i,t))throw new xe(He,"Only one element can be added and only after doctype");if(qt(e)){if(Et(s,qt))throw new xe(He,"Only one doctype is allowed");var a=Et(s,Ct);if(t&&s.indexOf(a)1||Et(r,Uo))throw new xe(He,"More than one element or text in fragment");if(n.length===1&&!Xl(i,t))throw new xe(He,"Element in fragment can not be inserted before doctype")}if(Ct(e)&&!Xl(i,t))throw new xe(He,"Only one element can be added and only after doctype");if(qt(e)){let l=function(f){return qt(f)&&f!==t};var o=l;if(Et(s,l))throw new xe(He,"Only one doctype is allowed");var a=Et(s,Ct);if(t&&s.indexOf(a)0&&Js(t.documentElement,function(r){if(r!==t&&r.nodeType===dt){var n=r.getAttribute("class");if(n){var a=i===n;if(!a){var o=Hl(n);a=e.every(jb(o))}a&&s.push(r)}}}),s})},createElement:function(i){var e=new bi;e.ownerDocument=this,e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new Ft;var t=e.attributes=new un;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new Rn;return i.ownerDocument=this,i.childNodes=new Ft,i},createTextNode:function(i){var e=new $o;return e.ownerDocument=this,e.appendData(i),e},createComment:function(i){var e=new jo;return e.ownerDocument=this,e.appendData(i),e},createCDATASection:function(i){var e=new qo;return e.ownerDocument=this,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new Ho;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){var e=new cn;return e.ownerDocument=this,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){var e=new Vo;return e.ownerDocument=this,e.nodeName=i,e},createElementNS:function(i,e){var t=new bi,s=e.split(":"),r=t.attributes=new un;return t.childNodes=new Ft,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=i,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,r._ownerElement=t,t},createAttributeNS:function(i,e){var t=new cn,s=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=i,t.specified=!0,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,t}};We(ar,ae);function bi(){this._nsMap={}}bi.prototype={nodeType:dt,hasAttribute:function(i){return this.getAttributeNode(i)!=null},getAttribute:function(i){var e=this.getAttributeNode(i);return e&&e.value||""},getAttributeNode:function(i){return this.attributes.getNamedItem(i)},setAttribute:function(i,e){var t=this.ownerDocument.createAttribute(i);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(i){var e=this.getAttributeNode(i);e&&this.removeAttributeNode(e)},appendChild:function(i){return i.nodeType===jt?this.insertBefore(i,null):Xb(this,i)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(i,e){return this.getAttributeNodeNS(i,e)!=null},getAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);return t&&t.value||""},setAttributeNS:function(i,e,t){var s=this.ownerDocument.createAttributeNS(i,e);s.value=s.nodeValue=""+t,this.setAttributeNode(s)},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByTagName:function(i){return new Yi(this,function(e){var t=[];return Js(e,function(s){s!==e&&s.nodeType==dt&&(i==="*"||s.tagName==i)&&t.push(s)}),t})},getElementsByTagNameNS:function(i,e){return new Yi(this,function(t){var s=[];return Js(t,function(r){r!==t&&r.nodeType===dt&&(i==="*"||r.namespaceURI===i)&&(e==="*"||r.localName==e)&&s.push(r)}),s})}};ar.prototype.getElementsByTagName=bi.prototype.getElementsByTagName;ar.prototype.getElementsByTagNameNS=bi.prototype.getElementsByTagNameNS;We(bi,ae);function cn(){}cn.prototype.nodeType=Xi;We(cn,ae);function or(){}or.prototype={data:"",substringData:function(i,e){return this.data.substring(i,i+e)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,e){this.replaceData(i,0,e)},appendChild:function(i){throw new Error(ke[He])},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var s=this.data.substring(0,i),r=this.data.substring(i+e);t=s+t+r,this.nodeValue=this.data=t,this.length=t.length}};We(or,ae);function $o(){}$o.prototype={nodeName:"#text",nodeType:on,splitText:function(i){var e=this.data,t=e.substring(i);e=e.substring(0,i),this.data=this.nodeValue=e,this.length=e.length;var s=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}};We($o,or);function jo(){}jo.prototype={nodeName:"#comment",nodeType:Vd};We(jo,or);function qo(){}qo.prototype={nodeName:"#cdata-section",nodeType:$d};We(qo,or);function On(){}On.prototype.nodeType=Gd;We(On,ae);function Zd(){}Zd.prototype.nodeType=Vb;We(Zd,ae);function eh(){}eh.prototype.nodeType=qb;We(eh,ae);function Vo(){}Vo.prototype.nodeType=jd;We(Vo,ae);function Rn(){}Rn.prototype.nodeName="#document-fragment";Rn.prototype.nodeType=jt;We(Rn,ae);function Ho(){}Ho.prototype.nodeType=qd;We(Ho,ae);function th(){}th.prototype.serializeToString=function(i,e,t){return ih.call(i,e,t)};ae.prototype.toString=ih;function ih(i,e){var t=[],s=this.nodeType==9&&this.documentElement||this,r=s.prefix,n=s.namespaceURI;if(n&&r==null){var r=s.lookupPrefix(n);if(r==null)var a=[{namespace:n,prefix:null}]}return Bi(this,t,i,e,a),t.join("")}function Yl(i,e,t){var s=i.prefix||"",r=i.namespaceURI;if(!r||s==="xml"&&r===Qs.XML||r===Qs.XMLNS)return!1;for(var n=t.length;n--;){var a=t[n];if(a.prefix===s)return a.namespace!==r}return!0}function Pa(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,Xd),'"')}function Bi(i,e,t,s,r){if(r||(r=[]),s)if(i=s(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case dt:var n=i.attributes,a=n.length,k=i.firstChild,o=i.tagName;t=Qs.isHTML(i.namespaceURI)||t;var l=o;if(!t&&!i.prefix&&i.namespaceURI){for(var f,m=0;m=0;y--){var T=r[y];if(T.prefix===""&&T.namespace===i.namespaceURI){f=T.namespace;break}}if(f!==i.namespaceURI)for(var y=r.length-1;y>=0;y--){var T=r[y];if(T.namespace===i.namespaceURI){T.prefix&&(l=T.prefix+":"+o);break}}}e.push("<",l);for(var S=0;S"),t&&/^script$/i.test(o))for(;k;)k.data?e.push(k.data):Bi(k,e,t,s,r.slice()),k=k.nextSibling;else for(;k;)Bi(k,e,t,s,r.slice()),k=k.nextSibling;e.push("")}else e.push("/>");return;case Hd:case jt:for(var k=i.firstChild;k;)Bi(k,e,t,s,r.slice()),k=k.nextSibling;return;case Xi:return Pa(e,i.name,i.value);case on:return e.push(i.data.replace(/[<&>]/g,Xd));case $d:return e.push("");case Vd:return e.push("");case Gd:var I=i.publicId,M=i.systemId;if(e.push("");else if(M&&M!=".")e.push(" SYSTEM ",M,">");else{var R=i.internalSubset;R&&e.push(" [",R,"]"),e.push(">")}return;case qd:return e.push("");case jd:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function sh(i,e,t){var s;switch(e.nodeType){case dt:s=e.cloneNode(!1),s.ownerDocument=i;case jt:break;case Xi:t=!0;break}if(s||(s=e.cloneNode(!1)),s.ownerDocument=i,s.parentNode=null,t)for(var r=e.firstChild;r;)s.appendChild(sh(i,r,t)),r=r.nextSibling;return s}function eo(i,e,t){var s=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];typeof n!="object"&&n!=s[r]&&(s[r]=n)}switch(e.childNodes&&(s.childNodes=new Ft),s.ownerDocument=i,s.nodeType){case dt:var a=e.attributes,o=s.attributes=new un,l=a.length;o._ownerElement=s;for(var f=0;f",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` +`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),i.entityMap=i.HTML_ENTITIES})(nh);var Go={},Zs=Ht.NAMESPACE,to=/[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]/,Ql=new RegExp("[\\-\\.0-9"+to.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Jl=new RegExp("^"+to.source+Ql.source+"*(?::"+to.source+Ql.source+"*)?$"),ks=0,Kt=1,wi=2,Is=3,ki=4,Ii=5,Ps=6,qr=7;function Qi(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Qi)}Qi.prototype=new Error;Qi.prototype.name=Qi.name;function ah(){}ah.prototype={parse:function(i,e,t){var s=this.domBuilder;s.startDocument(),oh(e,e={}),Yb(i,e,t,s,this.errorHandler),s.endDocument()}};function Yb(i,e,t,s,r){function n(ie){if(ie>65535){ie-=65536;var Te=55296+(ie>>10),Pt=56320+(ie&1023);return String.fromCharCode(Te,Pt)}else return String.fromCharCode(ie)}function a(ie){var Te=ie.slice(1,-1);return Object.hasOwnProperty.call(t,Te)?t[Te]:Te.charAt(0)==="#"?n(parseInt(Te.substr(1).replace("x","0x"))):(r.error("entity not found:"+ie),ie)}function o(ie){if(ie>D){var Te=i.substring(D,ie).replace(/&#?\w+;/g,a);T&&l(D),s.characters(Te,0,ie-D),D=ie}}function l(ie,Te){for(;ie>=m&&(Te=y.exec(i));)f=Te.index,m=f+Te[0].length,T.lineNumber++;T.columnNumber=ie-f+1}for(var f=0,m=0,y=/.*(?:\r\n?|\n)|.*$/g,T=s.locator,S=[{currentNSMap:e}],_={},D=0;;){try{var w=i.indexOf("<",D);if(w<0){if(!i.substr(D).match(/^\s*$/)){var k=s.doc,I=k.createTextNode(i.substr(D));k.appendChild(I),s.currentElement=I}return}switch(w>D&&o(w),i.charAt(w+1)){case"/":var ee=i.indexOf(">",w+3),M=i.substring(w+2,ee).replace(/[ \t\n\r]+$/g,""),R=S.pop();ee<0?(M=i.substring(w+2).replace(/[\s<].*/,""),r.error("end tag name: "+M+" is not complete:"+R.tagName),ee=w+1+M.length):M.match(/\sD?D=ee:o(Math.max(w,D)+1)}}function Zl(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function Qb(i,e,t,s,r,n){function a(T,S,_){t.attributeNames.hasOwnProperty(T)&&n.fatalError("Attribute "+T+" redefined"),t.addValue(T,S.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),_)}for(var o,l,f=++e,m=ks;;){var y=i.charAt(f);switch(y){case"=":if(m===Kt)o=i.slice(e,f),m=Is;else if(m===wi)m=Is;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(m===Is||m===Kt)if(m===Kt&&(n.warning('attribute value must after "="'),o=i.slice(e,f)),e=f+1,f=i.indexOf(y,e),f>0)l=i.slice(e,f),a(o,l,e-1),m=Ii;else throw new Error("attribute value no end '"+y+"' match");else if(m==ki)l=i.slice(e,f),a(o,l,e),n.warning('attribute "'+o+'" missed start quot('+y+")!!"),e=f+1,m=Ii;else throw new Error('attribute value must after "="');break;case"/":switch(m){case ks:t.setTagName(i.slice(e,f));case Ii:case Ps:case qr:m=qr,t.closed=!0;case ki:case Kt:break;case wi:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),m==ks&&t.setTagName(i.slice(e,f)),f;case">":switch(m){case ks:t.setTagName(i.slice(e,f));case Ii:case Ps:case qr:break;case ki:case Kt:l=i.slice(e,f),l.slice(-1)==="/"&&(t.closed=!0,l=l.slice(0,-1));case wi:m===wi&&(l=o),m==ki?(n.warning('attribute "'+l+'" missed quot(")!'),a(o,l,e)):((!Zs.isHTML(s[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),a(l,l,e));break;case Is:throw new Error("attribute value missed!!")}return f;case"€":y=" ";default:if(y<=" ")switch(m){case ks:t.setTagName(i.slice(e,f)),m=Ps;break;case Kt:o=i.slice(e,f),m=wi;break;case ki:var l=i.slice(e,f);n.warning('attribute "'+l+'" missed quot(")!!'),a(o,l,e);case Ii:m=Ps;break}else switch(m){case wi:t.tagName,(!Zs.isHTML(s[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=f,m=Kt;break;case Ii:n.warning('attribute space is required"'+o+'"!!');case Ps:m=Kt,e=f;break;case Is:m=ki,e=f;break;case qr:throw new Error("elements closed character '/' and '>' must be connected to")}}f++}}function ec(i,e,t){for(var s=i.tagName,r=null,y=i.length;y--;){var n=i[y],a=n.qName,o=n.value,T=a.indexOf(":");if(T>0)var l=n.prefix=a.slice(0,T),f=a.slice(T+1),m=l==="xmlns"&&f;else f=a,l=null,m=a==="xmlns"&&"";n.localName=f,m!==!1&&(r==null&&(r={},oh(t,t={})),t[m]=r[m]=o,n.uri=Zs.XMLNS,e.startPrefixMapping(m,o))}for(var y=i.length;y--;){n=i[y];var l=n.prefix;l&&(l==="xml"&&(n.uri=Zs.XML),l!=="xmlns"&&(n.uri=t[l||""]))}var T=s.indexOf(":");T>0?(l=i.prefix=s.slice(0,T),f=i.localName=s.slice(T+1)):(l=null,f=i.localName=s);var S=i.uri=t[l||""];if(e.startElement(S,f,s,i),i.closed){if(e.endElement(S,f,s),r)for(l in r)Object.prototype.hasOwnProperty.call(r,l)&&e.endPrefixMapping(l)}else return i.currentNSMap=t,i.localNSMap=r,!0}function Jb(i,e,t,s,r){if(/^(?:script|textarea)$/i.test(t)){var n=i.indexOf("",e),a=i.substring(e+1,n);if(/[&<]/.test(a))return/^script$/i.test(t)?(r.characters(a,0,a.length),n):(a=a.replace(/&#?\w+;/g,s),r.characters(a,0,a.length),n)}return e+1}function Zb(i,e,t,s){var r=s[t];return r==null&&(r=i.lastIndexOf(""),r",e+4);return n>e?(t.comment(i,e+4,n-e-4),n+3):(s.error("Unclosed comment"),-1)}else return-1;default:if(i.substr(e+3,6)=="CDATA["){var n=i.indexOf("]]>",e+9);return t.startCDATA(),t.characters(i,e+9,n-e-9),t.endCDATA(),n+3}var a=i2(i,e),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var l=a[1][0],f=!1,m=!1;o>3&&(/^public$/i.test(a[2][0])?(f=a[3][0],m=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(m=a[3][0]));var y=a[o-1];return t.startDTD(l,f,m),t.endDTD(),y.index+y[0].length}}return-1}function t2(i,e,t){var s=i.indexOf("?>",e);if(s){var r=i.substring(e,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,t.processingInstruction(r[1],r[2]),s+2):-1}return-1}function uh(){this.attributeNames={}}uh.prototype={setTagName:function(i){if(!Jl.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!Jl.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:e,offset:t}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};function i2(i,e){var t,s=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(i);t=r.exec(i);)if(s.push(t),t[1])return s}Go.XMLReader=ah;Go.ParseError=Qi;var s2=Ht,r2=ei,tc=nh,lh=Go,n2=r2.DOMImplementation,ic=s2.NAMESPACE,a2=lh.ParseError,o2=lh.XMLReader;function ch(i){return i.replace(/\r[\n\u0085]/g,` +`).replace(/[\r\u0085\u2028]/g,` +`)}function dh(i){this.options=i||{locator:{}}}dh.prototype.parseFromString=function(i,e){var t=this.options,s=new o2,r=t.domBuilder||new ur,n=t.errorHandler,a=t.locator,o=t.xmlns||{},l=/\/x?html?$/.test(e),f=l?tc.HTML_ENTITIES:tc.XML_ENTITIES;a&&r.setDocumentLocator(a),s.errorHandler=u2(n,r,a),s.domBuilder=t.domBuilder||r,l&&(o[""]=ic.HTML),o.xml=o.xml||ic.XML;var m=t.normalizeLineEndings||ch;return i&&typeof i=="string"?s.parse(m(i),o,f):s.errorHandler.error("invalid doc source"),r.doc};function u2(i,e,t){if(!i){if(e instanceof ur)return e;i=e}var s={},r=i instanceof Function;t=t||{};function n(a){var o=i[a];!o&&r&&(o=i.length==2?function(l){i(a,l)}:i),s[a]=o&&function(l){o("[xmldom "+a+"] "+l+io(t))}||function(){}}return n("warning"),n("error"),n("fatalError"),s}function ur(){this.cdata=!1}function Pi(i,e){e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber}ur.prototype={startDocument:function(){this.doc=new n2().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,e,t,s){var r=this.doc,n=r.createElementNS(i,t||e),a=s.length;Vr(this,n),this.currentElement=n,this.locator&&Pi(this.locator,n);for(var o=0;o=e+t||e?new java.lang.String(i,e,t)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){ur.prototype[i]=function(){return null}});function Vr(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}Mn.__DOMHandler=ur;Mn.normalizeLineEndings=ch;Mn.DOMParser=dh;var l2=Mn.DOMParser;/*! @name mpd-parser @version 1.3.0 @license Apache-2.0 */const rc=i=>!!i&&typeof i=="object",we=(...i)=>i.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(s=>{Array.isArray(e[s])&&Array.isArray(t[s])?e[s]=e[s].concat(t[s]):rc(e[s])&&rc(t[s])?e[s]=we(e[s],t[s]):e[s]=t[s]}),e),{}),hh=i=>Object.keys(i).map(e=>i[e]),c2=(i,e)=>{const t=[];for(let s=i;si.reduce((e,t)=>e.concat(t),[]),fh=i=>{if(!i.length)return[];const e=[];for(let t=0;ti.reduce((t,s,r)=>(s[e]&&t.push(r),t),[]),h2=(i,e)=>hh(i.reduce((t,s)=>(s.forEach(r=>{t[e(r)]=r}),t),{}));var Zi={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 er=({baseUrl:i="",source:e="",range:t="",indexRange:s=""})=>{const r={uri:e,resolvedUri:Ln(i||"",e)};if(t||s){const a=(t||s).split("-");let o=E.BigInt?E.BigInt(a[0]):parseInt(a[0],10),l=E.BigInt?E.BigInt(a[1]):parseInt(a[1],10);o{let e;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=E.BigInt(i.offset)+E.BigInt(i.length)-E.BigInt(1):e=i.offset+i.length-1,`${i.offset}-${e}`},nc=i=>(i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i),p2={static(i){const{duration:e,timescale:t=1,sourceDuration:s,periodDuration:r}=i,n=nc(i.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:s/a}},dynamic(i){const{NOW:e,clientOffset:t,availabilityStartTime:s,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=i,f=nc(i.endNumber),m=(e+t)/1e3,y=s+a,S=m+o-y,_=Math.ceil(S*r/n),D=Math.floor((m-y-l)*r/n),w=Math.floor((m-y)*r/n);return{start:Math.max(0,D),end:typeof f=="number"?f:Math.min(_,w)}}},m2=i=>e=>{const{duration:t,timescale:s=1,periodStart:r,startNumber:n=1}=i;return{number:n+e,duration:t/s,timeline:r,time:e*t}},zo=i=>{const{type:e,duration:t,timescale:s=1,periodDuration:r,sourceDuration:n}=i,{start:a,end:o}=p2[e](i),l=c2(a,o).map(m2(i));if(e==="static"){const f=l.length-1,m=typeof r=="number"?r:n;l[f].duration=m-t/s*f}return l},ph=i=>{const{baseUrl:e,initialization:t={},sourceDuration:s,indexRange:r="",periodStart:n,presentationTime:a,number:o=0,duration:l}=i;if(!e)throw new Error(Zi.NO_BASE_URL);const f=er({baseUrl:e,source:t.sourceURL,range:t.range}),m=er({baseUrl:e,source:e,indexRange:r});if(m.map=f,l){const y=zo(i);y.length&&(m.duration=y[0].duration,m.timeline=y[0].timeline)}else s&&(m.duration=s,m.timeline=n);return m.presentationTime=a||n,m.number=o,[m]},Wo=(i,e,t)=>{const s=i.sidx.map?i.sidx.map:null,r=i.sidx.duration,n=i.timeline||0,a=i.sidx.byterange,o=a.offset+a.length,l=e.timescale,f=e.references.filter(w=>w.referenceType!==1),m=[],y=i.endList?"static":"dynamic",T=i.sidx.timeline;let S=T,_=i.mediaSequence||0,D;typeof e.firstOffset=="bigint"?D=E.BigInt(o)+e.firstOffset:D=o+e.firstOffset;for(let w=0;wh2(i,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),_2=(i,e)=>{for(let t=0;t{let e=[];return Ob(i,g2,(t,s,r,n)=>{e=e.concat(t.playlists||[])}),e},oc=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((t,s)=>{t.number=i.mediaSequence+s})},v2=({oldPlaylists:i,newPlaylists:e,timelineStarts:t})=>{e.forEach(s=>{s.discontinuitySequence=t.findIndex(function({timeline:l}){return l===s.timeline});const r=_2(i,s.attributes.NAME);if(!r||s.sidx)return;const n=s.segments[0],a=r.segments.findIndex(function(l){return Math.abs(l.presentationTime-n.presentationTime)r.timeline||r.segments.length&&s.timeline>r.segments[r.segments.length-1].timeline)&&s.discontinuitySequence--;return}r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,s.discontinuityStarts.unshift(0),s.discontinuitySequence--),oc({playlist:s,mediaSequence:r.segments[a].number})})},T2=({oldManifest:i,newManifest:e})=>{const t=i.playlists.concat(ac(i)),s=e.playlists.concat(ac(e));return e.timelineStarts=mh([i.timelineStarts,e.timelineStarts]),v2({oldPlaylists:t,newPlaylists:s,timelineStarts:e.timelineStarts}),e},Nn=i=>i&&i.uri+"-"+f2(i.byterange),La=i=>{const e=i.reduce(function(s,r){return s[r.attributes.baseUrl]||(s[r.attributes.baseUrl]=[]),s[r.attributes.baseUrl].push(r),s},{});let t=[];return Object.values(e).forEach(s=>{const r=hh(s.reduce((n,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return n[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[o].segments.push(...a.segments)),a.attributes.contentProtection&&(n[o].attributes.contentProtection=a.attributes.contentProtection)):(n[o]=a,n[o].attributes.timelineStarts=[]),n[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(s=>(s.discontinuityStarts=d2(s.segments||[],"discontinuity"),s))},Ko=(i,e)=>{const t=Nn(i.sidx),s=t&&e[t]&&e[t].sidx;return s&&Wo(i,s,i.sidx.resolvedUri),i},b2=(i,e={})=>{if(!Object.keys(e).length)return i;for(const t in i)i[t]=Ko(i[t],e);return i},S2=({attributes:i,segments:e,sidx:t,mediaSequence:s,discontinuitySequence:r,discontinuityStarts:n},a)=>{const o={attributes:{NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:i.timelineStarts,mediaSequence:s,segments:e};return i.contentProtection&&(o.contentProtection=i.contentProtection),i.serviceLocation&&(o.attributes.serviceLocation=i.serviceLocation),t&&(o.sidx=t),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},x2=({attributes:i,segments:e,mediaSequence:t,discontinuityStarts:s,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);const n={NAME:i.id,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1};i.codecs&&(n.CODECS=i.codecs);const a={attributes:n,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:s,discontinuitySequence:r,mediaSequence:t,segments:e};return i.serviceLocation&&(a.attributes.serviceLocation=i.serviceLocation),a},E2=(i,e={},t=!1)=>{let s;const r=i.reduce((n,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",l=a.attributes.lang||"";let f=a.attributes.label||"main";if(l&&!a.attributes.label){const y=o?` (${o})`:"";f=`${a.attributes.lang}${y}`}n[f]||(n[f]={language:l,autoselect:!0,default:o==="main",playlists:[],uri:""});const m=Ko(S2(a,t),e);return n[f].playlists.push(m),typeof s>"u"&&o==="main"&&(s=a,s.default=!0),n},{});if(!s){const n=Object.keys(r)[0];r[n].default=!0}return r},C2=(i,e={})=>i.reduce((t,s)=>{const r=s.attributes.label||s.attributes.lang||"text";return t[r]||(t[r]={language:r,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(Ko(x2(s),e)),t},{}),A2=i=>i.reduce((e,t)=>(t&&t.forEach(s=>{const{channel:r,language:n}=s;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},s.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=s.aspectRatio),s.hasOwnProperty("easyReader")&&(e[n].easyReader=s.easyReader),s.hasOwnProperty("3D")&&(e[n]["3D"]=s["3D"])}),e),{}),D2=({attributes:i,segments:e,sidx:t,discontinuityStarts:s})=>{const r={attributes:{NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuityStarts:s,timelineStarts:i.timelineStarts,segments:e};return i.frameRate&&(r.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(r.contentProtection=i.contentProtection),i.serviceLocation&&(r.attributes.serviceLocation=i.serviceLocation),t&&(r.sidx=t),r},w2=({attributes:i})=>i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video",k2=({attributes:i})=>i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio",I2=({attributes:i})=>i.mimeType==="text/vtt"||i.contentType==="text",P2=(i,e)=>{i.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:s}){return s===t.timeline}),t.segments&&t.segments.forEach((s,r)=>{s.number=r})})},uc=i=>i?Object.keys(i).reduce((e,t)=>{const s=i[t];return e.concat(s.playlists)},[]):[],L2=({dashPlaylists:i,locations:e,contentSteering:t,sidxMapping:s={},previousManifest:r,eventStream:n})=>{if(!i.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:f}=i[0].attributes,m=La(i.filter(w2)).map(D2),y=La(i.filter(k2)),T=La(i.filter(I2)),S=i.map(R=>R.attributes.captionServices).filter(Boolean),_={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:b2(m,s)};f>=0&&(_.minimumUpdatePeriod=f*1e3),e&&(_.locations=e),t&&(_.contentSteering=t),o==="dynamic"&&(_.suggestedPresentationDelay=l),n&&n.length>0&&(_.eventStream=n);const D=_.playlists.length===0,w=y.length?E2(y,s,D):null,k=T.length?C2(T,s):null,I=m.concat(uc(w),uc(k)),M=I.map(({timelineStarts:R})=>R);return _.timelineStarts=mh(M),P2(I,_.timelineStarts),w&&(_.mediaGroups.AUDIO.audio=w),k&&(_.mediaGroups.SUBTITLES.subs=k),S.length&&(_.mediaGroups["CLOSED-CAPTIONS"].cc=A2(S)),r?T2({oldManifest:r,newManifest:_}):_},O2=(i,e,t)=>{const{NOW:s,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=i,f=(s+r)/1e3,m=n+o,T=f+l-m;return Math.ceil((T*a-e)/t)},gh=(i,e)=>{const{type:t,minimumUpdatePeriod:s=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:l}=i,f=[];let m=-1;for(let y=0;ym&&(m=D);let w;if(_<0){const M=y+1;M===e.length?t==="dynamic"&&s>0&&r.indexOf("$Number$")>0?w=O2(i,m,S):w=(n*a-m)/S:w=(e[M].t-m)/S}else w=_+1;const k=o+f.length+w;let I=o+f.length;for(;I(e,t,s,r)=>{if(e==="$$")return"$";if(typeof i[t]>"u")return e;const n=""+i[t];return t==="RepresentationID"||(s?r=parseInt(r,10):r=1,n.length>=r)?n:`${new Array(r-n.length+1).join("0")}${n}`},lc=(i,e)=>i.replace(R2,M2(e)),N2=(i,e)=>!i.duration&&!e?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?zo(i):gh(i,e),B2=(i,e)=>{const t={RepresentationID:i.id,Bandwidth:i.bandwidth||0},{initialization:s={sourceURL:"",range:""}}=i,r=er({baseUrl:i.baseUrl,source:lc(s.sourceURL,t),range:s.range});return N2(i,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=lc(i.media||"",t),l=i.timescale||1,f=i.presentationTimeOffset||0,m=i.periodStart+(a.time-f)/l;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:Ln(i.baseUrl||"",o),map:r,number:a.number,presentationTime:m}})},F2=(i,e)=>{const{baseUrl:t,initialization:s={}}=i,r=er({baseUrl:t,source:s.sourceURL,range:s.range}),n=er({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},U2=(i,e)=>{const{duration:t,segmentUrls:s=[],periodStart:r}=i;if(!t&&!e||t&&e)throw new Error(Zi.SEGMENT_TIME_UNSPECIFIED);const n=s.map(l=>F2(i,l));let a;return t&&(a=zo(i)),e&&(a=gh(i,e)),a.map((l,f)=>{if(n[f]){const m=n[f],y=i.timescale||1,T=i.presentationTimeOffset||0;return m.timeline=l.timeline,m.duration=l.duration,m.number=l.number,m.presentationTime=r+(l.time-T)/y,m}}).filter(l=>l)},$2=({attributes:i,segmentInfo:e})=>{let t,s;e.template?(s=B2,t=we(i,e.template)):e.base?(s=ph,t=we(i,e.base)):e.list&&(s=U2,t=we(i,e.list));const r={attributes:i};if(!s)return r;const n=s(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:o=1}=t;t.duration=a/o}else n.length?t.duration=n.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},j2=i=>i.map($2),me=(i,e)=>fh(i.childNodes).filter(({tagName:t})=>t===e),lr=i=>i.textContent.trim(),q2=i=>parseFloat(i.split("/").reduce((e,t)=>e/t)),Li=i=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(i);if(!o)return 0;const[l,f,m,y,T,S]=o.slice(1);return parseFloat(l||0)*31536e3+parseFloat(f||0)*2592e3+parseFloat(m||0)*86400+parseFloat(y||0)*3600+parseFloat(T||0)*60+parseFloat(S||0)},V2=i=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)),cc={mediaPresentationDuration(i){return Li(i)},availabilityStartTime(i){return V2(i)/1e3},minimumUpdatePeriod(i){return Li(i)},suggestedPresentationDelay(i){return Li(i)},type(i){return i},timeShiftBufferDepth(i){return Li(i)},start(i){return Li(i)},width(i){return parseInt(i,10)},height(i){return parseInt(i,10)},bandwidth(i){return parseInt(i,10)},frameRate(i){return q2(i)},startNumber(i){return parseInt(i,10)},timescale(i){return parseInt(i,10)},presentationTimeOffset(i){return parseInt(i,10)},duration(i){const e=parseInt(i,10);return isNaN(e)?Li(i):e},d(i){return parseInt(i,10)},t(i){return parseInt(i,10)},r(i){return parseInt(i,10)},presentationTime(i){return parseInt(i,10)},DEFAULT(i){return i}},Ee=i=>i&&i.attributes?fh(i.attributes).reduce((e,t)=>{const s=cc[t.name]||cc.DEFAULT;return e[t.name]=s(t.value),e},{}):{},H2={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},Bn=(i,e)=>e.length?Ji(i.map(function(t){return e.map(function(s){const r=lr(s),n=Ln(t.baseUrl,r),a=we(Ee(s),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):i,Xo=i=>{const e=me(i,"SegmentTemplate")[0],t=me(i,"SegmentList")[0],s=t&&me(t,"SegmentURL").map(y=>we({tag:"SegmentURL"},Ee(y))),r=me(i,"SegmentBase")[0],n=t||e,a=n&&me(n,"SegmentTimeline")[0],o=t||r||e,l=o&&me(o,"Initialization")[0],f=e&&Ee(e);f&&l?f.initialization=l&&Ee(l):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});const m={template:f,segmentTimeline:a&&me(a,"S").map(y=>Ee(y)),list:t&&we(Ee(t),{segmentUrls:s,initialization:Ee(l)}),base:r&&we(Ee(r),{initialization:Ee(l)})};return Object.keys(m).forEach(y=>{m[y]||delete m[y]}),m},G2=(i,e,t)=>s=>{const r=me(s,"BaseURL"),n=Bn(e,r),a=we(i,Ee(s)),o=Xo(s);return n.map(l=>({segmentInfo:we(t,o),attributes:we(a,l)}))},z2=i=>i.reduce((e,t)=>{const s=Ee(t);s.schemeIdUri&&(s.schemeIdUri=s.schemeIdUri.toLowerCase());const r=H2[s.schemeIdUri];if(r){e[r]={attributes:s};const n=me(t,"cenc:pssh")[0];if(n){const a=lr(n);e[r].pssh=a&&Mb(a)}}return e},{}),W2=i=>{if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let s,r;return r=t,/^CC\d=/.test(t)?[s,r]=t.split("="):/^CC\d$/.test(t)&&(s=t),{channel:s,language:r}});if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{const s={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,n=""]=t.split("=");s.channel=r,s.language=t,n.split(",").forEach(a=>{const[o,l]=a.split(":");o==="lang"?s.language=l:o==="er"?s.easyReader=Number(l):o==="war"?s.aspectRatio=Number(l):o==="3D"&&(s["3D"]=Number(l))})}else s.language=t;return s.channel&&(s.channel="SERVICE"+s.channel),s})},K2=i=>Ji(me(i.node,"EventStream").map(e=>{const t=Ee(e),s=t.schemeIdUri;return me(e,"Event").map(r=>{const n=Ee(r),a=n.presentationTime||0,o=t.timescale||1,l=n.duration||0,f=a/o+i.attributes.start;return{schemeIdUri:s,value:t.value,id:n.id,start:f,end:f+l/o,messageData:lr(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),X2=(i,e,t)=>s=>{const r=Ee(s),n=Bn(e,me(s,"BaseURL")),a=me(s,"Role")[0],o={role:Ee(a)};let l=we(i,r,o);const f=me(s,"Accessibility")[0],m=W2(Ee(f));m&&(l=we(l,{captionServices:m}));const y=me(s,"Label")[0];if(y&&y.childNodes.length){const w=y.childNodes[0].nodeValue.trim();l=we(l,{label:w})}const T=z2(me(s,"ContentProtection"));Object.keys(T).length&&(l=we(l,{contentProtection:T}));const S=Xo(s),_=me(s,"Representation"),D=we(t,S);return Ji(_.map(G2(l,n,D)))},Y2=(i,e)=>(t,s)=>{const r=Bn(e,me(t.node,"BaseURL")),n=we(i,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=me(t.node,"AdaptationSet"),o=Xo(t.node);return Ji(a.map(X2(n,r,o)))},Q2=(i,e)=>{if(i.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!i.length)return null;const t=we({serverURL:lr(i[0])},Ee(i[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},J2=({attributes:i,priorPeriodAttributes:e,mpdType:t})=>typeof i.start=="number"?i.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,Z2=(i,e={})=>{const{manifestUri:t="",NOW:s=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=me(i,"Period");if(!a.length)throw new Error(Zi.INVALID_NUMBER_OF_PERIOD);const o=me(i,"Location"),l=Ee(i),f=Bn([{baseUrl:t}],me(i,"BaseURL")),m=me(i,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=s,l.clientOffset=r,o.length&&(l.locations=o.map(lr));const y=[];return a.forEach((T,S)=>{const _=Ee(T),D=y[S-1];_.start=J2({attributes:_,priorPeriodAttributes:D?D.attributes:null,mpdType:l.type}),y.push({node:T,attributes:_})}),{locations:l.locations,contentSteeringInfo:Q2(m,n),representationInfo:Ji(y.map(Y2(l,f))),eventStream:Ji(y.map(K2))}},yh=i=>{if(i==="")throw new Error(Zi.DASH_EMPTY_MANIFEST);const e=new l2;let t,s;try{t=e.parseFromString(i,"application/xml"),s=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!s||s&&s.getElementsByTagName("parsererror").length>0)throw new Error(Zi.DASH_INVALID_XML);return s},e1=i=>{const e=me(i,"UTCTiming")[0];if(!e)return null;const t=Ee(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Zi.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},t1=(i,e={})=>{const t=Z2(yh(i),e),s=j2(t.representationInfo);return L2({dashPlaylists:s,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},i1=i=>e1(yh(i));var _h=Math.pow(2,32),s1=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t;return e.getBigUint64?(t=e.getBigUint64(0),t0;s+=12,r--)t.references.push({referenceType:(i[s]&128)>>>7,referencedSize:e.getUint32(s)&2147483647,subsegmentDuration:e.getUint32(s+4),startsWithSap:!!(i[s+8]&128),sapType:(i[s+8]&112)>>>4,sapDeltaTime:e.getUint32(s+8)&268435455});return t},a1=n1;const o1=Zt(a1);var u1=H([73,68,51]),l1=function(e,t){t===void 0&&(t=0),e=H(e);var s=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(s&16)>>4;return n?r+20:r+10},Us=function i(e,t){return t===void 0&&(t=0),e=H(e),e.length-t<10||!pe(e,u1,{offset:t})?t:(t+=l1(e,t),i(e,t))},hc=function(e){return typeof e=="string"?Nd(e):e},c1=function(e){return Array.isArray(e)?e.map(function(t){return hc(t)}):[hc(e)]},d1=function i(e,t,s){s===void 0&&(s=!1),t=c1(t),e=H(e);var r=[];if(!t.length)return r;for(var n=0;n>>0,o=e.subarray(n+4,n+8);if(a===0)break;var l=n+a;if(l>e.length){if(s)break;l=e.length}var f=e.subarray(n+8,l);pe(o,t[0])&&(t.length===1?r.push(f):r.push.apply(r,i(f,t.slice(1),s))),n=l}return r},Hr={EBML:H([26,69,223,163]),DocType:H([66,130]),Segment:H([24,83,128,103]),SegmentInfo:H([21,73,169,102]),Tracks:H([22,84,174,107]),Track:H([174]),TrackNumber:H([215]),DefaultDuration:H([35,227,131]),TrackEntry:H([174]),TrackType:H([131]),FlagDefault:H([136]),CodecID:H([134]),CodecPrivate:H([99,162]),VideoTrack:H([224]),AudioTrack:H([225]),Cluster:H([31,67,182,117]),Timestamp:H([231]),TimestampScale:H([42,215,177]),BlockGroup:H([160]),BlockDuration:H([155]),Block:H([161]),SimpleBlock:H([163])},so=[128,64,32,16,8,4,2,1],h1=function(e){for(var t=1,s=0;s=t.length)return t.length;var r=dn(t,s,!1);if(pe(e.bytes,r.bytes))return s;var n=dn(t,s+r.length);return i(e,t,s+n.length+n.value+r.length)},pc=function i(e,t){t=f1(t),e=H(e);var s=[];if(!t.length)return s;for(var r=0;re.length?e.length:o+a.value,f=e.subarray(o,l);pe(t[0],n.bytes)&&(t.length===1?s.push(f):s=s.concat(i(f,t.slice(1))));var m=n.length+a.length+f.length;r+=m}return s},m1=H([0,0,0,1]),g1=H([0,0,1]),y1=H([0,0,3]),_1=function(e){for(var t=[],s=1;s>1&63),s.indexOf(f)!==-1&&(a=n+l),n+=l+(t==="h264"?1:2)}return e.subarray(0,0)},v1=function(e,t,s){return vh(e,"h264",t,s)},T1=function(e,t,s){return vh(e,"h265",t,s)},Ne={webm:H([119,101,98,109]),matroska:H([109,97,116,114,111,115,107,97]),flac:H([102,76,97,67]),ogg:H([79,103,103,83]),ac3:H([11,119]),riff:H([82,73,70,70]),avi:H([65,86,73]),wav:H([87,65,86,69]),"3gp":H([102,116,121,112,51,103]),mp4:H([102,116,121,112]),fmp4:H([115,116,121,112]),mov:H([102,116,121,112,113,116]),moov:H([109,111,111,118]),moof:H([109,111,111,102])},es={aac:function(e){var t=Us(e);return pe(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Us(e);return pe(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=pc(e,[Hr.EBML,Hr.DocType])[0];return pe(t,Ne.webm)},mkv:function(e){var t=pc(e,[Hr.EBML,Hr.DocType])[0];return pe(t,Ne.matroska)},mp4:function(e){if(es["3gp"](e)||es.mov(e))return!1;if(pe(e,Ne.mp4,{offset:4})||pe(e,Ne.fmp4,{offset:4})||pe(e,Ne.moof,{offset:4})||pe(e,Ne.moov,{offset:4}))return!0},mov:function(e){return pe(e,Ne.mov,{offset:4})},"3gp":function(e){return pe(e,Ne["3gp"],{offset:4})},ac3:function(e){var t=Us(e);return pe(e,Ne.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+1880},Qo=9e4,Jo,Zo,Fn,eu,Th,bh,Sh;Jo=function(i){return i*Qo};Zo=function(i,e){return i*e};Fn=function(i){return i/Qo};eu=function(i,e){return i/e};Th=function(i,e){return Jo(eu(i,e))};bh=function(i,e){return Zo(Fn(i),e)};Sh=function(i,e,t){return Fn(t?i:i-e)};var mi={ONE_SECOND_IN_TS:Qo,secondsToVideoTs:Jo,secondsToAudioTs:Zo,videoTsToSeconds:Fn,audioTsToSeconds:eu,audioTsToVideoTs:Th,videoTsToAudioTs:bh,metadataTsToSeconds:Sh};/** + * @license + * Video.js 8.12.0 + * Copyright Brightcove, Inc. + * Available under Apache License Version 2.0 + * + * + * Includes vtt.js + * Available under Apache License Version 2.0 + * + */var no="8.12.0";const Nt={},Qt=function(i,e){return Nt[i]=Nt[i]||[],e&&(Nt[i]=Nt[i].concat(e)),Nt[i]},x1=function(i,e){Qt(i,e)},xh=function(i,e){const t=Qt(i).indexOf(e);return t<=-1?!1:(Nt[i]=Nt[i].slice(),Nt[i].splice(t,1),!0)},E1=function(i,e){Qt(i,[].concat(e).map(t=>{const s=(...r)=>(xh(i,s),t(...r));return s}))},hn={prefixed:!0},en=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],mc=en[0];let $s;for(let i=0;i(s,r,n)=>{const a=e.levels[r],o=new RegExp(`^(${a})$`);let l=i;if(s!=="log"&&n.unshift(s.toUpperCase()+":"),t&&(l=`%c${i}`,n.unshift(t)),n.unshift(l+":"),Ve){Ve.push([].concat(n));const m=Ve.length-1e3;Ve.splice(0,m>0?m:0)}if(!E.console)return;let f=E.console[s];!f&&s==="debug"&&(f=E.console.info||E.console.log),!(!f||!a||!o.test(s))&&f[Array.isArray(n)?"apply":"call"](E.console,n)};function ao(i,e=":",t=""){let s="info",r;const n=function(...a){r("log",s,a)};return r=C1(i,n,t),n.createLogger=(a,o,l)=>{const f=o!==void 0?o:e,m=l!==void 0?l:t,y=`${i} ${f} ${a}`;return ao(y,f,m)},n.createNewLogger=(a,o,l)=>ao(a,o,l),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);s=a}return s},n.history=()=>Ve?[].concat(Ve):[],n.history.filter=a=>(Ve||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),n.history.clear=()=>{Ve&&(Ve.length=0)},n.history.disable=()=>{Ve!==null&&(Ve.length=0,Ve=null)},n.history.enable=()=>{Ve===null&&(Ve=[])},n.error=(...a)=>r("error",s,a),n.warn=(...a)=>r("warn",s,a),n.debug=(...a)=>r("debug",s,a),n}const Z=ao("VIDEOJS"),Eh=Z.createLogger,A1=Object.prototype.toString,Ch=function(i){return At(i)?Object.keys(i):[]};function qi(i,e){Ch(i).forEach(t=>e(i[t],t))}function Ah(i,e,t=0){return Ch(i).reduce((s,r)=>e(s,i[r],r),t)}function At(i){return!!i&&typeof i=="object"}function ts(i){return At(i)&&A1.call(i)==="[object Object]"&&i.constructor===Object}function le(...i){const e={};return i.forEach(t=>{t&&qi(t,(s,r)=>{if(!ts(s)){e[r]=s;return}ts(e[r])||(e[r]={}),e[r]=le(e[r],s)})}),e}function Dh(i={}){const e=[];for(const t in i)if(i.hasOwnProperty(t)){const s=i[t];e.push(s)}return e}function Un(i,e,t,s=!0){const r=a=>Object.defineProperty(i,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return s&&(n.set=r),Object.defineProperty(i,e,n)}var D1=Object.freeze({__proto__:null,each:qi,reduce:Ah,isObject:At,isPlain:ts,merge:le,values:Dh,defineLazyProperty:Un});let tu=!1,wh=null,Dt=!1,kh,Ih=!1,Vi=!1,Hi=!1,wt=!1,iu=null,$n=null,Ph=null,fn=!1,jn=!1,pn=!1,qn=!1,oo=!1,uo=!1,lo=!1;const tr=!!(ls()&&("ontouchstart"in E||E.navigator.maxTouchPoints||E.DocumentTouch&&E.document instanceof E.DocumentTouch)),Xt=E.navigator&&E.navigator.userAgentData;Xt&&Xt.platform&&Xt.brands&&(Dt=Xt.platform==="Android",Vi=!!Xt.brands.find(i=>i.brand==="Microsoft Edge"),Hi=!!Xt.brands.find(i=>i.brand==="Chromium"),wt=!Vi&&Hi,iu=$n=(Xt.brands.find(i=>i.brand==="Chromium")||{}).version||null,jn=Xt.platform==="Windows");if(!Hi){const i=E.navigator&&E.navigator.userAgent||"";tu=/iPod/i.test(i),wh=function(){const e=i.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Dt=/Android/i.test(i),kh=function(){const e=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),s=e[2]&&parseFloat(e[2]);return t&&s?parseFloat(e[1]+"."+e[2]):t||null}(),Ih=/Firefox/i.test(i),Vi=/Edg/i.test(i),Hi=/Chrome/i.test(i)||/CriOS/i.test(i),wt=!Vi&&Hi,iu=$n=function(){const e=i.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Ph=function(){const e=/MSIE\s(\d+)\.\d/.exec(i);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(i)&&/rv:11.0/.test(i)&&(t=11),t}(),oo=/Tizen/i.test(i),uo=/Web0S/i.test(i),lo=oo||uo,fn=/Safari/i.test(i)&&!wt&&!Dt&&!Vi&&!lo,jn=/Windows/i.test(i),pn=/iPad/i.test(i)||fn&&tr&&!/iPhone/i.test(i),qn=/iPhone/i.test(i)&&!pn}const $e=qn||pn||tu,Vn=(fn||$e)&&!wt;var Lh=Object.freeze({__proto__:null,get IS_IPOD(){return tu},get IOS_VERSION(){return wh},get IS_ANDROID(){return Dt},get ANDROID_VERSION(){return kh},get IS_FIREFOX(){return Ih},get IS_EDGE(){return Vi},get IS_CHROMIUM(){return Hi},get IS_CHROME(){return wt},get CHROMIUM_VERSION(){return iu},get CHROME_VERSION(){return $n},get IE_VERSION(){return Ph},get IS_SAFARI(){return fn},get IS_WINDOWS(){return jn},get IS_IPAD(){return pn},get IS_IPHONE(){return qn},get IS_TIZEN(){return oo},get IS_WEBOS(){return uo},get IS_SMART_TV(){return lo},TOUCH_ENABLED:tr,IS_IOS:$e,IS_ANY_SAFARI:Vn});function gc(i){return typeof i=="string"&&!!i.trim()}function w1(i){if(i.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function ls(){return F===E.document}function cs(i){return At(i)&&i.nodeType===1}function Oh(){try{return E.parent!==E.self}catch{return!0}}function Rh(i){return function(e,t){if(!gc(e))return F[i](null);gc(t)&&(t=F.querySelector(t));const s=cs(t)?t:F;return s[i]&&s[i](e)}}function Y(i="div",e={},t={},s){const r=F.createElement(i);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?ti(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),s&&su(r,s),r}function ti(i,e){return typeof i.textContent>"u"?i.innerText=e:i.textContent=e,i}function co(i,e){e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}function Hs(i,e){return w1(e),i.classList.contains(e)}function _i(i,...e){return i.classList.add(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i}function Hn(i,...e){return i?(i.classList.remove(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i):(Z.warn("removeClass was called with an element that doesn't exist"),null)}function Mh(i,e,t){return typeof t=="function"&&(t=t(i,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(s=>i.classList.toggle(s,t)),i}function Nh(i,e){Object.getOwnPropertyNames(e).forEach(function(t){const s=e[t];s===null||typeof s>"u"||s===!1?i.removeAttribute(t):i.setAttribute(t,s===!0?"":s)})}function Yt(i){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(i&&i.attributes&&i.attributes.length>0){const s=i.attributes;for(let r=s.length-1;r>=0;r--){const n=s[r].name;let a=s[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function Bh(i,e){return i.getAttribute(e)}function is(i,e,t){i.setAttribute(e,t)}function Gn(i,e){i.removeAttribute(e)}function Fh(){F.body.focus(),F.onselectstart=function(){return!1}}function Uh(){F.onselectstart=function(){return!0}}function ss(i){if(i&&i.getBoundingClientRect&&i.parentNode){const e=i.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(s=>{e[s]!==void 0&&(t[s]=e[s])}),t.height||(t.height=parseFloat(rs(i,"height"))),t.width||(t.width=parseFloat(rs(i,"width"))),t}}function ir(i){if(!i||i&&!i.offsetParent)return{left:0,top:0,width:0,height:0};const e=i.offsetWidth,t=i.offsetHeight;let s=0,r=0;for(;i.offsetParent&&i!==F[hn.fullscreenElement];)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return{left:s,top:r,width:e,height:t}}function zn(i,e){const t={x:0,y:0};if($e){let m=i;for(;m&&m.nodeName.toLowerCase()!=="html";){const y=rs(m,"transform");if(/^matrix/.test(y)){const T=y.slice(7,-1).split(/,\s/).map(Number);t.x+=T[4],t.y+=T[5]}else if(/^matrix3d/.test(y)){const T=y.slice(9,-1).split(/,\s/).map(Number);t.x+=T[12],t.y+=T[13]}m=m.parentNode}}const s={},r=ir(e.target),n=ir(i),a=n.width,o=n.height;let l=e.offsetY-(n.top-r.top),f=e.offsetX-(n.left-r.left);return e.changedTouches&&(f=e.changedTouches[0].pageX-n.left,l=e.changedTouches[0].pageY+n.top,$e&&(f-=t.x,l-=t.y)),s.y=1-Math.max(0,Math.min(1,l/o)),s.x=Math.max(0,Math.min(1,f/a)),s}function $h(i){return At(i)&&i.nodeType===3}function Wn(i){for(;i.firstChild;)i.removeChild(i.firstChild);return i}function jh(i){return typeof i=="function"&&(i=i()),(Array.isArray(i)?i:[i]).map(e=>{if(typeof e=="function"&&(e=e()),cs(e)||$h(e))return e;if(typeof e=="string"&&/\S/.test(e))return F.createTextNode(e)}).filter(e=>e)}function su(i,e){return jh(e).forEach(t=>i.appendChild(t)),i}function qh(i,e){return su(Wn(i),e)}function sr(i){return i.button===void 0&&i.buttons===void 0||i.button===0&&i.buttons===void 0||i.type==="mouseup"&&i.button===0&&i.buttons===0?!0:!(i.button!==0||i.buttons!==1)}const Jt=Rh("querySelector"),Vh=Rh("querySelectorAll");function rs(i,e){if(!i||!e)return"";if(typeof E.getComputedStyle=="function"){let t;try{t=E.getComputedStyle(i)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function Hh(i){[...F.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),s=F.createElement("style");s.textContent=t,i.document.head.appendChild(s)}catch{const s=F.createElement("link");s.rel="stylesheet",s.type=e.type,s.media=e.media.mediaText,s.href=e.href,i.document.head.appendChild(s)}})}var Gh=Object.freeze({__proto__:null,isReal:ls,isEl:cs,isInFrame:Oh,createEl:Y,textContent:ti,prependTo:co,hasClass:Hs,addClass:_i,removeClass:Hn,toggleClass:Mh,setAttributes:Nh,getAttributes:Yt,getAttribute:Bh,setAttribute:is,removeAttribute:Gn,blockTextSelection:Fh,unblockTextSelection:Uh,getBoundingClientRect:ss,findPosition:ir,getPointerPosition:zn,isTextNode:$h,emptyEl:Wn,normalizeContent:jh,appendContent:su,insertContent:qh,isSingleLeftClick:sr,$:Jt,$$:Vh,computedStyle:rs,copyStyleSheetsToWindow:Hh});let zh=!1,ho;const k1=function(){if(ho.options.autoSetup===!1)return;const i=Array.prototype.slice.call(F.getElementsByTagName("video")),e=Array.prototype.slice.call(F.getElementsByTagName("audio")),t=Array.prototype.slice.call(F.getElementsByTagName("video-js")),s=i.concat(e,t);if(s&&s.length>0)for(let r=0,n=s.length;r-1&&(r={passive:!0}),i.addEventListener(e,s.dispatcher,r)}else i.attachEvent&&i.attachEvent("on"+e,s.dispatcher)}function Oe(i,e,t){if(!Ue.has(i))return;const s=Ue.get(i);if(!s.handlers)return;if(Array.isArray(e))return ru(Oe,i,e,t);const r=function(a,o){s.handlers[o]=[],yc(a,o)};if(e===void 0){for(const a in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},a)&&r(i,a);return}const n=s.handlers[e];if(n){if(!t){r(i,e);return}if(t.guid)for(let a=0;a=e&&(i(...r),t=n)}},Xh=function(i,e,t,s=E){let r;const n=()=>{s.clearTimeout(r),r=null},a=function(){const o=this,l=arguments;let f=function(){r=null,f=null,t||i.apply(o,l)};!r&&t&&i.apply(o,l),s.clearTimeout(r),r=s.setTimeout(f,e)};return a.cancel=n,a};var M1=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:at,bind_:ce,throttle:kt,debounce:Xh});let Ls;class ot{on(e,t){const s=this.addEventListener;this.addEventListener=()=>{},tt(this,e,t),this.addEventListener=s}off(e,t){Oe(this,e,t)}one(e,t){const s=this.addEventListener;this.addEventListener=()=>{},Xn(this,e,t),this.addEventListener=s}any(e,t){const s=this.addEventListener;this.addEventListener=()=>{},nu(this,e,t),this.addEventListener=s}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Kn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),ds(this,e)}queueTrigger(e){Ls||(Ls=new Map);const t=e.type||e;let s=Ls.get(this);s||(s=new Map,Ls.set(this,s));const r=s.get(t);s.delete(t),E.clearTimeout(r);const n=E.setTimeout(()=>{s.delete(t),s.size===0&&(s=null,Ls.delete(this)),this.trigger(e)},0);s.set(t,n)}}ot.prototype.allowedEvents_={};ot.prototype.addEventListener=ot.prototype.on;ot.prototype.removeEventListener=ot.prototype.off;ot.prototype.dispatchEvent=ot.prototype.trigger;const Yn=i=>typeof i.name=="function"?i.name():typeof i.name=="string"?i.name:i.name_?i.name_:i.constructor&&i.constructor.name?i.constructor.name:typeof i,Ut=i=>i instanceof ot||!!i.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof i[e]=="function"),N1=(i,e)=>{Ut(i)?e():(i.eventedCallbacks||(i.eventedCallbacks=[]),i.eventedCallbacks.push(e))},mo=i=>typeof i=="string"&&/\S/.test(i)||Array.isArray(i)&&!!i.length,mn=(i,e,t)=>{if(!i||!i.nodeName&&!Ut(i))throw new Error(`Invalid target for ${Yn(e)}#${t}; must be a DOM node or evented object.`)},Yh=(i,e,t)=>{if(!mo(i))throw new Error(`Invalid event type for ${Yn(e)}#${t}; must be a non-empty string or array.`)},Qh=(i,e,t)=>{if(typeof i!="function")throw new Error(`Invalid listener for ${Yn(e)}#${t}; must be a function.`)},Oa=(i,e,t)=>{const s=e.length<3||e[0]===i||e[0]===i.eventBusEl_;let r,n,a;return s?(r=i.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):[r,n,a]=e,mn(r,i,t),Yh(n,i,t),Qh(a,i,t),a=ce(i,a),{isTargetingSelf:s,target:r,type:n,listener:a}},di=(i,e,t,s)=>{mn(i,i,e),i.nodeName?R1[e](i,t,s):i[e](t,s)},B1={on(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Oa(this,i,"on");if(di(t,"on",s,r),!e){const n=()=>this.off(t,s,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,di(this,"on","dispose",n),di(t,"on","dispose",a)}},one(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Oa(this,i,"one");if(e)di(t,"one",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,di(t,"one",s,n)}},any(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Oa(this,i,"any");if(e)di(t,"any",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,di(t,"any",s,n)}},off(i,e,t){if(!i||mo(i))Oe(this.eventBusEl_,i,e);else{const s=i,r=e;mn(s,this,"off"),Yh(r,this,"off"),Qh(t,this,"off"),t=ce(this,t),this.off("dispose",t),s.nodeName?(Oe(s,r,t),Oe(s,"dispose",t)):Ut(s)&&(s.off(r,t),s.off("dispose",t))}},trigger(i,e){mn(this.eventBusEl_,this,"trigger");const t=i&&typeof i!="string"?i.type:i;if(!mo(t))throw new Error(`Invalid event type for ${Yn(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return ds(this.eventBusEl_,i,e)}};function au(i,e={}){const{eventBusKey:t}=e;if(t){if(!i[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);i.eventBusEl_=i[t]}else i.eventBusEl_=Y("span",{className:"vjs-event-bus"});return Object.assign(i,B1),i.eventedCallbacks&&i.eventedCallbacks.forEach(s=>{s()}),i.on("dispose",()=>{i.off(),[i,i.el_,i.eventBusEl_].forEach(function(s){s&&Ue.has(s)&&Ue.delete(s)}),E.setTimeout(()=>{i.eventBusEl_=null},0)}),i}const F1={state:{},setState(i){typeof i=="function"&&(i=i());let e;return qi(i,(t,s)=>{this.state[s]!==t&&(e=e||{},e[s]={from:this.state[s],to:t}),this.state[s]=t}),e&&Ut(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function Jh(i,e){return Object.assign(i,F1),i.state=Object.assign({},i.state,e),typeof i.handleStateChanged=="function"&&Ut(i)&&i.on("statechanged",i.handleStateChanged),i}const Gs=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toLowerCase())},ve=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},Zh=function(i,e){return ve(i)===ve(e)};var U1=Object.freeze({__proto__:null,toLowerCase:Gs,toTitleCase:ve,titleCaseEquals:Zh});let B=class qe{constructor(e,t,s){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=le({},this.options_),t=this.options_=le(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${ft()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&(au(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),Jh(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(s),t.reportTouchActivity!==!1&&this.enableTouchActivity()}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e,t){}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=le(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,s){return Y(e,t,s)}localize(e,t,s=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],o=r&&r.split("-")[0],l=n&&n[o];let f=s;return a&&a[e]?f=a[e]:l&&l[e]&&(f=l[e]),t&&(f=f.replace(/\{(\d+)\}/g,function(m,y){const T=t[y-1];let S=T;return typeof T>"u"&&(S=m),S})),f}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((s,r)=>s.concat(r),[]);let t=this;for(let s=0;s=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[ve(e.name())]=null,this.childNameIndex_[Gs(e.name())]=null;const s=e.el();s&&s.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,s=a=>{const o=a.name;let l=a.opts;if(t[o]!==void 0&&(l=t[o]),l===!1)return;l===!0&&(l={}),l.playerOptions=this.options_.playerOptions;const f=this.addChild(o,l);f&&(this[o]=f)};let r;const n=qe.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(o){return typeof o=="string"?a===o:a===o.name})})).map(a=>{let o,l;return typeof a=="string"?(o=a,l=e[o]||this.options_[o]||{}):(o=a.name,l=a),{name:o,opts:l}}).filter(a=>{const o=qe.getComponent(a.opts.componentClass||ve(a.name));return o&&!n.isTech(o)}).forEach(s)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return Jt(e,t||this.contentEl())}$$(e,t){return Vh(e,t||this.contentEl())}hasClass(e){return Hs(this.el_,e)}addClass(...e){_i(this.el_,...e)}removeClass(...e){Hn(this.el_,...e)}toggleClass(e,t){Mh(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 Bh(this.el_,e)}setAttribute(e,t){is(this.el_,e,t)}removeAttribute(e){Gn(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,s){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",s||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+ve(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=rs(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const s=`offset${ve(e)}`;t=this.el_[s]}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){this.player_&&(W.isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const s=10,r=200;let n;this.on("touchstart",function(o){o.touches.length===1&&(t={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},e=E.performance.now(),n=!0)}),this.on("touchmove",function(o){if(o.touches.length>1)n=!1;else if(t){const l=o.touches[0].pageX-t.pageX,f=o.touches[0].pageY-t.pageY;Math.sqrt(l*l+f*f)>s&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(o){t=null,n===!0&&E.performance.now()-e{this.setTimeoutIds_.has(s)&&this.setTimeoutIds_.delete(s),e()},t),this.setTimeoutIds_.add(s),s}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),E.clearTimeout(e)),e}setInterval(e,t){e=ce(this,e),this.clearTimersOnDispose_();const s=E.setInterval(e,t);return this.setIntervalIds_.add(s),s}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),E.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=ce(this,e),t=E.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e))return;this.clearTimersOnDispose_(),t=ce(this,t);const s=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,s),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),E.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((s,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const s=qe.getComponent("Tech"),r=s&&s.isTech(t),n=qe===t||qe.prototype.isPrototypeOf(t.prototype);if(r||!n){let o;throw r?o="techs must be registered using Tech.registerTech()":o="must be a Component subclass",new Error(`Illegal component, "${e}"; ${o}.`)}e=ve(e),qe.components_||(qe.components_={});const a=qe.getComponent("Player");if(e==="Player"&&a&&a.players){const o=a.players,l=Object.keys(o);if(o&&l.length>0&&l.map(f=>o[f]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return qe.components_[e]=t,qe.components_[Gs(e)]=t,t}static getComponent(e){if(!(!e||!qe.components_))return qe.components_[e]}};B.registerComponent("Component",B);function $1(i,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${i}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function _c(i,e,t,s){return $1(i,s,t.length-1),t[s][e]}function Ra(i){let e;return i===void 0||i.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:i.length,start:_c.bind(null,"start",0,i),end:_c.bind(null,"end",1,i)},E.Symbol&&E.Symbol.iterator&&(e[E.Symbol.iterator]=()=>(i||[]).values()),e}function ht(i,e){return Array.isArray(i)?Ra(i):i===void 0||e===void 0?Ra():Ra([[i,e]])}const ef=function(i,e){i=i<0?0:i;let t=Math.floor(i%60),s=Math.floor(i/60%60),r=Math.floor(i/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(r=s=t="-"),r=r>0||a>0?r+":":"",s=((r||n>=10)&&s<10?"0"+s:s)+":",t=t<10?"0"+t:t,r+s+t};let ou=ef;function tf(i){ou=i}function sf(){ou=ef}function Si(i,e=i){return ou(i,e)}var j1=Object.freeze({__proto__:null,createTimeRanges:ht,createTimeRange:ht,setFormatTime:tf,resetFormatTime:sf,formatTime:Si});function rf(i,e){let t=0,s,r;if(!e)return 0;(!i||!i.length)&&(i=ht(0,0));for(let n=0;ne&&(r=e),t+=r-s;return t/e}function _e(i){if(i instanceof _e)return i;typeof i=="number"?this.code=i:typeof i=="string"?this.message=i:At(i)&&(typeof i.code=="number"&&(this.code=i.code),Object.assign(this,i)),this.message||(this.message=_e.defaultMessages[this.code]||"")}_e.prototype.code=0;_e.prototype.message="";_e.prototype.status=null;_e.prototype.metadata=null;_e.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];_e.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."};_e.MEDIA_ERR_CUSTOM=0;_e.prototype.MEDIA_ERR_CUSTOM=0;_e.MEDIA_ERR_ABORTED=1;_e.prototype.MEDIA_ERR_ABORTED=1;_e.MEDIA_ERR_NETWORK=2;_e.prototype.MEDIA_ERR_NETWORK=2;_e.MEDIA_ERR_DECODE=3;_e.prototype.MEDIA_ERR_DECODE=3;_e.MEDIA_ERR_SRC_NOT_SUPPORTED=4;_e.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;_e.MEDIA_ERR_ENCRYPTED=5;_e.prototype.MEDIA_ERR_ENCRYPTED=5;function zs(i){return i!=null&&typeof i.then=="function"}function vt(i){zs(i)&&i.then(null,e=>{})}const go=function(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,s,r)=>(i[s]&&(t[s]=i[s]),t),{cues:i.cues&&Array.prototype.map.call(i.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},q1=function(i){const e=i.$$("track"),t=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const n=go(r.track);return r.src&&(n.src=r.src),n}).concat(Array.prototype.filter.call(i.textTracks(),function(r){return t.indexOf(r)===-1}).map(go))},V1=function(i,e){return i.forEach(function(t){const s=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>s.addCue(r))}),e.textTracks()};var vc={textTracksToJson:q1,jsonToTextTracks:V1,trackToJson_:go};const Ma="vjs-modal-dialog";let hs=class extends B{constructor(e,t){super(e,t),this.handleKeyDown_=s=>this.handleKeyDown(s),this.close_=s=>this.close(s),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=Y("div",{className:`${Ma}-content`},{role:"document"}),this.descEl_=Y("p",{className:`${Ma}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),ti(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Ma} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let s=this.getChild("closeButton");if(t&&!s){const r=this.contentEl_;this.contentEl_=this.el_,s=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(s,"close",this.close_)}!t&&s&&(this.off(s,"close",this.close_),this.removeChild(s),s.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),s=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,s.removeChild(t),this.empty(),qh(t,e),this.trigger("modalfill"),r?s.insertBefore(t,r):s.appendChild(t);const n=this.getChild("closeButton");n&&s.appendChild(n.el_)}empty(){this.trigger("beforemodalempty"),Wn(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=F.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(e.stopPropagation(),W.isEventKey(e,"Escape")&&this.closeable()){e.preventDefault(),this.close();return}if(!W.isEventKey(e,"Tab"))return;const t=this.focusableEls_(),s=this.el_.querySelector(":focus");let r;for(let n=0;n(t instanceof E.HTMLAnchorElement||t instanceof E.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof E.HTMLInputElement||t instanceof E.HTMLSelectElement||t instanceof E.HTMLTextAreaElement||t instanceof E.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof E.HTMLIFrameElement||t instanceof E.HTMLObjectElement||t instanceof E.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}};hs.prototype.options_={pauseOnOpen:!0,temporary:!0};B.registerComponent("ModalDialog",hs);class ns extends ot{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t{this.trigger({track:e,type:"labelchange",target:this})},Ut(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let s=0,r=this.length;s=0;t--)if(e[t].enabled){Na(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Na(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Na(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Ba=function(i,e){for(let t=0;t=0;t--)if(e[t].selected){Ba(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t{this.changing_||(this.changing_=!0,Ba(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class nf extends ns{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class z1{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,s=e.length;t0&&(E.console&&E.console.groupCollapsed&&E.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),s.forEach(r=>Z.error(r)),E.console&&E.console.groupEnd&&E.console.groupEnd()),t.flush()},Sc=function(i,e){const t={uri:i},s=Qn(i);s&&(t.cors=s);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),Dd(t,ce(this,function(n,a,o){if(n)return Z.error(n,a);e.loaded_=!0,typeof E.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],l=>{if(l.type==="vttjserror"){Z.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return bc(o,e)}):bc(o,e)}))};class cr extends uu{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=le(e,{kind:X1[e.kind]||"subtitles",language:e.language||e.srclang||""});let s=Tc[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(s="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new gn(this.cues_),a=new gn(this.activeCues_);let o=!1;this.timeupdateHandler=ce(this,function(f={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const l=()=>{this.stopTracking()};this.tech_.one("dispose",l),s!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return s},set(f){Tc[f]&&s!==f&&(s=f,!this.preload_&&s!=="disabled"&&this.cues.length===0&&Sc(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const f=this.tech_.currentTime(),m=[];for(let y=0,T=this.cues.length;y=f&&m.push(S)}if(o=!1,m.length!==this.activeCues_.length)o=!0;else for(let y=0;y{t=Vt.LOADED,this.trigger({type:"load",target:this})})}}Vt.prototype.allowedEvents_={load:"load"};Vt.NONE=0;Vt.LOADING=1;Vt.LOADED=2;Vt.ERROR=3;const nt={audio:{ListClass:H1,TrackClass:of,capitalName:"Audio"},video:{ListClass:G1,TrackClass:uf,capitalName:"Video"},text:{ListClass:nf,TrackClass:cr,capitalName:"Text"}};Object.keys(nt).forEach(function(i){nt[i].getterName=`${i}Tracks`,nt[i].privateName=`${i}Tracks_`});const as={remoteText:{ListClass:nf,TrackClass:cr,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:z1,TrackClass:Vt,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Be=Object.assign({},nt,as);as.names=Object.keys(as);nt.names=Object.keys(nt);Be.names=[].concat(as.names).concat(nt.names);function Q1(i,e,t,s,r={}){const n=i.textTracks();r.kind=e,t&&(r.label=t),s&&(r.language=s),r.tech=i;const a=new Be.text.TrackClass(r);return n.addTrack(a),a}class K extends B{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=s=>this.onDurationChange(s),this.trackProgress_=s=>this.trackProgress(s),this.trackCurrentTime_=s=>this.trackCurrentTime(s),this.stopTrackingCurrentTime_=s=>this.stopTrackingCurrentTime(s),this.disposeSourceHandler_=s=>this.disposeSourceHandler(s),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),Be.names.forEach(s=>{const r=Be[s];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(s=>{e[`native${s}Tracks`]===!1&&(this[`featuresNative${s}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new Be.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(ce(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return ht(0,0)}bufferedPercent(){return rf(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(nt.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const s=this[`${t}Tracks`]()||[];let r=s.length;for(;r--;){const n=s[r];t==="text"&&this.removeRemoteTextTrack(n),s.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const s=e[t];this.removeRemoteTextTrack(s)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new _e(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?ht(0,0):ht()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){nt.names.forEach(e=>{const t=nt[e],s=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),this.on("dispose",()=>{r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s)})})}addWebVttScript_(){if(!E.WebVTT)if(F.body.contains(this.el())){if(!this.options_["vtt.js"]&&ts(Ul)&&Object.keys(Ul).length>0){this.trigger("vttjsloaded");return}const e=F.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}),E.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),s=o=>e.addTrack(o.track),r=o=>e.removeTrack(o.track);t.on("addtrack",s),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let o=0;othis.autoRemoteTextTracks_.addTrack(s.track)),s}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=ft();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return K.canPlayType(e.type)}static isTech(e){return e.prototype instanceof K||e instanceof K||e===K}static registerTech(e,t){if(K.techs_||(K.techs_={}),!K.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!K.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!K.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=ve(e),K.techs_[e]=t,K.techs_[Gs(e)]=t,e!=="Tech"&&K.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(K.techs_&&K.techs_[e])return K.techs_[e];if(e=ve(e),E&&E.videojs&&E.videojs[e])return Z.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),E.videojs[e]}}}Be.names.forEach(function(i){const e=Be[i];K.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});K.prototype.featuresVolumeControl=!0;K.prototype.featuresMuteControl=!0;K.prototype.featuresFullscreenResize=!1;K.prototype.featuresPlaybackRate=!1;K.prototype.featuresProgressEvents=!1;K.prototype.featuresSourceset=!1;K.prototype.featuresTimeupdateEvents=!1;K.prototype.featuresNativeTextTracks=!1;K.prototype.featuresVideoFrameCallback=!1;K.withSourceHandlers=function(i){i.registerSourceHandler=function(t,s){let r=i.sourceHandlers;r||(r=i.sourceHandlers=[]),s===void 0&&(s=r.length),r.splice(s,0,t)},i.canPlayType=function(t){const s=i.sourceHandlers||[];let r;for(let n=0;nhi(e,vi[e.type],t,i),1)}function eS(i,e){i.forEach(t=>t.setTech&&t.setTech(e))}function tS(i,e,t){return i.reduceRight(du(t),e[t]())}function iS(i,e,t,s){return e[t](i.reduce(du(t),s))}function xc(i,e,t,s=null){const r="call"+ve(t),n=i.reduce(du(r),s),a=n===yn,o=a?null:e[t](n);return nS(i,t,o,a),o}const sS={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},rS={setCurrentTime:1,setMuted:1,setVolume:1},Ec={play:1,pause:1};function du(i){return(e,t)=>e===yn?yn:t[i]?t[i](e):e}function nS(i,e,t,s){for(let r=i.length-1;r>=0;r--){const n=i[r];n[e]&&n[e](s,t)}}function aS(i){yo[i.id()]=null}function oS(i,e){const t=yo[i.id()];let s=null;if(t==null)return s=e(i),yo[i.id()]=[[e,s]],s;for(let r=0;r{if(!e)return"";if(i.cache_.source.src===e&&i.cache_.source.type)return i.cache_.source.type;const t=i.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const s=i.$$("source");for(let r=0;r + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`;class dS extends B{constructor(e,t,s){const r=le({createEl:!1},t);if(super(e,r,s),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;nthis.handleMouseOver(s),this.handleMouseOut_=s=>this.handleMouseOut(s),this.handleClick_=s=>this.handleClick(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.emitTapEvents(),this.enable()}createEl(e="div",t={},s={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&Z.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),s=Object.assign({role:"button"},s),this.tabIndex_=t.tabIndex;const r=Y(e,t,s);return this.player_.options_.experimentalSvgIcons||r.appendChild(Y("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=Y("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const s=this.localize(e);this.controlText_=e,ti(this.controlTextEl_,s),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",s)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){W.isEventKey(e,"Space")||W.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}B.registerComponent("ClickableComponent",Jn);class _o extends Jn{constructor(e,t){super(e,t),this.update(),this.update_=s=>this.update(s),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return Y("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(Y("picture",{className:"vjs-poster",tabIndex:-1},{},Y("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?vt(this.player_.play()):this.player_.pause())}}_o.prototype.crossorigin=_o.prototype.crossOrigin;B.registerComponent("PosterImage",_o);const st="#222",Ac="#ccc",hS={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 Fa(i,e){let t;if(i.length===4)t=i[1]+i[1]+i[2]+i[2]+i[3]+i[3];else if(i.length===7)t=i.slice(1);else throw new Error("Invalid color code provided, "+i+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function Os(i,e,t){try{i.style[e]=t}catch{return}}function Dc(i){return i?`${i}px`:""}class fS extends B{constructor(e,t,s){super(e,t,s);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(ce(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=E.screen.orientation||E,o=E.screen.orientation?"change":"orientationchange";a.addEventListener(o,n),e.on("dispose",()=>a.removeEventListener(o,n));const l=this.options_.playerOptions.tracks||[];for(let f=0;f.1&&(s>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),Os(this.el_,"insetInline",Dc(n)),Os(this.el_,"insetBlock",Dc(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),s=e.activeCues;let r=s.length;for(;r--;){const n=s[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&Os(a.firstChild,"color",Fa(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Os(a.firstChild,"backgroundColor",Fa(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Os(a,"backgroundColor",Fa(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${st}, 2px 2px 4px ${st}, 2px 2px 5px ${st}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${st}, 2px 2px ${st}, 3px 3px ${st}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Ac}, 0 1px ${Ac}, -1px -1px ${st}, 0 -1px ${st}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${st}, 0 0 4px ${st}, 0 0 4px ${st}, 0 0 4px ${st}`)),t.fontPercent&&t.fontPercent!==1){const o=E.parseFloat(a.style.fontSize);a.style.fontSize=o*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=hS[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof E.WebVTT!="function"||e.every(s=>!s.activeCues))return;const t=[];for(let s=0;sthis.handleMouseDown(s))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){vt(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const s=this.player_.getChild("controlBar"),r=s&&s.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const n=()=>r.focus();zs(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}cf.prototype.controlText_="Play Video";B.registerComponent("BigPlayButton",cf);class mS extends et{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){W.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}B.registerComponent("CloseButton",mS);class df extends et{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",s=>this.handlePlay(s)),this.on(e,"pause",s=>this.handlePause(s)),t.replay&&this.on(e,"ended",s=>this.handleEnded(s))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?vt(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}df.prototype.controlText_="Play";B.registerComponent("PlayToggle",df);class fs extends B{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],s=>this.update(s)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),s=Y("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(s),this.contentEl_=Y("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=Si(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,Z.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_=F.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}fs.prototype.labelText_="Time";fs.prototype.controlText_="Time";B.registerComponent("TimeDisplay",fs);class hu extends fs{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}hu.prototype.labelText_="Current Time";hu.prototype.controlText_="Current Time";B.registerComponent("CurrentTimeDisplay",hu);class fu extends fs{constructor(e,t){super(e,t);const s=r=>this.updateContent(r);this.on(e,"durationchange",s),this.on(e,"loadstart",s),this.on(e,"loadedmetadata",s)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}fu.prototype.labelText_="Duration";fu.prototype.controlText_="Duration";B.registerComponent("DurationDisplay",fu);class gS extends B{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),s=super.createEl("span",{textContent:"/"});return t.appendChild(s),e.appendChild(t),e}}B.registerComponent("TimeDivider",gS);class pu extends fs{constructor(e,t){super(e,t),this.on(e,"durationchange",s=>this.updateContent(s))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(Y("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}pu.prototype.labelText_="Remaining Time";pu.prototype.controlText_="Remaining Time";B.registerComponent("RemainingTimeDisplay",pu);class yS extends B{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",s=>this.updateShowing(s))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Y("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Y("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(F.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}B.registerComponent("LiveDisplay",yS);class hf extends et{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=s=>this.updateLiveEdgeStatus(s),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=Y("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}hf.prototype.controlText_="Seek to live, currently playing live";B.registerComponent("SeekToLive",hf);function dr(i,e,t){return i=Number(i),Math.min(t,Math.max(e,isNaN(i)?e:i))}var _S=Object.freeze({__proto__:null,clamp:dr});class mu extends B{constructor(e,t){super(e,t),this.handleMouseDown_=s=>this.handleMouseDown(s),this.handleMouseUp_=s=>this.handleMouseUp(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.handleClick_=s=>this.handleClick(s),this.handleMouseMove_=s=>this.handleMouseMove(s),this.update_=s=>this.update(s),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},s={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),s=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},s),super.createEl(e,t,s)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!wt&&e.preventDefault(),Fh(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;Uh(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(dr(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=zn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){W.isEventKey(e,"Left")||W.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):W.isEventKey(e,"Right")||W.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}B.registerComponent("Slider",mu);const Ua=(i,e)=>dr(i/e*100,0,100).toFixed(2)+"%";class vS extends B{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",s=>this.update(s))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=Y("span",{className:"vjs-control-text"}),s=Y("span",{textContent:this.localize("Loaded")}),r=F.createTextNode(": ");return this.percentageEl_=Y("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(s),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,s=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,o=Ua(n,r);this.percent_!==o&&(this.el_.style.width=o,ti(this.percentageEl_,o),this.percent_=o);for(let l=0;ls.length;l--)this.el_.removeChild(a[l-1]);a.length=s.length})}}B.registerComponent("LoadProgressBar",vS);class TS extends B{constructor(e,t){super(e,t),this.update=kt(ce(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,s){const r=ir(this.el_),n=ss(this.player_.el()),a=e.width*t;if(!n||!r)return;let o=e.left-n.left+a,l=e.width-a+(n.right-e.right);l||(l=e.width-a,o=a);let f=r.width/2;or.width&&(f=r.width),f=Math.round(f),this.el_.style.right=`-${f}px`,this.write(s)}write(e){ti(this.el_,e)}updateTime(e,t,s,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const o=this.player_.liveTracker.liveWindow(),l=o-t*o;n=(l<1?"":"-")+Si(l,o)}else n=Si(s,a);this.update(e,t,n),r&&r()})}}B.registerComponent("TimeTooltip",TS);class gu extends B{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=kt(ce(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const s=this.getChild("timeTooltip");if(!s)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(e,t,r)}}gu.prototype.options_={children:[]};!$e&&!Dt&&gu.prototype.options_.children.push("timeTooltip");B.registerComponent("PlayProgressBar",gu);class ff extends B{constructor(e,t){super(e,t),this.update=kt(ce(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const s=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,s,()=>{this.el_.style.left=`${e.width*t}px`})}}ff.prototype.options_={children:["timeTooltip"]};B.registerComponent("MouseTimeDisplay",ff);const zr=5,wc=12;class yu extends mu{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=ce(this,this.update),this.update=kt(this.update_,at),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in F&&"visibilityState"in F&&this.on(F,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){F.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,at))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(F.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const s=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==s||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Si(s,n),Si(n,n)],"{1} of {2}")),this.currentTime_=s,this.duration_=n),this.bar&&this.bar.update(ss(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const s=this.player_.liveTracker;return s&&s.isLive()?(t=(e-s.seekableStart())/s.liveWindow(),s.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){sr(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!sr(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let s;const r=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())s=r*this.player_.duration(),s===this.player_.duration()&&(s=s-.1);else{if(r>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),o=n.liveCurrentTime();if(s=a+r*n.liveWindow(),s>=o&&(s=o),s<=a&&(s=a+.1),s===1/0)return}this.userSeek_(s),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?vt(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+zr)}stepBack(){this.userSeek_(this.player_.currentTime()-zr)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(W.isEventKey(e,"Space")||W.isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(W.isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(W.isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(W(e))){e.preventDefault(),e.stopPropagation();const s=(W.codes[W(e)]-W.codes[0])*10/100;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*s):this.userSeek_(this.player_.duration()*s)}else W.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-zr*wc)):W.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+zr*wc)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in F&&"visibilityState"in F&&this.off(F,"visibilitychange",this.toggleVisibility_),super.dispose()}}yu.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!$e&&!Dt&&yu.prototype.options_.children.splice(1,0,"mouseTimeDisplay");B.registerComponent("SeekBar",yu);class pf extends B{constructor(e,t){super(e,t),this.handleMouseMove=kt(ce(this,this.handleMouseMove),at),this.throttledHandleMouseSeek=kt(ce(this,this.handleMouseSeek),at),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.handleMouseDownHandler_=s=>this.handleMouseDown(s),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const s=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!s&&!r)return;const n=t.el(),a=ir(n);let o=zn(n,e).x;o=dr(o,0,1),r&&r.update(a,o),s&&s.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&vt(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,s=this.getChild("seekBar");s&&s.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}pf.prototype.options_={children:["seekBar"]};B.registerComponent("ProgressControl",pf);class mf extends et{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],s=>this.handlePictureInPictureChange(s)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],s=>this.handlePictureInPictureEnabledChange(s)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){F.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in E?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof F.exitPictureInPicture=="function"&&super.show()}}mf.prototype.controlText_="Picture-in-Picture";B.registerComponent("PictureInPictureToggle",mf);class gf extends et{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",s=>this.handleFullscreenChange(s)),F[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}gf.prototype.controlText_="Fullscreen";B.registerComponent("FullscreenToggle",gf);const bS=function(i,e){e.tech_&&!e.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class SS extends B{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}B.registerComponent("VolumeLevel",SS);class xS extends B{constructor(e,t){super(e,t),this.update=kt(ce(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,s,r){if(!s){const n=ss(this.el_),a=ss(this.player_.el()),o=e.width*t;if(!a||!n)return;const l=e.left-a.left+o,f=e.width-o+(a.right-e.right);let m=n.width/2;ln.width&&(m=n.width),this.el_.style.right=`-${m}px`}this.write(`${r}%`)}write(e){ti(this.el_,e)}updateVolume(e,t,s,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,s,r.toFixed(0)),n&&n()})}}B.registerComponent("VolumeLevelTooltip",xS);class yf extends B{constructor(e,t){super(e,t),this.update=kt(ce(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,s){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,s,r,()=>{s?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}yf.prototype.options_={children:["volumeLevelTooltip"]};B.registerComponent("MouseVolumeLevelDisplay",yf);class Zn extends mu{constructor(e,t){super(e,t),this.on("slideractive",s=>this.updateLastVolume_(s)),this.on(e,"volumechange",s=>this.updateARIAAttributes(s)),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){sr(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const s=this.el(),r=ss(s),n=this.vertical();let a=zn(s,e);a=n?a.y:a.x,a=dr(a,0,1),t.update(r,a,n)}sr(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Zn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!$e&&!Dt&&Zn.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Zn.prototype.playerEvent="volumechange";B.registerComponent("VolumeBar",Zn);class _f extends B{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||ts(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),bS(this,e),this.throttledHandleMouseMove=kt(ce(this,this.handleMouseMove),at),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.on("mousedown",s=>this.handleMouseDown(s)),this.on("touchstart",s=>this.handleMouseDown(s)),this.on("mousemove",s=>this.handleMouseMove(s)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}_f.prototype.options_={children:["volumeBar"]};B.registerComponent("VolumeControl",_f);const ES=function(i,e){e.tech_&&!e.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class vf extends et{constructor(e,t){super(e,t),ES(this,e),this.on(e,["loadstart","volumechange"],s=>this.update(s))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),s=this.player_.lastVolume_();if(t===0){const r=s<.1?.1:s;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),$e&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),Hn(this.el_,[0,1,2,3].reduce((s,r)=>s+`${r?" ":""}vjs-vol-${r}`,"")),_i(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}vf.prototype.controlText_="Mute";B.registerComponent("MuteToggle",vf);class Tf extends B{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||ts(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=s=>this.handleKeyPress(s),this.on(e,["loadstart"],s=>this.volumePanelState_(s)),this.on(this.muteToggle,"keyup",s=>this.handleKeyPress(s)),this.on(this.volumeControl,"keyup",s=>this.handleVolumeControlKeyUp(s)),this.on("keydown",s=>this.handleKeyPress(s)),this.on("mouseover",s=>this.handleMouseOver(s)),this.on("mouseout",s=>this.handleMouseOut(s)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){W.isEventKey(e,"Esc")&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),tt(F,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Oe(F,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){W.isEventKey(e,"Esc")&&this.handleMouseOut()}}Tf.prototype.options_={children:["muteToggle","volumeControl"]};B.registerComponent("VolumePanel",Tf);class bf extends et{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()?s.seekableEnd():this.player_.duration();let n;t+this.skipTime<=r?n=t+this.skipTime:n=r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}bf.prototype.controlText_="Skip Forward";B.registerComponent("SkipForward",bf);class Sf extends et{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()&&s.seekableStart();let n;r&&t-this.skipTime<=r?n=r:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}Sf.prototype.controlText_="Skip Backward";B.registerComponent("SkipBackward",Sf);class xf extends B{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",s=>this.handleKeyDown(s)),this.boundHandleBlur_=s=>this.handleBlur(s),this.boundHandleTapClick_=s=>this.handleTapClick(s)}addEventListenerForItem(e){e instanceof B&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof B&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=Y(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),tt(t,"click",function(s){s.preventDefault(),s.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||F.activeElement;if(!this.children().some(s=>s.el()===t)){const s=this.menuButton_;s&&s.buttonPressed_&&t!==s.el().firstChild&&s.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const s=t.filter(r=>r.el()===e.target)[0];if(!s)return;s.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){W.isEventKey(e,"Left")||W.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(W.isEventKey(e,"Right")||W.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}B.registerComponent("Menu",xf);class _u extends B{constructor(e,t={}){super(e,t),this.menuButton_=new et(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const s=et.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+s,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),tt(F,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new xf(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=Y("li",{className:"vjs-menu-title",textContent:ve(this.options_.title),tabIndex:-1}),s=new B(this.player_,{el:t});e.addItem(s)}if(this.items=this.createItems(),this.items)for(let t=0;tW.isEventKey(e,t))||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}B.registerComponent("MenuItem",hr);class fr extends hr{constructor(e,t){const s=t.track,r=e.textTracks();t.label=s.label||s.language||"Unknown",t.selected=s.mode==="showing",super(e,t),this.track=s,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...o)=>{this.handleTracksChange.apply(this,o)},a=(...o)=>{this.handleSelectedLanguageChange.apply(this,o)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let o;this.on(["tap","click"],function(){if(typeof E.Event!="object")try{o=new E.Event("change")}catch{}o||(o=F.createEvent("Event"),o.initEvent("change",!0,!0)),r.dispatchEvent(o)})}this.handleTracksChange()}handleClick(e){const t=this.track,s=this.player_.textTracks();if(super.handleClick(e),!!s)for(let r=0;r-1&&a.mode==="showing"){s=!1;break}}s!==this.isSelected_&&this.selected(s)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let s=!0;for(let r=0,n=t.length;r-1&&a.mode==="showing"){s=!1;break}}s&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}B.registerComponent("OffTextTrackMenuItem",Ef);class ps extends vu{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=fr){let s;this.label_&&(s=`${this.label_} off`),e.push(new Ef(this.player_,{kinds:this.kinds_,kind:this.kind_,label:s})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return e}}B.registerComponent("TextTrackButton",ps);class Cf extends hr{constructor(e,t){const s=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const s=e[t];if(s.kind===this.kind_)return s}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(ve(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let s=0,r=t.length;s-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(ve(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new xu(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Af),e}}Cu.prototype.kinds_=["captions","subtitles"];Cu.prototype.controlText_="Subtitles";B.registerComponent("SubsCapsButton",Cu);class Df extends hr{constructor(e,t){const s=t.track,r=e.audioTracks();t.label=s.label||s.language||"Unknown",t.selected=s.enabled,super(e,t),this.track=s,this.addClass(`vjs-${s.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,s){const r=super.createEl(e,t,s),n=r.querySelector(".vjs-menu-item-text");return["main-desc","description"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(Y("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(Y("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let s=0;sthis.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Au.prototype.contentElType="button";B.registerComponent("PlaybackRateMenuItem",Au);class kf extends _u{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",s=>this.updateVisibility(s)),this.on(e,"ratechange",s=>this.updateLabel(s)),this.on(e,"playbackrateschange",s=>this.handlePlaybackRateschange(s))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=Y("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let s=e.length-1;s>=0;s--)t.push(new Au(this.player(),{rate:e[s]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}kf.prototype.controlText_="Playback Rate";B.registerComponent("PlaybackRateMenuButton",kf);class If extends B{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},s={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,s)}}B.registerComponent("Spacer",If);class AS extends If{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}B.registerComponent("CustomControlSpacer",AS);class Pf extends B{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Pf.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};B.registerComponent("ControlBar",Pf);class Lf extends hs{constructor(e,t){super(e,t),this.on(e,"error",s=>{this.open(s)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Lf.prototype.options_=Object.assign({},hs.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});B.registerComponent("ErrorDisplay",Lf);const $a="vjs-text-track-settings",kc=["#000","Black"],Ic=["#00F","Blue"],Pc=["#0FF","Cyan"],Lc=["#0F0","Green"],Oc=["#F0F","Magenta"],Rc=["#F00","Red"],Mc=["#FFF","White"],Nc=["#FF0","Yellow"],ja=["1","Opaque"],qa=["0.5","Semi-Transparent"],Bc=["0","Transparent"],fi={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[kc,Mc,Rc,Lc,Ic,Nc,Oc,Pc]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[ja,qa,Bc]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Mc,kc,Rc,Lc,Ic,Nc,Oc,Pc]},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:i=>i==="1.00"?null:Number(i)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[ja,qa]},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:[Bc,qa,ja]}};fi.windowColor.options=fi.backgroundColor.options;function Of(i,e){if(e&&(i=e(i)),i&&i!=="none")return i}function DS(i,e){const t=i.options[i.options.selectedIndex].value;return Of(t,e)}function wS(i,e,t){if(e){for(let s=0;s{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),"click",()=>{this.setDefaults(),this.updateDisplay()}),qi(fi,s=>{this.on(this.$(s.selector),"change",this.updateDisplay)}),this.options_.persistTextTrackSettings&&this.restoreSettings()}dispose(){this.endDialog=null,super.dispose()}createElSelect_(e,t="",s="label"){const r=fi[e],n=r.id.replace("%s",this.id_),a=[t,n].join(" ").trim(),o=`vjs_select_${ft()}`;return[`<${s} id="${n}"${s==="label"?` for="${o}" class="vjs-label"`:""}>`,this.localize(r.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 Y("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return Y("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 Y("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 Ah(fi,(e,t,s)=>{const r=DS(this.$(t.selector),t.parser);return r!==void 0&&(e[s]=r),e},{})}setValues(e){qi(fi,(t,s)=>{wS(this.$(t.selector),e[s],t.parser)})}setDefaults(){qi(fi,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(E.localStorage.getItem($a))}catch(t){Z.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?E.localStorage.setItem($a,JSON.stringify(e)):E.localStorage.removeItem($a)}catch(t){Z.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}conditionalBlur_(){this.previouslyActiveEl_=null;const e=this.player_.controlBar,t=e&&e.subsCapsButton,s=e&&e.captionsButton;t?t.focus():s&&s.focus()}handleLanguagechange(){this.fill()}}B.registerComponent("TextTrackSettings",kS);class IS extends B{constructor(e,t){let s=t.ResizeObserver||E.ResizeObserver;t.ResizeObserver===null&&(s=!1);const r=le({createEl:!s,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||E.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=Xh(()=>{this.resizeHandler()},100,!1,this),s?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){Oe(this,"resize",n),Oe(this,"unload",a),a=null};tt(this.el_.contentWindow,"unload",a),tt(this.el_.contentWindow,"resize",n)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}B.registerComponent("ResizeManager",IS);const PS={trackingThreshold:20,liveTolerance:15};class LS extends B{constructor(e,t){const s=le(PS,t,{createEl:!1});super(e,s),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(E.performance.now().toFixed(4)),s=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+s;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,at),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.end(s));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.start(s));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}B.registerComponent("LiveTracker",LS);class OS extends B{constructor(e,t){super(e,t),this.on("statechanged",s=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:Y("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${ft()}`}),description:Y("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${ft()}`})},Y("div",{className:"vjs-title-bar"},{},Dh(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,s={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],o=s[r];Wn(a),n&&ti(a,n),t&&(t.removeAttribute(o),n&&t.setAttribute(o,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}B.registerComponent("TitleBar",OS);const vo=i=>{const e=i.el();if(e.hasAttribute("src"))return i.triggerSourceset(e.src),!0;const t=i.$$("source"),s=[];let r="";if(!t.length)return!1;for(let n=0;n{let t={};for(let s=0;sRf([i.el(),E.HTMLMediaElement.prototype,E.Element.prototype,RS],"innerHTML"),Fc=function(i){const e=i.el();if(e.resetSourceWatch_)return;const t={},s=MS(i),r=n=>(...a)=>{const o=n.apply(e,a);return vo(i),o};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",le(s,{set:r(s.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",s)},i.one("sourceset",e.resetSourceWatch_)},NS=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?af(E.Element.prototype.getAttribute.call(this,"src")):""},set(i){return E.Element.prototype.setAttribute.call(this,"src",i),i}}),BS=i=>Rf([i.el(),E.HTMLMediaElement.prototype,NS],"src"),FS=function(i){if(!i.featuresSourceset)return;const e=i.el();if(e.resetSourceset_)return;const t=BS(i),s=e.setAttribute,r=e.load;Object.defineProperty(e,"src",le(t,{set:n=>{const a=t.set.call(e,n);return i.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const o=s.call(e,n,a);return/src/i.test(n)&&i.triggerSourceset(e.src),o},e.load=()=>{const n=r.call(e);return vo(i)||(i.triggerSourceset(""),Fc(i)),n},e.currentSrc?i.triggerSourceset(e.currentSrc):vo(i)||Fc(i),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=s,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class j extends K{constructor(e,t){super(e,t);const s=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",s&&(this.el_.currentSrc!==s.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(s):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const o=[];for(;a--;){const l=n[a];l.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(l),this.remoteTextTracks().addTrack(l.track),this.textTracks().addTrack(l.track),!r&&!this.el_.hasAttribute("crossorigin")&&Qn(l.src)&&(r=!0)):o.push(l))}for(let l=0;l{t=[];for(let n=0;ne.removeEventListener("change",s));const r=()=>{for(let n=0;n{e.removeEventListener("change",s),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",s),e.addEventListener("change",s),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const s=e.toLowerCase();this[`${s}TracksListeners_`]&&Object.keys(this[`${s}TracksListeners_`]).forEach(r=>{this.el()[`${s}Tracks`].removeEventListener(r,this[`${s}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${s}TracksListeners_`]=null,this.proxyNativeTracksForType_(s)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=nt[e],s=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!s||!s.addEventListener)return;const n={change:o=>{const l={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(l),e==="text"&&this[as.remoteText.getterName]().trigger(l)},addtrack(o){r.addTrack(o.track)},removetrack(o){r.removeTrack(o.track)}},a=function(){const o=[];for(let l=0;l{const l=n[o];s.addEventListener(o,l),this.on("dispose",f=>s.removeEventListener(o,l))}),this.on("loadstart",a),this.on("dispose",o=>this.off("loadstart",a))}proxyNativeTracks_(){nt.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const s=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(s,e),j.disposeMediaElement(e),e=s}else{e=F.createElement("video");const s=this.options_.tag&&Yt(this.options_.tag),r=le({},s);(!tr||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,Nh(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&is(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let s=0;s=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(s){this.trigger(s)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Vn?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){Z(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Dt&&wt&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)vt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}reset(){j.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,s){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,s):super.addTextTrack(e,t,s)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=F.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const s=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(s),s}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let s=t.length;for(;s--;)(e===t[s]||e===t[s].track)&&this.el().removeChild(t[s])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),E.performance&&(e.creationTime=E.performance.now()),e}}Un(j,"TEST_VID",function(){if(!ls())return;const i=F.createElement("video"),e=F.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",i.appendChild(e),i});j.isSupported=function(){try{j.TEST_VID.volume=.5}catch{return!1}return!!(j.TEST_VID&&j.TEST_VID.canPlayType)};j.canPlayType=function(i){return j.TEST_VID.canPlayType(i)};j.canPlaySource=function(i,e){return j.canPlayType(i.type)};j.canControlVolume=function(){try{const i=j.TEST_VID.volume;j.TEST_VID.volume=i/2+.1;const e=i!==j.TEST_VID.volume;return e&&$e?(E.setTimeout(()=>{j&&j.prototype&&(j.prototype.featuresVolumeControl=i!==j.TEST_VID.volume)}),!1):e}catch{return!1}};j.canMuteVolume=function(){try{const i=j.TEST_VID.muted;return j.TEST_VID.muted=!i,j.TEST_VID.muted?is(j.TEST_VID,"muted","muted"):Gn(j.TEST_VID,"muted","muted"),i!==j.TEST_VID.muted}catch{return!1}};j.canControlPlaybackRate=function(){if(Dt&&wt&&$n<58)return!1;try{const i=j.TEST_VID.playbackRate;return j.TEST_VID.playbackRate=i/2+.1,i!==j.TEST_VID.playbackRate}catch{return!1}};j.canOverrideAttributes=function(){try{const i=()=>{};Object.defineProperty(F.createElement("video"),"src",{get:i,set:i}),Object.defineProperty(F.createElement("audio"),"src",{get:i,set:i}),Object.defineProperty(F.createElement("video"),"innerHTML",{get:i,set:i}),Object.defineProperty(F.createElement("audio"),"innerHTML",{get:i,set:i})}catch{return!1}return!0};j.supportsNativeTextTracks=function(){return Vn||$e&&wt};j.supportsNativeVideoTracks=function(){return!!(j.TEST_VID&&j.TEST_VID.videoTracks)};j.supportsNativeAudioTracks=function(){return!!(j.TEST_VID&&j.TEST_VID.audioTracks)};j.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([i,e]){Un(j.prototype,i,()=>j[e](),!0)});j.prototype.featuresVolumeControl=j.canControlVolume();j.prototype.movingMediaElementInDOM=!$e;j.prototype.featuresFullscreenResize=!0;j.prototype.featuresProgressEvents=!0;j.prototype.featuresTimeupdateEvents=!0;j.prototype.featuresVideoFrameCallback=!!(j.TEST_VID&&j.TEST_VID.requestVideoFrameCallback);j.disposeMediaElement=function(i){if(i){for(i.parentNode&&i.parentNode.removeChild(i);i.hasChildNodes();)i.removeChild(i.firstChild);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()}};j.resetMediaElement=function(i){if(!i)return;const e=i.querySelectorAll("source");let t=e.length;for(;t--;)i.removeChild(e[t]);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(i){j.prototype[i]=function(){return this.el_[i]||this.el_.hasAttribute(i)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(i){j.prototype["set"+ve(i)]=function(e){this.el_[i]=e,e?this.el_.setAttribute(i,i):this.el_.removeAttribute(i)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(i){j.prototype[i]=function(){return this.el_[i]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(i){j.prototype["set"+ve(i)]=function(e){this.el_[i]=e}});["pause","load","play"].forEach(function(i){j.prototype[i]=function(){return this.el_[i]()}});K.withSourceHandlers(j);j.nativeSourceHandler={};j.nativeSourceHandler.canPlayType=function(i){try{return j.TEST_VID.canPlayType(i)}catch{return""}};j.nativeSourceHandler.canHandleSource=function(i,e){if(i.type)return j.nativeSourceHandler.canPlayType(i.type);if(i.src){const t=cu(i.src);return j.nativeSourceHandler.canPlayType(`video/${t}`)}return""};j.nativeSourceHandler.handleSource=function(i,e,t){e.setSrc(i.src)};j.nativeSourceHandler.dispose=function(){};j.registerSourceHandler(j.nativeSourceHandler);K.registerTech("Html5",j);const Mf=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Va={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},To=["tiny","xsmall","small","medium","large","xlarge","huge"],tn={};To.forEach(i=>{const e=i.charAt(0)==="x"?`x-${i.substring(1)}`:i;tn[i]=`vjs-layout-${e}`});const US={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};let Ae=class Mi extends B{constructor(e,t,s){if(e.id=e.id||t.id||`vjs_video_${ft()}`,t=Object.assign(Mi.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,s),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.isFullscreen_=!1,this.log=Eh(this.id_),this.fsApi_=hn,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&Yt(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(o){a[o.toLowerCase()]=t.languages[o]}),this.languages_=a}else this.languages_=Mi.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),au(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(tt(F,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=le(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const o=new E.DOMParser().parseFromString(cS,"image/svg+xml");if(o.querySelector("parsererror"))Z.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const f=o.documentElement;f.style.display="none",this.el_.appendChild(f),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),tr&&this.addClass("vjs-touch-enabled"),$e||this.addClass("vjs-workinghover"),Mi.players[this.id_]=this;const n=no.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),Oe(F,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Oe(F,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Mi.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),aS(this),Be.names.forEach(e=>{const t=Be[e],s=this[t.getterName]();s&&s.off&&s.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,s=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";s?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const n=Yt(e);if(r){for(t=this.el_=e,e=this.tag=F.createElement("video");t.children.length;)e.appendChild(t.firstChild);Hs(t,"video-js")||_i(t,"video-js"),t.appendChild(e),s=this.playerElIngest_=t,Object.keys(t).forEach(l=>{try{e[l]=t[l]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",wt&&jn&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(l){r&&l==="class"||t.setAttribute(l,n[l]),r&&e.setAttribute(l,n[l])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE"].filter(l=>Lh[l]).map(l=>"vjs-device-"+l.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),E.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=Wh("vjs-styles-dimensions");const l=Jt(".vjs-styles-defaults"),f=Jt("head");f.insertBefore(this.styleEl_,l?l.nextSibling:f.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=e.getElementsByTagName("a");for(let l=0;l"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){Z.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const s=e+"_";if(t===void 0)return this[s]||0;if(t===""||t==="auto"){this[s]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){Z.error(`Improper value "${t}" supplied for for ${e}`);return}this[s]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Ut(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),N1(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(E.VIDEOJS_NO_DYNAMIC_STYLE===!0){const o=typeof this.width_=="number"?this.width_:this.options_.width,l=typeof this.height_=="number"?this.height_:this.options_.height,f=this.tech_&&this.tech_.el();f&&(o>=0&&(f.width=o),l>=0&&(f.height=l));return}let e,t,s,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?s=this.aspectRatio_:this.videoWidth()>0?s=this.videoWidth()+":"+this.videoHeight():s="16:9";const n=s.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),Kh(this.styleEl_,` + .${r} { + width: ${e}px; + height: ${t}px; + } + + .${r}.vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: ${a*100}%; + } + `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const s=ve(e),r=e.charAt(0).toLowerCase()+e.slice(1);s!=="Html5"&&this.tag&&(K.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};Be.names.forEach(l=>{const f=Be[l];a[f.getterName]=this[f.privateName]}),Object.assign(a,this.options_[s]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const o=K.getTech(e);if(!o)throw new Error(`No Tech named '${s}' exists! '${s}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(ce(this,this.handleTechReady_),!0),vc.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Mf.forEach(l=>{this.on(this.tech_,l,f=>this[`handleTech${ve(l)}_`](f))}),Object.keys(Va).forEach(l=>{this.on(this.tech_,l,f=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Va[l]}_`].bind(this),event:f});return}this[`handleTech${Va[l]}_`](f)})}),this.on(this.tech_,"loadstart",l=>this.handleTechLoadStart_(l)),this.on(this.tech_,"sourceset",l=>this.handleTechSourceset_(l)),this.on(this.tech_,"waiting",l=>this.handleTechWaiting_(l)),this.on(this.tech_,"ended",l=>this.handleTechEnded_(l)),this.on(this.tech_,"seeking",l=>this.handleTechSeeking_(l)),this.on(this.tech_,"play",l=>this.handleTechPlay_(l)),this.on(this.tech_,"pause",l=>this.handleTechPause_(l)),this.on(this.tech_,"durationchange",l=>this.handleTechDurationChange_(l)),this.on(this.tech_,"fullscreenchange",(l,f)=>this.handleTechFullscreenChange_(l,f)),this.on(this.tech_,"fullscreenerror",(l,f)=>this.handleTechFullscreenError_(l,f)),this.on(this.tech_,"enterpictureinpicture",l=>this.handleTechEnterPictureInPicture_(l)),this.on(this.tech_,"leavepictureinpicture",l=>this.handleTechLeavePictureInPicture_(l)),this.on(this.tech_,"error",l=>this.handleTechError_(l)),this.on(this.tech_,"posterchange",l=>this.handleTechPosterChange_(l)),this.on(this.tech_,"textdata",l=>this.handleTechTextData_(l)),this.on(this.tech_,"ratechange",l=>this.handleTechRateChange_(l)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(s!=="Html5"||!this.tag)&&co(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){Be.names.forEach(e=>{const t=Be[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=vc.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&Z.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. +See https://github.com/videojs/video.js/issues/2617 for more info. +`),this.tech_}version(){return{"video.js":no}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(zs(a))return a.catch(o=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${o||""}`)})};let s;if(e==="any"&&!this.muted()?(s=this.play(),zs(s)&&(s=s.catch(t))):e==="muted"&&!this.muted()?s=t():s=this.play(),!!zs(s))return s.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,s="";typeof t!="string"&&(t=e.src,s=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!s&&(s=lS(this,t)),this.cache_.source=le({},e,{src:t,type:s});const r=this.cache_.sources.filter(l=>l.src&&l.src===t),n=[],a=this.$$("source"),o=[];for(let l=0;lthis.updateSourceCaches_(n);const s=this.currentSource().src,r=e.src;s&&!/^blob:/.test(s)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==s)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?vt(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),s=>s.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const s=this.el();let r=F[this.fsApi_.fullscreenElement]===s;!r&&s.matches&&(r=s.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in rS)return iS(this.middleware_,this.tech_,e,t);if(e in Ec)return xc(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(s){throw Z(s),s}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in sS)return tS(this.middleware_,this.tech_,e);if(e in Ec)return xc(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(Z(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(Z(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(Z(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=vt){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),s=!!(Vn||$e);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&s&&this.load();return}const r=this.techGet_("play");s&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(s){s(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||ht(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=ht(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=ht(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return rf(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let s=e.end(e.length-1);return s>t&&(s=t),s}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((s,r)=>{function n(){t.off("fullscreenerror",o),t.off("fullscreenchange",a)}function a(){n(),s()}function o(f,m){n(),r(m)}t.one("fullscreenchange",a),t.one("fullscreenerror",o);const l=t.requestFullscreenHelper_(e);l&&(l.then(n,n),l.then(s,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const s=this.el_[this.fsApi_.requestFullscreen](t);return s&&s.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),s}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,s)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(l,f){r(),s(f)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const o=e.exitFullscreenHelper_();o&&(o.then(r,r),o.then(t,s))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=F[this.fsApi_.exitFullscreen]();return e&&vt(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=F.documentElement.style.overflow,tt(F,"keydown",this.boundFullWindowOnEscKey_),F.documentElement.style.overflow="hidden",_i(F.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){W.isEventKey(e,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Oe(F,"keydown",this.boundFullWindowOnEscKey_),F.documentElement.style.overflow=this.docOrigOverflow,Hn(F.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&E.documentPictureInPicture){const e=F.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(Y("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),E.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(Hh(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",s=>{const r=s.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in F&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(E.documentPictureInPicture&&E.documentPictureInPicture.window)return E.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in F)return F.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(r=>{const n=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(r.type)===-1:["textarea"].indexOf(n)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:s=a=>W.isEventKey(a,"f"),muteKey:r=a=>W.isEventKey(a,"m"),playPauseKey:n=a=>W.isEventKey(a,"k")||W.isEventKey(a,"Space")}=t;if(s.call(this,e)){e.preventDefault(),e.stopPropagation();const a=B.getComponent("FullscreenToggle");F[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),B.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),B.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let s=0,r=this.options_.techOrder;s[o,K.getTech(o)]).filter(([o,l])=>l?l.isSupported():(Z.error(`The "${o}" tech is undefined. Skipped browser support check for that tech.`),!1)),s=function(o,l,f){let m;return o.some(y=>l.some(T=>{if(m=f(y,T),m)return!0})),m};let r;const n=o=>(l,f)=>o(f,l),a=([o,l],f)=>{if(l.canPlaySource(f,this.options_[o.toLowerCase()]))return{source:f,tech:o}};return this.options_.sourceOrder?r=s(e,t,n(a)):r=s(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const s=lf(e);if(!s.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=s),this.updateSourceCaches_(s[0]),Z1(this,s[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=s),this.updateSourceCaches_(r),this.src_(r)){if(s.length>1)return this.handleSrc_(s.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}eS(n,this.tech_)}),s.length>1){const r=()=>{this.error(null),this.handleSrc_(s.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?Zh(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}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();vt(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),Ut(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:s,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=s||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(Qt("beforeerror").forEach(t=>{const s=t(this,e);if(!(At(s)&&!Array.isArray(s)||typeof s=="string"||typeof s=="number"||s===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=s}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new _e(e),this.addClass("vjs-error"),Z.error(`(CODE:${this.error_.code} ${_e.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Qt("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,s;const r=ce(this,this.reportUserActivity),n=function(y){(y.screenX!==t||y.screenY!==s)&&(t=y.screenX,s=y.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},o=function(y){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",o),this.on("mouseleave",o);const l=this.getChild("controlBar");l&&!$e&&!Dt&&(l.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),l.on("mouseleave",function(y){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let f;const m=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(f);const y=this.options_.inactivityTimeout;y<=0||(f=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))};this.setInterval(m,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),s=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(s),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_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,s){if(this.tech_)return this.tech_.addTextTrack(e,t,s)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Ut(this)&&this.trigger("languagechange"))}languages(){return le(Mi.prototype.options_.languages,this.languages_)}toJSON(){const e=le(this.options_),t=e.tracks;e.tracks=[];for(let s=0;s{this.removeChild(s)}),s.open(),s}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let s=0;sthis.addRemoteTextTrack(y,!1)),this.titleBar&&this.titleBar.update({title:m,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),s=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),r={src:t,textTracks:s};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:_n(r.poster)}]),r}return le(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},s=Yt(e),r=s["data-setup"];if(Hs(e,"vjs-fill")&&(s.fill=!0),Hs(e,"vjs-fluid")&&(s.fluid=!0),r!==null){const[n,a]=xT(r||"{}");n&&Z.error(n),Object.assign(s,a)}if(Object.assign(t,s),e.hasChildNodes()){const n=e.childNodes;for(let a=0,o=n.length;atypeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}};Be.names.forEach(function(i){const e=Be[i];Ae.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Ae.prototype.crossorigin=Ae.prototype.crossOrigin;Ae.players={};const Rs=E.navigator;Ae.prototype.options_={techOrder:K.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Rs&&(Rs.languages&&Rs.languages[0]||Rs.userLanguage||Rs.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,enableSmoothSeeking:!1};Mf.forEach(function(i){Ae.prototype[`handleTech${ve(i)}_`]=function(){return this.trigger(i)}});B.registerComponent("Player",Ae);const vn="plugin",Gi="activePlugins_",Fi={},Tn=i=>Fi.hasOwnProperty(i),sn=i=>Tn(i)?Fi[i]:void 0,Nf=(i,e)=>{i[Gi]=i[Gi]||{},i[Gi][e]=!0},bn=(i,e,t)=>{const s=(t?"before":"")+"pluginsetup";i.trigger(s,e),i.trigger(s+":"+e.name,e)},$S=function(i,e){const t=function(){bn(this,{name:i,plugin:e,instance:null},!0);const s=e.apply(this,arguments);return Nf(this,i),bn(this,{name:i,plugin:e,instance:s}),s};return Object.keys(e).forEach(function(s){t[s]=e[s]}),t},Uc=(i,e)=>(e.prototype.name=i,function(...t){bn(this,{name:i,plugin:e,instance:null},!0);const s=new e(this,...t);return this[i]=()=>s,bn(this,s.getEventHash()),s});let It=class rn{constructor(e){if(this.constructor===rn)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),au(this),delete this.trigger,Jh(this,this.constructor.defaultState),Nf(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return ds(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[Gi][e]=!1,this.player=this.state=null,t[e]=Uc(e,Fi[e])}static isBasic(e){const t=typeof e=="string"?sn(e):e;return typeof t=="function"&&!rn.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(Tn(e))Z.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Ae.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return Fi[e]=t,e!==vn&&(rn.isBasic(t)?Ae.prototype[e]=$S(e,t):Ae.prototype[e]=Uc(e,t)),t}static deregisterPlugin(e){if(e===vn)throw new Error("Cannot de-register base plugin.");Tn(e)&&(delete Fi[e],delete Ae.prototype[e])}static getPlugins(e=Object.keys(Fi)){let t;return e.forEach(s=>{const r=sn(s);r&&(t=t||{},t[s]=r)}),t}static getPluginVersion(e){const t=sn(e);return t&&t.VERSION||""}};It.getPlugin=sn;It.BASE_PLUGIN_NAME=vn;It.registerPlugin(vn,It);Ae.prototype.usingPlugin=function(i){return!!this[Gi]&&this[Gi][i]===!0};Ae.prototype.hasPlugin=function(i){return!!Tn(i)};function jS(i,e){let t=!1;return function(...s){return t||Z.warn(i),t=!0,e.apply(this,s)}}function pt(i,e,t,s){return jS(`${e} is deprecated and will be removed in ${i}.0; please use ${t} instead.`,s)}var qS={UnsupportedSidxContainer:"unsupported-sidx-container-error",DashManifestSidxParsingError:"dash-manifest-sidx-parsing-error",HlsPlaylistRequestError:"hls-playlist-request-error",SegmentUnsupportedMediaFormat:"segment-unsupported-media-format-error",UnsupportedMediaInitialization:"unsupported-media-initialization-error",SegmentSwitchError:"segment-switch-error",SegmentExceedsSourceBufferQuota:"segment-exceeds-source-buffer-quota-error",SegmentAppendError:"segment-append-error",VttLoadError:"vtt-load-error",VttCueParsingError:"vtt-cue-parsing-error",AdsBeforePrerollError:"ads-before-preroll-error",AdsPrerollError:"ads-preroll-error",AdsMidrollError:"ads-midroll-error",AdsPostrollError:"ads-postroll-error",AdsMacroReplacementFailed:"ads-macro-replacement-failed",AdsResumeContentFailed:"ads-resume-content-failed",EMEFailedToRequestMediaKeySystemAccess:"eme-failed-request-media-key-system-access",EMEFailedToCreateMediaKeys:"eme-failed-create-media-keys",EMEFailedToAttachMediaKeysToVideoElement:"eme-failed-attach-media-keys-to-video",EMEFailedToCreateMediaKeySession:"eme-failed-create-media-key-session",EMEFailedToSetServerCertificate:"eme-failed-set-server-certificate",EMEFailedToGenerateLicenseRequest:"eme-failed-generate-license-request",EMEFailedToUpdateSessionWithReceivedLicenseKeys:"eme-failed-update-session",EMEFailedToCloseSession:"eme-failed-close-session",EMEFailedToRemoveKeysFromSession:"eme-failed-remove-keys",EMEFailedToLoadSessionBySessionId:"eme-failed-load-session"};const Bf=i=>i.indexOf("#")===0?i.slice(1):i;function A(i,e,t){let s=A.getPlayer(i);if(s)return e&&Z.warn(`Player "${i}" is already initialised. Options will not be applied.`),t&&s.ready(t),s;const r=typeof i=="string"?Jt("#"+Bf(i)):i;if(!cs(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof E.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&Z.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),Qt("beforesetup").forEach(l=>{const f=l(r,le(e));if(!At(f)||Array.isArray(f)){Z.error("please return an object in beforesetup hooks");return}e=le(e,f)});const o=B.getComponent("Player");return s=new o(r,e,t),Qt("setup").forEach(l=>l(s)),s}A.hooks_=Nt;A.hooks=Qt;A.hook=x1;A.hookOnce=E1;A.removeHook=xh;if(E.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&ls()){let i=Jt(".vjs-styles-defaults");if(!i){i=Wh("vjs-styles-defaults");const e=Jt("head");e&&e.insertBefore(i,e.firstChild),Kh(i,` + .video-js { + width: 300px; + height: 150px; + } + + .vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: 56.25% + } + `)}}fo(1,A);A.VERSION=no;A.options=Ae.prototype.options_;A.getPlayers=()=>Ae.players;A.getPlayer=i=>{const e=Ae.players;let t;if(typeof i=="string"){const s=Bf(i),r=e[s];if(r)return r;t=Jt("#"+s)}else t=i;if(cs(t)){const{player:s,playerId:r}=t;if(s||e[r])return s||e[r]}};A.getAllPlayers=()=>Object.keys(Ae.players).map(i=>Ae.players[i]).filter(Boolean);A.players=Ae.players;A.getComponent=B.getComponent;A.registerComponent=(i,e)=>(K.isTech(e)&&Z.warn(`The ${i} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),B.registerComponent.call(B,i,e));A.getTech=K.getTech;A.registerTech=K.registerTech;A.use=J1;Object.defineProperty(A,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(A.middleware,"TERMINATOR",{value:yn,writeable:!1,enumerable:!0});A.browser=Lh;A.obj=D1;A.mergeOptions=pt(9,"videojs.mergeOptions","videojs.obj.merge",le);A.defineLazyProperty=pt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Un);A.bind=pt(9,"videojs.bind","native Function.prototype.bind",ce);A.registerPlugin=It.registerPlugin;A.deregisterPlugin=It.deregisterPlugin;A.plugin=(i,e)=>(Z.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),It.registerPlugin(i,e));A.getPlugins=It.getPlugins;A.getPlugin=It.getPlugin;A.getPluginVersion=It.getPluginVersion;A.addLanguage=function(i,e){return i=(""+i).toLowerCase(),A.options.languages=le(A.options.languages,{[i]:e}),A.options.languages[i]};A.log=Z;A.createLogger=Eh;A.time=j1;A.createTimeRange=pt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",ht);A.createTimeRanges=pt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",ht);A.formatTime=pt(9,"videojs.formatTime","videojs.time.formatTime",Si);A.setFormatTime=pt(9,"videojs.setFormatTime","videojs.time.setFormatTime",tf);A.resetFormatTime=pt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",sf);A.parseUrl=pt(9,"videojs.parseUrl","videojs.url.parseUrl",lu);A.isCrossOrigin=pt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Qn);A.EventTarget=ot;A.any=nu;A.on=tt;A.one=Xn;A.off=Oe;A.trigger=ds;A.xhr=Dd;A.TextTrack=cr;A.AudioTrack=of;A.VideoTrack=uf;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(i=>{A[i]=function(){return Z.warn(`videojs.${i}() is deprecated; use videojs.dom.${i}() instead`),Gh[i].apply(null,arguments)}});A.computedStyle=pt(9,"videojs.computedStyle","videojs.dom.computedStyle",rs);A.dom=Gh;A.fn=M1;A.num=_S;A.str=U1;A.url=Y1;A.Error=qS;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class VS{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(s){t.enabled_(s)}}),t}}class Sn extends A.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const s=this.levels_.length;return t=new VS(e),""+s in this||Object.defineProperty(this,s,{get(){return this.levels_[s]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let s=0,r=this.length;ss&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,s=this.length;ts,i.qualityLevels.VERSION=Ff,s},Uf=function(i){return HS(this,A.obj.merge({},i))};A.registerPlugin("qualityLevels",Uf);Uf.VERSION=Ff;/*! @name @videojs/http-streaming @version 3.12.1 @license Apache-2.0 */const Ge=Ln,xn=(i,e)=>e&&e.responseURL&&i!==e.responseURL?e.responseURL:i,ut=i=>A.log.debug?A.log.debug.bind(A,"VHS:",`${i} >`):function(){};function se(...i){const e=A.obj||A;return(e.merge||e.mergeOptions).apply(e,i)}function Le(...i){const e=A.time||A;return(e.createTimeRanges||e.createTimeRanges).apply(e,i)}function GS(i){if(i.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: +`;for(let t=0;t ${r}. Duration (${r-s}) +`}return e}const Tt=1/30,bt=Tt*3,$f=function(i,e){const t=[];let s;if(i&&i.length)for(s=0;s=e})},Wr=function(i,e){return $f(i,function(t){return t-Tt>=e})},zS=function(i){if(i.length<2)return Le();const e=[];for(let t=1;t{const e=[];if(!i||!i.length)return"";for(let t=0;t "+i.end(t));return e.join(", ")},KS=function(i,e,t=1){return((i.length?i.end(i.length-1):0)-e)/t},gi=i=>{const e=[];for(let t=0;tn)){if(e>r&&e<=n){t+=n-e;continue}t+=n-r}}return t},wu=(i,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(s){t+=s.duration}),(e.preloadHints||[]).forEach(function(s){s.type==="PART"&&(t+=i.partTargetDuration)}),t},bo=i=>(i.segments||[]).reduce((e,t,s)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:s,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:s,partIndex:null,segment:t,part:null}),e),[]),qf=i=>{const e=i.segments&&i.segments.length&&i.segments[i.segments.length-1];return e&&e.parts||[]},Vf=({preloadSegment:i})=>{if(!i)return;const{parts:e,preloadHints:t}=i;let s=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return s+=e&&e.length?e.length:0,s},Hf=(i,e)=>{if(e.endList)return 0;if(i&&i.suggestedPresentationDelay)return i.suggestedPresentationDelay;const t=qf(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},YS=function(i,e){let t=0,s=e-i.mediaSequence,r=i.segments[s];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;s--;){if(r=i.segments[s],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=wu(i,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},QS=function(i,e){let t=0,s,r=e-i.mediaSequence;for(;r"u"&&(e=i.mediaSequence+i.segments.length),e"u"){if(i.totalDuration)return i.totalDuration;if(!i.endList)return E.Infinity}return Gf(i,e,t)},Ws=function({defaultDuration:i,durationList:e,startIndex:t,endIndex:s}){let r=0;if(t>s&&([t,s]=[s,t]),t<0){for(let n=t;n0)for(let f=l-1;f>=0;f--){const m=o[f];if(a+=m.duration,n){if(a<0)continue}else if(a+Tt<=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r-Ws({defaultDuration:i.targetDuration,durationList:o,startIndex:l,endIndex:f})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e}}if(l<0){for(let f=l;f<0;f++)if(a-=i.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e};l=0}for(let f=l;fTt,T=a===0,S=y&&a+Tt>=0;if(!((T||S)&&f!==o.length-1)){if(n){if(a>0)continue}else if(a-Tt>=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r+Ws({defaultDuration:i.targetDuration,durationList:o,startIndex:l,endIndex:f})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},Kf=function(i){return i.excludeUntil&&i.excludeUntil>Date.now()},ku=function(i){return i.excludeUntil&&i.excludeUntil===1/0},ea=function(i){const e=Kf(i);return!i.disabled&&!e},ex=function(i){return i.disabled},tx=function(i){for(let e=0;e{if(i.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return i.playlists.filter(s=>ea(s)?(s.attributes.BANDWIDTH||0)!i&&!e||!i&&e||i&&!e?!1:!!(i===e||i.id&&e.id&&i.id===e.id||i.resolvedUri&&e.resolvedUri&&i.resolvedUri===e.resolvedUri||i.uri&&e.uri&&i.uri===e.uri),$c=function(i,e){const t=i&&i.mediaGroups&&i.mediaGroups.AUDIO||{};let s=!1;for(const r in t){for(const n in t[r])if(s=e(t[r][n]),s)break;if(s)break}return!!s},pr=i=>{if(!i||!i.playlists||!i.playlists.length)return $c(i,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;eOd(n))||$c(i,n=>Iu(t,n))))return!1}return!0};var ze={liveEdgeDelay:Hf,duration:zf,seekable:JS,getMediaInfoForTime:ZS,isEnabled:ea,isDisabled:ex,isExcluded:Kf,isIncompatible:ku,playlistEnd:Wf,isAes:tx,hasAttribute:Xf,estimateSegmentRequestTime:ix,isLowestEnabledRendition:So,isAudioOnly:pr,playlistMatch:Iu,segmentDurationWithParts:wu};const{log:Yf}=A,zi=(i,e)=>`${i}-${e}`,Qf=(i,e,t)=>`placeholder-uri-${i}-${e}-${t}`,sx=({onwarn:i,oninfo:e,manifestString:t,customTagParsers:s=[],customTagMappers:r=[],llhls:n})=>{const a=new Tb;i&&a.on("warn",i),e&&a.on("info",e),s.forEach(f=>a.addParser(f)),r.forEach(f=>a.addTagMapper(f)),a.push(t),a.end();const o=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(f){o.hasOwnProperty(f)&&delete o[f]}),o.segments&&o.segments.forEach(function(f){["parts","preloadHints"].forEach(function(m){f.hasOwnProperty(m)&&delete f[m]})})),!o.targetDuration){let f=10;o.segments&&o.segments.length&&(f=o.segments.reduce((m,y)=>Math.max(m,y.duration),0)),i&&i({message:`manifest has no targetDuration defaulting to ${f}`}),o.targetDuration=f}const l=qf(o);if(l.length&&!o.partTargetDuration){const f=l.reduce((m,y)=>Math.max(m,y.duration),0);i&&(i({message:`manifest has no partTargetDuration defaulting to ${f}`}),Yf.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=f}return o},ms=(i,e)=>{i.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(i.mediaGroups[t])for(const s in i.mediaGroups[t])for(const r in i.mediaGroups[t][s]){const n=i.mediaGroups[t][s][r];e(n,t,s,r)}})},Jf=({playlist:i,uri:e,id:t})=>{i.id=t,i.playlistErrors_=0,e&&(i.uri=e),i.attributes=i.attributes||{}},rx=i=>{let e=i.playlists.length;for(;e--;){const t=i.playlists[e];Jf({playlist:t,id:zi(e,t.uri)}),t.resolvedUri=Ge(i.uri,t.uri),i.playlists[t.id]=t,i.playlists[t.uri]=t,t.attributes.BANDWIDTH||Yf.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},nx=i=>{ms(i,e=>{e.uri&&(e.resolvedUri=Ge(i.uri,e.uri))})},ax=(i,e)=>{const t=zi(0,e),s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:E.location.href,resolvedUri:E.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return s.playlists[t]=s.playlists[0],s.playlists[e]=s.playlists[0],s},Zf=(i,e,t=Qf)=>{i.uri=e;for(let r=0;r{if(!r.playlists||!r.playlists.length){if(s&&n==="AUDIO"&&!r.uri)for(let l=0;l(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((s,r)=>{if(!this.processedDateRanges_.has(r)&&(s.startTime=s.startDate.getTime()/1e3-this.offset_,s.processDateRange=()=>this.processDateRange(s),t.push(s),!!s.class))if(e[s.class]){const n=e[s.class].push(s);s.classListIndex=n-1}else e[s.class]=[s],s.classListIndex=0});for(const s of t){const r=e[s.class]||[];s.endDate?s.endTime=s.endDate.getTime()/1e3-this.offset_:s.endOnNext&&r[s.classListIndex+1]?s.endTime=r[s.classListIndex+1].startTime:s.duration?s.endTime=s.startTime+s.duration:s.plannedDuration?s.endTime=s.startTime+s.plannedDuration:s.endTime=s.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((s,r)=>{s.startDate.getTime(){if(e.endList||!e.serverControl)return i;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:s}=e;let r=e.mediaSequence+e.segments.length;if(s){const n=s.parts||[],a=Vf(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const s=new E.URL(i);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&s.searchParams.set(r,t[r])}),i=s.toString()}return i},lx=(i,e)=>{if(!i)return e;const t=se(i,e);if(i.preloadHints&&!e.preloadHints&&delete t.preloadHints,i.parts&&!e.parts)delete t.parts;else if(i.parts&&e.parts)for(let s=0;s{const s=i.slice(),r=e.slice();t=t||0;const n=[];let a;for(let o=0;o{!i.resolvedUri&&i.uri&&(i.resolvedUri=Ge(e,i.uri)),i.key&&!i.key.resolvedUri&&(i.key.resolvedUri=Ge(e,i.key.uri)),i.map&&!i.map.resolvedUri&&(i.map.resolvedUri=Ge(e,i.map.uri)),i.map&&i.map.key&&!i.map.key.resolvedUri&&(i.map.key.resolvedUri=Ge(e,i.map.key.uri)),i.parts&&i.parts.length&&i.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=Ge(e,t.uri))}),i.preloadHints&&i.preloadHints.length&&i.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=Ge(e,t.uri))})},tp=function(i){const e=i.segments||[],t=i.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let s=0;si===e||i.segments&&e.segments&&i.segments.length===e.segments.length&&i.endList===e.endList&&i.mediaSequence===e.mediaSequence&&i.preloadSegment===e.preloadSegment,xo=(i,e,t=ip)=>{const s=se(i,{}),r=s.playlists[e.id];if(!r||t(r,e))return null;e.segments=tp(e);const n=se(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a{ep(a,n.resolvedUri)});for(let a=0;a{if(a.playlists)for(let m=0;m{const t=i.segments||[],s=t[t.length-1],r=s&&s.parts&&s.parts[s.parts.length-1],n=r&&r.duration||s&&s.duration;return e&&n?n*1e3:(i.partTargetDuration||i.targetDuration||10)*500};class $i extends ox{constructor(e,t,s={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=ut("PlaylistLoader");const{withCredentials:r=!1}=s;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=s.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new jc,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=Ge(this.main.uri,e.uri);this.llhls&&(t=ux(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(s,r)=>{if(this.request){if(s)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,s){const{uri:r,id:n}=t;this.request=null,s&&(this.state=s),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:{errorType:A.Error.HlsPlaylistRequestError}},this.trigger("error")}parseManifest_({url:e,manifestString:t}){return sx({onwarn:({message:s})=>this.logger_(`m3u8-parser warn for ${e}: ${s}`),oninfo:({message:s})=>this.logger_(`m3u8-parser info for ${e}: ${s}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}haveMetadata({playlistString:e,playlistObject:t,url:s,id:r}){this.request=null,this.state="HAVE_METADATA";const n=t||this.parseManifest_({url:s,manifestString:e});n.lastRequest=Date.now(),Jf({playlist:n,uri:s,id:r});const a=xo(this.main,n);this.targetDuration=n.partTargetDuration||n.targetDuration,this.pendingMedia_=null,a?(this.main=a,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Eo(this.media(),!!a)),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),E.clearTimeout(this.mediaUpdateTimeout),E.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new jc,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(E.clearTimeout(this.finalRenditionTimeout),t){const a=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=E.setTimeout(this.media.bind(this,e,!1),a);return}const s=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Eo(e,!0)),!!r){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(a,o)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=xn(e.resolvedUri,o),a)return this.playlistRequestError(this.request,e,s);this.haveMetadata({playlistString:o.responseText,url:e.uri,id:e.id}),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}}pause(){this.mediaUpdateTimeout&&(E.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(E.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const s=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=E.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},s);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(E.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=E.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=E.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,requestType:"hls-playlist"},(e,t)=>{if(!this.request)return;if(this.request=null,e)return this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2,metadata:{errorType:A.Error.HlsPlaylistRequestError}},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.src=xn(this.src,t);const s=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(s)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,Zf(this.main,this.srcUri()),e.playlists.forEach(s=>{s.segments=tp(s),s.segments.forEach(r=>{ep(r,s.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||E.location.href;this.main=ax(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const s=this.main,r=e.ID;let n=s.playlists.length;for(;n--;){const a=s.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const o=a.resolvedUri,l=a.id;if(t){const f=this.createCloneURI_(a.resolvedUri,e),m=zi(r,f),y=this.createCloneAttributes_(r,a.attributes),T=this.createClonePlaylist_(a,m,e,y);s.playlists[n]=T,s.playlists[m]=T,s.playlists[f]=T}else s.playlists.splice(n,1);delete s.playlists[l],delete s.playlists[o]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const s=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!s.mediaGroups[n]||!s.mediaGroups[n][r])){for(const a in s.mediaGroups[n])if(a===r){for(const o in s.mediaGroups[n][a])s.mediaGroups[n][a][o].playlists.forEach((f,m)=>{const y=s.playlists[f.id],T=y.id,S=y.resolvedUri;delete s.playlists[T],delete s.playlists[S]});delete s.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const s=this.main,r=s.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=zi(e.ID,n),o=this.createCloneAttributes_(e.ID,t.attributes),l=this.createClonePlaylist_(t,a,e,o);s.playlists[r]=l,s.playlists[a]=l,s.playlists[n]=l,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,s=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||r.mediaGroups[n][t]))for(const a in r.mediaGroups[n]){if(a===s)r.mediaGroups[n][t]={};else continue;for(const o in r.mediaGroups[n][a]){const l=r.mediaGroups[n][a][o];r.mediaGroups[n][t][o]=rt({},l);const f=r.mediaGroups[n][t][o],m=this.createCloneURI_(l.resolvedUri,e);f.resolvedUri=m,f.uri=m,f.playlists=[],l.playlists.forEach((y,T)=>{const S=r.playlists[y.id],_=Qf(n,t,o),D=zi(t,_);if(S&&!r.playlists[D]){const w=this.createClonePlaylist_(S,D,e),k=w.resolvedUri;r.playlists[D]=w,r.playlists[k]=w}f.playlists[T]=this.createClonePlaylist_(y,D,e)})}}})}createClonePlaylist_(e,t,s,r){const n=this.createCloneURI_(e.resolvedUri,s),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),se(e,a)}createCloneURI_(e,t){const s=new URL(e);s.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))s.searchParams.set(n,r[n]);return s.href}createCloneAttributes_(e,t){const s={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(s[r]=e)}),s}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const Co=function(i,e,t,s){const r=i.responseType==="arraybuffer"?i.response:i.responseText;!e&&r&&(i.responseTime=Date.now(),i.roundTripTime=i.responseTime-i.requestTime,i.bytesReceived=r.byteLength||r.length,i.bandwidth||(i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3))),t.headers&&(i.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(i.timedout=!0),!e&&!i.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(i&&(r||i.responseText)))),s(e,i)},dx=(i,e)=>{if(!i||!i.size)return;let t=e;return i.forEach(s=>{t=s(t)}),t},hx=(i,e,t,s)=>{!i||!i.size||i.forEach(r=>{r(e,t,s)})},sp=function(){const i=function e(t,s){t=se({timeout:45e3},t);const r=e.beforeRequest||A.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||A.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||A.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(A.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const o=A.Vhs.xhr.original===!0?A.xhr:A.Vhs.xhr,l=dx(n,t);n.delete(r);const f=o(l||t,function(y,T){return hx(a,f,y,T),Co(f,y,T,s)}),m=f.abort;return f.abort=function(){return f.aborted=!0,m.apply(f,arguments)},f.uri=t.uri,f.requestTime=Date.now(),f};return i.original=!0,i},fx=function(i){let e;const t=i.offset;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=E.BigInt(i.offset)+E.BigInt(i.length)-E.BigInt(1):e=i.offset+i.length-1,"bytes="+t+"-"+e},Ao=function(i){const e={};return i.byterange&&(e.Range=fx(i.byterange)),e},px=function(i,e){return i.start(e)+"-"+i.end(e)},mx=function(i,e){const t=i.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},gx=function(i){return i>=32&&i<126?String.fromCharCode(i):"."},rp=function(i){const e={};return Object.keys(i).forEach(t=>{const s=i[t];Md(s)?e[t]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:e[t]=s}),e},En=function(i){const e=i.byterange||{length:1/0,offset:0};return[e.length,e.offset,i.resolvedUri].join(",")},np=function(i){return i.resolvedUri},ap=i=>{const e=Array.prototype.slice.call(i),t=16;let s="",r,n;for(let a=0;aap(i),_x=i=>{let e="",t;for(t=0;t{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,n=i-r;return new Date(e.dateTimeObject.getTime()+n*1e3)},bx=i=>i.transmuxedPresentationEnd-i.transmuxedPresentationStart-i.transmuxerPrependedSeconds,Sx=(i,e)=>{let t;try{t=new Date(i)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let s=e.segments[0];if(to?null:(t>new Date(n)&&(s=r),{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:ze.duration(e,e.mediaSequence+e.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"})},xx=(i,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,s;for(let n=0;nt){if(i>t+r.duration*op)return null;s=r}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:t-s.duration,type:s.videoTimingInfo?"accurate":"estimate"}},Ex=(i,e)=>{let t,s;try{t=new Date(i),s=new Date(e)}catch{}const r=t.getTime();return(s.getTime()-r)/1e3},Cx=i=>{if(!i.segments||i.segments.length===0)return!1;for(let e=0;e{if(!t)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const s=xx(e,i);if(!s)return t({message:"valid programTime was not found"});if(s.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});const r={mediaSeconds:e},n=Tx(e,s.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},up=({programTime:i,playlist:e,retryCount:t=2,seekTo:s,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof i>"u"||!e||!s)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!Cx(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=Sx(i,e);if(!o)return a({message:`${i} was not found in the stream`});const l=o.segment,f=Ex(l.dateTimeObject,i);if(o.type==="estimate"){if(t===0)return a({message:`${i} is not buffered yet. Try again`});s(o.estimatedStart+f),n.one("seeked",()=>{up({programTime:i,playlist:e,retryCount:t-1,seekTo:s,pauseAfterSeek:r,tech:n,callback:a})});return}const m=l.start+f,y=()=>a(null,n.currentTime());n.one("seeked",y),r&&n.pause(),s(m)},Ga=(i,e)=>{if(i.readyState===4)return e()},Dx=(i,e,t)=>{let s=[],r,n=!1;const a=function(m,y,T,S){return y.abort(),n=!0,t(m,y,T,S)},o=function(m,y){if(n)return;if(m)return a(m,y,"",s);const T=y.responseText.substring(s&&s.byteLength||0,y.responseText.length);if(s=Lb(s,Nd(T,!0)),r=r||Us(s),s.length<10||r&&s.lengtha(m,y,"",s));const S=Yo(s);return S==="ts"&&s.length<188?Ga(y,()=>a(m,y,"",s)):!S&&s.length<376?Ga(y,()=>a(m,y,"",s)):a(null,y,S,s)},f=e({uri:i,beforeSend(m){m.overrideMimeType("text/plain; charset=x-user-defined"),m.addEventListener("progress",function({total:y,loaded:T}){return Co(m,null,{statusCode:m.status},o)})}},function(m,y){return Co(f,m,y,o)});return f},{EventTarget:wx}=A,qc=function(i,e){if(!ip(i,e)||i.sidx&&e.sidx&&(i.sidx.offset!==e.sidx.offset||i.sidx.length!==e.sidx.length))return!1;if(!i.sidx&&e.sidx||i.sidx&&!e.sidx||i.segments&&!e.segments||!i.segments&&e.segments)return!1;if(!i.segments&&!e.segments)return!0;for(let t=0;t{const r=s.attributes.NAME||t;return`placeholder-uri-${i}-${e}-${r}`},Ix=({mainXml:i,srcUrl:e,clientOffset:t,sidxMapping:s,previousManifest:r})=>{const n=t1(i,{manifestUri:e,clientOffset:t,sidxMapping:s,previousManifest:r});return Zf(n,e,kx),n},Px=(i,e)=>{ms(i,(t,s,r,n)=>{n in e.mediaGroups[s][r]||delete i.mediaGroups[s][r][n]})},Lx=(i,e,t)=>{let s=!0,r=se(i,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n{if(n.playlists&&n.playlists.length){const f=n.playlists[0].id,m=xo(r,n.playlists[0],qc);m&&(r=m,l in r.mediaGroups[a][o]||(r.mediaGroups[a][o][l]=n),r.mediaGroups[a][o][l].playlists[0]=r.playlists[f],s=!1)}}),Px(r,e),e.minimumUpdatePeriod!==i.minimumUpdatePeriod&&(s=!1),s?null:r},Ox=(i,e)=>(!i.map&&!e.map||!!(i.map&&e.map&&i.map.byterange.offset===e.map.byterange.offset&&i.map.byterange.length===e.map.byterange.length))&&i.uri===e.uri&&i.byterange.offset===e.byterange.offset&&i.byterange.length===e.byterange.length,Vc=(i,e)=>{const t={};for(const s in i){const n=i[s].sidx;if(n){const a=Nn(n);if(!e[a])break;const o=e[a].sidxInfo;Ox(o,n)&&(t[a]=e[a])}}return t},Rx=(i,e)=>{let s=Vc(i.playlists,e);return ms(i,(r,n,a,o)=>{if(r.playlists&&r.playlists.length){const l=r.playlists;s=se(s,Vc(l,e))}}),s};class Do extends wx{constructor(e,t,s={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=s;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=s.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=ut("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,s){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},s&&(this.state=s),this.trigger("error"),!0}addSidxSegments_(e,t,s){const r=e.sidx&&Nn(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){this.mediaRequest_=E.setTimeout(()=>s(!1),0);return}const n=xn(e.sidx.resolvedUri),a=(o,l)=>{if(this.requestErrored_(o,l,t))return;const f=this.mainPlaylistLoader_.sidxMapping_;let m;try{m=o1(H(l.response).subarray(8))}catch(y){y.metadata={errorType:A.Error.DashManifestSidxParsingError},this.requestErrored_(y,l,t);return}return f[r]={sidxInfo:e.sidx,sidx:m},Wo(e,m,e.sidx.resolvedUri),s(!0)};this.request=Dx(n,this.vhs_.xhr,(o,l,f,m)=>{if(o)return a(o,l);if(!f||f!=="mp4"){const S=f||"unknown";return a({status:l.status,message:`Unsupported ${S} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2,metadata:{errorType:A.Error.UnsupportedSidxContainer,sidxContainer:S}},l)}const{offset:y,length:T}=e.sidx.byterange;if(m.length>=T+y)return a(o,{response:m.subarray(y,y+T),status:l.status,uri:l.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",headers:Ao({byterange:e.sidx.byterange})},a)})}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},E.clearTimeout(this.minimumUpdatePeriodTimeout_),E.clearTimeout(this.mediaRequest_),E.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const s=!this.media_||e.id!==this.media_.id;if(s&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,s&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}s&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),E.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(E.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){E.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const s=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=E.setTimeout(()=>this.load(),s);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){this.mediaRequest_=E.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(t,s)=>{if(this.requestErrored_(t,s)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}const r=s.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=s.responseText,s.responseHeaders&&s.responseHeaders.date?this.mainLoaded_=Date.parse(s.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=xn(this.mainPlaylistLoader_.srcUrl,s),r){this.handleMain_(),this.syncClientServerClock_(()=>e(s,r));return}return e(s,r)})}syncClientServerClock_(e){const t=i1(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:Ge(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(s,r)=>{if(!this.request)return;if(s)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();let n;t.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(r.responseHeaders.date):n=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main;let t=Ix({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=Lx(e,t,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=t||e;const s=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];return s&&s!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=s),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(t),!!t}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(E.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=E.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=Rx(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,s=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,s=!this.media_||this.media_!==t[e];if(s?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=E.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},Eo(this.media(),!!s)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(s=>({cueTime:s.start,frames:[{data:s.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var De={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 Mx=i=>{const e=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t-1):!1},this.trigger=function(c){var h,d,p,g;if(h=u[c],!!h)if(arguments.length===2)for(p=h.length,d=0;d"u")){for(u in V)V.hasOwnProperty(u)&&(V[u]=[u.charCodeAt(0),u.charCodeAt(1),u.charCodeAt(2),u.charCodeAt(3)]);te=new Uint8Array([105,115,111,109]),ie=new Uint8Array([97,118,99,49]),Xe=new Uint8Array([0,0,0,1]),Te=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),Pt=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),ii={video:Te,audio:Pt},ni=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ri=new Uint8Array([0,0,0,0,0,0,0,0]),gr=new Uint8Array([0,0,0,0,0,0,0,0]),Bu=gr,Fu=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Uu=gr,si=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(u){var c=[],h=0,d,p,g;for(d=1;d>>1,u.samplingfrequencyindex<<7|u.channelcount<<3,6,1,2]))},m=function(){return o(V.ftyp,te,Xe,te,ie)},U=function(u){return o(V.hdlr,ii[u])},y=function(u){return o(V.mdat,u)},L=function(u){var c=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,u.duration>>>24&255,u.duration>>>16&255,u.duration>>>8&255,u.duration&255,85,196,0,0]);return u.samplerate&&(c[12]=u.samplerate>>>24&255,c[13]=u.samplerate>>>16&255,c[14]=u.samplerate>>>8&255,c[15]=u.samplerate&255),o(V.mdhd,c)},R=function(u){return o(V.mdia,L(u),U(u.type),S(u))},T=function(u){return o(V.mfhd,new Uint8Array([0,0,0,0,(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&255]))},S=function(u){return o(V.minf,u.type==="video"?o(V.vmhd,si):o(V.smhd,ri),l(),J(u))},_=function(u,c){for(var h=[],d=c.length;d--;)h[d]=ue(c[d]);return o.apply(null,[V.moof,T(u)].concat(h))},D=function(u){for(var c=u.length,h=[];c--;)h[c]=I(u[c]);return o.apply(null,[V.moov,k(4294967295)].concat(h).concat(w(u)))},w=function(u){for(var c=u.length,h=[];c--;)h[c]=ee(u[c]);return o.apply(null,[V.mvex].concat(h))},k=function(u){var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return o(V.mvhd,c)},q=function(u){var c=u.samples||[],h=new Uint8Array(4+c.length),d,p;for(p=0;p>>8),g.push(d[b].byteLength&255),g=g.concat(Array.prototype.slice.call(d[b]));for(b=0;b>>8),v.push(p[b].byteLength&255),v=v.concat(Array.prototype.slice.call(p[b]));if(x=[V.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,(h.width&65280)>>8,h.width&255,(h.height&65280)>>8,h.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o(V.avcC,new Uint8Array([1,h.profileIdc,h.profileCompatibility,h.levelIdc,255].concat([d.length],g,[p.length],v))),o(V.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],h.sarRatio){var C=h.sarRatio[0],P=h.sarRatio[1];x.push(o(V.pasp,new Uint8Array([(C&4278190080)>>24,(C&16711680)>>16,(C&65280)>>8,C&255,(P&4278190080)>>24,(P&16711680)>>16,(P&65280)>>8,P&255])))}return o.apply(null,x)},c=function(h){return o(V.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(h.channelcount&65280)>>8,h.channelcount&255,(h.samplesize&65280)>>8,h.samplesize&255,0,0,0,0,(h.samplerate&65280)>>8,h.samplerate&255,0,0]),f(h))}}(),M=function(u){var c=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,0,(u.duration&4278190080)>>24,(u.duration&16711680)>>16,(u.duration&65280)>>8,u.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,(u.width&65280)>>8,u.width&255,0,0,(u.height&65280)>>8,u.height&255,0,0]);return o(V.tkhd,c)},ue=function(u){var c,h,d,p,g,v,b;return c=o(V.tfhd,new Uint8Array([0,0,0,58,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),v=Math.floor(u.baseMediaDecodeTime/a),b=Math.floor(u.baseMediaDecodeTime%a),h=o(V.tfdt,new Uint8Array([1,0,0,0,v>>>24&255,v>>>16&255,v>>>8&255,v&255,b>>>24&255,b>>>16&255,b>>>8&255,b&255])),g=92,u.type==="audio"?(d=de(u,g),o(V.traf,c,h,d)):(p=q(u),d=de(u,p.length+g),o(V.traf,c,h,d,p))},I=function(u){return u.duration=u.duration||4294967295,o(V.trak,M(u),R(u))},ee=function(u){var c=new Uint8Array([0,0,0,0,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return u.type!=="video"&&(c[c.length-1]=0),o(V.trex,c)},function(){var u,c,h;h=function(d,p){var g=0,v=0,b=0,x=0;return d.length&&(d[0].duration!==void 0&&(g=1),d[0].size!==void 0&&(v=2),d[0].flags!==void 0&&(b=4),d[0].compositionTimeOffset!==void 0&&(x=8)),[0,0,g|v|b|x,1,(d.length&4278190080)>>>24,(d.length&16711680)>>>16,(d.length&65280)>>>8,d.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},c=function(d,p){var g,v,b,x,C,P;for(x=d.samples||[],p+=20+16*x.length,b=h(x,p),v=new Uint8Array(b.length+x.length*16),v.set(b),g=b.length,P=0;P>>24,v[g++]=(C.duration&16711680)>>>16,v[g++]=(C.duration&65280)>>>8,v[g++]=C.duration&255,v[g++]=(C.size&4278190080)>>>24,v[g++]=(C.size&16711680)>>>16,v[g++]=(C.size&65280)>>>8,v[g++]=C.size&255,v[g++]=C.flags.isLeading<<2|C.flags.dependsOn,v[g++]=C.flags.isDependedOn<<6|C.flags.hasRedundancy<<4|C.flags.paddingValue<<1|C.flags.isNonSyncSample,v[g++]=C.flags.degradationPriority&61440,v[g++]=C.flags.degradationPriority&15,v[g++]=(C.compositionTimeOffset&4278190080)>>>24,v[g++]=(C.compositionTimeOffset&16711680)>>>16,v[g++]=(C.compositionTimeOffset&65280)>>>8,v[g++]=C.compositionTimeOffset&255;return o(V.trun,v)},u=function(d,p){var g,v,b,x,C,P;for(x=d.samples||[],p+=20+8*x.length,b=h(x,p),g=new Uint8Array(b.length+x.length*8),g.set(b),v=b.length,P=0;P>>24,g[v++]=(C.duration&16711680)>>>16,g[v++]=(C.duration&65280)>>>8,g[v++]=C.duration&255,g[v++]=(C.size&4278190080)>>>24,g[v++]=(C.size&16711680)>>>16,g[v++]=(C.size&65280)>>>8,g[v++]=C.size&255;return o(V.trun,g)},de=function(d,p){return d.type==="audio"?u(d,p):c(d,p)}}();var t_={ftyp:m,mdat:y,moof:_,moov:D,initSegment:function(u){var c=m(),h=D(u),d;return d=new Uint8Array(c.byteLength+h.byteLength),d.set(c),d.set(h,c.byteLength),d}},i_=function(u){var c,h,d=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,d.byteLength=0,c=0;c1&&(c=u.shift(),u.byteLength-=c.byteLength,u.nalCount-=c.nalCount,u[0][0].dts=c.dts,u[0][0].pts=c.pts,u[0][0].duration+=c.duration),u},n_=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},$u=function(u,c){var h=n_();return h.dataOffset=c,h.compositionTimeOffset=u.pts-u.dts,h.duration=u.duration,h.size=4*u.length,h.size+=u.byteLength,u.keyFrame&&(h.flags.dependsOn=2,h.flags.isNonSyncSample=0),h},a_=function(u,c){var h,d,p,g,v,b=c||0,x=[];for(h=0;h_r.ONE_SECOND_IN_TS/2))){for(C=f_()[u.samplerate],C||(C=c[0].data),P=0;P=h?u:(c.minSegmentDts=1/0,u.filter(function(d){return d.dts>=h?(c.minSegmentDts=Math.min(c.minSegmentDts,d.dts),c.minSegmentPts=c.minSegmentDts,!0):!1}))},y_=function(u){var c,h,d=[];for(c=0;c=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(u),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},Lt.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},Lt.prototype.addText=function(u){this.rows[this.rowIdx]+=u},Lt.prototype.backspace=function(){if(!this.isEmpty()){var u=this.rows[this.rowIdx];this.rows[this.rowIdx]=u.substr(0,u.length-1)}};var br=function(u,c,h){this.serviceNum=u,this.text="",this.currentWindow=new Lt(-1),this.windows=[],this.stream=h,typeof c=="string"&&this.createTextDecoder(c)};br.prototype.init=function(u,c){this.startPts=u;for(var h=0;h<8;h++)this.windows[h]=new Lt(h),typeof c=="function"&&(this.windows[h].beforeRowOverflow=c)},br.prototype.setCurrentWindow=function(u){this.currentWindow=this.windows[u]},br.prototype.createTextDecoder=function(u){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(u)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+u+" encoding. "+c})}};var oe=function(u){u=u||{},oe.prototype.init.call(this);var c=this,h=u.captionServices||{},d={},p;Object.keys(h).forEach(g=>{p=h[g],/^SERVICE/.test(g)&&(d[g]=p.encoding)}),this.serviceEncodings=d,this.current708Packet=null,this.services={},this.push=function(g){g.type===3?(c.new708Packet(),c.add708Bytes(g)):(c.current708Packet===null&&c.new708Packet(),c.add708Bytes(g))}};oe.prototype=new ua,oe.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},oe.prototype.add708Bytes=function(u){var c=u.ccData,h=c>>>8,d=c&255;this.current708Packet.ptsVals.push(u.pts),this.current708Packet.data.push(h),this.current708Packet.data.push(d)},oe.prototype.push708Packet=function(){var u=this.current708Packet,c=u.data,h=null,d=null,p=0,g=c[p++];for(u.seq=g>>6,u.sizeCode=g&63;p>5,d=g&31,h===7&&d>0&&(g=c[p++],h=g),this.pushServiceBlock(h,p,d),d>0&&(p+=d-1)},oe.prototype.pushServiceBlock=function(u,c,h){var d,p=c,g=this.current708Packet.data,v=this.services[u];for(v||(v=this.initService(u,p));p("0"+(G&255).toString(16)).slice(-2)).join("")}if(p?(O=[b,x],u++):O=[b],c.textDecoder_&&!d)P=c.textDecoder_.decode(new Uint8Array(O));else if(p){const N=$(O);P=String.fromCharCode(parseInt(N,16))}else P=P_(v|b);return C.pendingNewLine&&!C.isEmpty()&&C.newLine(this.getPts(u)),C.pendingNewLine=!1,C.addText(P),u},oe.prototype.multiByteCharacter=function(u,c){var h=this.current708Packet.data,d=h[u+1],p=h[u+2];return Tr(d)&&Tr(p)&&(u=this.handleText(++u,c,{isMultiByte:!0})),u},oe.prototype.setCurrentWindow=function(u,c){var h=this.current708Packet.data,d=h[u],p=d&7;return c.setCurrentWindow(p),u},oe.prototype.defineWindow=function(u,c){var h=this.current708Packet.data,d=h[u],p=d&7;c.setCurrentWindow(p);var g=c.currentWindow;return d=h[++u],g.visible=(d&32)>>5,g.rowLock=(d&16)>>4,g.columnLock=(d&8)>>3,g.priority=d&7,d=h[++u],g.relativePositioning=(d&128)>>7,g.anchorVertical=d&127,d=h[++u],g.anchorHorizontal=d,d=h[++u],g.anchorPoint=(d&240)>>4,g.rowCount=d&15,d=h[++u],g.columnCount=d&63,d=h[++u],g.windowStyle=(d&56)>>3,g.penStyle=d&7,g.virtualRowCount=g.rowCount+1,u},oe.prototype.setWindowAttributes=function(u,c){var h=this.current708Packet.data,d=h[u],p=c.currentWindow.winAttr;return d=h[++u],p.fillOpacity=(d&192)>>6,p.fillRed=(d&48)>>4,p.fillGreen=(d&12)>>2,p.fillBlue=d&3,d=h[++u],p.borderType=(d&192)>>6,p.borderRed=(d&48)>>4,p.borderGreen=(d&12)>>2,p.borderBlue=d&3,d=h[++u],p.borderType+=(d&128)>>5,p.wordWrap=(d&64)>>6,p.printDirection=(d&48)>>4,p.scrollDirection=(d&12)>>2,p.justify=d&3,d=h[++u],p.effectSpeed=(d&240)>>4,p.effectDirection=(d&12)>>2,p.displayEffect=d&3,u},oe.prototype.flushDisplayed=function(u,c){for(var h=[],d=0;d<8;d++)c.windows[d].visible&&!c.windows[d].isEmpty()&&h.push(c.windows[d].getText());c.endPts=u,c.text=h.join(` + +`),this.pushCaption(c),c.startPts=u},oe.prototype.pushCaption=function(u){u.text!==""&&(this.trigger("data",{startPts:u.startPts,endPts:u.endPts,text:u.text,stream:"cc708_"+u.serviceNum}),u.text="",u.startPts=u.endPts)},oe.prototype.displayWindows=function(u,c){var h=this.current708Packet.data,d=h[++u],p=this.getPts(u);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<>4,p.offset=(d&12)>>2,p.penSize=d&3,d=h[++u],p.italics=(d&128)>>7,p.underline=(d&64)>>6,p.edgeType=(d&56)>>3,p.fontStyle=d&7,u},oe.prototype.setPenColor=function(u,c){var h=this.current708Packet.data,d=h[u],p=c.currentWindow.penColor;return d=h[++u],p.fgOpacity=(d&192)>>6,p.fgRed=(d&48)>>4,p.fgGreen=(d&12)>>2,p.fgBlue=d&3,d=h[++u],p.bgOpacity=(d&192)>>6,p.bgRed=(d&48)>>4,p.bgGreen=(d&12)>>2,p.bgBlue=d&3,d=h[++u],p.edgeRed=(d&48)>>4,p.edgeGreen=(d&12)>>2,p.edgeBlue=d&3,u},oe.prototype.setPenLocation=function(u,c){var h=this.current708Packet.data,d=h[u],p=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,d=h[++u],p.row=d&15,d=h[++u],p.column=d&63,u},oe.prototype.reset=function(u,c){var h=this.getPts(u);return this.flushDisplayed(h,c),this.initService(c.serviceNum,u)};var L_={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},Sr=function(u){return u===null?"":(u=L_[u]||u,String.fromCharCode(u))},xr=14,O_=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],ai=function(){for(var u=[],c=xr+1;c--;)u.push({text:"",indent:0,offset:0});return u},fe=function(u,c){fe.prototype.init.call(this),this.field_=u||0,this.dataChannel_=c||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(h){var d,p,g,v,b;if(d=h.ccData&32639,d===this.lastControlCode_){this.lastControlCode_=null;return}if((d&61440)===4096?this.lastControlCode_=d:d!==this.PADDING_&&(this.lastControlCode_=null),g=d>>>8,v=d&255,d!==this.PADDING_)if(d===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(d===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(h.pts),this.flushDisplayed(h.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=h.pts;else if(d===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(h.pts);else if(d===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(h.pts);else if(d===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(h.pts);else if(d===this.CARRIAGE_RETURN_)this.clearFormatting(h.pts),this.flushDisplayed(h.pts),this.shiftRowsUp_(),this.startPts_=h.pts;else if(d===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(d===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(h.pts),this.displayed_=ai();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=ai();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(h.pts),this.displayed_=ai()),this.mode_="paintOn",this.startPts_=h.pts;else if(this.isSpecialCharacter(g,v))g=(g&3)<<8,b=Sr(g|v),this[this.mode_](h.pts,b),this.column_++;else if(this.isExtCharacter(g,v))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),g=(g&3)<<8,b=Sr(g|v),this[this.mode_](h.pts,b),this.column_++;else if(this.isMidRowCode(g,v))this.clearFormatting(h.pts),this[this.mode_](h.pts," "),this.column_++,(v&14)===14&&this.addFormatting(h.pts,["i"]),(v&1)===1&&this.addFormatting(h.pts,["u"]);else if(this.isOffsetControlCode(g,v)){const C=v&3;this.nonDisplayed_[this.row_].offset=C,this.column_+=C}else if(this.isPAC(g,v)){var x=O_.indexOf(d&7968);if(this.mode_==="rollUp"&&(x-this.rollUpRows_+1<0&&(x=this.rollUpRows_-1),this.setRollUp(h.pts,x)),x!==this.row_&&x>=0&&x<=14&&(this.clearFormatting(h.pts),this.row_=x),v&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(h.pts,["u"]),(d&16)===16){const C=(d&14)>>1;this.column_=C*4,this.nonDisplayed_[this.row_].indent+=C}this.isColorPAC(v)&&(v&14)===14&&this.addFormatting(h.pts,["i"])}else this.isNormalChar(g)&&(v===0&&(v=null),b=Sr(g),b+=Sr(v),this[this.mode_](h.pts,b),this.column_+=b.length)}};fe.prototype=new ua,fe.prototype.flushDisplayed=function(u){const c=d=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."})},h=[];this.displayed_.forEach((d,p)=>{if(d&&d.text&&d.text.length){try{d.text=d.text.trim()}catch{c(p)}d.text.length&&h.push({text:d.text,line:p+1,position:10+Math.min(70,d.indent*10)+d.offset*2.5})}else d==null&&c(p)}),h.length&&this.trigger("data",{startPts:this.startPts_,endPts:u,content:h,stream:this.name_})},fe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=ai(),this.nonDisplayed_=ai(),this.lastControlCode_=null,this.column_=0,this.row_=xr,this.rollUpRows_=2,this.formatting_=[]},fe.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},fe.prototype.isSpecialCharacter=function(u,c){return u===this.EXT_&&c>=48&&c<=63},fe.prototype.isExtCharacter=function(u,c){return(u===this.EXT_+1||u===this.EXT_+2)&&c>=32&&c<=63},fe.prototype.isMidRowCode=function(u,c){return u===this.EXT_&&c>=32&&c<=47},fe.prototype.isOffsetControlCode=function(u,c){return u===this.OFFSET_&&c>=33&&c<=35},fe.prototype.isPAC=function(u,c){return u>=this.BASE_&&u=64&&c<=127},fe.prototype.isColorPAC=function(u){return u>=64&&u<=79||u>=96&&u<=127},fe.prototype.isNormalChar=function(u){return u>=32&&u<=127},fe.prototype.setRollUp=function(u,c){if(this.mode_!=="rollUp"&&(this.row_=xr,this.mode_="rollUp",this.flushDisplayed(u),this.nonDisplayed_=ai(),this.displayed_=ai()),c!==void 0&&c!==this.row_)for(var h=0;h"},"");this[this.mode_](u,h)},fe.prototype.clearFormatting=function(u){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(h,d){return h+""},"");this.formatting_=[],this[this.mode_](u,c)}},fe.prototype.popOn=function(u,c){var h=this.nonDisplayed_[this.row_].text;h+=c,this.nonDisplayed_[this.row_].text=h},fe.prototype.rollUp=function(u,c){var h=this.displayed_[this.row_].text;h+=c,this.displayed_[this.row_].text=h},fe.prototype.shiftRowsUp_=function(){var u;for(u=0;uc&&(h=-1);Math.abs(c-u)>N_;)u+=h*M_;return u},ca=function(u){var c,h;ca.prototype.init.call(this),this.type_=u||Wu,this.push=function(d){if(d.type==="metadata"){this.trigger("data",d);return}this.type_!==Wu&&d.type!==this.type_||(h===void 0&&(h=d.dts),d.dts=la(d.dts,h),d.pts=la(d.pts,h),c=d.dts,this.trigger("data",d))},this.flush=function(){h=c,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){h=void 0,c=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};ca.prototype=new R_;var Ku={TimestampRolloverStream:ca,handleRollover:la},B_=(u,c,h)=>{if(!u)return-1;for(var d=h;d";u.data[0]===Ar.Utf8&&(h=Cr(u.data,0,c),!(h<0)&&(u.mimeType=ys(u.data,c,h),c=h+1,u.pictureType=u.data[c],c++,d=Cr(u.data,0,c),!(d<0)&&(u.description=gs(u.data,c,d),c=d+1,u.mimeType===p?u.url=ys(u.data,c,u.data.length):u.pictureData=u.data.subarray(c,u.data.length))))},"T*":function(u){u.data[0]===Ar.Utf8&&(u.value=gs(u.data,1,u.data.length).replace(/\0*$/,""),u.values=u.value.split("\0"))},TXXX:function(u){var c;u.data[0]===Ar.Utf8&&(c=Cr(u.data,0,1),c!==-1&&(u.description=gs(u.data,1,c),u.value=gs(u.data,c+1,u.data.length).replace(/\0*$/,""),u.data=u.value))},"W*":function(u){u.url=ys(u.data,0,u.data.length).replace(/\0.*$/,"")},WXXX:function(u){var c;u.data[0]===Ar.Utf8&&(c=Cr(u.data,0,1),c!==-1&&(u.description=gs(u.data,1,c),u.url=ys(u.data,c+1,u.data.length).replace(/\0.*$/,"")))},PRIV:function(u){var c;for(c=0;c>>2;G*=4,G+=N[7]&3,P.timeStamp=G,b.pts===void 0&&b.dts===void 0&&(b.pts=P.timeStamp,b.dts=P.timeStamp),this.trigger("timestamp",P)}b.frames.push(P),x+=10,x+=C}while(x>>4>1&&(v+=p[v]+1),g.pid===0)g.type="pat",u(p.subarray(v),g),this.trigger("data",g);else if(g.pid===this.pmtPid)for(g.type="pmt",u(p.subarray(v),g),this.trigger("data",g);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,v,g]):this.processPes_(p,v,g)},this.processPes_=function(p,g,v){v.pid===this.programMapTable.video?v.streamType=lt.H264_STREAM_TYPE:v.pid===this.programMapTable.audio?v.streamType=lt.ADTS_STREAM_TYPE:v.streamType=this.programMapTable["timed-metadata"][v.pid],v.type="pes",v.data=p.subarray(g),this.trigger("data",v)}},Ts.prototype=new da,Ts.STREAM_TYPES={h264:27,adts:15},kr=function(){var u=this,c=!1,h={data:[],size:0},d={data:[],size:0},p={data:[],size:0},g,v=function(x,C){var P;const O=x[0]<<16|x[1]<<8|x[2];C.data=new Uint8Array,O===1&&(C.packetLength=6+(x[4]<<8|x[5]),C.dataAlignmentIndicator=(x[6]&4)!==0,P=x[7],P&192&&(C.pts=(x[9]&14)<<27|(x[10]&255)<<20|(x[11]&254)<<12|(x[12]&255)<<5|(x[13]&254)>>>3,C.pts*=4,C.pts+=(x[13]&6)>>>1,C.dts=C.pts,P&64&&(C.dts=(x[14]&14)<<27|(x[15]&255)<<20|(x[16]&254)<<12|(x[17]&255)<<5|(x[18]&254)>>>3,C.dts*=4,C.dts+=(x[18]&6)>>>1)),C.data=x.subarray(9+x[8]))},b=function(x,C,P){var O=new Uint8Array(x.size),$={type:C},N=0,G=0,z=!1,Ce;if(!(!x.data.length||x.size<9)){for($.trackId=x.data[0].pid,N=0;N>5,x=((c[p+6]&3)+1)*1024,C=x*z_/Ju[(c[p+2]&60)>>>2],c.byteLength-p>>6&3)+1,channelcount:(c[p+2]&1)<<2|(c[p+3]&192)>>>6,samplerate:Ju[(c[p+2]&60)>>>2],samplingfrequencyindex:(c[p+2]&60)>>>2,samplesize:16,data:c.subarray(p+7+v,p+g)}),h++,p+=g}typeof P=="number"&&(this.skipWarn_(P,p),P=null),c=c.subarray(p)}},this.flush=function(){h=0,this.trigger("done")},this.reset=function(){c=void 0,this.trigger("reset")},this.endTimeline=function(){c=void 0,this.trigger("endedtimeline")}},Ir.prototype=new G_;var W_=Ir,Zu;Zu=function(u){var c=u.byteLength,h=0,d=0;this.length=function(){return 8*c},this.bitsAvailable=function(){return 8*c+d},this.loadWord=function(){var p=u.byteLength-c,g=new Uint8Array(4),v=Math.min(4,c);if(v===0)throw new Error("no bytes available");g.set(u.subarray(p,p+v)),h=new DataView(g.buffer).getUint32(0),d=v*8,c-=v},this.skipBits=function(p){var g;d>p?(h<<=p,d-=p):(p-=d,g=Math.floor(p/8),p-=g*8,c-=g,this.loadWord(),h<<=p,d-=p)},this.readBits=function(p){var g=Math.min(d,p),v=h>>>32-g;return d-=g,d>0?h<<=g:c>0&&this.loadWord(),g=p-g,g>0?v<>>p)return h<<=p,d-=p,p;return this.loadWord(),p+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var p=this.skipLeadingZeros();return this.readBits(p+1)-1},this.readExpGolomb=function(){var p=this.readUnsignedExpGolomb();return 1&p?1+p>>>1:-1*(p>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var K_=Zu,el=t,X_=K_,Pr,bs,tl;bs=function(){var u=0,c,h;bs.prototype.init.call(this),this.push=function(d){var p;h?(p=new Uint8Array(h.byteLength+d.data.byteLength),p.set(h),p.set(d.data,h.byteLength),h=p):h=d.data;for(var g=h.byteLength;u3&&this.trigger("data",h.subarray(u+3)),h=null,u=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},bs.prototype=new el,tl={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Pr=function(){var u=new bs,c,h,d,p,g,v,b;Pr.prototype.init.call(this),c=this,this.push=function(x){x.type==="video"&&(h=x.trackId,d=x.pts,p=x.dts,u.push(x))},u.on("data",function(x){var C={trackId:h,pts:d,dts:p,data:x,nalUnitTypeCode:x[0]&31};switch(C.nalUnitTypeCode){case 5:C.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:C.nalUnitType="sei_rbsp",C.escapedRBSP=g(x.subarray(1));break;case 7:C.nalUnitType="seq_parameter_set_rbsp",C.escapedRBSP=g(x.subarray(1)),C.config=v(C.escapedRBSP);break;case 8:C.nalUnitType="pic_parameter_set_rbsp";break;case 9:C.nalUnitType="access_unit_delimiter_rbsp";break}c.trigger("data",C)}),u.on("done",function(){c.trigger("done")}),u.on("partialdone",function(){c.trigger("partialdone")}),u.on("reset",function(){c.trigger("reset")}),u.on("endedtimeline",function(){c.trigger("endedtimeline")}),this.flush=function(){u.flush()},this.partialFlush=function(){u.partialFlush()},this.reset=function(){u.reset()},this.endTimeline=function(){u.endTimeline()},b=function(x,C){var P=8,O=8,$,N;for($=0;$>4;return h=h>=0?h:0,p?h+20:h+10},sl=function(u,c){return u.length-c<10||u[c]!==73||u[c+1]!==68||u[c+2]!==51?c:(c+=il(u,c),sl(u,c))},J_=function(u){var c=sl(u,0);return u.length>=c+2&&(u[c]&255)===255&&(u[c+1]&240)===240&&(u[c+1]&22)===16},rl=function(u){return u[0]<<21|u[1]<<14|u[2]<<7|u[3]},Z_=function(u,c,h){var d,p="";for(d=c;d>5,d=u[c+4]<<3,p=u[c+3]&6144;return p|d|h},iv=function(u,c){return u[c]===73&&u[c+1]===68&&u[c+2]===51?"timed-metadata":u[c]&!0&&(u[c+1]&240)===240?"audio":null},sv=function(u){for(var c=0;c+5>>2]}return null},rv=function(u){var c,h,d,p;c=10,u[5]&64&&(c+=4,c+=rl(u.subarray(10,14)));do{if(h=rl(u.subarray(c+4,c+8)),h<1)return null;if(p=String.fromCharCode(u[c],u[c+1],u[c+2],u[c+3]),p==="PRIV"){d=u.subarray(c+10,c+h+10);for(var g=0;g>>2;return x*=4,x+=b[7]&3,x}break}}c+=10,c+=h}while(c=3;){if(u[p]===73&&u[p+1]===68&&u[p+2]===51){if(u.length-p<10||(d=nl.parseId3TagSize(u,p),p+d>u.length))break;v={type:"timed-metadata",data:u.subarray(p,p+d)},this.trigger("data",v),p+=d;continue}else if((u[p]&255)===255&&(u[p+1]&240)===240){if(u.length-p<7||(d=nl.parseAdtsSize(u,p),p+d>u.length))break;b={type:"audio",data:u.subarray(p,p+d),pts:c,dts:c},this.trigger("data",b),p+=d;continue}p++}g=u.length-p,g>0?u=u.subarray(p):u=new Uint8Array},this.reset=function(){u=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){u=new Uint8Array,this.trigger("endedtimeline")}},Lr.prototype=new nv;var av=Lr,ov=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],uv=ov,lv=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],cv=lv,Or=t,Ss=t_,xs=c_,Rr=v_,ct=E_,Ot=H_,Mr=he,al=W_,dv=Y_.H264Stream,hv=av,fv=ma.isLikelyAacData,pv=he.ONE_SECOND_IN_TS,ga=uv,ya=cv,Es,Ci,Nr,oi,mv=function(u,c){c.stream=u,this.trigger("log",c)},ol=function(u,c){for(var h=Object.keys(c),d=0;d=-C&&O<=x&&(!$||P>O)&&($=G,P=O)));return $?$.gop:null},this.alignGopsAtStart_=function(b){var x,C,P,O,$,N,G,z;for($=b.byteLength,N=b.nalCount,G=b.duration,x=C=0;xP.pts){x++;continue}C++,$-=O.byteLength,N-=O.nalCount,G-=O.duration}return C===0?b:C===b.length?null:(z=b.slice(C),z.byteLength=$,z.duration=G,z.nalCount=N,z.pts=z[0].pts,z.dts=z[0].dts,z)},this.alignGopsAtEnd_=function(b){var x,C,P,O,$,N;for(x=p.length-1,C=b.length-1,$=null,N=!1;x>=0&&C>=0;){if(P=p[x],O=b[C],P.pts===O.pts){N=!0;break}if(P.pts>O.pts){x--;continue}x===p.length-1&&($=C),C--}if(!N&&$===null)return null;var G;if(N?G=C:G=$,G===0)return b;var z=b.slice(G),Ce=z.reduce(function(it,li){return it.byteLength+=li.byteLength,it.duration+=li.duration,it.nalCount+=li.nalCount,it},{byteLength:0,duration:0,nalCount:0});return z.byteLength=Ce.byteLength,z.duration=Ce.duration,z.nalCount=Ce.nalCount,z.pts=z[0].pts,z.dts=z[0].dts,z},this.alignGopsWith=function(b){p=b}},Es.prototype=new Or,oi=function(u,c){this.numberOfTracks=0,this.metadataStream=c,u=u||{},typeof u.remux<"u"?this.remuxTracks=!!u.remux:this.remuxTracks=!0,typeof u.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=u.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,oi.prototype.init.call(this),this.push=function(h){if(h.content||h.text)return this.pendingCaptions.push(h);if(h.frames)return this.pendingMetadata.push(h);this.pendingTracks.push(h.track),this.pendingBytes+=h.boxes.byteLength,h.track.type==="video"&&(this.videoTrack=h.track,this.pendingBoxes.push(h.boxes)),h.track.type==="audio"&&(this.audioTrack=h.track,this.pendingBoxes.unshift(h.boxes))}},oi.prototype=new Or,oi.prototype.flush=function(u){var c=0,h={captions:[],captionStreams:{},metadata:[],info:{}},d,p,g,v=0,b;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(v=this.videoTrack.timelineStartInfo.pts,ya.forEach(function(x){h.info[x]=this.videoTrack[x]},this)):this.audioTrack&&(v=this.audioTrack.timelineStartInfo.pts,ga.forEach(function(x){h.info[x]=this.audioTrack[x]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?h.type=this.pendingTracks[0].type:h.type="combined",this.emittedTracks+=this.pendingTracks.length,g=Ss.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(g.byteLength),h.initSegment.set(g),h.data=new Uint8Array(this.pendingBytes),b=0;b=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},oi.prototype.setRemux=function(u){this.remuxTracks=u},Nr=function(u){var c=this,h=!0,d,p;Nr.prototype.init.call(this),u=u||{},this.baseMediaDecodeTime=u.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="aac",g.metadataStream=new Ot.MetadataStream,g.aacStream=new hv,g.audioTimestampRolloverStream=new Ot.TimestampRolloverStream("audio"),g.timedMetadataTimestampRolloverStream=new Ot.TimestampRolloverStream("timed-metadata"),g.adtsStream=new al,g.coalesceStream=new oi(u,g.metadataStream),g.headOfPipeline=g.aacStream,g.aacStream.pipe(g.audioTimestampRolloverStream).pipe(g.adtsStream),g.aacStream.pipe(g.timedMetadataTimestampRolloverStream).pipe(g.metadataStream).pipe(g.coalesceStream),g.metadataStream.on("timestamp",function(v){g.aacStream.setTimestamp(v.timeStamp)}),g.aacStream.on("data",function(v){v.type!=="timed-metadata"&&v.type!=="audio"||g.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:c.baseMediaDecodeTime},codec:"adts",type:"audio"},g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new Ci(p,u),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d}))}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),ol(this,g)},this.setupTsPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="ts",g.metadataStream=new Ot.MetadataStream,g.packetStream=new Ot.TransportPacketStream,g.parseStream=new Ot.TransportParseStream,g.elementaryStream=new Ot.ElementaryStream,g.timestampRolloverStream=new Ot.TimestampRolloverStream,g.adtsStream=new al,g.h264Stream=new dv,g.captionStream=new Ot.CaptionStream(u),g.coalesceStream=new oi(u,g.metadataStream),g.headOfPipeline=g.packetStream,g.packetStream.pipe(g.parseStream).pipe(g.elementaryStream).pipe(g.timestampRolloverStream),g.timestampRolloverStream.pipe(g.h264Stream),g.timestampRolloverStream.pipe(g.adtsStream),g.timestampRolloverStream.pipe(g.metadataStream).pipe(g.coalesceStream),g.h264Stream.pipe(g.captionStream).pipe(g.coalesceStream),g.elementaryStream.on("data",function(v){var b;if(v.type==="metadata"){for(b=v.tracks.length;b--;)!d&&v.tracks[b].type==="video"?(d=v.tracks[b],d.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime):!p&&v.tracks[b].type==="audio"&&(p=v.tracks[b],p.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime);d&&!g.videoSegmentStream&&(g.coalesceStream.numberOfTracks++,g.videoSegmentStream=new Es(d,u),g.videoSegmentStream.on("log",c.getLogTrigger_("videoSegmentStream")),g.videoSegmentStream.on("timelineStartInfo",function(x){p&&!u.keepOriginalTimestamps&&(p.timelineStartInfo=x,g.audioSegmentStream.setEarliestDts(x.dts-c.baseMediaDecodeTime))}),g.videoSegmentStream.on("processedGopsInfo",c.trigger.bind(c,"gopInfo")),g.videoSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"videoSegmentTimingInfo")),g.videoSegmentStream.on("baseMediaDecodeTime",function(x){p&&g.audioSegmentStream.setVideoBaseMediaDecodeTime(x)}),g.videoSegmentStream.on("timingInfo",c.trigger.bind(c,"videoTimingInfo")),g.h264Stream.pipe(g.videoSegmentStream).pipe(g.coalesceStream)),p&&!g.audioSegmentStream&&(g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new Ci(p,u),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.audioSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"audioSegmentTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream)),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d})}}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("id3Frame",function(v){v.dispatchType=g.metadataStream.dispatchType,c.trigger("id3Frame",v)}),g.coalesceStream.on("caption",this.trigger.bind(this,"caption")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),ol(this,g)},this.setBaseMediaDecodeTime=function(g){var v=this.transmuxPipeline_;u.keepOriginalTimestamps||(this.baseMediaDecodeTime=g),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,ct.clearDtsInfo(p),v.audioTimestampRolloverStream&&v.audioTimestampRolloverStream.discontinuity()),d&&(v.videoSegmentStream&&(v.videoSegmentStream.gopCache_=[]),d.timelineStartInfo.dts=void 0,d.timelineStartInfo.pts=void 0,ct.clearDtsInfo(d),v.captionStream.reset()),v.timestampRolloverStream&&v.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(g){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(g)},this.setRemux=function(g){var v=this.transmuxPipeline_;u.remux=g,v&&v.coalesceStream&&v.coalesceStream.setRemux(g)},this.alignGopsWith=function(g){d&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(g)},this.getLogTrigger_=function(g){var v=this;return function(b){b.stream=g,v.trigger("log",b)}},this.push=function(g){if(h){var v=fv(g);v&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!v&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),h=!1}this.transmuxPipeline_.headOfPipeline.push(g)},this.flush=function(){h=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Nr.prototype=new Or;var gv={Transmuxer:Nr,VideoSegmentStream:Es,AudioSegmentStream:Ci,AUDIO_PROPERTIES:ga,VIDEO_PROPERTIES:ya,generateSegmentTimingInfo:_a},yv=function(u){return u>>>0},_v=function(u){return("00"+u.toString(16)).slice(-2)},Br={toUnsigned:yv,toHexString:_v},vv=function(u){var c="";return c+=String.fromCharCode(u[0]),c+=String.fromCharCode(u[1]),c+=String.fromCharCode(u[2]),c+=String.fromCharCode(u[3]),c},ll=vv,Tv=Br.toUnsigned,bv=ll,cl=function(u,c){var h=[],d,p,g,v,b;if(!c.length)return null;for(d=0;d1?d+p:u.byteLength,g===c[0]&&(c.length===1?h.push(u.subarray(d+8,v)):(b=cl(u.subarray(d+8,v),c.slice(1)),b.length&&(h=h.concat(b)))),d=v;return h},dl=cl,Sv=Br.toUnsigned,xv=n.getUint64,Ev=function(u){var c={version:u[0],flags:new Uint8Array(u.subarray(1,4))};return c.version===1?c.baseMediaDecodeTime=xv(u.subarray(4)):c.baseMediaDecodeTime=Sv(u[4]<<24|u[5]<<16|u[6]<<8|u[7]),c},hl=Ev,Cv=function(u){return{isLeading:(u[0]&12)>>>2,dependsOn:u[0]&3,isDependedOn:(u[1]&192)>>>6,hasRedundancy:(u[1]&48)>>>4,paddingValue:(u[1]&14)>>>1,isNonSyncSample:u[1]&1,degradationPriority:u[2]<<8|u[3]}},Av=Cv,fl=Av,Dv=function(u){var c={version:u[0],flags:new Uint8Array(u.subarray(1,4)),samples:[]},h=new DataView(u.buffer,u.byteOffset,u.byteLength),d=c.flags[2]&1,p=c.flags[2]&4,g=c.flags[1]&1,v=c.flags[1]&2,b=c.flags[1]&4,x=c.flags[1]&8,C=h.getUint32(4),P=8,O;for(d&&(c.dataOffset=h.getInt32(P),P+=4),p&&C&&(O={flags:fl(u.subarray(P,P+4))},P+=4,g&&(O.duration=h.getUint32(P),P+=4),v&&(O.size=h.getUint32(P),P+=4),x&&(c.version===1?O.compositionTimeOffset=h.getInt32(P):O.compositionTimeOffset=h.getUint32(P),P+=4),c.samples.push(O),C--);C--;)O={},g&&(O.duration=h.getUint32(P),P+=4),v&&(O.size=h.getUint32(P),P+=4),b&&(O.flags=fl(u.subarray(P,P+4)),P+=4),x&&(c.version===1?O.compositionTimeOffset=h.getInt32(P):O.compositionTimeOffset=h.getUint32(P),P+=4),c.samples.push(O);return c},pl=Dv,wv=function(u){var c=new DataView(u.buffer,u.byteOffset,u.byteLength),h={version:u[0],flags:new Uint8Array(u.subarray(1,4)),trackId:c.getUint32(4)},d=h.flags[2]&1,p=h.flags[2]&2,g=h.flags[2]&8,v=h.flags[2]&16,b=h.flags[2]&32,x=h.flags[0]&65536,C=h.flags[0]&131072,P;return P=8,d&&(P+=4,h.baseDataOffset=c.getUint32(12),P+=4),p&&(h.sampleDescriptionIndex=c.getUint32(P),P+=4),g&&(h.defaultSampleDuration=c.getUint32(P),P+=4),v&&(h.defaultSampleSize=c.getUint32(P),P+=4),b&&(h.defaultSampleFlags=c.getUint32(P)),x&&(h.durationIsEmpty=!0),!d&&C&&(h.baseDataOffsetIsMoof=!0),h},ml=wv,Cs;typeof window<"u"?Cs=window:typeof i<"u"?Cs=i:typeof self<"u"?Cs=self:Cs={};var gl=Cs,kv=Gu.discardEmulationPreventionBytes,Iv=zu.CaptionStream,As=dl,Pv=hl,Lv=pl,Ov=ml,yl=gl,Rv=function(u,c){for(var h=u,d=0;d0?Pv($[0]).baseMediaDecodeTime:0,G=As(x,["trun"]),z,Ce;c===O&&G.length>0&&(z=Nv(G,N,P),Ce=Mv(b,z,O),p[O]||(p[O]={seiNals:[],logs:[]}),p[O].seiNals=p[O].seiNals.concat(Ce.seiNals),p[O].logs=p[O].logs.concat(Ce.logs))}),p},Fv=function(u,c,h){var d;if(c===null)return null;d=Bv(u,c);var p=d[c]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:h}},Uv=function(){var u=!1,c,h,d,p,g,v;this.isInitialized=function(){return u},this.init=function(b){c=new Iv,u=!0,v=b?b.isPartial:!1,c.on("data",function(x){x.startTime=x.startPts/p,x.endTime=x.endPts/p,g.captions.push(x),g.captionStreams[x.stream]=!0}),c.on("log",function(x){g.logs.push(x)})},this.isNewInit=function(b,x){return b&&b.length===0||x&&typeof x=="object"&&Object.keys(x).length===0?!1:d!==b[0]||p!==x[d]},this.parse=function(b,x,C){var P;if(this.isInitialized()){if(!x||!C)return null;if(this.isNewInit(x,C))d=x[0],p=C[d];else if(d===null||!p)return h.push(b),null}else return null;for(;h.length>0;){var O=h.shift();this.parse(O,x,C)}return P=Fv(b,d,p),P&&P.logs&&(g.logs=g.logs.concat(P.logs)),P===null||!P.seiNals?g.logs.length?{logs:g.logs,captions:[],captionStreams:[]}:null:(this.pushNals(P.seiNals),this.flushStream(),g)},this.pushNals=function(b){if(!this.isInitialized()||!b||b.length===0)return null;b.forEach(function(x){c.push(x)})},this.flushStream=function(){if(!this.isInitialized())return null;v?c.partialFlush():c.flush()},this.clearParsedCaptions=function(){g.captions=[],g.captionStreams={},g.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;c.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],d=null,p=null,g?this.clearParsedCaptions():g={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},$v=Uv,jv=function(u){for(var c=0,h=String.fromCharCode(u[c]),d="";h!=="\0";)d+=h,c++,h=String.fromCharCode(u[c]);return d+=h,d},qv={uint8ToCString:jv},Fr=qv.uint8ToCString,Vv=n.getUint64,Hv=function(u){var c=4,h=u[0],d,p,g,v,b,x,C,P;if(h===0){d=Fr(u.subarray(c)),c+=d.length,p=Fr(u.subarray(c)),c+=p.length;var O=new DataView(u.buffer);g=O.getUint32(c),c+=4,b=O.getUint32(c),c+=4,x=O.getUint32(c),c+=4,C=O.getUint32(c),c+=4}else if(h===1){var O=new DataView(u.buffer);g=O.getUint32(c),c+=4,v=Vv(u.subarray(c)),c+=8,x=O.getUint32(c),c+=4,C=O.getUint32(c),c+=4,d=Fr(u.subarray(c)),c+=d.length,p=Fr(u.subarray(c)),c+=p.length}P=new Uint8Array(u.subarray(c,u.byteLength));var $={scheme_id_uri:d,value:p,timescale:g||1,presentation_time:v,presentation_time_delta:b,event_duration:x,id:C,message_data:P};return zv(h,$)?$:void 0},Gv=function(u,c,h,d){return u||u===0?u/c:d+h/c},zv=function(u,c){var h=c.scheme_id_uri!=="\0",d=u===0&&_l(c.presentation_time_delta)&&h,p=u===1&&_l(c.presentation_time)&&h;return!(u>1)&&d||p},_l=function(u){return u!==void 0||u!==null},Wv={parseEmsgBox:Hv,scaleTime:Gv},Ur=Br.toUnsigned,Ds=Br.toHexString,be=dl,Ai=ll,va=Wv,Kv=ml,Xv=pl,Yv=hl,Qv=n.getUint64,vl,Tl,bl,Sl,xl,Ta,El,ba=gl,Jv=Yu.parseId3Frames;vl=function(u){var c={},h=be(u,["moov","trak"]);return h.reduce(function(d,p){var g,v,b,x,C;return g=be(p,["tkhd"])[0],!g||(v=g[0],b=v===0?12:20,x=Ur(g[b]<<24|g[b+1]<<16|g[b+2]<<8|g[b+3]),C=be(p,["mdia","mdhd"])[0],!C)?null:(v=C[0],b=v===0?12:20,d[x]=Ur(C[b]<<24|C[b+1]<<16|C[b+2]<<8|C[b+3]),d)},c)},Tl=function(u,c){var h;h=be(c,["moof","traf"]);var d=h.reduce(function(p,g){var v=be(g,["tfhd"])[0],b=Ur(v[4]<<24|v[5]<<16|v[6]<<8|v[7]),x=u[b]||9e4,C=be(g,["tfdt"])[0],P=new DataView(C.buffer,C.byteOffset,C.byteLength),O;C[0]===1?O=Qv(C.subarray(4,12)):O=P.getUint32(4);let $;return typeof O=="bigint"?$=O/ba.BigInt(x):typeof O=="number"&&!isNaN(O)&&($=O/x),$11?(p.codec+=".",p.codec+=Ds(N[9]),p.codec+=Ds(N[10]),p.codec+=Ds(N[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(N=$.subarray(28),G=Ai(N.subarray(4,8)),G==="esds"&&N.length>20&&N[19]!==0?(p.codec+="."+Ds(N[19]),p.codec+="."+Ds(N[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var z=be(d,["mdia","mdhd"])[0];z&&(p.timescale=Ta(z)),h.push(p)}),h},El=function(u,c=0){var h=be(u,["emsg"]);return h.map(d=>{var p=va.parseEmsgBox(new Uint8Array(d)),g=Jv(p.message_data);return{cueTime:va.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,c),duration:va.scaleTime(p.event_duration,p.timescale),frames:g}})};var Sa={findBox:be,parseType:Ai,timescale:vl,startTime:Tl,compositionStartTime:bl,videoTrackIds:Sl,tracks:xl,getTimescaleFromMediaHeader:Ta,getEmsgID3:El},xa=Er,Cl=function(u){var c=u[1]&31;return c<<=8,c|=u[2],c},$r=function(u){return!!(u[1]&64)},jr=function(u){var c=0;return(u[3]&48)>>>4>1&&(c+=u[4]+1),c},Zv=function(u,c){var h=Cl(u);return h===0?"pat":h===c?"pmt":c?"pes":null},eT=function(u){var c=$r(u),h=4+jr(u);return c&&(h+=u[h]+1),(u[h+10]&31)<<8|u[h+11]},tT=function(u){var c={},h=$r(u),d=4+jr(u);if(h&&(d+=u[d]+1),!!(u[d+5]&1)){var p,g,v;p=(u[d+1]&15)<<8|u[d+2],g=3+p-4,v=(u[d+10]&15)<<8|u[d+11];for(var b=12+v;b=u.byteLength)return null;var d=null,p;return p=u[h+7],p&192&&(d={},d.pts=(u[h+9]&14)<<27|(u[h+10]&255)<<20|(u[h+11]&254)<<12|(u[h+12]&255)<<5|(u[h+13]&254)>>>3,d.pts*=4,d.pts+=(u[h+13]&6)>>>1,d.dts=d.pts,p&64&&(d.dts=(u[h+14]&14)<<27|(u[h+15]&255)<<20|(u[h+16]&254)<<12|(u[h+17]&255)<<5|(u[h+18]&254)>>>3,d.dts*=4,d.dts+=(u[h+18]&6)>>>1)),d},Ea=function(u){switch(u){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}},rT=function(u){for(var c=4+jr(u),h=u.subarray(c),d=0,p=0,g=!1,v;p3&&(v=Ea(h[p+3]&31),v==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0)),g},nT={parseType:Zv,parsePat:eT,parsePmt:tT,parsePayloadUnitStartIndicator:$r,parsePesType:iT,parsePesTime:sT,videoPacketContainsKeyFrame:rT},Al=Er,Di=Ku.handleRollover,ne={};ne.ts=nT,ne.aac=ma;var ui=he.ONE_SECOND_IN_TS,Me=188,mt=71,aT=function(u,c){for(var h=0,d=Me,p,g;d=0;){if(u[d]===mt&&(u[p]===mt||p===u.byteLength)){switch(g=u.subarray(d,p),v=ne.ts.parseType(g,c.pid),v){case"pes":b=ne.ts.parsePesType(g,c.table),x=ne.ts.parsePayloadUnitStartIndicator(g),b==="audio"&&x&&(C=ne.ts.parsePesTime(g),C&&(C.type="audio",h.audio.push(C),P=!0));break}if(P)break;d-=Me,p-=Me;continue}d--,p--}},oT=function(u,c,h){for(var d=0,p=Me,g,v,b,x,C,P,O,$,N=!1,G={data:[],size:0};p=0;){if(u[d]===mt&&u[p]===mt){switch(g=u.subarray(d,p),v=ne.ts.parseType(g,c.pid),v){case"pes":b=ne.ts.parsePesType(g,c.table),x=ne.ts.parsePayloadUnitStartIndicator(g),b==="video"&&x&&(C=ne.ts.parsePesTime(g),C&&(C.type="video",h.video.push(C),N=!0));break}if(N)break;d-=Me,p-=Me;continue}d--,p--}},uT=function(u,c){if(u.audio&&u.audio.length){var h=c;(typeof h>"u"||isNaN(h))&&(h=u.audio[0].dts),u.audio.forEach(function(g){g.dts=Di(g.dts,h),g.pts=Di(g.pts,h),g.dtsTime=g.dts/ui,g.ptsTime=g.pts/ui})}if(u.video&&u.video.length){var d=c;if((typeof d>"u"||isNaN(d))&&(d=u.video[0].dts),u.video.forEach(function(g){g.dts=Di(g.dts,d),g.pts=Di(g.pts,d),g.dtsTime=g.dts/ui,g.ptsTime=g.pts/ui}),u.firstKeyFrame){var p=u.firstKeyFrame;p.dts=Di(p.dts,d),p.pts=Di(p.pts,d),p.dtsTime=p.dts/ui,p.ptsTime=p.pts/ui}}},lT=function(u){for(var c=!1,h=0,d=null,p=null,g=0,v=0,b;u.length-v>=3;){var x=ne.aac.parseType(u,v);switch(x){case"timed-metadata":if(u.length-v<10){c=!0;break}if(g=ne.aac.parseId3TagSize(u,v),g>u.length){c=!0;break}p===null&&(b=u.subarray(v,v+g),p=ne.aac.parseAacTimestamp(b)),v+=g;break;case"audio":if(u.length-v<7){c=!0;break}if(g=ne.aac.parseAdtsSize(u,v),g>u.length){c=!0;break}d===null&&(b=u.subarray(v,v+g),d=ne.aac.parseSampleRate(b)),h++,v+=g;break;default:v++;break}if(c)return null}if(d===null||p===null)return null;var C=ui/d,P={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+h*1024*C,pts:p+h*1024*C}]};return P},cT=function(u){var c={pid:null,table:null},h={};aT(u,c);for(var d in c.table)if(c.table.hasOwnProperty(d)){var p=c.table[d];switch(p){case Al.H264_STREAM_TYPE:h.video=[],oT(u,c,h),h.video.length===0&&delete h.video;break;case Al.ADTS_STREAM_TYPE:h.audio=[],Dl(u,c,h),h.audio.length===0&&delete h.audio;break}}return h},dT=function(u,c){var h=ne.aac.isLikelyAacData(u),d;return h?d=lT(u):d=cT(u),!d||!d.audio&&!d.video?null:(uT(d,c),d)},hT={inspect:dT,parseAudioPes_:Dl};const fT=function(u,c){c.on("data",function(h){const d=h.initSegment;h.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};const p=h.data;h.data=p.buffer,u.postMessage({action:"data",segment:h,byteOffset:p.byteOffset,byteLength:p.byteLength},[h.data])}),c.on("done",function(h){u.postMessage({action:"done"})}),c.on("gopInfo",function(h){u.postMessage({action:"gopInfo",gopInfo:h})}),c.on("videoSegmentTimingInfo",function(h){const d={start:{decode:he.videoTsToSeconds(h.start.dts),presentation:he.videoTsToSeconds(h.start.pts)},end:{decode:he.videoTsToSeconds(h.end.dts),presentation:he.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:he.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=he.videoTsToSeconds(h.prependedContentDuration)),u.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),c.on("audioSegmentTimingInfo",function(h){const d={start:{decode:he.videoTsToSeconds(h.start.dts),presentation:he.videoTsToSeconds(h.start.pts)},end:{decode:he.videoTsToSeconds(h.end.dts),presentation:he.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:he.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=he.videoTsToSeconds(h.prependedContentDuration)),u.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),c.on("id3Frame",function(h){u.postMessage({action:"id3Frame",id3Frame:h})}),c.on("caption",function(h){u.postMessage({action:"caption",caption:h})}),c.on("trackinfo",function(h){u.postMessage({action:"trackinfo",trackInfo:h})}),c.on("audioTimingInfo",function(h){u.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:he.videoTsToSeconds(h.start),end:he.videoTsToSeconds(h.end)}})}),c.on("videoTimingInfo",function(h){u.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:he.videoTsToSeconds(h.start),end:he.videoTsToSeconds(h.end)}})}),c.on("log",function(h){u.postMessage({action:"log",log:h})})};class wl{constructor(c,h){this.options=h||{},this.self=c,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new gv.Transmuxer(this.options),fT(this.self,this.transmuxer)}pushMp4Captions(c){this.captionParser||(this.captionParser=new $v,this.captionParser.init());const h=new Uint8Array(c.data,c.byteOffset,c.byteLength),d=this.captionParser.parse(h,c.trackIds,c.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:h.buffer},[h.buffer])}probeMp4StartTime({timescales:c,data:h}){const d=Sa.startTime(c,h);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:h},[h.buffer])}probeMp4Tracks({data:c}){const h=Sa.tracks(c);this.self.postMessage({action:"probeMp4Tracks",tracks:h,data:c},[c.buffer])}probeEmsgID3({data:c,offset:h}){const d=Sa.getEmsgID3(c,h);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:c},[c.buffer])}probeTs({data:c,baseStartTime:h}){const d=typeof h=="number"&&!isNaN(h)?h*he.ONE_SECOND_IN_TS:void 0,p=hT.inspect(c,d);let g=null;p&&(g={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},g.hasVideo&&(g.videoStart=p.video[0].ptsTime),g.hasAudio&&(g.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:g,data:c},[c.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(c){const h=new Uint8Array(c.data,c.byteOffset,c.byteLength);this.transmuxer.push(h)}reset(){this.transmuxer.reset()}setTimestampOffset(c){const h=c.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(he.secondsToVideoTs(h)))}setAudioAppendStart(c){this.transmuxer.setAudioAppendStart(Math.ceil(he.secondsToVideoTs(c.appendStart)))}setRemux(c){this.transmuxer.setRemux(c.remux)}flush(c){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(c){this.transmuxer.alignGopsWith(c.gopsToAlignWith.slice())}}self.onmessage=function(u){if(u.data.action==="init"&&u.data.options){this.messageHandlers=new wl(self,u.data.options);return}this.messageHandlers||(this.messageHandlers=new wl(self)),u.data&&u.data.action&&u.data.action!=="init"&&this.messageHandlers[u.data.action]&&this.messageHandlers[u.data.action](u.data)}}));var Fx=cp(Bx);const Ux=(i,e,t)=>{const{type:s,initSegment:r,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:f}=i.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:o});const m=i.data.segment.boxes||{data:i.data.segment.data},y={type:s,data:new Uint8Array(m.data,m.data.byteOffset,m.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof l<"u"&&(y.videoFrameDtsTime=l),typeof f<"u"&&(y.videoFramePtsTime=f),t(y)},$x=({transmuxedData:i,callback:e})=>{i.buffer=[],e(i)},jx=(i,e)=>{e.gopInfo=i.data.gopInfo},fp=i=>{const{transmuxer:e,bytes:t,audioAppendStart:s,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:f,onVideoSegmentTimingInfo:m,onAudioSegmentTimingInfo:y,onId3:T,onCaptions:S,onDone:_,onEndedTimeline:D,onTransmuxerLog:w,isEndOfTimeline:k}=i,I={buffer:[]};let M=k;const R=L=>{e.currentTransmux===i&&(L.data.action==="data"&&Ux(L,I,a),L.data.action==="trackinfo"&&o(L.data.trackInfo),L.data.action==="gopInfo"&&jx(L,I),L.data.action==="audioTimingInfo"&&l(L.data.audioTimingInfo),L.data.action==="videoTimingInfo"&&f(L.data.videoTimingInfo),L.data.action==="videoSegmentTimingInfo"&&m(L.data.videoSegmentTimingInfo),L.data.action==="audioSegmentTimingInfo"&&y(L.data.audioSegmentTimingInfo),L.data.action==="id3Frame"&&T([L.data.id3Frame],L.data.id3Frame.dispatchType),L.data.action==="caption"&&S(L.data.caption),L.data.action==="endedtimeline"&&(M=!1,D()),L.data.action==="log"&&w(L.data.log),L.data.type==="transmuxed"&&(M||(e.onmessage=null,$x({transmuxedData:I,callback:_}),pp(e))))};if(e.onmessage=R,s&&e.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const L=t instanceof ArrayBuffer?t:t.buffer,U=t instanceof ArrayBuffer?0:t.byteOffset;e.postMessage({action:"push",data:L,byteOffset:U,byteLength:t.byteLength},[L])}k&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},pp=i=>{i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():fp(i.currentTransmux))},Hc=(i,e)=>{i.postMessage({action:e}),pp(i)},mp=(i,e)=>{if(!e.currentTransmux){e.currentTransmux=i,Hc(e,i);return}e.transmuxQueue.push(Hc.bind(null,e,i))},qx=i=>{mp("reset",i)},Vx=i=>{mp("endTimeline",i)},gp=i=>{if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,fp(i);return}i.transmuxer.transmuxQueue.push(i)},Hx=i=>{const e=new Fx;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:i}),e};var za={reset:qx,endTimeline:Vx,transmux:gp,createTransmuxer:Hx};const Ks=function(i){const e=i.transmuxer,t=i.endAction||i.action,s=i.callback,r=rt({},i,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,i.byteOffset||0,i.byteLength||a.data.data.byteLength),i.data&&(i.data=a.data.data)),s(a.data))};if(e.addEventListener("message",n),i.data){const a=i.data instanceof ArrayBuffer;r.byteOffset=a?0:i.data.byteOffset,r.byteLength=i.data.byteLength;const o=[a?i.data:i.data.buffer];e.postMessage(r,o)}else e.postMessage(r)},St={FAILURE:2,TIMEOUT:-101,ABORTED:-102},wo=i=>{i.forEach(e=>{e.abort()})},Gx=i=>({bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}),zx=i=>{const e=i.target,s={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return s.bytesReceived=i.loaded,s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3),s},Pu=(i,e)=>e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:St.TIMEOUT,xhr:e}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:St.ABORTED,xhr:e}:i?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:St.FAILURE,xhr:e}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:St.FAILURE,xhr:e}:null,Gc=(i,e,t)=>(s,r)=>{const n=r.response,a=Pu(s,r);if(a)return t(a,i);if(n.byteLength!==16)return t({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:St.FAILURE,xhr:r},i);const o=new DataView(n),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]);for(let f=0;f{const t=Yo(i.map.bytes);if(t!=="mp4"){const s=i.map.resolvedUri||i.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${s}`,code:St.FAILURE,metadata:{errorType:A.Error.UnsupportedMediaInitialization,mediaType:r}})}Ks({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:s,data:r})=>(i.map.bytes=r,s.forEach(function(n){i.map.tracks=i.map.tracks||{},!i.map.tracks[n.type]&&(i.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[n.id]=n.timescale))}),e(null))})},Wx=({segment:i,finishProcessingFn:e})=>(t,s)=>{const r=Pu(t,s);if(r)return e(r,i);const n=new Uint8Array(s.response);if(i.map.key)return i.map.encryptedBytes=n,e(null,i);i.map.bytes=n,yp(i,function(a){if(a)return a.xhr=s,a.status=s.status,e(a,i);e(null,i)})},Kx=({segment:i,finishProcessingFn:e,responseType:t})=>(s,r)=>{const n=Pu(s,r);if(n)return e(n,i);const a=t==="arraybuffer"||!r.responseText?r.response:Mx(r.responseText.substring(i.lastReachedChar||0));return i.stats=Gx(r),i.key?i.encryptedBytes=new Uint8Array(a):i.bytes=new Uint8Array(a),e(null,i)},Xx=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})=>{const S=i.map&&i.map.tracks||{},_=!!(S.audio&&S.video);let D=s.bind(null,i,"audio","start");const w=s.bind(null,i,"audio","end");let k=s.bind(null,i,"video","start");const I=s.bind(null,i,"video","end"),M=()=>gp({bytes:e,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:_,onData:R=>{R.type=R.type==="combined"?"video":R.type,m(i,R)},onTrackInfo:R=>{t&&(_&&(R.isMuxed=!0),t(i,R))},onAudioTimingInfo:R=>{D&&typeof R.start<"u"&&(D(R.start),D=null),w&&typeof R.end<"u"&&w(R.end)},onVideoTimingInfo:R=>{k&&typeof R.start<"u"&&(k(R.start),k=null),I&&typeof R.end<"u"&&I(R.end)},onVideoSegmentTimingInfo:R=>{r(R)},onAudioSegmentTimingInfo:R=>{n(R)},onId3:(R,L)=>{a(i,R,L)},onCaptions:R=>{o(i,[R])},isEndOfTimeline:l,onEndedTimeline:()=>{f()},onTransmuxerLog:T,onDone:R=>{y&&(R.type=R.type==="combined"?"video":R.type,y(null,i,R))}});Ks({action:"probeTs",transmuxer:i.transmuxer,data:e,baseStartTime:i.baseStartTime,callback:R=>{i.bytes=e=R.data;const L=R.result;L&&(t(i,{hasAudio:L.hasAudio,hasVideo:L.hasVideo,isMuxed:_}),t=null),M()}})},_p=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})=>{let S=new Uint8Array(e);if(S1(S)){i.isFmp4=!0;const{tracks:_}=i.map,D={isFmp4:!0,hasVideo:!!_.video,hasAudio:!!_.audio};_.audio&&_.audio.codec&&_.audio.codec!=="enca"&&(D.audioCodec=_.audio.codec),_.video&&_.video.codec&&_.video.codec!=="encv"&&(D.videoCodec=_.video.codec),_.video&&_.audio&&(D.isMuxed=!0),t(i,D);const w=(k,I)=>{m(i,{data:S,type:D.hasAudio&&!D.isMuxed?"audio":"video"}),I&&I.length&&a(i,I),k&&k.length&&o(i,k),y(null,i,{})};Ks({action:"probeMp4StartTime",timescales:i.map.timescales,data:S,transmuxer:i.transmuxer,callback:({data:k,startTime:I})=>{e=k.buffer,i.bytes=S=k,D.hasAudio&&!D.isMuxed&&s(i,"audio","start",I),D.hasVideo&&s(i,"video","start",I),Ks({action:"probeEmsgID3",data:S,transmuxer:i.transmuxer,offset:I,callback:({emsgData:M,id3Frames:R})=>{if(e=M.buffer,i.bytes=S=M,!_.video||!M.byteLength||!i.transmuxer){w(void 0,R);return}Ks({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:S,timescales:i.map.timescales,trackIds:[_.video.id],callback:L=>{e=L.data.buffer,i.bytes=S=L.data,L.logs.forEach(function(U){T(se(U,{stream:"mp4CaptionParser"}))}),w(L.captions,R)}})}})}});return}if(!i.transmuxer){y(null,i,{});return}if(typeof i.container>"u"&&(i.container=Yo(S)),i.container!=="ts"&&i.container!=="aac"){t(i,{hasAudio:!1,hasVideo:!1}),y(null,i,{});return}Xx({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})},vp=function({id:i,key:e,encryptedBytes:t,decryptionWorker:s},r){const n=o=>{if(o.data.source===i){s.removeEventListener("message",n);const l=o.data.decrypted;r(new Uint8Array(l.bytes,l.byteOffset,l.byteLength))}};s.addEventListener("message",n);let a;e.bytes.slice?a=e.bytes.slice():a=new Uint32Array(Array.prototype.slice.call(e.bytes)),s.postMessage(rp({source:i,encrypted:t,key:a,iv:e.iv}),[t.buffer,a.buffer])},Yx=({decryptionWorker:i,segment:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})=>{vp({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:i},S=>{e.bytes=S,_p({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})})},Qx=({activeXhrs:i,decryptionWorker:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})=>{let S=0,_=!1;return(D,w)=>{if(!_){if(D)return _=!0,wo(i),y(D,w);if(S+=1,S===i.length){const k=function(){if(w.encryptedBytes)return Yx({decryptionWorker:e,segment:w,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T});_p({segment:w,bytes:w.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})};if(w.endOfAllRequests=Date.now(),w.map&&w.map.encryptedBytes&&!w.map.bytes)return vp({decryptionWorker:e,id:w.requestId+"-init",encryptedBytes:w.map.encryptedBytes,key:w.map.key},I=>{w.map.bytes=I,yp(w,M=>{if(M)return wo(i),y(M,w);k()})});k()}}}},Jx=({loadendState:i,abortFn:e})=>t=>{t.target.aborted&&e&&!i.calledAbortFn&&(e(),i.calledAbortFn=!0)},Zx=({segment:i,progressFn:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m})=>y=>{if(!y.target.aborted)return i.stats=se(i.stats,zx(y)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),e(y,i)},eE=({xhr:i,xhrOptions:e,decryptionWorker:t,segment:s,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:S,dataFn:_,doneFn:D,onTransmuxerLog:w})=>{const k=[],I=Qx({activeXhrs:k,decryptionWorker:t,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:S,dataFn:_,doneFn:D,onTransmuxerLog:w});if(s.key&&!s.key.bytes){const q=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&q.push(s.map.key);const J=se(e,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),X=Gc(s,q,I),ue=i(J,X);k.push(ue)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){const ee=se(e,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),de=Gc(s,[s.map.key],I),V=i(ee,de);k.push(V)}const J=se(e,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:Ao(s.map),requestType:"segment-media-initialization"}),X=Wx({segment:s,finishProcessingFn:I}),ue=i(J,X);k.push(ue)}const M=se(e,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:Ao(s),requestType:"segment"}),R=Kx({segment:s,finishProcessingFn:I,responseType:M.responseType}),L=i(M,R);L.addEventListener("progress",Zx({segment:s,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:S,dataFn:_})),k.push(L);const U={};return k.forEach(q=>{q.addEventListener("loadend",Jx({loadendState:U,abortFn:r}))}),()=>wo(k)},tE=ut("CodecUtils"),iE=function(i){const e=i.attributes||{};if(e.CODECS)return gt(e.CODECS)},Tp=(i,e)=>{const t=e.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&t.AUDIO&&i.mediaGroups.AUDIO[t.AUDIO]},sE=(i,e)=>{if(!Tp(i,e))return!0;const t=e.attributes||{},s=i.mediaGroups.AUDIO[t.AUDIO];for(const r in s)if(!s[r].uri&&!s[r].playlists)return!0;return!1},Cn=function(i){const e={};return i.forEach(({mediaType:t,type:s,details:r})=>{e[t]=e[t]||[],e[t].push(Ld(`${s}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){tE(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},zc=function(i){let e=0;return i.audio&&e++,i.video&&e++,e},Xs=function(i,e){const t=e.attributes||{},s=Cn(iE(e)||[]);if(Tp(i,e)&&!s.audio&&!sE(i,e)){const r=Cn(Sb(i,t.AUDIO)||[]);r.audio&&(s.audio=r.audio)}return s},Kr=ut("PlaylistSelector"),Wc=function(i){if(!i||!i.playlist)return;const e=i.playlist;return JSON.stringify({id:e.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:e.attributes&&e.attributes.CODECS||""})},An=function(i,e){if(!i)return"";const t=E.getComputedStyle(i);return t?t[e]:""},Wi=function(i,e){const t=i.slice();i.sort(function(s,r){const n=e(s,r);return n===0?t.indexOf(s)-t.indexOf(r):n})},Lu=function(i,e){let t,s;return i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),t=t||E.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(s=e.attributes.BANDWIDTH),s=s||E.Number.MAX_VALUE,t-s},rE=function(i,e){let t,s;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),t=t||E.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(s=e.attributes.RESOLUTION.width),s=s||E.Number.MAX_VALUE,t===s&&i.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?i.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-s};let bp=function(i,e,t,s,r,n){if(!i)return;const a={bandwidth:e,width:t,height:s,limitRenditionByPlayerDimensions:r};let o=i.playlists;ze.isAudioOnly(i)&&(o=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let l=o.map(L=>{let U;const q=L.attributes&&L.attributes.RESOLUTION&&L.attributes.RESOLUTION.width,J=L.attributes&&L.attributes.RESOLUTION&&L.attributes.RESOLUTION.height;return U=L.attributes&&L.attributes.BANDWIDTH,U=U||E.Number.MAX_VALUE,{bandwidth:U,width:q,height:J,playlist:L}});Wi(l,(L,U)=>L.bandwidth-U.bandwidth),l=l.filter(L=>!ze.isIncompatible(L.playlist));let f=l.filter(L=>ze.isEnabled(L.playlist));f.length||(f=l.filter(L=>!ze.isDisabled(L.playlist)));const m=f.filter(L=>L.bandwidth*De.BANDWIDTH_VARIANCEL.bandwidth===y.bandwidth)[0];if(r===!1){const L=T||f[0]||l[0];if(L&&L.playlist){let U="sortedPlaylistReps";return T&&(U="bandwidthBestRep"),f[0]&&(U="enabledPlaylistReps"),Kr(`choosing ${Wc(L)} using ${U} with options`,a),L.playlist}return Kr("could not choose a playlist with options",a),null}const S=m.filter(L=>L.width&&L.height);Wi(S,(L,U)=>L.width-U.width);const _=S.filter(L=>L.width===t&&L.height===s);y=_[_.length-1];const D=_.filter(L=>L.bandwidth===y.bandwidth)[0];let w,k,I;D||(w=S.filter(L=>L.width>t||L.height>s),k=w.filter(L=>L.width===w[0].width&&L.height===w[0].height),y=k[k.length-1],I=k.filter(L=>L.bandwidth===y.bandwidth)[0]);let M;if(n.leastPixelDiffSelector){const L=S.map(U=>(U.pixelDiff=Math.abs(U.width-t)+Math.abs(U.height-s),U));Wi(L,(U,q)=>U.pixelDiff===q.pixelDiff?q.bandwidth-U.bandwidth:U.pixelDiff-q.pixelDiff),M=L[0]}const R=M||I||D||T||f[0]||l[0];if(R&&R.playlist){let L="sortedPlaylistReps";return M?L="leastPixelDiffRep":I?L="resolutionPlusOneRep":D?L="resolutionBestRep":T?L="bandwidthBestRep":f[0]&&(L="enabledPlaylistReps"),Kr(`choosing ${Wc(R)} using ${L} with options`,a),R.playlist}return Kr("could not choose a playlist with options",a),null};const Kc=function(){let i=this.useDevicePixelRatio&&E.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),bp(this.playlists.main,this.systemBandwidth,parseInt(An(this.tech_.el(),"width"),10)*i,parseInt(An(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)},nE=function(i){let e=-1,t=-1;if(i<0||i>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let s=this.useDevicePixelRatio&&E.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=i*this.systemBandwidth+(1-i)*e,t=this.systemBandwidth),bp(this.playlists.main,e,parseInt(An(this.tech_.el(),"width"),10)*s,parseInt(An(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)}},aE=function(i){const{main:e,currentTime:t,bandwidth:s,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=i,f=e.playlists.filter(_=>!ze.isIncompatible(_));let m=f.filter(ze.isEnabled);m.length||(m=f.filter(_=>!ze.isDisabled(_)));const T=m.filter(ze.hasAttribute.bind(null,"BANDWIDTH")).map(_=>{const w=l.getSyncPoint(_,r,o,t)?1:2,I=ze.estimateSegmentRequestTime(n,s,_)*w-a;return{playlist:_,rebufferingImpact:I}}),S=T.filter(_=>_.rebufferingImpact<=0);return Wi(S,(_,D)=>Lu(D.playlist,_.playlist)),S.length?S[0]:(Wi(T,(_,D)=>_.rebufferingImpact-D.rebufferingImpact),T[0]||null)},oE=function(){const i=this.playlists.main.playlists.filter(ze.isEnabled);return Wi(i,(t,s)=>Lu(t,s)),i.filter(t=>!!Xs(this.playlists.main,t).video)[0]||null},uE=i=>{let e=0,t;return i.bytes&&(t=new Uint8Array(i.bytes),i.segments.forEach(s=>{t.set(s,e),e+=s.byteLength})),t};function Sp(i){try{return new URL(i).pathname.split("/").slice(-2).join("/")}catch{return""}}const lE=function(i,e,t){if(!i[t]){e.trigger({type:"usage",name:"vhs-608"});let s=t;/^cc708_/.test(t)&&(s="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(s);if(r)i[t]=r;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,o=t,l=!1;const f=n[s];f&&(a=f.label,o=f.language,l=f.default),i[t]=e.addRemoteTextTrack({kind:"captions",id:s,default:l,label:a,language:o},!1).track}}},cE=function({inbandTextTracks:i,captionArray:e,timestampOffset:t}){if(!e)return;const s=E.WebKitDataCue||E.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const o=new s(r.startTime+t,r.endTime+t,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",i[n].addCue(o)}):i[n].addCue(new s(r.startTime+t,r.endTime+t,r.text))})},dE=function(i){Object.defineProperties(i.frame,{id:{get(){return A.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get(){return A.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get(){return A.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},hE=({inbandTextTracks:i,metadataArray:e,timestampOffset:t,videoDuration:s})=>{if(!e)return;const r=E.WebKitDataCue||E.VTTCue,n=i.metadataTrack_;if(!n||(e.forEach(m=>{const y=m.cueTime+t;typeof y!="number"||E.isNaN(y)||y<0||!(y<1/0)||!m.frames||!m.frames.length||m.frames.forEach(T=>{const S=new r(y,y,T.value||T.url||T.data||"");S.frame=T,S.value=T,dE(S),n.addCue(S)})}),!n.cues||!n.cues.length))return;const a=n.cues,o=[];for(let m=0;m{const T=m[y.startTime]||[];return T.push(y),m[y.startTime]=T,m},{}),f=Object.keys(l).sort((m,y)=>Number(m)-Number(y));f.forEach((m,y)=>{const T=l[m],S=isFinite(s)?s:m,_=Number(f[y+1])||S;T.forEach(D=>{D.endTime=_})})},fE={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"},pE=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),mE=({inbandTextTracks:i,dateRanges:e})=>{const t=i.metadataTrack_;if(!t)return;const s=E.WebKitDataCue||E.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(pE.has(n))continue;const a=new s(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:fE[n],data:r[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},Xc=(i,e,t)=>{i.metadataTrack_||(i.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,A.browser.IS_ANY_SAFARI||(i.metadataTrack_.inBandMetadataTrackDispatchType=e))},js=function(i,e,t){let s,r;if(t&&t.cues)for(s=t.cues.length;s--;)r=t.cues[s],r.startTime>=i&&r.endTime<=e&&t.removeCue(r)},gE=function(i){const e=i.cues;if(!e)return;const t={};for(let s=e.length-1;s>=0;s--){const r=e[s],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?i.removeCue(r):t[n]=r}},yE=(i,e,t)=>{if(typeof e>"u"||e===null||!i.length)return[];const s=Math.ceil((e-t+3)*mi.ONE_SECOND_IN_TS);let r;for(r=0;rs);r++);return i.slice(r)},_E=(i,e,t)=>{if(!e.length)return i;if(t)return e.slice();const s=e[0].pts;let r=0;for(r;r=s);r++);return i.slice(0,r).concat(e)},vE=(i,e,t,s)=>{const r=Math.ceil((e-s)*mi.ONE_SECOND_IN_TS),n=Math.ceil((t-s)*mi.ONE_SECOND_IN_TS),a=i.slice();let o=i.length;for(;o--&&!(i[o].pts<=n););if(o===-1)return a;let l=o+1;for(;l--&&!(i[l].pts<=r););return l=Math.max(l,0),a.splice(l,o-l+1),a},TE=function(i,e){if(!i&&!e||!i&&e||i&&!e)return!1;if(i===e)return!0;const t=Object.keys(i).sort(),s=Object.keys(e).sort();if(t.length!==s.length)return!1;for(let r=0;rt))return n}return s.length===0?0:s[s.length-1]},Ms=1,SE=500,Yc=i=>typeof i=="number"&&isFinite(i),Xr=1/60,xE=(i,e,t)=>i!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,EE=(i,e,t)=>{let s=e-De.BACK_BUFFER_LENGTH;i.length&&(s=Math.max(s,i.start(0)));const r=e-t;return Math.min(r,s)},Oi=i=>{const{startOfSegment:e,duration:t,segment:s,part:r,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:f,timeline:m}=i,y=o.length-1;let T="mediaIndex/partIndex increment";i.getMediaInfoForTime?T=`getMediaInfoForTime (${i.getMediaInfoForTime})`:i.isSyncRequest&&(T="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(T+=` with independent ${i.independent}`);const S=typeof f=="number",_=i.segment.uri?"segment":"pre-segment",D=S?Vf({preloadSegment:s})-1:0;return`${_} [${n+l}/${n+y}]`+(S?` part [${f}/${D}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(S?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${m}] selected by [${T}] playlist [${a}]`},Qc=i=>`${i}TimingInfo`,CE=({segmentTimeline:i,currentTimeline:e,startOfSegment:t,buffered:s,overrideCheck:r})=>!r&&i===e?null:i{if(e===t)return!1;if(s==="audio"){const n=i.lastTimelineChange({type:"main"});return!n||n.to!==t}if(s==="main"&&r){const n=i.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},AE=i=>{let e=0;return["video","audio"].forEach(function(t){const s=i[`${t}TimingInfo`];if(!s)return;const{start:r,end:n}=s;let a;typeof r=="bigint"||typeof n=="bigint"?a=E.BigInt(n)-E.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&ei?Math.round(i)>e+Tt:!1,DE=(i,e)=>{if(e!=="hls")return null;const t=AE({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!t)return null;const s=i.playlist.targetDuration,r=Zc({segmentDuration:t,maxDuration:s*2}),n=Zc({segmentDuration:t,maxDuration:s}),a=`Segment with index ${i.mediaIndex} from playlist ${i.playlist.id} has a duration of ${t} when the reported duration is ${i.duration} and the target duration is ${s}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null};class ko extends A.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=ut(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(s){s!==this.state_&&(this.logger_(`${this.state_} -> ${s}`),this.state_=s,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return za.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&E.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,E.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&za.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Le();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:s,isMuxed:r}=e;if(s&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(s)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const s=En(e);let r=this.initSegments_[s];return t&&!r&&e.bytes&&(this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const s=np(e);let r=this.keyCache_[s];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[s]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const s=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(s&&(s.id?n=s.id:s.uri&&(n=s.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: +currentTime: ${this.currentTime_()} +bufferedEnd: ${Ha(this.buffered_())} +`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!s||s.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-s.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=l}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(s,e)}pause(){this.checkBufferTimeout_&&(E.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&za.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,s=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&s()};(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=vE(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)js(e,t,this.inbandTextTracks_[o]);js(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&E.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=E.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&E.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=E.setTimeout(this.monitorBufferTick_.bind(this),SE)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();e&&(typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,s=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||s+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=Ha(e)||0,s=Du(e,this.currentTime_()),r=!this.hasPlayed_()&&s>=1,n=s>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=bE(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const T=a[this.mediaIndex],S=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=T.end?T.end:t,T.parts&&T.parts[S+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=S+1):o.mediaIndex=this.mediaIndex+1}else{let T,S,_;const D=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: +For TargetTime: ${D}. +CurrentTime: ${this.currentTime_()} +BufferedEnd: ${t} +Fetch At Buffer: ${this.fetchAtBuffer_} +`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const w=this.getSyncInfoFromMediaSequenceSync_(D);if(!w)return this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null;this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${w.start} --> ${w.end})`),T=w.segmentIndex,S=w.partIndex,_=w.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const w=ze.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:D,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});T=w.segmentIndex,S=w.partIndex,_=w.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${D}`:`currentTime ${D}`,o.mediaIndex=T,o.startOfSegment=_,o.partIndex=S,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const l=a[o.mediaIndex];let f=l&&typeof o.partIndex=="number"&&l.parts&&l.parts[o.partIndex];if(!l||typeof o.partIndex=="number"&&!f)return null;typeof o.partIndex!="number"&&l.parts&&(o.partIndex=0,f=l.parts[0]);const m=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!s&&f&&!m&&!f.independent)if(o.partIndex===0){const T=a[o.mediaIndex-1],S=T.parts&&T.parts.length&&T.parts[T.parts.length-1];S&&S.independent&&(o.mediaIndex-=1,o.partIndex=T.parts.length-1,o.independent="previous segment")}else l.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const s=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!s)return null;if(!s.isAppended)return s;const r=this.mediaSequenceSync_.getSyncInfoForTime(s.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:s,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:o,forceTimestampOffset:l,getMediaInfoForTime:f}=e,m=s.segments[r],y=typeof o=="number"&&m.parts[o],T={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||m.resolvedUri,mediaIndex:r,partIndex:y?o:null,isSyncRequest:a,startOfSegment:n,playlist:s,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:m.timeline,duration:y&&y.duration||m.duration,segment:m,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:f,independent:t},S=typeof l<"u"?l:this.isPendingTimestampOffset_;T.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:m.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:S});const _=Ha(this.sourceUpdater_.audioBuffered());return typeof _=="number"&&(T.audioAppendStart=_-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(T.gopsToAlignWith=yE(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),T}timestampOffsetForSegment_(e){return CE(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),s=e.bandwidth,r=this.pendingSegment_.duration,n=ze.estimateSegmentRequestTime(r,s,this.playlist_,e.bytesReceived),a=KS(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const o=aE({main:this.vhs_.playlists.main,currentTime:t,bandwidth:s,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const f=n-a-o.rebufferingImpact;let m=.5;a<=Tt&&(m=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||f{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const o=n[a.stream];o.startTime=Math.min(o.startTime,a.startTime+r),o.endTime=Math.max(o.endTime,a.endTime+r),o.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:o,endTime:l,captions:f}=n[a],m=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${l} for ${a}`),lE(m,this.vhs_.tech_,a),js(o,l,m[a]),cE({captionArray:f,inbandTextTracks:m,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,s));return}this.addMetadataToTextTrack(s,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Jc({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:s,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||s&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Jc({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,t));return}const s=this.pendingSegment_;if(this.setTimeMapping_(s.timeline),this.updateMediaSecondsLoaded_(s.part||s.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),s.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),s.isFmp4=e.isFmp4,s.timingInfo=s.timingInfo||{},s.isFmp4)this.trigger("fmp4"),s.timingInfo.start=s[Qc(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=s.videoTimingInfo.start),s.timingInfo.start=this.trueSegmentStart_({currentStart:s.timingInfo.start,playlist:s.playlist,mediaIndex:s.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:s.videoTimingInfo,audioTimingInfo:s.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(s,t.type),this.updateSourceBufferTimestampOffset_(s),s.isSyncRequest){this.updateTimingInfoEnd_(s),this.syncController_.saveSegmentTimingInfo({segmentInfo:s,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==s.mediaIndex||r.partIndex!==s.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}s.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(s,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:s,playlist:r}){if(s){const n=En(s);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(s,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+gi(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+gi(a).join(", "));const o=n.length?n.start(0):0,l=n.length?n.end(n.length-1):0,f=a.length?a.start(0):0,m=a.length?a.end(a.length-1):0;if(l-o<=Ms&&m-f<=Ms){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${s.byteLength}, audio buffer: ${gi(n).join(", ")}, video buffer: ${gi(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0,metadata:{errorType:A.Error.SegmentExceedsSourceBufferQuota}}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:s}));const T=this.currentTime_()-Ms;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${T}`),this.remove(0,T,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Ms}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=E.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Ms*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:s},r){if(r){if(r.code===xp){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${s.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:A.Error.SegmentAppendError}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:s,data:r,bytes:n}){if(!n){const a=[r];let o=r.byteLength;s&&(a.unshift(s),o+=s.byteLength),n=uE({bytes:o,segments:a})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,s){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=s.prependedContentDuration||0,r[n].transmuxedPresentationStart=s.start.presentation,r[n].transmuxedDecodeStart=s.start.decode,r[n].transmuxedPresentationEnd=s.end.presentation,r[n].transmuxedDecodeEnd=s.end.decode,r[n].baseMediaDecodeTime=s.baseMediaDecodeTime}appendData_(e,t){const{type:s,data:r}=t;if(!r||!r.byteLength||s==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:s,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:s,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(()=>{const t=rt({},e,{forceTimestampOffset:!0});rt(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),s=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=s||r&&n;this.logger_(`Requesting +${Sp(e.uri)} +${Oi(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=eE({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:l,stream:f})=>{this.logger_(`${Oi(e)} logged from transmuxer stream ${f} as a ${l}: ${o}`)}})}trimBackBuffer_(e){const t=EE(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,s=e.part,r={resolvedUri:s?s.resolvedUri:t.resolvedUri,byterange:s?s.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},n=e.playlist.segments[e.mediaIndex-1];if(n&&n.timeline===t.timeline&&(n.videoTimingInfo?r.baseStartTime=n.videoTimingInfo.transmuxedDecodeEnd:n.audioTimingInfo&&(r.baseStartTime=n.audioTimingInfo.transmuxedDecodeEnd)),t.key){const a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);r.key=this.segmentKey(t.key),r.key.iv=a}return t.map&&(r.map=this.initSegmentForMap(t.map)),r}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e"u"||f.end!==r+n?r:o.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0,metadata:{errorType:A.Error.SegmentUnsupportedMediaFormat}}),this.trigger("error");return}const{hasAudio:s,hasVideo:r,isMuxed:n}=t,a=this.loaderType_==="main"&&r,o=!this.audioDisabled_&&s&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=xE(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0,metadata:{errorType:A.Error.SegmentSwitchError}}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:s}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:s.start:s.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=DE(e,this.sourceType_);if(t&&(t.severity==="warn"?A.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Oi(e)}`);return}this.logger_(`Appended ${Oi(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const s=e.segment,r=e.part,n=s.end&&this.currentTime_()-s.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${Oi(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},wE=["video","audio"],Io=(i,e)=>{const t=e[`${i}Buffer`];return t&&t.updating||e.queuePending[i]},kE=(i,e)=>{for(let t=0;t{if(e.queue.length===0)return;let t=0,s=e.queue[t];if(s.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),s.action(e),s.doneFn&&s.doneFn(),Ki("audio",e),Ki("video",e));return}if(i!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Io(i,e))){if(s.type!==i){if(t=kE(i,e.queue),t===null)return;s=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[i]=s,s.action(i,e),!s.doneFn){e.queuePending[i]=null,Ki(i,e);return}}},Cp=(i,e)=>{const t=e[`${i}Buffer`],s=Ep(i);t&&(t.removeEventListener("updateend",e[`on${s}UpdateEnd_`]),t.removeEventListener("error",e[`on${s}Error_`]),e.codecs[i]=null,e[`${i}Buffer`]=null)},yt=(i,e)=>i&&e&&Array.prototype.indexOf.call(i.sourceBuffers,e)!==-1,Qe={appendBuffer:(i,e,t)=>(s,r)=>{const n=r[`${s}Buffer`];if(yt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${i.length} bytes to ${s}Buffer`);try{n.appendBuffer(i)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===xp?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${s}Buffer`),r.queuePending[s]=null,t(a)}}},remove:(i,e)=>(t,s)=>{const r=s[`${t}Buffer`];if(yt(s.mediaSource,r)){s.logger_(`Removing ${i} to ${e} from ${t}Buffer`);try{r.remove(i,e)}catch{s.logger_(`Remove ${i} to ${e} from ${t}Buffer failed`)}}},timestampOffset:i=>(e,t)=>{const s=t[`${e}Buffer`];yt(t.mediaSource,s)&&(t.logger_(`Setting ${e}timestampOffset to ${i}`),s.timestampOffset=i)},callback:i=>(e,t)=>{i()},endOfStream:i=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${i||""})`);try{e.mediaSource.endOfStream(i)}catch(t){A.log.warn("Failed to call media source endOfStream",t)}}},duration:i=>e=>{e.logger_(`Setting mediaSource duration to ${i}`);try{e.mediaSource.duration=i}catch(t){A.log.warn("Failed to set media source duration",t)}},abort:()=>(i,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${i}Buffer`];if(yt(e.mediaSource,t)){e.logger_(`calling abort on ${i}Buffer`);try{t.abort()}catch(s){A.log.warn(`Failed to abort on ${i}Buffer`,s)}}},addSourceBuffer:(i,e)=>t=>{const s=Ep(i),r=Ys(e);t.logger_(`Adding ${i}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${s}UpdateEnd_`]),n.addEventListener("error",t[`on${s}Error_`]),t.codecs[i]=e,t[`${i}Buffer`]=n},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];if(Cp(i,e),!!yt(e.mediaSource,t)){e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(s){A.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,s)}}},changeType:i=>(e,t)=>{const s=t[`${e}Buffer`],r=Ys(i);if(!yt(t.mediaSource,s))return;const n=i.substring(0,i.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))!==n){t.logger_(`changing ${e}Buffer codec from ${t.codecs[e]} to ${i}`);try{s.changeType(r),t.codecs[e]=i}catch(l){A.log.warn(`Failed to changeType on ${e}Buffer`,l)}}}},Je=({type:i,sourceUpdater:e,action:t,doneFn:s,name:r})=>{e.queue.push({type:i,action:t,doneFn:s,name:r}),Ki(i,e)},ed=(i,e)=>t=>{const s=e[`${i}Buffered`](),r=GS(s);if(e.logger_(`received "updateend" event for ${i} Source Buffer: `,r),e.queuePending[i]){const n=e.queuePending[i].doneFn;e.queuePending[i]=null,n&&n(e[`${i}Error_`])}Ki(i,e)};class Ap extends A.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Ki("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=ut("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=ed("video",this),this.onAudioUpdateEnd_=ed("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){Je({type:"mediaSource",sourceUpdater:this,action:Qe.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){Je({type:e,sourceUpdater:this,action:Qe.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){A.log.error("removeSourceBuffer is not supported!");return}Je({type:"mediaSource",sourceUpdater:this,action:Qe.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!A.browser.IS_FIREFOX&&E.MediaSource&&E.MediaSource.prototype&&typeof E.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return E.SourceBuffer&&E.SourceBuffer.prototype&&typeof E.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){A.log.error("changeType is not supported!");return}Je({type:e,sourceUpdater:this,action:Qe.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const s=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,s);this.canChangeType()&&this.changeType(t,s)})}appendBuffer(e,t){const{segmentInfo:s,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(Je({type:r,sourceUpdater:this,action:Qe.appendBuffer(n,s||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(l=>{this.appendBuffer.apply(this,l)})}}audioBuffered(){return yt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Le()}videoBuffered(){return yt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Le()}buffered(){const e=yt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=yt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():WS(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Bt){Je({type:"mediaSource",sourceUpdater:this,action:Qe.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Bt){typeof e!="string"&&(e=void 0),Je({type:"mediaSource",sourceUpdater:this,action:Qe.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,s=Bt){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){s();return}Je({type:"audio",sourceUpdater:this,action:Qe.remove(e,t),doneFn:s,name:"remove"})}removeVideo(e,t,s=Bt){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){s();return}Je({type:"video",sourceUpdater:this,action:Qe.remove(e,t),doneFn:s,name:"remove"})}updating(){return!!(Io("audio",this)||Io("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Je({type:"audio",sourceUpdater:this,action:Qe.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset!==e&&(Je({type:"video",sourceUpdater:this,action:Qe.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Je({type:"audio",sourceUpdater:this,action:Qe.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Je({type:"video",sourceUpdater:this,action:Qe.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),wE.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>Cp(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const td=i=>decodeURIComponent(escape(String.fromCharCode.apply(null,i))),IE=i=>{const e=new Uint8Array(i);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},id=new Uint8Array(` + +`.split("").map(i=>i.charCodeAt(0)));class PE extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class LE extends ko{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Le();const e=this.subtitlesTrack_.cues,t=e[0].startTime,s=e[e.length-1].startTime;return Le([[t,s]])}initSegmentForMap(e,t=!1){if(!e)return null;const s=En(e);let r=this.initSegments_[s];if(t&&!r&&e.bytes){const n=id.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(id,e.bytes.byteLength),this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){js(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,s){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===St.TIMEOUT&&this.handleTimeout_(),e.code===St.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=r.segment;if(n.map&&(n.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof E.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,s),()=>this.stopForError({message:"Error loading vtt.js",metadata:{errorType:A.Error.VttLoadError}}));return}n.requested=!0;try{this.parseVTTCues_(r)}catch(a){this.stopForError({message:a.message,metadata:{errorType:A.Error.VttCueParsingError}});return}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,r.cues.forEach(a=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new E.VTTCue(a.startTime,a.endTime,a.text):a)}),gE(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,s=!1;if(typeof E.WebVTT!="function")throw new PE;typeof E.TextDecoder=="function"?t=new E.TextDecoder("utf8"):(t=E.WebVTT.StringDecoder(),s=!0);const r=new E.WebVTT.Parser(E,E.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{A.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;s&&(a=td(a)),r.parse(a)}let n=e.bytes;s&&(n=td(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,s){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,l=n/mi.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(f=>{const m=f.endTime-f.startTime,y=n===0?f.startTime+l:this.handleRollover_(f.startTime+l,t.time);f.startTime=Math.max(y,0),f.endTime=Math.max(y+m,0)}),!s.syncInfo){const f=e.cues[0].startTime,m=e.cues[e.cues.length-1].startTime;s.syncInfo={mediaSequence:s.mediaSequence+e.mediaIndex,time:Math.min(f,m-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let s=e*mi.ONE_SECOND_IN_TS;const r=t*mi.ONE_SECOND_IN_TS;let n;for(r4294967296;)s+=n;return s/mi.ONE_SECOND_IN_TS}}const OE=function(i,e){const t=i.cues;for(let s=0;s=r.adStartTime&&e<=r.adEndTime)return r}return null},RE=function(i,e,t=0){if(!i.segments)return;let s=t,r;for(let n=0;n=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Wa{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:s,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(s,r),!!this.isReliable_)return this.updateStorage_(r,s,this.calculateBaseTime_(s,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:s}of this.storage_.values())if(s.length){for(const r of s)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}updateStorage_(e,t,s){const r=new Map;let n=` +`,a=s,o=t;this.start_=a,e.forEach((l,f)=>{const m=this.storage_.get(o),y=a,T=y+l.duration,S=!!(m&&m.segmentSyncInfo&&m.segmentSyncInfo.isAppended),_=new sd({start:y,end:T,appended:S,segmentIndex:f});l.syncInfo=_;let D=a;const w=(l.parts||[]).map((k,I)=>{const M=D,R=D+k.duration,L=!!(m&&m.partsSyncInfo&&m.partsSyncInfo[I]&&m.partsSyncInfo[I].isAppended),U=new sd({start:M,end:R,appended:L,segmentIndex:f,partIndex:I});return D=R,n+=`Media Sequence: ${o}.${I} | Range: ${M} --> ${R} | Appended: ${L} +`,k.syncInfo=U,U});r.set(o,new ME(_,w)),n+=`${Sp(l.resolvedUri)} | Media Sequence: ${o} | Range: ${y} --> ${T} | Appended: ${S} +`,o++,a=T}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}const NE=86400,Ka=[{name:"VOD",run:(i,e,t,s,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(i,e,t,s,r,n)=>{const a=i.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const o=a.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(i,e,t,s,r)=>{if(!Object.keys(i.timelineToDatetimeMappings).length)return null;let n=null,a=null;const o=bo(e);r=r||0;for(let l=0;l{let n=null,a=null;r=r||0;const o=bo(e);for(let l=0;l=S)&&(a=S,n={time:T,segmentIndex:m.segmentIndex,partIndex:m.partIndex})}}return n}},{name:"Discontinuity",run:(i,e,t,s,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o=y)&&(a=y,n={time:m.time,segmentIndex:l,partIndex:null})}}}return n}},{name:"Playlist",run:(i,e,t,s,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class BE extends A.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.mediaSequenceStorage_={main:new Wa,audio:new Wa,vtt:new Wa},this.logger_=ut("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,s,r,n){if(t!==1/0)return Ka.find(({name:l})=>l==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,s,r,n);if(!a.length)return null;for(const o of a){const{syncPoint:l,strategy:f}=o,{segmentIndex:m,time:y}=l;if(m<0)continue;const T=e.segments[m],S=y,_=S+T.duration;if(this.logger_(`Strategy: ${f}. Current time: ${r}. selected segment: ${m}. Time: [${S} -> ${_}]}`),r>=S&&r<_)return this.logger_("Found sync point with exact match: ",l),l}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const s=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!s.length)return null;const r=this.selectSyncPoint_(s,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Ws({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,s,r,n){const a=[];for(let o=0;oNE){A.log.warn(`Not saving expired segment info. Media sequence gap ${s} is too large.`);return}for(let r=s-1;r>=0;r--){const n=e.segments[r];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],s=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-s}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const s=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;s&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,s){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],o,l;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},s&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,l=t.end+a.mapping;else if(a)o=t.start+a.mapping,l=t.end+a.mapping;else return!1;return n&&(n.start=o,n.end=l),(!r.start||ol){let f;o<0?f=s.start-Ws({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):f=s.end+Ws({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:f,accuracy:l}}}}dispose(){this.trigger("dispose"),this.off()}}class FE extends A.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:s}){return typeof t=="number"&&typeof s=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:s},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:s}){return typeof t=="number"&&typeof s=="number"&&(this.lastTimelineChanges_[e]={type:e,from:t,to:s},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const UE=dp(hp(function(){var i=function(){function D(){this.listeners={}}var w=D.prototype;return w.on=function(I,M){this.listeners[I]||(this.listeners[I]=[]),this.listeners[I].push(M)},w.off=function(I,M){if(!this.listeners[I])return!1;var R=this.listeners[I].indexOf(M);return this.listeners[I]=this.listeners[I].slice(0),this.listeners[I].splice(R,1),R>-1},w.trigger=function(I){var M=this.listeners[I];if(M)if(arguments.length===2)for(var R=M.length,L=0;L>7)*283)^R]=R;for(L=U=0;!I[L];L^=X||1,U=J[U]||1)for(de=U^U<<1^U<<2^U<<3^U<<4,de=de>>8^de&255^99,I[L]=de,M[de]=L,ee=q[ue=q[X=q[L]]],te=ee*16843009^ue*65537^X*257^L*16843008,V=q[de]*257^de*16843008,R=0;R<4;R++)w[R][L]=V=V<<24^V>>>8,k[R][de]=te=te<<24^te>>>8;for(R=0;R<5;R++)w[R]=w[R].slice(0),k[R]=k[R].slice(0);return D};let s=null;class r{constructor(w){s||(s=t()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let k,I,M;const R=this._tables[0][4],L=this._tables[1],U=w.length;let q=1;if(U!==4&&U!==6&&U!==8)throw new Error("Invalid aes key size");const J=w.slice(0),X=[];for(this._key=[J,X],k=U;k<4*U+28;k++)M=J[k-1],(k%U===0||U===8&&k%U===4)&&(M=R[M>>>24]<<24^R[M>>16&255]<<16^R[M>>8&255]<<8^R[M&255],k%U===0&&(M=M<<8^M>>>24^q<<24,q=q<<1^(q>>7)*283)),J[k]=J[k-U]^M;for(I=0;k;I++,k--)M=J[I&3?k:k-4],k<=4||I<4?X[I]=M:X[I]=L[0][R[M>>>24]]^L[1][R[M>>16&255]]^L[2][R[M>>8&255]]^L[3][R[M&255]]}decrypt(w,k,I,M,R,L){const U=this._key[1];let q=w^U[0],J=M^U[1],X=I^U[2],ue=k^U[3],ee,de,V;const te=U.length/4-2;let Xe,ie=4;const Te=this._tables[1],Pt=Te[0],ii=Te[1],si=Te[2],ri=Te[3],ni=Te[4];for(Xe=0;Xe>>24]^ii[J>>16&255]^si[X>>8&255]^ri[ue&255]^U[ie],de=Pt[J>>>24]^ii[X>>16&255]^si[ue>>8&255]^ri[q&255]^U[ie+1],V=Pt[X>>>24]^ii[ue>>16&255]^si[q>>8&255]^ri[J&255]^U[ie+2],ue=Pt[ue>>>24]^ii[q>>16&255]^si[J>>8&255]^ri[X&255]^U[ie+3],ie+=4,q=ee,J=de,X=V;for(Xe=0;Xe<4;Xe++)R[(3&-Xe)+L]=ni[q>>>24]<<24^ni[J>>16&255]<<16^ni[X>>8&255]<<8^ni[ue&255]^U[ie++],ee=q,q=J,J=X,X=ue,ue=ee}}class n extends i{constructor(){super(i),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(w){this.jobs.push(w),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},o=function(D,w,k){const I=new Int32Array(D.buffer,D.byteOffset,D.byteLength>>2),M=new r(Array.prototype.slice.call(w)),R=new Uint8Array(D.byteLength),L=new Int32Array(R.buffer);let U,q,J,X,ue,ee,de,V,te;for(U=k[0],q=k[1],J=k[2],X=k[3],te=0;te{const I=D[k];T(I)?w[k]={bytes:I.buffer,byteOffset:I.byteOffset,byteLength:I.byteLength}:w[k]=I}),w};self.onmessage=function(D){const w=D.data,k=new Uint8Array(w.encrypted.bytes,w.encrypted.byteOffset,w.encrypted.byteLength),I=new Uint32Array(w.key.bytes,w.key.byteOffset,w.key.byteLength/4),M=new Uint32Array(w.iv.bytes,w.iv.byteOffset,w.iv.byteLength/4);new l(k,I,M,function(R,L){self.postMessage(_({source:w.source,decrypted:L}),[L.buffer])})}}));var $E=cp(UE);const jE=i=>{let e=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},Dp=(i,e)=>{i.abort(),i.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Po=(i,e)=>{e.activePlaylistLoader=i,i.load()},qE=(i,e)=>()=>{const{segmentLoaders:{[i]:t,main:s},mediaTypes:{[i]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,l=r.lastGroup_;if(!(a&&l&&a.id===l.id)&&(r.lastGroup_=a,r.lastTrack_=n,Dp(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&s.resetEverything();return}t.resyncLoader(),Po(a.playlistLoader,r)}},VE=(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:s}}=e;s.lastGroup_=null,t.abort(),t.pause()},HE=(i,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[i]:s,main:r},mediaTypes:{[i]:n}}=e,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,f=n.lastTrack_;if(!(f&&a&&f.id===a.id)&&(n.lastGroup_=o,n.lastTrack_=a,Dp(s,n),!!o)){if(o.isMainPlaylist){if(!a||!f||a.id===f.id)return;const m=e.vhs.playlistController_,y=m.selectPlaylist();if(m.media()===y)return;n.logger_(`track change. Switching main audio from ${f.id} to ${a.id}`),t.pause(),r.resetEverything(),m.fastQualityChange_(y);return}if(i==="AUDIO"){if(!o.playlistLoader){r.setAudio(!0),r.resetEverything();return}s.setAudio(!0),r.setAudio(!1)}if(l===o.playlistLoader){Po(o.playlistLoader,n);return}s.track&&s.track(a),s.resetEverything(),Po(o.playlistLoader,n)}},Dn={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:t},excludePlaylist:s}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(l=>l.default)[0]||n[0]).id,o=t.tracks[a];if(r===o){s({error:{message:"Problem encountered loading the default audio track."}});return}A.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const l in t.tracks)t.tracks[l].enabled=t.tracks[l]===o;t.onTrackChanged()},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:t}}=e;A.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const s=t.activeTrack();s&&(s.mode="disabled"),t.onTrackChanged()}},rd={AUDIO:(i,e,t)=>{if(!e)return;const{tech:s,requestOptions:r,segmentLoaders:{[i]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!s.paused()||a.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Dn[i](i,t))},SUBTITLES:(i,e,t)=>{const{tech:s,requestOptions:r,segmentLoaders:{[i]:n},mediaTypes:{[i]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();n.playlist(o,r),n.track(a.activeTrack()),(!s.paused()||o.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",Dn[i](i,t))}},GE={AUDIO:(i,e)=>{const{vhs:t,sourceType:s,segmentLoaders:{[i]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[i]:{groups:o,tracks:l,logger_:f}},mainPlaylistLoader:m}=e,y=pr(m.main);(!a[i]||Object.keys(a[i]).length===0)&&(a[i]={main:{default:{default:!0}}},y&&(a[i].main.default.playlists=m.main.playlists));for(const T in a[i]){o[T]||(o[T]=[]);for(const S in a[i][T]){let _=a[i][T][S],D;if(y?(f(`AUDIO group '${T}' label '${S}' is a main playlist`),_.isMainPlaylist=!0,D=null):s==="vhs-json"&&_.playlists?D=new $i(_.playlists[0],t,n):_.resolvedUri?D=new $i(_.resolvedUri,t,n):_.playlists&&s==="dash"?D=new Do(_.playlists[0],t,n,m):D=null,_=se({id:S,playlistLoader:D},_),rd[i](i,_.playlistLoader,e),o[T].push(_),typeof l[S]>"u"){const w=new A.AudioTrack({id:S,kind:jE(_),enabled:!1,language:_.language,default:_.default,label:S});l[S]=w}}}r.on("error",Dn[i](i,e))},SUBTITLES:(i,e)=>{const{tech:t,vhs:s,sourceType:r,segmentLoaders:{[i]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[i]:{groups:l,tracks:f}},mainPlaylistLoader:m}=e;for(const y in o[i]){l[y]||(l[y]=[]);for(const T in o[i][y]){if(!s.options_.useForcedSubtitles&&o[i][y][T].forced)continue;let S=o[i][y][T],_;if(r==="hls")_=new $i(S.resolvedUri,s,a);else if(r==="dash"){if(!S.playlists.filter(w=>w.excludeUntil!==1/0).length)return;_=new Do(S.playlists[0],s,a,m)}else r==="vhs-json"&&(_=new $i(S.playlists?S.playlists[0]:S.resolvedUri,s,a));if(S=se({id:T,playlistLoader:_},S),rd[i](i,S.playlistLoader,e),l[y].push(S),typeof f[T]>"u"){const D=t.addRemoteTextTrack({id:T,kind:"subtitles",default:S.default&&S.autoselect,language:S.language,label:T},!1).track;f[T]=D}}}n.on("error",Dn[i](i,e))},"CLOSED-CAPTIONS":(i,e)=>{const{tech:t,main:{mediaGroups:s},mediaTypes:{[i]:{groups:r,tracks:n}}}=e;for(const a in s[i]){r[a]||(r[a]=[]);for(const o in s[i][a]){const l=s[i][a][o];if(!/^(?:CC|SERVICE)/.test(l.instreamId))continue;const f=t.options_.vhs&&t.options_.vhs.captionServices||{};let m={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(f[m.instreamId]&&(m=se(m,f[m.instreamId])),m.default===void 0&&delete m.default,r[a].push(se({id:o},l)),typeof n[o]>"u"){const y=t.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;n[o]=y}}}}},wp=(i,e)=>{for(let t=0;tt=>{const{mainPlaylistLoader:s,mediaTypes:{[i]:{groups:r}}}=e,n=s.media();if(!n)return null;let a=null;n.attributes[i]&&(a=r[n.attributes[i]]);const o=Object.keys(r);if(!a)if(i==="AUDIO"&&o.length>1&&pr(e.main))for(let l=0;l"u"?a:t===null||!a?null:a.filter(l=>l.id===t.id)[0]||null},WE={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].enabled)return t[s];return null},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].mode==="showing"||t[s].mode==="hidden")return t[s];return null}},KE=(i,{mediaTypes:e})=>()=>{const t=e[i].activeTrack();return t?e[i].activeGroup(t):null},XE=i=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(f=>{GE[f](f,i)});const{mediaTypes:e,mainPlaylistLoader:t,tech:s,vhs:r,segmentLoaders:{["AUDIO"]:n,main:a}}=i;["AUDIO","SUBTITLES"].forEach(f=>{e[f].activeGroup=zE(f,i),e[f].activeTrack=WE[f](f,i),e[f].onGroupChanged=qE(f,i),e[f].onGroupChanging=VE(f,i),e[f].onTrackChanged=HE(f,i),e[f].getActiveGroup=KE(f,i)});const o=e.AUDIO.activeGroup();if(o){const f=(o.filter(y=>y.default)[0]||o[0]).id;e.AUDIO.tracks[f].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanging())});const l=()=>{e.AUDIO.onTrackChanged(),s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",l),s.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{s.audioTracks().removeEventListener("change",l),s.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),s.clearTracks("audio");for(const f in e.AUDIO.tracks)s.audioTracks().addTrack(e.AUDIO.tracks[f])},YE=()=>{const i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Bt,activeTrack:Bt,getActiveGroup:Bt,onGroupChanged:Bt,onTrackChanged:Bt,lastTrack_:null,logger_:ut(`MediaGroups[${e}]`)}}),i};class nd{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Ge(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class QE extends A.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new nd,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=ut("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const s=t.serverUri||t.serverURL;if(!s){this.logger_(`steering manifest URL is ${s}, cannot request steering manifest.`),this.trigger("error");return}if(s.startsWith("data:")){this.decodeDataUriManifest_(s.substring(s.indexOf(",")+1));return}this.steeringManifest.reloadUri=Ge(e,s),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const s=e?t:this.getRequestURI(t);if(!s){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}this.request_=this.xhr_({uri:s,requestType:"content-steering-manifest"},(r,n)=>{if(r){if(n.status===410){this.logger_(`manifest request 410 ${r}.`),this.logger_(`There will be no more content steering requests to ${s} this session.`),this.excludedSteeringManifestURLs.add(s);return}if(n.status===429){const o=n.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${r}.`),this.logger_(`content steering will retry in ${o} seconds.`),this.startTTLTimeout_(parseInt(o,10));return}this.logger_(`manifest failed to load ${r}.`),this.startTTLTimeout_();return}const a=JSON.parse(this.request_.responseText);this.assignSteeringProperties_(a),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new E.URL(e),s=new E.URL(this.proxyServerUrl_);return s.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(s.toString())}decodeDataUriManifest_(e){const t=JSON.parse(E.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new E.URL(e),s=this.getPathway(),r=this.getBandwidth_();if(s){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,s)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const s=(r=>{for(const n of r)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==s&&(this.currentPathway=s,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const s=this.setSteeringParams_(e);return t(s)?null:s}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=E.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){E.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new nd}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(Ge(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const JE=10;let Mt;const ZE=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],eC=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},tC=function({currentPlaylist:i,buffered:e,currentTime:t,nextPlaylist:s,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!s)return A.log.warn("We received no playlist to switch to. Please check your stream."),!1;const f=`allowing switch ${i&&i.id||"null"} -> ${s.id}`;if(!i)return l(`${f} as current playlist is not set`),!0;if(s.id===i.id)return!1;const m=!!Ui(e,t).length;if(!i.endList)return!m&&typeof i.partTargetDuration=="number"?(l(`not ${f} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(l(`${f} as current playlist is live`),!0);const y=Du(e,t),T=o?De.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:De.MAX_BUFFER_LOW_WATER_LINE;if(a_)&&y>=r){let D=`${f} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return o&&(D+=` and next bandwidth > current bandwidth (${S} > ${_})`),l(D),!0}return l(`not ${f} as no switching criteria met`),!1};class iC extends A.EventTarget{constructor(e){super();const{src:t,withCredentials:s,tech:r,bandwidth:n,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:f,sourceType:m,cacheEncryptionKeys:y,bufferBasedABR:T,leastPixelDiffSelector:S,captionServices:_}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:D}=e;(D===null||typeof D>"u")&&(D=1/0),Mt=a,this.bufferBasedABR=!!T,this.leastPixelDiffSelector=!!S,this.withCredentials=s,this.tech_=r,this.vhs_=r.vhs,this.sourceType_=m,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=D,this.enableLowInitialPlaylist=f,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:s,maxPlaylistRetries:D,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=YE(),this.mediaSource=new E.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_=Le(),this.hasPlayed_=!1,this.syncController_=new BE(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new $E,this.sourceUpdater_=new Ap(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new FE,this.keyStatusMap_=new Map;const w={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:_,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:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Do(t,this.vhs_,se(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new $i(t,this.vhs_,se(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new ko(se(w,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new ko(se(w,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new LE(se(w,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((M,R)=>{function L(){r.off("vttjserror",U),M()}function U(){r.off("vttjsloaded",L),R()}r.one("vttjsloaded",L),r.one("vttjserror",U),r.addWebVttScript_()})}),e);const k=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new QE(this.vhs_.xhr,k),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),ZE.forEach(M=>{this[M+"_"]=eC.bind(this,M)}),this.logger_=ut("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const I=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(I,()=>{const M=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-M,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,s){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);n&&n!==a&&(this.logger_(`switch media ${n} -> ${a} from ${t}`),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})),this.mainPlaylistLoader_.media(e,s)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],s=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(s&&r){const a=(s.length?s[0].playlists:s.playlists).filter(o=>o.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=E.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(E.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const s=e.mediaGroups.AUDIO,r=Object.keys(s);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const o=s.main||r.length&&s[r[0]];for(const l in o)if(o[l].default){n={label:l};break}}if(!n)return t;const a=[];for(const o in s)if(s[o][n.label]){const l=s[o][n.label];if(l.playlists&&l.playlists.length)a.push.apply(a,l.playlists);else if(l.uri)a.push(l);else if(e.playlists.length)for(let f=0;f{const e=this.mainPlaylistLoader_.media(),t=e.targetDuration*1.5*1e3;So(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),XE({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(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let t;if(this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),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(),t=e.targetDuration*1.5*1e3;So(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if(e.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const s=e.mediaGroups||{};let r=!0;const n=Object.keys(s.AUDIO);for(const a in s.AUDIO)for(const o in s.AUDIO[a])s.AUDIO[a][o].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(s.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Mt.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(s.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,s=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return tC({buffered:a,currentTime:s,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const t=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",t=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:JE}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const t=this.getCodecsOrExclude_();t&&this.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.tech_.setCurrentTime(this.tech_.currentTime())})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const s=this.syncController_.getExpiredTime(e,this.duration());if(s===null)return!1;const r=Mt.Playlist.playlistEnd(e,s),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=bt;const o=a.end(a.length-1);return o-n<=bt&&r-o<=bt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:s}){if(e=e||this.mainPlaylistLoader_.media(),s=s||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(ea),a=n.length===1&&n[0]===e;if(r.length===1&&s!==1/0)return A.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const _=this.pathwayAttribute_(e),D=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(_),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(_)},D);return}let S=!1;r.forEach(_=>{if(_===e)return;const D=_.excludeUntil;typeof D<"u"&&D!==1/0&&(S=!0,delete _.excludeUntil)}),S&&(A.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+s*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const l=this.selectPlaylist();if(!l){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const f=t.internal?this.logger_:A.log.warn,m=t.message?" "+t.message:"";f(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${m} Switching to playlist ${l.id}.`),l.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const y=l.targetDuration/2*1e3||5*1e3,T=typeof l.lastRequest=="number"&&Date.now()-l.lastRequest<=y;return this.switchMedia_(l,"exclude",a||T)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const s=[],r=e==="all";(r||e==="main")&&s.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&s.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&s.push(o)}),s.forEach(a=>t.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const t=Ui(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Mt.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let s=this.syncController_.getExpiredTime(t,this.duration());if(s===null)return;const r=this.mainPlaylistLoader_.main,n=Mt.Playlist.seekable(t,s,Mt.Playlist.liveEdgeDelay(r,t));if(n.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),s=this.syncController_.getExpiredTime(t,this.duration()),s===null||(e=Mt.Playlist.seekable(t,s,Mt.Playlist.liveEdgeDelay(r,t)),e.length===0)))return;let a,o;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),o=this.seekable_.start(0)),e?e.start(0)>n.end(0)||n.start(0)>e.end(0)?this.seekable_=n:this.seekable_=Le([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)0&&(s=Math.max(s,t.end(t.length-1))),this.mediaSource.duration!==s&&this.sourceUpdater_.setDuration(s)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const s in t)t[s].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),s=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!s)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const s=Xs(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=s.video||e.main.videoCodec||Eb),e.main.isMuxed&&(r.video+=`,${s.audio||e.main.audioCodec||Vl}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=s.audio||e.main.audioCodec||e.audio.audioCodec||Vl,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(f,m)=>f?Zr(m):Ia(m),o={};let l;if(["video","audio"].forEach(function(f){if(r.hasOwnProperty(f)&&!a(e[f].isFmp4,r[f])){const m=e[f].isFmp4?"browser":"muxer";o[m]=o[m]||[],o[m].push(r[f]),f==="audio"&&(l=m)}}),n&&l&&t.attributes.AUDIO){const f=t.attributes.AUDIO;this.main().playlists.forEach(m=>{(m.attributes&&m.attributes.AUDIO)===f&&m!==t&&(m.excludeUntil=1/0)}),this.logger_(`excluding audio group ${f} as ${l} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){const f=Object.keys(o).reduce((m,y)=>(m&&(m+=", "),m+=`${y} does not support codec(s): "${o[y].join(",")}"`,m),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:f},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const f=[];if(["video","audio"].forEach(m=>{const y=(gt(this.sourceUpdater_.codecs[m]||"")[0]||{}).type,T=(gt(r[m]||"")[0]||{}).type;y&&T&&y.toLowerCase()!==T.toLowerCase()&&f.push(`"${this.sourceUpdater_.codecs[m]}" -> "${r[m]}"`)}),f.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${f.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(s=>{const r=e[s];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=Xs(this.main,r),a=[];n.audio&&!Ia(n.audio)&&!Zr(n.audio)&&a.push(`audio codec ${n.audio}`),n.video&&!Ia(n.video)&&!Zr(n.video)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],s=this.main().playlists,r=Cn(gt(e)),n=zc(r),a=r.video&>(r.video)[0]||null,o=r.audio&>(r.audio)[0]||null;Object.keys(s).forEach(l=>{const f=s[l];if(t.indexOf(f.id)!==-1||f.excludeUntil===1/0)return;t.push(f.id);const m=[],y=Xs(this.mainPlaylistLoader_.main,f),T=zc(y);if(!(!y.audio&&!y.video)){if(T!==n&&m.push(`codec count "${T}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const S=y.video&>(y.video)[0]||null,_=y.audio&>(y.audio)[0]||null;S&&a&&S.type.toLowerCase()!==a.type.toLowerCase()&&m.push(`video codec "${S.type}" !== "${a.type}"`),_&&o&&_.type.toLowerCase()!==o.type.toLowerCase()&&m.push(`audio codec "${_.type}" !== "${o.type}"`)}m.length&&(f.excludeUntil=1/0,this.logger_(`excluding ${f.id}: ${m.join(" && ")}`))}})}updateAdCues_(e){let t=0;const s=this.seekable();s.length&&(t=s.start(0)),RE(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=De.GOAL_BUFFER_LENGTH,s=De.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,De.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*s,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=De.BUFFER_LOW_WATER_LINE,s=De.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,De.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,De.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*s,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return De.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Xc(this.inbandTextTracks_,"com.apple.streaming",this.tech_),mE({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,s){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Xc(this.inbandTextTracks_,e,this.tech_),hE({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:s})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const r=this.contentSteeringController_.getAvailablePathways(),n=[];for(const a of e.playlists){const o=a.attributes.serviceLocation;if(o&&(n.push(o),!r.has(o)))return!0}return!!(!n.length&&r.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const s=this.main().playlists,r=new Set;let n=!1;Object.keys(s).forEach(a=>{const o=s[a],l=this.pathwayAttribute_(o),f=l&&e!==l;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!f&&(delete o.excludeUntil,delete o.lastExcludeReason_,n=!0);const y=!o.excludeUntil&&o.excludeUntil!==1/0;!r.has(o.id)&&f&&y&&(r.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const o=this.mediaTypes_[a];if(o.activePlaylistLoader){const l=o.activePlaylistLoader.media_;l&&l.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,s=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(s&&s.size||r&&r.size){for(const[a,o]of s.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(o),this.contentSteeringController_.excludePathway(a));for(const[a,o]of r.entries()){const l=s.get(a);if(!l){t.filter(m=>m.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(m=>{this.mainPlaylistLoader_.addClonePathway(o,m)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(l,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const s=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in s)if(s[n]!==r[n])return!1;for(const n in r)if(s[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=this.mainPlaylistLoader_.getKeyIdSet(s);!r||!r.size||r.forEach(n=>{const a="usable",o=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,l=s.lastExcludeReason_===t&&s.excludeUntil===1/0;o?o&&l&&(delete s.excludeUntil,delete s.lastExcludeReason_,this.logger_(`enabling playlist ${s.id} because key ID ${n} is ${a}`)):(s.excludeUntil!==1/0&&s.lastExcludeReason_!==t&&(s.excludeUntil=1/0,s.lastExcludeReason_=t,this.logger_(`excluding playlist ${s.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=s&&s.attributes&&s.attributes.RESOLUTION&&s.attributes.RESOLUTION.height<720,n=s.excludeUntil===1/0&&s.lastExcludeReason_===t;r&&n&&(delete s.excludeUntil,A.log.warn(`enabling non-HD playlist ${s.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:IE(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const sC=(i,e,t)=>s=>{const r=i.main.playlists[e],n=ku(r),a=ea(r);return typeof s>"u"?a:(s?delete r.disabled:r.disabled=!0,s!==a&&!n&&(t(r),s?i.trigger("renditionenabled"):i.trigger("renditiondisabled")),s)};class rC{constructor(e,t,s){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=Xs(r.main(),t),this.playlist=t,this.id=s,this.enabled=sC(e.playlists,t.id,n)}}const nC=function(i){i.representations=()=>{const e=i.playlistController_.main(),t=pr(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(s=>!ku(s)).map((s,r)=>new rC(i,s,s.id)):[]}},ad=["seeking","seeked","pause","playing","error"];class aC{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_=ut("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),s=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach(m=>{l[m]={reset:()=>this.resetSegmentDownloads_(m),updateend:()=>this.checkSegmentDownloads_(m)},a[`${m}SegmentLoader_`].on("appendsdone",l[m].updateend),a[`${m}SegmentLoader_`].on("playlistupdate",l[m].reset),this.tech_.on(["seeked","seeking"],l[m].reset)});const f=m=>{["main","audio"].forEach(y=>{a[`${y}SegmentLoader_`][m]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),f("off"))},this.clearSeekingAppendCheck_=()=>f("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),f("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(ad,n),this.tech_.on("canplay",s),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(ad,n),this.tech_.off("canplay",s),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(m=>{a[`${m}SegmentLoader_`].off("appendsdone",l[m].updateend),a[`${m}SegmentLoader_`].off("playlistupdate",l[m].reset),this.tech_.off(["seeked","seeking"],l[m].reset)}),this.checkCurrentTimeTimeout_&&E.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&E.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=E.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,s=t[`${e}SegmentLoader_`],r=s.buffered_(),n=XS(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:s.playlist_&&s.playlist_.id,buffered:gi(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+bt>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),s=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,s,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,s)){const _=t.start(0);n=_+(_===t.end(0)?0:bt)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${s} with seekable range ${jf(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),l=a.audioBuffer?a.audioBuffered():null,f=a.videoBuffer?a.videoBuffered():null,m=this.media(),y=m.partTargetDuration?m.partTargetDuration:(m.targetDuration-Tt)*2,T=[l,f];for(let _=0;_ ${s.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const s=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:s.audioBuffered(),videoBuffered:s.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Wr(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,s,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+bt;const a=!s.endList,o=typeof s.partTargetDuration=="number";return a&&(o||r)&&(n=e.end(e.length-1)+s.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:n,end:a}}return null}}const oC={errorInterval:30,getSource(i){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return i(t)}},kp=function(i,e){let t=0,s=0;const r=se(oC,e);i.ready(()=>{i.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){s&&i.currentTime(s)},a=function(m){m!=null&&(s=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",n),i.src(m),i.trigger({type:"usage",name:"vhs-error-reload"}),i.play())},o=function(){if(Date.now()-t{Object.defineProperty(ge,i,{get(){return A.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),De[i]},set(e){if(A.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){A.log.warn(`value of Vhs.${i} must be greater than or equal to 0`);return}De[i]=e}})});const Pp="videojs-vhs",Lp=function(i,e){const t=e.media();let s=-1;for(let r=0;r{i.addQualityLevel(t)}),Lp(i,e.playlists)};ge.canPlaySource=function(){return A.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const pC=(i,e,t)=>{if(!i)return i;let s={};e&&e.attributes&&e.attributes.CODECS&&(s=Cn(gt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(s.audio=t.attributes.CODECS);const r=Ys(s.video),n=Ys(s.audio),a={};for(const o in i)a[o]={},n&&(a[o].audioContentType=n),r&&(a[o].videoContentType=r),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof i[o]=="string"&&(a[o].url=i[o]);return se(i,a)},mC=(i,e)=>i.reduce((t,s)=>{if(!s.contentProtection)return t;const r=e.reduce((n,a)=>{const o=s.contentProtection[a];return o&&o.pssh&&(n[a]={pssh:o.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),gC=({player:i,sourceKeySystems:e,audioMedia:t,mainPlaylists:s})=>{if(!i.eme.initializeMediaKeys)return Promise.resolve();const r=t?s.concat([t]):s,n=mC(r,Object.keys(e)),a=[],o=[];return n.forEach(l=>{o.push(new Promise((f,m)=>{i.tech_.one("keysessioncreated",f)})),a.push(new Promise((f,m)=>{i.eme.initializeMediaKeys({keySystems:l},y=>{if(y){m(y);return}f()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},yC=({player:i,sourceKeySystems:e,media:t,audioMedia:s})=>{const r=pC(e,t,s);return r?(i.currentSource().keySystems=r,r&&!i.eme?(A.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Op=()=>{if(!E.localStorage)return null;const i=E.localStorage.getItem(Pp);if(!i)return null;try{return JSON.parse(i)}catch{return null}},_C=i=>{if(!E.localStorage)return!1;let e=Op();e=e?se(e,i):i;try{E.localStorage.setItem(Pp,JSON.stringify(e))}catch{return!1}return e},vC=i=>i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i,Rp=(i,e)=>{i._requestCallbackSet||(i._requestCallbackSet=new Set),i._requestCallbackSet.add(e)},Mp=(i,e)=>{i._responseCallbackSet||(i._responseCallbackSet=new Set),i._responseCallbackSet.add(e)},Np=(i,e)=>{i._requestCallbackSet&&(i._requestCallbackSet.delete(e),i._requestCallbackSet.size||delete i._requestCallbackSet)},Bp=(i,e)=>{i._responseCallbackSet&&(i._responseCallbackSet.delete(e),i._responseCallbackSet.size||delete i._responseCallbackSet)};ge.supportsNativeHls=function(){if(!F||!F.createElement)return!1;const i=F.createElement("video");return A.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(i.canPlayType(t))}):!1}();ge.supportsNativeDash=function(){return!F||!F.createElement||!A.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(F.createElement("video").canPlayType("application/dash+xml"))}();ge.supportsTypeNatively=i=>i==="hls"?ge.supportsNativeHls:i==="dash"?ge.supportsNativeDash:!1;ge.isSupported=function(){return A.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};ge.xhr.onRequest=function(i){Rp(ge.xhr,i)};ge.xhr.onResponse=function(i){Mp(ge.xhr,i)};ge.xhr.offRequest=function(i){Np(ge.xhr,i)};ge.xhr.offResponse=function(i){Bp(ge.xhr,i)};const TC=A.getComponent("Component");class Fp extends TC{constructor(e,t,s){if(super(t,s.vhs),typeof s.initialBandwidth=="number"&&(this.options_.bandwidth=s.initialBandwidth),this.logger_=ut("VhsHandler"),t.options_&&t.options_.playerId){const r=A.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(F,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=F.fullscreenElement||F.webkitFullscreenElement||F.mozFullScreenElement||F.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=se(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const s=Op();s&&s.bandwidth&&(this.options_.bandwidth=s.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),s&&s.throughput&&(this.options_.throughput=s.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=De.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===De.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(s=>{typeof this.source_[s]<"u"&&(this.options_[s]=this.source_[s])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=vC(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=ge,this.options_.sourceType=Rd(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.playlistController_=new iC(this.options_);const s=se({liveRangeSafeTimeDelta:bt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new aC(s),this.playlistController_.on("error",()=>{const n=A.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const r=this.options_.bufferBasedABR?ge.movingAverageBandwidthSelector(.55):ge.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=ge.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=E.navigator.connection||E.navigator.mozConnection||E.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const l=a.downlink*1e3*1e3;l>=o&&n>=o?n=Math.max(n,l):n=l}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){A.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>gi(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>gi(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&_C({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{nC(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=E.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"),gC({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3,metadata:{errorType:A.Error.EMEKeySessionCreationError}})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=yC({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",s=>{this.playlistController_.updatePlaylistByKeyStatus(s.keyId,s.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=A.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{fC(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Lp(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Ip,"mux.js":lC,"mpd-parser":cC,"m3u8-parser":dC,"aes-decrypter":hC}}version(){return this.constructor.version()}canChangeType(){return Ap.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&E.URL.revokeObjectURL&&(E.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return Ax({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,s=!0,r=2){return up({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:s,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{Rp(this.xhr,e)},this.xhr.onResponse=e=>{Mp(this.xhr,e)},this.xhr.offRequest=e=>{Np(this.xhr,e)},this.xhr.offResponse=e=>{Bp(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}}const wn={name:"videojs-http-streaming",VERSION:Ip,canHandleSource(i,e={}){const t=se(A.options,e);return wn.canPlayType(i.type,t)},handleSource(i,e,t={}){const s=se(A.options,t);return e.vhs=new Fp(i,e,s),e.vhs.xhr=sp(),e.vhs.setupXhrHooks_(),e.vhs.src(i.src,i.type),e.vhs},canPlayType(i,e){const t=Rd(i);if(!t)return"";const s=wn.getOverrideNative(e);return!ge.supportsTypeNatively(t)||s?"maybe":""},getOverrideNative(i={}){const{vhs:e={}}=i,t=!(A.browser.IS_ANY_SAFARI||A.browser.IS_IOS),{overrideNative:s=t}=e;return s}},bC=()=>Zr("avc1.4d400d,mp4a.40.2");bC()&&A.getTech("Html5").registerSourceHandler(wn,0);A.VhsHandler=Fp;A.VhsSourceHandler=wn;A.Vhs=ge;A.use||A.registerComponent("Vhs",ge);A.options.vhs=A.options.vhs||{};(!A.getPlugin||!A.getPlugin("reloadSourceOnError"))&&A.registerPlugin("reloadSourceOnError",uC);/*! @name videojs-contrib-eme @version 3.11.2 @license Apache-2.0 */function kn(){return kn=Object.assign||function(i){for(var e=1;e=400&&r.statusCode<=599){var a=n;t&&(a=String.fromCharCode.apply(null,new Uint8Array(n))),e({cause:a});return}e(null,n)}});var AC=function(e){var t=String.fromCharCode.apply(null,new Uint16Array(e)),s=new E.DOMParser().parseFromString(t,"application/xml"),r=s.getElementsByTagName("HttpHeaders")[0],n={};if(r)for(var a=r.getElementsByTagName("name"),o=r.getElementsByTagName("value"),l=0;l"u"){s.mediaKeysObject=null,s.pendingSessionData=[];var y,T;m=new Promise(function(S,_){if(s.keySystem=a.keySystem,T=ud(a.keySystem,o.keySystems[a.keySystem]),!T.getCertificate){S(a);return}T.getCertificate(o,function(D,w){if(D){_(D);return}y=w,S()})}).then(function(){return a.createMediaKeys()}).then(function(S){return IC({player:t,video:s,certificate:y,createdMediaKeys:S})}).catch(function(S){return S?Promise.reject(S):Promise.reject("Failed to create and initialize a MediaKeys object")})}return m.then(function(){var S=ud(s.keySystem,o.keySystems[s.keySystem]),_=S.getLicense;return kC({player:t,video:s,initDataType:r,initData:n,options:o,getLicense:s.keySystem?OC(_,f):null,removeSession:l,eventBus:f})})},Ru="com.apple.fps.1_0",MC=function(e){var t=e.initData,s=e.id,r=e.cert;typeof s=="string"&&(s=SC(s));var n=0,a=new ArrayBuffer(t.byteLength+4+s.byteLength+4+r.byteLength),o=new DataView(a),l=new Uint8Array(a,n,t.byteLength);l.set(t),n+=t.byteLength,o.setUint32(n,s.byteLength,!0),n+=4;var f=new Uint16Array(a,n,s.length);f.set(s),n+=f.byteLength,o.setUint32(n,r.byteLength,!0),n+=4;var m=new Uint8Array(a,n,r.byteLength);return m.set(r),new Uint8Array(a,0,a.byteLength)},NC=function(e){var t=e.video,s=e.contentId,r=e.initData,n=e.cert,a=e.options,o=e.getLicense,l=e.eventBus;return new Promise(function(f,m){if(!t.webkitKeys)try{t.webkitSetMediaKeys(new E.WebKitMediaKeys(Ru))}catch{m("Could not create MediaKeys");return}var y;try{y=t.webkitKeys.createSession("video/mp4",MC({id:s,initData:r,cert:n}))}catch{m("Could not create key session");return}l.trigger("keysessioncreated"),y.contentId=s,y.addEventListener("webkitkeymessage",function(T){o(a,s,T.message,function(S,_){if(l&&l.trigger("licenserequestattempted"),S){m(S);return}y.update(new Uint8Array(_))})}),y.addEventListener("webkitkeyadded",function(){f()}),y.addEventListener("webkitkeyerror",function(){var T=y.error;m("KeySession error: code "+T.code+", systemCode "+T.systemCode)})})},BC=function(e){return function(t,s){var r=ta(t.emeHeaders,e.certificateHeaders);A.xhr({uri:e.certificateUri,responseType:"arraybuffer",headers:r},os(function(n,a){if(n){s(n);return}s(null,new Uint8Array(a))}))}},FC=function(e,t){return EC(xC(t))},UC=function(e){return function(t,s,r,n){var a=ta({"Content-type":"application/octet-stream"},t.emeHeaders,e.licenseHeaders);A.xhr({uri:e.licenseUri,method:"POST",responseType:"arraybuffer",body:r,headers:a},os(n,!0))}},$C=function(e){var t=e.video,s=e.initData,r=e.options,n=e.eventBus,a=r.keySystems[Ru],o=a.getCertificate||BC(a),l=a.getContentId||FC,f=a.getLicense||UC(a);return new Promise(function(m,y){o(r,function(T,S){if(T){y(T);return}m(S)})}).then(function(m){return NC({video:t,cert:m,initData:s,getLicense:f,options:r,contentId:l(r,s),eventBus:n})})},ji="com.microsoft.playready",jC=function(e,t,s,r){var n=e.keySystems[ji];if(typeof n.getKey=="function"){n.getKey(e,s.destinationURL,s.message.buffer,function(o,l){if(o){r.trigger({message:"Unable to get key: "+o,target:t,type:"mskeyerror"});return}t.update(l)});return}typeof n=="string"?n={url:n}:typeof n=="boolean"&&(n={}),n.url||(n.url=s.destinationURL);var a=function(l,f){if(r&&r.trigger("licenserequestattempted"),l){r.trigger({message:"Unable to request key from url: "+n.url,target:t,type:"mskeyerror"});return}t.update(new Uint8Array(f))};n.getLicense?n.getLicense(e,s.message.buffer,a):Up(n,s.message.buffer,e,a)},qC=function(e,t,s,r){var n=e.msKeys.createSession("video/mp4",t);if(!n)throw new Error("Could not create key session.");r.trigger("keysessioncreated"),n.addEventListener("mskeymessage",function(a){jC(s,n,a,r)}),n.addEventListener("mskeyerror",function(a){r.trigger({message:"Unexpected key error from key session with "+("code: "+n.error.code+" and systemCode: "+n.error.systemCode),target:n,type:"mskeyerror"})}),n.addEventListener("mskeyadded",function(){r.trigger({target:n,type:"mskeyadded"})})},VC=function(i){var e=i.video,t=i.initData,s=i.options,r=i.eventBus;e.msKeys&&delete e.msKeys;try{e.msSetMediaKeys(new E.MSMediaKeys(ji))}catch(n){throw new Error("Unable to create media keys for PlayReady key system. Error: "+n.message)}qC(e,t,s,r)},HC="3.11.2",GC=function(e,t){for(var s=0;s=0)&&(t[r]=i[r]);return t}function dd(i,e){if(i==null)return{};var t=ZC(i,e),s,r;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(i,s)&&(t[s]=i[s])}return t}var eA="1.12.1";const tA=A.getComponent("player");class iA extends tA{constructor(e,t,s){t=A.obj.merge(t,{plugins:{eme:!0}}),super(e,t,s)}audioTrack(e){const t=Array.from(this.player().audioTracks());if(!e)return t.find(a=>a.enabled);const{kind:s,language:r}=e,n=t.find(a=>a.language===r&&a.kind===s)||t.find(a=>a.language===r);return n&&(n.enabled=!0),n}bufferedRanges(){const e=[];for(let t=0;t!["chapters","metadata"].includes(a.kind));if(!e)return t.find(a=>a.mode==="showing");t.forEach(a=>a.mode="disabled");const{kind:s,language:r}=e;return t.find(a=>(a.language===r&&a.kind===s&&(a.mode="showing"),a.mode==="showing"))||t.find(a=>(a.language===r&&(a.mode="showing"),a.mode==="showing"))}}A.registerComponent("player",iA);const ye=A;ye.VERSION={pillarbox:eA,videojs:A.VERSION,[A.VhsSourceHandler.name]:A.VhsSourceHandler.VERSION,eme:A.getPlugin("eme").VERSION};ye.options.enableSmoothSeeking=!0;ye.options.fill=!0;ye.options.html5={vhs:{useForcedSubtitles:!0}};ye.options.liveTracker={trackingThreshold:120,liveTolerance:15};ye.options.liveui=!0;ye.options.playsinline=!0;ye.options.responsive=!0;ye.options.trackers={};class hd{constructor(e="il.srgssr.ch"){this.setIlHost(e)}setIlHost(e){this.baseUrl=`${e}/integrationlayer/2.1/`}handleRequest(e){var t=this;return function(){var s=Ni(function*(r){const n=typeof e=="function"?e(r):t.mediaCompositionUrlHandler(r),a=yield fetch(n);if(!a.ok)throw a;return yield a.json()});return function(r){return s.apply(this,arguments)}}()}mediaCompositionUrlHandler(e){return`https://${this.baseUrl}mediaComposition/byUrn/${e}?onlyChapters=true&vector=portalplay`}}const Ri={WIDTH_240:"240",WIDTH_320:"320",WIDTH_480:"480",WIDTH_960:"960",WIDTH_1920:"1920"},Qr={JPG:"jpg",WEBP:"webp",PNG:"png"},sA="https://il.srgssr.ch/images/";class rA{static scale({url:e,width:t=Ri.WIDTH_960,format:s=Qr.JPG}={},r=sA){if(!e)return;const n=new URL(r);return n.searchParams.set("imageUrl",e),n.searchParams.set("format",s),n.searchParams.set("width",t),decodeURIComponent(n.href)}static get JPG(){return Qr.JPG}static get PNG(){return Qr.PNG}static get WEBP(){return Qr.WEBP}static get WIDTH_240(){return Ri.WIDTH_240}static get WIDTH_320(){return Ri.WIDTH_320}static get WIDTH_480(){return Ri.WIDTH_480}static get WIDTH_960(){return Ri.WIDTH_960}static get WIDTH_1920(){return Ri.WIDTH_1920}}const nA={WIDEVINE:"com.widevine.alpha",FAIRPLAY:"com.apple.fps.1_0",PLAYREADY:"com.microsoft.playready"};class rr{static buildKeySystems(e=[]){const t={};return e.forEach(s=>{const r=rr.vendors[s.type];if(rr.vendors.FAIRPLAY===r){const{certificateUrl:n,licenseUrl:a}=s;t[r]={certificateUri:n,licenseUri:a}}else t[r]=s.licenseUrl}),{keySystems:t}}static hasDrm(e){return e.some(({drmList:t})=>t&&t.length>0)}static get vendors(){return nA}}const Jr={AKAMAI:"AKAMAI",NONE:"NONE"};class Ti{static aclPath(e){const t=e.pathname;return`${t.substring(0,t.lastIndexOf("/")+1)}*`}static get AKAMAI(){return Jr.AKAMAI}static hasToken(e){return e.some(t=>Ti.isAkamai(t.tokenType))}static isAkamai(e){return Jr.AKAMAI===e}static isNone(e){return Jr.NONE===e}static get NONE(){return Jr.NONE}static tokenize(e,t){const s=new URL(`${e.url}`),r=Ti.aclPath(s),n=`${t}${encodeURIComponent(r)}`;return fetch(n).then(a=>a.ok?a.json():Promise.reject({status:a.status,statusText:a.statusText})).then(({token:{authparams:a}})=>(new URLSearchParams(a).forEach((l,f)=>s.searchParams.set(f,l)),Object.assign({},e,{url:s.toString()}))).catch(a=>Promise.reject(a))}static tokenizeSources(e,t="https://tp.srgssr.ch/akahd/token?acl="){const s=[];return e.forEach(r=>{const n=Ti.tokenize(r,t);s.push(n)}),Promise.all(s).then(r=>r).catch(r=>Promise.reject(r))}}const fd="emptied",pd="ended",md="loadeddata",gd="loadstart",Xa="pause",aA="play",Ya="playing",yd="ratechange",_d="seeking",Qa="timeupdate",vd="waiting";class pi{constructor(e,{debug:t=!1,environment:s="prod",playerVersion:r="none",tagCommanderScriptURL:n="//colibri-js.akamaized.net/penguin/tc_SRGGD_11.js"}={}){this.isDebugEnabled=t,this.elapsedPlaybackTime=0,this.environment=s,this.hasStarted=!1,this.heartBeatIntervalId=void 0,this.initialized=!1,this.isSeeking=!1,this.isWaiting=!1,this.mediaSession=0,this.pendingQueue=[],this.pendingTagCommanderReload=!1,this.player=e,this.playerVersion=r,this.srcMediaData=void 0,this.startPlaybackSession=0,this.tagCommanderScriptURL=n,this.trackedCurrentTime=0,this.uptimeIntervalId=void 0,this.initScript(),this.initListeners()}beforeunload(){this.notify("stop")}clearTimers(){clearInterval(this.heartBeatIntervalId),clearInterval(this.uptimeIntervalId),clearTimeout(this.uptimeTimeoutId)}currentTime(){return Math.round(this.trackedCurrentTime)}debug(e){if(e===void 0)return this.isDebugEnabled||this.player.debug();this.isDebugEnabled=!!e}destroy(){this.clearTimers(),window.tc_vars||(window.tc_vars={}),this.elapsedPlaybackTime=0,this.hasStarted=!1,this.heartBeatIntervalId=void 0,this.initialized=!1,this.isWaiting=!1,this.mediaSession=0,this.pendingQueue=[],this.srcMediaData=void 0,this.startPlaybackSession=0,this.trackedCurrentTime=0,this.uptimeIntervalId=void 0}dispose(){this.beforeunload(),this.clearTimers(),window.removeEventListener("beforeunload",this.beforeunloadListener),this.player.off(fd,this.emptiedListener),this.player.off(pd,this.endedListener),this.player.off(gd,this.loadstartListener),this.player.off(md,this.loadeddataListener),this.player.off(Ya,this.playListener),this.player.off(Xa,this.pauseListener),this.player.off(yd,this.rateChangeListener),this.player.off(_d,this.seekingListener),this.player.off(Qa,this.timeUpdateListener),this.player.off(vd,this.waitingListener)}emptied(){this.player.ended()||this.notify("stop")}ended(){this.notify("eof"),this.mediaSession=0,this.clearTimers()}flush(){this.isTrackerDisabled()||(this.pendingTagCommanderReload&&window.tC&&(window.tC.container.reload(),this.pendingTagCommanderReload=!1),window.tc_events_11&&this.pendingQueue.length>0&&(this.pendingQueue.forEach(e=>{window.tc_events_11(this.player.el(),e.action,e.labels)}),this.pendingQueue=[]))}getCurrentAudioTrack(){const e=Array.from(this.player.audioTracks()).find(s=>s.enabled);let t="und";return e&&e.language&&(t=e.language),e?t.toUpperCase():""}getCurrentTextTrack(){const e=this.player.textTrack();let t="und";return e&&e.language&&(t=e.language),e?t.toUpperCase():""}getDvrWindowPosition(){const{liveTracker:e}=this.player,t=this.currentTime()-e.seekableStart()|0,s=e.liveWindow()-t;return s<0||s===1/0?0:s*1e3}getDvrWindowSize(){const e=this.player.liveTracker.liveWindow()===1/0,t=this.player.liveTracker.liveWindow()*1e3;return e?0:t}getElapsedPlaybackTime(){return this.startPlaybackSession?this.getElapsedPlayingTime():this.elapsedPlaybackTime}getElapsedPlayingTime(){const e=pi.now()-this.startPlaybackSession|0;return this.elapsedPlaybackTime+e}getEventLabels(e){const t={event_id:e,event_timestamp:pi.now(),media_dvr_window_length:0,media_dvr_window_offset:0,media_is_dvr:!1,media_is_live:!1,media_mute:this.player.muted()?"1":"0",media_playback_rate:this.player.playbackRate(),media_position:this.currentTime(),media_quality:this.srcMediaData.mediaData.quality,media_subtitles_on:this.isTextTrackEnabled(),media_volume:(this.player.volume()*100).toFixed(0),navigation_environment:this.environment};return this.isAudioTrackEnabled()&&(t.media_audio_track=this.getCurrentAudioTrack()),this.isTextTrackEnabled()&&(t.media_subtitle_selection=this.getCurrentTextTrack()),this.isMediaOnDemand()||(t.media_is_live=!0,t.media_position=this.getElapsedPlaybackTime()),this.isMediaDvr()&&(t.media_dvr_window_offset=this.getDvrWindowPosition()|0,t.media_dvr_window_length=this.getDvrWindowSize()|0,t.media_is_dvr=!0,t.media_timeshift=[aA,Xa].includes(e)?this.timeShifted():0),t}getInternalLabels(){const e={media_bu_distributer:this.srcMediaData.mediaData.vendor,media_chromecast_selected:!!this.player.tech(!0).isCasting,media_embedding_url:document.referrer,media_player_display:"default",media_player_name:"pillarbox-web",media_player_version:this.playerVersion,media_url:this.srcMediaData.src},t=this.srcMediaData.mediaData.analyticsMetadata||{};window.tc_vars=Object.assign({},window.tc_vars,e,t)}heartBeat(){this.heartBeatIntervalId=setInterval(()=>{this.player.paused()||this.notify("pos")},3e4)}initCallbacks(){this.beforeunloadListener=this.beforeunload.bind(this),this.emptiedListener=this.emptied.bind(this),this.endedListener=this.ended.bind(this),this.loadstartListener=this.loadstart.bind(this),this.loadeddataListener=this.loadeddata.bind(this),this.playListener=this.play.bind(this),this.pauseListener=this.pause.bind(this),this.rateChangeListener=this.rateChange.bind(this),this.seekingListener=this.seeking.bind(this),this.timeUpdateListener=this.timeUpdate.bind(this),this.waitingListener=this.waiting.bind(this)}initListeners(){this.initCallbacks(),window.addEventListener("beforeunload",this.beforeunloadListener),this.player.on(fd,this.emptiedListener),this.player.on(pd,this.endedListener),this.player.on(gd,this.loadstartListener),this.player.on(md,this.loadeddataListener),this.player.on(Ya,this.playListener),this.player.on(Xa,this.pauseListener),this.player.on(yd,this.rateChangeListener),this.player.on(_d,this.seekingListener),this.player.on(Qa,this.timeUpdateListener),this.player.on(vd,this.waitingListener),this.player.one("dispose",this.dispose.bind(this))}initScript(){const e="tc_script__11";if(!document.querySelector(`#${e}`)){const t=document.createElement("script"),s=this.tagCommanderScriptURL;t.defer=!0,t.id=e,t.src=s,t.type="text/javascript",t.onload=r=>{this.flush()},document.body.appendChild(t)}}isAudioTrackEnabled(){return!!this.getCurrentAudioTrack()}isMediaDvr(){const{trackingThreshold:e}=this.player.liveTracker.options();return!this.isMediaOnDemand()&&ethis.player.liveTracker.liveWindow()}isMediaOnDemand(){return Number.isFinite(this.player.duration())}isTextTrackEnabled(){return!!this.getCurrentTextTrack()}isTrackerDisabled(){return!this.srcMediaData||!this.srcMediaData.mediaData?!0:Array.isArray(this.srcMediaData.disableTrackers)?!!this.srcMediaData.disableTrackers.find(e=>e.toLowerCase()===pi.name.toLowerCase()):!!this.srcMediaData.disableTrackers}loadstart(){this.destroy(),this.updateSrcMediaData(this.player.currentSource()),!this.isTrackerDisabled()&&(this.getInternalLabels(),this.reloadTagCommanderContainer(),this.notify("buffer_start"),this.hasStarted=!1)}loadeddata(){this.notify("init"),this.initialized=!0,this.notify("buffer_stop")}log(e,t,s="log"){this.debug()&&console[s](`SRGAnalytics:${e}`,t,window.tc_vars)}notify(e,t){if(this.isTrackerDisabled())return;try{this.flush()}catch(r){this.log(e,r,"error")}const s=Object.assign({},this.getEventLabels(e),t);this.log(e,s);try{window.tc_events_11?window.tc_events_11(this.player.el(),e,s):this.pendingQueue.push({action:e,labels:s})}catch(r){this.log(e,r,"error")}}static now(){return(Date.now()/1e3).toFixed(0)}play(){this.hasStarted||(this.hasStarted=!0),!this.startPlaybackSession&&!this.isMediaOnDemand()&&(this.startPlaybackSession=pi.now()),this.mediaSession===0&&(this.mediaSession=pi.now(),this.heartBeat(),this.uptime()),this.timeUpdate(),this.notify("play"),this.isSeeking&&(this.isSeeking=!1)}pause(){if(this.isMediaOnDemand()||(this.elapsedPlaybackTime=this.getElapsedPlayingTime(),this.startPlaybackSession=0),!this.player.seeking()&&!this.isMediaLive()&&this.player.currentTime(){!this.player.paused()&&!this.isMediaOnDemand()&&this.notify("uptime")};this.uptimeTimeoutId=setTimeout(()=>{e(),this.uptimeIntervalId=setInterval(()=>{e()},6e4)},3e4)}waiting(){if(!this.initialized||this.isWaiting)return;const e=()=>{this.isWaiting=!1,this.notify("buffer_stop")};this.isWaiting=!0,this.notify("buffer_start"),ye.browser.IS_ANY_SAFARI?this.player.one(Qa,e):this.player.one(Ya,e)}}class oA{findChapterByUrn(e){if(this.chapterList){const[t]=this.chapterList.filter(s=>s.urn===e);return t}}findMainSegment(){if(!this.segmentUrn)return;const e=this.getMainSegments(),[t]=e.filter(s=>s.urn===this.segmentUrn);return t}findResourceListByUrn(e){const t=this.findChapterByUrn(e);if(t)return t.resourceList||[]}getChapters(){const e="AUDIO";return this.getMainChapter().mediaType===e?[]:this.chapterList.filter(({mediaType:t})=>t!==e)}getFilteredExternalSubtitles(){const{subtitleList:e}=this.getMainChapter(),[{subtitleInformationList:t}={}]=this.getResourceList().filter(({subtitleInformationList:n})=>n),s=e&&!t;if(!e)return[];const r=e.filter(n=>n.format!=="TTML");return s?r:r.filter(n=>!t.find(o=>o.locale===n.locale&&n.type===o.type))}getMainBlockReason(){const e=this.getMainChapter();if(!e)return;let{blockReason:t}=e;return!t&&new Datee.blockReason)}getMainChapter(){return this.mainChapter||(this.mainChapter=this.findChapterByUrn(this.chapterUrn)),!this.mainChapter&&this.chapterList&&this.chapterList.length>0&&([this.mainChapter]=this.chapterList),this.mainChapter}getMainChapterImageUrl(){const e=this.getMainChapter();if(!(!e||!e.imageUrl))return e.imageUrl}getMainResources(){const e=this.getResourceList();if(!(!e||!e.length))return e.map(t=>({analyticsData:this.getMergedAnalyticsData(t.analyticsData),analyticsMetadata:this.getMergedAnalyticsMetadata(t.analyticsMetadata),blockReason:this.getMainChapter().blockReason,blockedSegments:this.getMainBlockedSegments(),imageUrl:this.getMainChapterImageUrl(),chapters:this.getChapters(),drmList:t.drmList,dvr:t.dvr,eventData:this.getMainChapter().eventData,id:this.getMainChapter().id,imageCopyright:this.getMainChapter().imageCopyright,intervals:this.getMainTimeIntervals(),live:t.live,mediaType:this.getMainChapter().mediaType,mimeType:t.mimeType,presentation:t.presentation,quality:t.quality,streaming:t.streaming,streamOffset:t.streamOffset,subtitles:this.getFilteredExternalSubtitles(),title:this.getMainChapter().title,tokenType:t.tokenType,url:t.url,urn:this.chapterUrn,vendor:this.getMainChapter().vendor}))}getMainSegments(){const e=this.getMainChapter();return!this.mainSegments&&e&&e.segmentList&&(this.mainSegments=e.segmentList),this.mainSegments||[]}getMainTimeIntervals(){const{timeIntervalList:e=[]}=this.getMainChapter()||{};return e}getMainValidFromDate(){const e=this.getMainChapter();if(!e)return new Date(0);const{validFrom:t}=e;if(t)return new Date(t)}getMergedAnalyticsData(e){return Pe(Pe(Pe({},this.analyticsData),this.getMainChapter().analyticsData),e)}getMergedAnalyticsMetadata(e){return Pe(Pe(Pe({},this.analyticsMetadata),this.getMainChapter().analyticsMetadata),e)}getResourceList(){const{resourceList:e}=this.getMainChapter();return e||[]}}var Hp="Wiedergabe",Gp="Pause",zp="Erneut abspielen",Wp="Dauer",Kp="LIVE",Xp="Geladen",Yp="Status",Qp="Vollbild",Jp="Stumm schalten",Zp="Ton einschalten",em="Untertitel",tm="Untertitel",im="Kapitel",sm="Schließen",rm="Beschreibungen",nm="Schrift",am="Weiß",om="Schwarz",um="Rot",lm="Grün",cm="Blau",dm="Gelb",hm="Magenta",fm="Türkis",pm="Hintergrund",mm="Fenster",gm="Durchsichtig",ym="Undurchsichtig",_m="Kein",vm="Erhoben",Tm="Gedrückt",bm="Uniform",Sm="Zwanglos",xm="Schreibschrift",Em="Zurücksetzen",Cm="Fertig",Am="Farbe",Dm="Deckkraft",uA={Play:Hp,Pause:Gp,Replay:zp,"Current Time":"Aktueller Zeitpunkt",Duration:Wp,"Remaining Time":"Verbleibende Zeit","Stream Type":"Streamtyp",LIVE:Kp,Loaded:Xp,Progress:Yp,Fullscreen:Qp,"Exit Fullscreen":"Vollbildmodus beenden",Mute:Jp,Unmute:Zp,"Playback Rate":"Wiedergabegeschwindigkeit",Subtitles:em,"subtitles off":"Untertitel aus",Captions:tm,"captions off":"Untertitel aus",Chapters:im,"You aborted the media playback":"Sie haben die Videowiedergabe abgebrochen.","A network error caused the media download to fail part-way.":"Der Videodownload ist aufgrund eines Netzwerkfehlers fehlgeschlagen.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"Die Videowiedergabe wurde entweder wegen eines Problems mit einem beschädigten Video oder wegen verwendeten Funktionen, die vom Browser nicht unterstützt werden, abgebrochen.","No compatible source was found for this media.":"Für dieses Video wurde keine kompatible Quelle gefunden.","Play Video":"Video abspielen",Close:sm,"Modal Window":"Modales Fenster","This is a modal window":"Dies ist ein modales Fenster","This modal can be closed by pressing the Escape key or activating the close button.":'Durch Drücken der Esc-Taste bzw. Betätigung der Schaltfläche "Schließen" wird dieses modale Fenster geschlossen.',", opens captions settings dialog":", öffnet Einstellungen für Untertitel",", opens subtitles settings dialog":", öffnet Einstellungen für Untertitel",", selected":", ausgewählt","captions settings":"Untertiteleinstellungen","subtitles settings":"Untertiteleinstellungen","descriptions settings":"Einstellungen für Beschreibungen","Close Modal Dialog":"Modales Fenster schließen",Descriptions:rm,"descriptions off":"Beschreibungen aus","The media is encrypted and we do not have the keys to decrypt it.":"Die Entschlüsselungsschlüssel für den verschlüsselten Medieninhalt sind nicht verfügbar.",", opens descriptions settings dialog":", öffnet Einstellungen für Beschreibungen","Audio Track":"Tonspur",Text:nm,White:am,Black:om,Red:um,Green:lm,Blue:cm,Yellow:dm,Magenta:hm,Cyan:fm,Background:pm,Window:mm,Transparent:gm,"Semi-Transparent":"Halbdurchsichtig",Opaque:ym,"Font Size":"Schriftgröße","Text Edge Style":"Textkantenstil",None:_m,Raised:vm,Depressed:Tm,Uniform:bm,"Drop shadow":"Schlagschatten","Font Family":"Schriftfamilie","Proportional Sans-Serif":"Proportionale Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportionale Serif","Monospace Serif":"Monospace Serif",Casual:Sm,Script:xm,"Small Caps":"Small-Caps",Reset:Em,"restore all settings to the default values":"Alle Einstellungen auf die Standardwerte zurücksetzen",Done:Cm,"Caption Settings Dialog":"Einstellungsdialog für Untertitel","Beginning of dialog window. Escape will cancel and close the window.":"Anfang des Dialogfensters. Esc bricht ab und schließt das Fenster.","End of dialog window.":"Ende des Dialogfensters.","Audio Player":"Audio-Player","Video Player":"Video-Player","Progress Bar":"Fortschrittsbalken","progress bar timing: currentTime={1} duration={2}":"{1} von {2}","Volume Level":"Lautstärke","{1} is loading.":"{1} wird geladen.","Seek to live, currently behind live":"Zur Live-Übertragung wechseln. Aktuell wird es nicht live abgespielt.","Seek to live, currently playing live":"Zur Live-Übertragung wechseln. Es wird aktuell live abgespielt.","Exit Picture-in-Picture":"Bild-im-Bild-Modus beenden","Picture-in-Picture":"Bild-im-Bild-Modus","No content":"Kein Inhalt",Color:Am,Opacity:Dm,"Text Background":"Texthintergrund","Caption Area Background":"Hintergrund des Untertitelbereichs","Playing in Picture-in-Picture":"Wird im Bild-im-Bild-Modus wiedergegeben","Skip forward {1} seconds":"{1} Sekunden vorwärts","Skip backward {1} seconds":"{1} Sekunden zurück"},lA=Object.freeze({__proto__:null,Background:pm,Black:om,Blue:cm,Captions:tm,Casual:Sm,Chapters:im,Close:sm,Color:Am,Cyan:fm,Depressed:Tm,Descriptions:rm,Done:Cm,Duration:Wp,Fullscreen:Qp,Green:lm,LIVE:Kp,Loaded:Xp,Magenta:hm,Mute:Jp,None:_m,Opacity:Dm,Opaque:ym,Pause:Gp,Play:Hp,Progress:Yp,Raised:vm,Red:um,Replay:zp,Reset:Em,Script:xm,Subtitles:em,Text:nm,Transparent:gm,Uniform:bm,Unmute:Zp,White:am,Window:mm,Yellow:dm,default:uA}),wm="Aus Gründen des Jugendschutzes steht dieser Inhalt nur zwischen 20:00 und 06:00 Uhr zur Verfügung.",km="Aus Gründen des Jugendschutzes steht dieser Inhalt nur zwischen 23:00 und 05:00 Uhr zur Verfügung.",Im="Die Werbung wurde übersprungen.",Pm="Dieser Inhalt ist nicht mehr verfügbar.",Lm="Dieser Inhalt ist ausserhalb der Schweiz nicht verfügbar.",Om="Dieser Inhalt ist aus rechtlichen Gründen nicht verfügbar.",Rm="Dieser Inhalt ist noch nicht verfügbar. Bitte probieren Sie es später noch einmal.",Mm="Dieser Inhalt ist nicht verfügbar.",cA={AGERATING12:wm,AGERATING18:km,COMMERCIAL:Im,ENDDATE:Pm,GEOBLOCK:Lm,LEGAL:Om,STARTDATE:Rm,UNKNOWN:Mm},dA=Object.freeze({__proto__:null,AGERATING12:wm,AGERATING18:km,COMMERCIAL:Im,ENDDATE:Pm,GEOBLOCK:Lm,LEGAL:Om,STARTDATE:Rm,UNKNOWN:Mm,default:cA});ye.addLanguage("de",Pe(Pe({},lA),dA));var Nm="Play",Bm="Pause",Fm="Replay",Um="Duration",$m="LIVE",jm="Loaded",qm="Progress",Vm="Fullscreen",Hm="Mute",Gm="Unmute",zm="Subtitles",Wm="Captions",Km="Chapters",Xm="Descriptions",Ym="Close",Qm="Text",Jm="White",Zm="Black",eg="Red",tg="Green",ig="Blue",sg="Yellow",rg="Magenta",ng="Cyan",ag="Background",og="Window",ug="Transparent",lg="Opaque",cg="None",dg="Raised",hg="Depressed",fg="Uniform",pg="Casual",mg="Script",gg="Reset",yg="Done",_g="Color",vg="Opacity",hA={"Audio Player":"Audio Player","Video Player":"Video Player",Play:Nm,Pause:Bm,Replay:Fm,"Current Time":"Current Time",Duration:Um,"Remaining Time":"Remaining Time","Stream Type":"Stream Type",LIVE:$m,"Seek to live, currently behind live":"Seek to live, currently behind live","Seek to live, currently playing live":"Seek to live, currently playing live",Loaded:jm,Progress:qm,"Progress Bar":"Progress Bar","progress bar timing: currentTime={1} duration={2}":"{1} of {2}",Fullscreen:Vm,"Exit Fullscreen":"Exit Fullscreen",Mute:Hm,Unmute:Gm,"Playback Rate":"Playback Rate",Subtitles:zm,"subtitles off":"subtitles off",Captions:Wm,"captions off":"captions off",Chapters:Km,Descriptions:Xm,"descriptions off":"descriptions off","Audio Track":"Audio Track","Volume Level":"Volume Level","You aborted the media playback":"You aborted the media playback","A network error caused the media download to fail part-way.":"A network error caused the media download to fail part-way.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"The media could not be loaded, either because the server or network failed or because the format is not supported.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.","No compatible source was found for this media.":"No compatible source was found for this media.","The media is encrypted and we do not have the keys to decrypt it.":"The media is encrypted and we do not have the keys to decrypt it.","Play Video":"Play Video",Close:Ym,"Close Modal Dialog":"Close Modal Dialog","Modal Window":"Modal Window","This is a modal window":"This is a modal window","This modal can be closed by pressing the Escape key or activating the close button.":"This modal can be closed by pressing the Escape key or activating the close button.",", opens captions settings dialog":", opens captions settings dialog",", opens subtitles settings dialog":", opens subtitles settings dialog",", opens descriptions settings dialog":", opens descriptions settings dialog",", selected":", selected","captions settings":"captions settings","subtitles settings":"subtitles settings","descriptions settings":"descriptions settings",Text:Qm,White:Jm,Black:Zm,Red:eg,Green:tg,Blue:ig,Yellow:sg,Magenta:rg,Cyan:ng,Background:ag,Window:og,Transparent:ug,"Semi-Transparent":"Semi-Transparent",Opaque:lg,"Font Size":"Font Size","Text Edge Style":"Text Edge Style",None:cg,Raised:dg,Depressed:hg,Uniform:fg,"Drop shadow":"Drop shadow","Font Family":"Font Family","Proportional Sans-Serif":"Proportional Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportional Serif","Monospace Serif":"Monospace Serif",Casual:pg,Script:mg,"Small Caps":"Small Caps",Reset:gg,"restore all settings to the default values":"restore all settings to the default values",Done:yg,"Caption Settings Dialog":"Caption Settings Dialog","Beginning of dialog window. Escape will cancel and close the window.":"Beginning of dialog window. Escape will cancel and close the window.","End of dialog window.":"End of dialog window.","{1} is loading.":"{1} is loading.","Exit Picture-in-Picture":"Exit Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture","No content":"No content",Color:_g,Opacity:vg,"Text Background":"Text Background","Caption Area Background":"Caption Area Background","Playing in Picture-in-Picture":"Playing in Picture-in-Picture","Skip backward {1} seconds":"Skip backward {1} seconds","Skip forward {1} seconds":"Skip forward {1} seconds"},fA=Object.freeze({__proto__:null,Background:ag,Black:Zm,Blue:ig,Captions:Wm,Casual:pg,Chapters:Km,Close:Ym,Color:_g,Cyan:ng,Depressed:hg,Descriptions:Xm,Done:yg,Duration:Um,Fullscreen:Vm,Green:tg,LIVE:$m,Loaded:jm,Magenta:rg,Mute:Hm,None:cg,Opacity:vg,Opaque:lg,Pause:Bm,Play:Nm,Progress:qm,Raised:dg,Red:eg,Replay:Fm,Reset:gg,Script:mg,Subtitles:zm,Text:Qm,Transparent:ug,Uniform:fg,Unmute:Gm,White:Jm,Window:og,Yellow:sg,default:hA}),Tg="To protect children this content is only available between 8PM and 6AM.",bg="To protect children this content is only available between 10PM and 5AM.",Sg="This commercial content is not available.",xg="This content is not available anymore.",Eg="This content is not available outside Switzerland.",Cg="This content is not available due to legal restrictions.",Ag="This content is not available yet.",Dg="This content is not available.",pA={AGERATING12:Tg,AGERATING18:bg,COMMERCIAL:Sg,ENDDATE:xg,GEOBLOCK:Eg,LEGAL:Cg,STARTDATE:Ag,UNKNOWN:Dg},mA=Object.freeze({__proto__:null,AGERATING12:Tg,AGERATING18:bg,COMMERCIAL:Sg,ENDDATE:xg,GEOBLOCK:Eg,LEGAL:Cg,STARTDATE:Ag,UNKNOWN:Dg,default:pA});ye.addLanguage("en",Pe(Pe({},fA),mA));var wg="Lecture",kg="Pause",Ig="Revoir",Pg="Durée",Lg="EN DIRECT",Og="Chargé",Rg="Progression",Mg="Plein écran",Ng="Mettre en sourdine",Bg="Activer le son",Fg="Sous-titres",Ug="Sous-titres transcrits",$g="Chapitres",jg="Descriptions",qg="Fermer",Vg="Texte",Hg="Blanc",Gg="Noir",zg="Rouge",Wg="Vert",Kg="Bleu",Xg="Jaune",Yg="Magenta",Qg="Cyan",Jg="Arrière-plan",Zg="Fenêtre",e0="Transparent",t0="Opaque",i0="Aucun",s0="Élevé",r0="Enfoncé",n0="Uniforme",a0="Manuscrite",o0="Scripte",u0="Réinitialiser",l0="Terminé",c0="Couleur",d0="Opacité",gA={"Audio Player":"Lecteur audio","Video Player":"Lecteur vidéo",Play:wg,Pause:kg,Replay:Ig,"Current Time":"Temps actuel",Duration:Pg,"Remaining Time":"Temps restant","Stream Type":"Type de flux",LIVE:Lg,"Seek to live, currently behind live":"Rechercher le direct, actuellement après le direct","Seek to live, currently playing live":"Rechercher le direct, le direct actuellement en cours de lecture",Loaded:Og,Progress:Rg,"Progress Bar":"Barre de progression","progress bar timing: currentTime={1} duration={2}":"{1} de {2}",Fullscreen:Mg,"Exit Fullscreen":"Fenêtré",Mute:Ng,Unmute:Bg,"Playback Rate":"Vitesse de lecture",Subtitles:Fg,"subtitles off":"Sous-titres désactivés",Captions:Ug,"captions off":"Sous-titres transcrits désactivés",Chapters:$g,Descriptions:jg,"descriptions off":"descriptions désactivées","Audio Track":"Piste audio","Volume Level":"Niveau de volume","You aborted the media playback":"Vous avez interrompu la lecture de la vidéo.","A network error caused the media download to fail part-way.":"Une erreur de réseau a interrompu le téléchargement de la vidéo.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Cette vidéo n'a pas pu être chargée, soit parce que le serveur ou le réseau a échoué ou parce que le format n'est pas reconnu.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"La lecture de la vidéo a été interrompue à cause d'un problème de corruption ou parce que la vidéo utilise des fonctionnalités non prises en charge par votre navigateur.","No compatible source was found for this media.":"Aucune source compatible n'a été trouvée pour cette vidéo.","The media is encrypted and we do not have the keys to decrypt it.":"Le média est chiffré et nous n'avons pas les clés pour le déchiffrer.","Play Video":"Lire la vidéo",Close:qg,"Close Modal Dialog":"Fermer la boîte de dialogue modale","Modal Window":"Fenêtre modale","This is a modal window":"Ceci est une fenêtre modale","This modal can be closed by pressing the Escape key or activating the close button.":"Ce modal peut être fermé en appuyant sur la touche Échap ou activer le bouton de fermeture.",", opens captions settings dialog":", ouvrir les paramètres des sous-titres transcrits",", opens subtitles settings dialog":", ouvrir les paramètres des sous-titres",", opens descriptions settings dialog":", ouvrir les paramètres des descriptions",", selected":", sélectionné","captions settings":"Paramètres des sous-titres transcrits","subtitles settings":"Paramètres des sous-titres","descriptions settings":"Paramètres des descriptions",Text:Vg,White:Hg,Black:Gg,Red:zg,Green:Wg,Blue:Kg,Yellow:Xg,Magenta:Yg,Cyan:Qg,Background:Jg,Window:Zg,Transparent:e0,"Semi-Transparent":"Semi-transparent",Opaque:t0,"Font Size":"Taille des caractères","Text Edge Style":"Style des contours du texte",None:i0,Raised:s0,Depressed:r0,Uniform:n0,"Drop shadow":"Ombre portée","Font Family":"Famille de polices","Proportional Sans-Serif":"Polices à chasse variable sans empattement (Proportional Sans-Serif)","Monospace Sans-Serif":"Polices à chasse fixe sans empattement (Monospace Sans-Serif)","Proportional Serif":"Polices à chasse variable avec empattement (Proportional Serif)","Monospace Serif":"Polices à chasse fixe avec empattement (Monospace Serif)",Casual:a0,Script:o0,"Small Caps":"Petites capitales",Reset:u0,"restore all settings to the default values":"Restaurer tous les paramètres aux valeurs par défaut",Done:l0,"Caption Settings Dialog":"Boîte de dialogue des paramètres des sous-titres transcrits","Beginning of dialog window. Escape will cancel and close the window.":"Début de la fenêtre de dialogue. La touche d'échappement annulera et fermera la fenêtre.","End of dialog window.":"Fin de la fenêtre de dialogue.","Exit Picture-in-Picture":"Quitter le mode image dans l'image","Picture-in-Picture":"Image dans l'image","{1} is loading.":"{1} en cours de chargement.","No content":"Aucun contenu",Color:c0,Opacity:d0,"Text Background":"Arrière-plan du texte","Caption Area Background":"Arrière-plan de la zone de sous-titre","Skip backward {1} seconds":"Reculer de {1} secondes","Skip forward {1} seconds":"Avancer de {1} secondes"},yA=Object.freeze({__proto__:null,Background:Jg,Black:Gg,Blue:Kg,Captions:Ug,Casual:a0,Chapters:$g,Close:qg,Color:c0,Cyan:Qg,Depressed:r0,Descriptions:jg,Done:l0,Duration:Pg,Fullscreen:Mg,Green:Wg,LIVE:Lg,Loaded:Og,Magenta:Yg,Mute:Ng,None:i0,Opacity:d0,Opaque:t0,Pause:kg,Play:wg,Progress:Rg,Raised:s0,Red:zg,Replay:Ig,Reset:u0,Script:o0,Subtitles:Fg,Text:Vg,Transparent:e0,Uniform:n0,Unmute:Bg,White:Hg,Window:Zg,Yellow:Xg,default:gA}),h0="Pour protéger les enfants, ce contenu est accessible entre 20h et 6h.",f0="Pour protéger les enfants, ce contenu est accessible entre 23h et 5h.",p0="Ce contenu n'est actuellement pas disponible.",m0="Ce contenu n'est plus disponible.",g0="La RTS ne dispose pas des droits de diffusion en dehors de la Suisse.",y0="Pour des raisons juridiques, ce contenu n'est pas disponible.",_0="Ce contenu n'est pas encore disponible. Veuillez réessayer plus tard.",v0="Ce contenu n'est actuellement pas disponible.",_A={AGERATING12:h0,AGERATING18:f0,COMMERCIAL:p0,ENDDATE:m0,GEOBLOCK:g0,LEGAL:y0,STARTDATE:_0,UNKNOWN:v0},vA=Object.freeze({__proto__:null,AGERATING12:h0,AGERATING18:f0,COMMERCIAL:p0,ENDDATE:m0,GEOBLOCK:g0,LEGAL:y0,STARTDATE:_0,UNKNOWN:v0,default:_A});ye.addLanguage("fr",Pe(Pe({},yA),vA));var T0="Play",b0="Pausa",S0="Replay",x0="Durata",E0="LIVE",C0="Caricato",A0="Stato",D0="Schermo intero",w0="Disattiva l’audio",k0="Attiva l’audio",I0="Sottotitoli",P0="Sottotitoli non udenti",L0="Capitolo",O0="Descrizioni",R0="Chiudi",M0="Testo",N0="Bianco",B0="Nero",F0="Rosso",U0="Verde",$0="Blu",j0="Giallo",q0="Magenta",V0="Ciano",H0="Sfondo",G0="Finestra",z0="Trasparente",W0="Opaco",K0="Nessuno",X0="Uniforme",Y0="Reinizializza",Q0="Fatto",J0="Colore",Z0="Opacità",TA={"Audio Player":"Lettore audio","Video Player":"Lettore video",Play:T0,Pause:b0,Replay:S0,"Current Time":"Orario attuale",Duration:x0,"Remaining Time":"Tempo rimanente","Stream Type":"Tipo di streaming",LIVE:E0,Loaded:C0,Progress:A0,"Progress Bar":"Barra di avanzamento","progress bar timing: currentTime={1} duration={2}":"{1} di {2}",Fullscreen:D0,"Exit Fullscreen":"Chiudi Schermo intero",Mute:w0,Unmute:k0,"Playback Rate":"Velocità di riproduzione",Subtitles:I0,"subtitles off":"Senza sottotitoli",Captions:P0,"captions off":"Senza sottotitoli non udenti",Chapters:L0,Descriptions:O0,"descriptions off":"Descrizioni disattivate","Audio Track":"Traccia audio","Volume Level":"Livello del volume","You aborted the media playback":"La riproduzione del contenuto multimediale è stata interrotta.","A network error caused the media download to fail part-way.":"Il download del contenuto multimediale è stato interrotto a causa di un problema rete.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Il contenuto multimediale non può essere caricato a causa di un errore nel server o nella rete o perché il formato non viene supportato.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"La riproduzione del contenuto multimediale è stata interrotta a causa di un file danneggiato o per l’utilizzo di impostazioni non supportate dal browser.","No compatible source was found for this media.":"Non ci sono fonti compatibili per questo contenuto multimediale.","The media is encrypted and we do not have the keys to decrypt it.":"Il contenuto multimediale è criptato e non disponiamo delle chiavi per decifrarlo.","Play Video":"Riproduci il video",Close:R0,"Close Modal Dialog":"Chiudi la finestra di dialogo","Modal Window":"Finestra di dialogo","This is a modal window":"Questa è una finestra di dialogo","This modal can be closed by pressing the Escape key or activating the close button.":"Questa finestra di dialogo può essere chiusa premendo sul tasto Esc o attivando il pulsante di chiusura.",", opens captions settings dialog":", aprire i parametri della trascrizione dei sottotitoli",", opens subtitles settings dialog":", aprire i parametri dei sottotitoli",", opens descriptions settings dialog":", aprire i parametri delle descrizioni",", selected":", selezionato","captions settings":"Parametri sottotitoli non udenti","subtitles settings":"Parametri sottotitoli","descriptions settings":"Parametri descrizioni",Text:M0,White:N0,Black:B0,Red:F0,Green:U0,Blue:$0,Yellow:j0,Magenta:q0,Cyan:V0,Background:H0,Window:G0,Transparent:z0,"Semi-Transparent":"Semi-Trasparente",Opaque:W0,"Font Size":"Dimensione dei caratteri","Text Edge Style":"Stile dei bordi del testo",None:K0,Uniform:X0,"Drop shadow":"Ombra","Font Family":"Carattere","Proportional Sans-Serif":"Sans-Serif proporzionale","Monospace Sans-Serif":"Sans-Serif monospaziato","Proportional Serif":"Serif proporzionale","Monospace Serif":"Serif monospaziato","Small Caps":"Maiuscoletto",Reset:Y0,"restore all settings to the default values":"Ripristina i valori predefiniti per tutti i parametri",Done:Q0,"Caption Settings Dialog":"Finestra di dialogo dei parametri della trascrizione dei sottotitoli","Beginning of dialog window. Escape will cancel and close the window.":"Inizio della finestra di dialogo. Il tasto Esc annullerà l’operazione e chiuderà la finestra.","End of dialog window.":"Fine della finestra di dialogo.","{1} is loading.":"{1} in fase di caricamento.","Exit Picture-in-Picture":"Esci dalla modalità Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture",Color:J0,Opacity:Z0,"Text Background":"Sfondo testo","Caption Area Background":"Sfondo area sottotitoli","Skip forward {1} seconds":"Avanti {1} secondi","Skip backward {1} seconds":"Indietro {1} secondi"},bA=Object.freeze({__proto__:null,Background:H0,Black:B0,Blue:$0,Captions:P0,Chapters:L0,Close:R0,Color:J0,Cyan:V0,Descriptions:O0,Done:Q0,Duration:x0,Fullscreen:D0,Green:U0,LIVE:E0,Loaded:C0,Magenta:q0,Mute:w0,None:K0,Opacity:Z0,Opaque:W0,Pause:b0,Play:T0,Progress:A0,Red:F0,Replay:S0,Reset:Y0,Subtitles:I0,Text:M0,Transparent:z0,Uniform:X0,Unmute:k0,White:N0,Window:G0,Yellow:j0,default:TA}),ey="Per proteggere i bambini, questo media è disponibile solo fra le 20 e le 6.",ty="Per proteggere i bambini, questo media è disponibile solo fra le 23 le 5.",iy="Questo contenuto commerciale non è disponibile.",sy="Questo media non è più disponibile.",ry="Questo media non è disponibile fuori dalla Svizzera.",ny="Il contenuto non è fruibile a causa di restrizioni legali.",ay="Il contenuto non è ancora disponibile. Per cortesia prova più tardi.",oy="Questo media non è disponibile.",SA={AGERATING12:ey,AGERATING18:ty,COMMERCIAL:iy,ENDDATE:sy,GEOBLOCK:ry,LEGAL:ny,STARTDATE:ay,UNKNOWN:oy},xA=Object.freeze({__proto__:null,AGERATING12:ey,AGERATING18:ty,COMMERCIAL:iy,ENDDATE:sy,GEOBLOCK:ry,LEGAL:ny,STARTDATE:ay,UNKNOWN:oy,default:SA});ye.addLanguage("it",Pe(Pe({},bA),xA));var uy="Laschar ir",ly="Pausa",cy="Mussar danovamain",dy="Durada",hy="LIVE",fy="Chargià",py="Progress",my="Entir visur",gy="Senza tun",yy="Cun tun",_y="Suttitels",vy="Suttitels",Ty="Chapitels",by="Descripziuns",Sy="Serrar",xy="Text",Ey="Alv",Cy="Nair",Ay="Cotschn",Dy="Verd",wy="Blau",ky="Mellen",Iy="Magenta",Py="Cyan",Ly="Fund",Oy="Fanestra",Ry="Transparent",My="Betg transparent",Ny="Nagin",By="Auzà",Fy="Sbassà",Uy="Uniform",$y="Sumbriva",jy="Casual",qy="Script",Vy="Da nov",Hy="Fatg",Gy="Per proteger uffants, è quest cuntegn disponibel mo tranter las 20.00 e las 06.00.",zy="Per proteger uffants, è quest cuntegn disponibel mo tranter las 23.00 e las 05.00.",Wy="Quest medium commerzial n'è betg disponibel.",Ky="Quest cuntegn n'è betg pli disponibel.",Xy="Quest cuntegn n'è betg disponibel ordaifer la Svizra.",Yy="Quest cuntegn n'è betg disponibel perquai ch'el è scadì.",Qy="Quest cuntegn n'è betg anc disponibel. Empruvai pli tard.",Jy="Quest cuntegn n'è betg disponibel.",EA={"Audio Player":"Audio-Player","Video Player":"Video-Player",Play:uy,Pause:ly,Replay:cy,"Current Time":"Temp actual",Duration:dy,"Remaining Time":"Temp restant","Stream Type":"Tip dal stream",LIVE:hy,Loaded:fy,Progress:py,"Progress Bar":"Bar da progessiun","progress bar timing: currentTime={1} duration={2}":"{1} da {2}",Fullscreen:my,"Non-Fullscreen":"Betg entir visur",Mute:gy,Unmute:yy,"Playback Rate":"Tempo ",Subtitles:_y,"subtitles off":"senza suttitels",Captions:vy,"captions off":"senza suttitels",Chapters:Ty,Descriptions:by,"descriptions off":"senza descripziuns","Audio Track":"Piese audio","Volume Level":"Nivel dal volumen","You aborted the media playback":"Vus avais interrut il vdieo","A network error caused the media download to fail part-way.":"In sbagl en la rait ha impedì il download","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Il video n'è betg chargià - ubain per in sbagl da server / da la rait, ubain ch'il format n'è betg cumpatibel.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"Il video è interrut: Ubain ch'il video è donnegià, ubain che funcziuns n'èn betg cumpatiblas.","No compatible source was found for this media.":"Chattà nagina funtauna cumpatibla per quest video.","The media is encrypted and we do not have the keys to decrypt it.":"Il video è codifitgà da moda nunenconuschenta.","Play Video":"Aviar video",Close:Sy,"Close Modal Dialog":"Serrar la fanestra modala","Modal Window":"Fanestra modala","This is a modal window":"Quai è ina fanestra modala","This modal can be closed by pressing the Escape key or activating the close button.":'Questa fanestra modala pudais serrar cun la tasta "Escape" ubain cun il buttun.',", opens captions settings dialog":", avra opziuns per ils suttitels",", opens subtitles settings dialog":", avra opziuns per ils suttitels",", opens descriptions settings dialog":", avra opziuns per la descripziun",", selected":", selecziunà","captions settings":"opziuns per ils suttitels","subtitles settings":"opziuns per ils suttitels","descriptions settings":"opziuns per la descripziun",Text:xy,White:Ey,Black:Cy,Red:Ay,Green:Dy,Blue:wy,Yellow:ky,Magenta:Iy,Cyan:Py,Background:Ly,Window:Oy,Transparent:Ry,"Semi-Transparent":"Mez transparent",Opaque:My,"Font Size":"Grandezza dal text","Text Edge Style":"Stil dal text",None:Ny,Raised:By,Depressed:Fy,Uniform:Uy,Dropshadow:$y,"Font Family":"Scrittira","Proportional Sans-Serif":"Proportionale Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportionale Serif","Monospace Serif":"Monospace Serif",Casual:jy,Script:qy,"Small Caps":"Bustabs pitschens",Reset:Vy,"restore all settings to the default values":"Enavos tar las opziuns da standard",Done:Hy,"Caption Settings Dialog":"Opziuns per suttitels","Beginning of dialog window. Escape will cancel and close the window.":"Entschatta da la fanestra da dialog. Escape stizza e serra la fanestra.","End of dialog window.":"Fin da la fanestra da dialog.",AGERATING12:Gy,AGERATING18:zy,COMMERCIAL:Wy,ENDDATE:Ky,GEOBLOCK:Xy,LEGAL:Yy,STARTDATE:Qy,UNKNOWN:Jy},CA=Object.freeze({__proto__:null,AGERATING12:Gy,AGERATING18:zy,Background:Ly,Black:Cy,Blue:wy,COMMERCIAL:Wy,Captions:vy,Casual:jy,Chapters:Ty,Close:Sy,Cyan:Py,Depressed:Fy,Descriptions:by,Done:Hy,Dropshadow:$y,Duration:dy,ENDDATE:Ky,Fullscreen:my,GEOBLOCK:Xy,Green:Dy,LEGAL:Yy,LIVE:hy,Loaded:fy,Magenta:Iy,Mute:gy,None:Ny,Opaque:My,Pause:ly,Play:uy,Progress:py,Raised:By,Red:Ay,Replay:cy,Reset:Vy,STARTDATE:Qy,Script:qy,Subtitles:_y,Text:xy,Transparent:Ry,UNKNOWN:Jy,Uniform:Uy,Unmute:yy,White:Ey,Window:Oy,Yellow:ky,default:EA});ye.addLanguage("rm",Pe({},CA));const AA=["url","mimeType","keySystems"],DA=["src"];class Q{static addBlockedSegments(e,t=[]){const s="srgssr-blocked-segments",r=e.textTracks().getTrackById(s);if(r&&e.textTracks().removeTrack(r),!Array.isArray(t)||!t.length)return;const n=t.filter(a=>a.blockReason);n.length&&Q.createTextTrack(e,s).then(a=>{n.forEach(o=>{Q.addTextTrackCue(a,o)}),e.textTracks().addTrack(a)})}static addRemoteTextTracks(e,t=[]){Array.isArray(t)&&t.forEach(({type:s,language:r,locale:n,url:a})=>{e.addRemoteTextTrack({kind:s==="SDH"?"captions":"subtitles",label:r,language:n,src:a})})}static addTextTrackCue(e,t){const s=(Number.isFinite(t.markIn)?t.markIn:t.fullLengthMarkIn)/1e3,r=(Number.isFinite(t.markOut)?t.markOut:t.fullLengthMarkOut)/1e3;e.addCue(new VTTCue(s,r,JSON.stringify(t)))}static addTextTracks(e,{mediaData:t}){Q.addRemoteTextTracks(e,t.subtitles),Q.addChapters(e,t.urn,t.chapters),Q.addBlockedSegments(e,t.blockedSegments),Q.addIntervals(e,t.intervals)}static addChapters(e,t,s=[]){const r="srgssr-chapters",n=e.textTracks().getTrackById(r);n&&e.textTracks().removeTrack(n),!(!Array.isArray(s)||!s.length)&&Q.createTextTrack(e,r).then(a=>{s.forEach(o=>{t===o.fullLengthUrn&&Q.addTextTrackCue(a,o)}),e.textTracks().addTrack(a)})}static addIntervals(e,t=[]){const s="srgssr-intervals",r=e.textTracks().getTrackById(s);r&&e.textTracks().removeTrack(r),!(!Array.isArray(t)||!t.length)&&Q.createTextTrack(e,s).then(n=>{t.forEach(a=>{Q.addTextTrackCue(n,a)}),e.textTracks().addTrack(n)})}static blockingReason(e,t){if(!t.mediaData.blockReason)return;const s=e.localize(t.mediaData.blockReason);return Q.error(e,{code:MediaError.MEDIA_ERR_ABORTED,message:s,metadata:{errorType:t.mediaData.blockReason,src:t}}),!0}static composeAkamaiResources(e=[]){return Ni(function*(){return Ti.hasToken(e)?Ti.tokenizeSources(e):Promise.resolve(e)})()}static composeKeySystemsResources(e=[]){return rr.hasDrm(e),e.map(t=>Pe(Pe({},t),rr.buildKeySystems(t.drmList)))}static composeMainResources(e){return Q.composeAkamaiResources(Q.composeKeySystemsResources(Q.filterIncompatibleResources(e.getMainResources())))}static composeSrcMediaData({mediaData:e,disableTrackers:t},s){const r=ye.obj.merge(s,e),{url:n,mimeType:a,keySystems:o}=r,l=dd(r,AA);return{src:n,type:a,keySystems:o,disableTrackers:t,mediaData:l}}static createTextTrack(e,t){return new Promise(s=>{setTimeout(()=>{s(new ye.TextTrack({id:t,kind:"metadata",label:t,tech:e.tech(!0)}))},100)})}static cuechangeEventProxy(e){e.textTracks().on("addtrack",({track:t})=>{["srgssr-chapters","srgssr-intervals"].includes(t.id)&&t.on("cuechange",()=>{const[s]=Array.from(t.activeCues),r=t.id.includes("srgssr-chapters")?"srgssr/chapter":"srgssr/interval";e.trigger({type:r,data:s})})})}static dataProvider(e){if(!e.options().srgOptions.dataProvider){const{dataProviderHost:t,dataProviderUrlHandler:s}=e.options().srgOptions,n=new hd(t).handleRequest(s);e.options({srgOptions:{dataProvider:n}})}return e.options().srgOptions.dataProvider}static dataProviderError(e,t){if(!t)return;const s=t.statusText?t.statusText:t.message;return Q.error(e,{code:0,message:e.localize("UNKNOWN"),metadata:{errorType:"UNKNOWN",urn:e.src(),status:t.status,statusText:s,url:t.url}}),!0}static error(e,{code:t,message:s,metadata:r}){e.error(null),e.error({code:t,message:s,metadata:r})}static filterIncompatibleResources(e=[]){return e.filter(t=>!["RTMP","HDS"].includes(t.streaming))}static getBlockedSegment(e){const s=e.textTracks().getTrackById("srgssr-blocked-segments");if(!s)return;const[r]=Array.from(s.activeCues);return r}static getBlockedSegmentByTime(e,t){const s=Q.getBlockedSegment(e);return s&&t>=s.startTime&&tr===t)||e[0]}static getSrcMediaObj(e,t){return Ni(function*(){const{src:s}=t,r=dd(t,DA),n=yield Q.getMediaComposition(s,Q.dataProvider(e)),a=yield Q.composeMainResources(n),o=Q.getMediaData(a);return Q.composeSrcMediaData(r,o)})()}static handleCurrentTime(e,t){const s=Q.getBlockedSegmentByTime(e,t);if(!s||!Number.isFinite(s.endTime))return t;const r=s.endTime+.1;return e.trigger({type:"srgssr/blocked-segment",data:s}),e.currentTime(r),r}static handleSetCurrentTime(e,t){const{endTime:s}=Q.getBlockedSegmentByTime(e,t)||{};return Number.isFinite(s)?s:t}static handleSetSource(e,t,s){return Ni(function*(){try{const r=yield Q.getSrcMediaObj(e,t);return Q.srgAnalytics(e),Q.updateTitleBar(e,r),Q.updatePoster(e,r),Q.blockingReason(e,r)?void 0:(Q.addTextTracks(e,r),s(null,r))}catch(r){return Q.dataProviderError(e,r)?void 0:s(r)}})()}static srgAnalytics(e){if(e.options().trackers.srgAnalytics!==!1&&!e.options().trackers.srgAnalytics){const t=new pi(e,{debug:e.debug(),playerVersion:ye.VERSION.pillarbox,tagCommanderScriptURL:e.options().srgOptions.tagCommanderScriptURL});e.options({trackers:{srgAnalytics:t}})}}static updatePoster(e,t,s=rA){e.poster(s.scale({url:t.mediaData.imageUrl}))}static updateTitleBar(e,t){e.titleBar&&e.titleBar.update({title:t.mediaData.vendor,description:t.mediaData.title})}static middleware(e){return Q.cuechangeEventProxy(e),{currentTime:t=>Q.handleCurrentTime(e,t),setCurrentTime:t=>Q.handleSetCurrentTime(e,t),setSource:function(){var t=Ni(function*(s,r){return Q.handleSetSource(e,s,r)});return function(r,n){return t.apply(this,arguments)}}()}}}ye.use("srgssr/urn",Q.middleware);ye.options.srgOptions={dataProvider:void 0,dataProviderHost:void 0,dataProviderUrlHandler:void 0,tagCommanderScriptURL:void 0};const wA="2.0.0",kA=A.getPlugin("plugin"),Td=A.log.createLogger("pillarbox-playlist"),_t={NO_REPEAT:0,REPEAT_ALL:1,REPEAT_ONE:2};class Mu extends kA{constructor(t,s){super(t);Rt(this,"items_",[]);Rt(this,"currentIndex_",-1);Rt(this,"previousNavigationThreshold",3);Rt(this,"repeat",_t.NO_REPEAT);Rt(this,"autoadvance",!1);Rt(this,"onEnded_",()=>this.handleEnded());s=this.options_=A.obj.merge(this.options_,s),s.playlist&&s.playlist.length&&t.ready(()=>{this.load(...s.playlist)}),this.autoadvance=!!s.autoadvance,this.repeat=s.repeat??this.repeat,this.previousNavigationThreshold=Number.isFinite(s.previousNavigationThreshold)?s.previousNavigationThreshold:this.previousNavigationThreshold,this.player.on("ended",this.onEnded_)}toggleRepeat(t=void 0){this.repeat=t??(this.repeat+1)%3}isRepeatOneMode(){return this.repeat===_t.REPEAT_ONE}isRepeatAllMode(){return this.repeat===_t.REPEAT_ALL}isNoRepeatMode(){return this.repeat===_t.NO_REPEAT}toggleAutoadvance(t=void 0){this.autoadvance=t??!this.autoadvance}dispose(){this.player.off("ended",this.onEnded_)}load(t){this.items_=[...t],this.select(0)}push(...t){this.items_.push(...t),this.updateState_()}splice(t,s,...r){const n=r.length,a=this.items_.splice(t,s,...r),o=a.length;return this.currentIndex_>=t&&this.currentIndex_=t&&(this.currentIndex_=this.currentIndex_-o+n),this.updateState_(),a}clear(){this.items_=[],this.currentIndex_=-1,this.updateState_()}reverse(){this.items_.length&&(this.items_.reverse(),this.currentIndex_=this.items_.length-1-this.currentIndex_,this.updateState_())}sort(t){if(!this.items_.length)return;const s=this.currentItem;this.items_.sort(t),this.currentIndex_=this.items_.indexOf(s),this.updateState_()}get currentIndex(){return this.currentIndex_}get currentItem(){return this.items_[this.currentIndex_]}get items(){return[...this.items_]}select(t){if(t<0||t>=this.items_.length){Td.warn(`Index: ${t} is out of bounds (The current playlist has ${this.items_.length} elements)`);return}if(t===this.currentIndex_){Td.warn(`Index: ${t} is already selected`);return}const s=this.items_[t];this.player.src(s.sources),this.player.poster(s.poster),this.currentIndex_=t,this.updateState_()}next(){if(this.hasNext()){this.select(this.currentIndex_+1);return}this.repeat===_t.REPEAT_ALL&&this.select(0)}hasNext(){return this.currentIndex_+1this.previousNavigationThreshold){this.player.currentTime(0);return}this.select(this.currentIndex_-1)}isLive(){const t=this.player.liveTracker;return t&&t.isLive()}hasPrevious(){return this.currentIndex_>0}handleEnded(){if(this.repeat===_t.REPEAT_ONE){this.player.play().then(()=>{});return}this.autoadvance&&this.next()}shuffle(){for(let t=this.items_.length-1;t>0;t-=1){const s=Math.floor(Math.random()*(t+1));[this.items_[t],this.items_[s]]=[this.items_[s],this.items_[t]],this.currentIndex_===t?this.currentIndex_=s:this.currentIndex_===s&&(this.currentIndex_=t)}this.updateState_()}updateState_(){this.setState({items:JSON.stringify(this.items_),currentIndex:this.currentIndex_})}}Mu.VERSION=wA;Mu.prototype.options_={autoadvance:!1,repeat:!1};A.registerPlugin("pillarboxPlaylist",Mu);const IA=A.getComponent("Button");class PA extends IA{constructor(t,s){s=A.mergeOptions({controlText:"Playlist"},s);super(t,s);Rt(this,"onPlaylistStateChanged_",({changes:t})=>{"items"in t&&this.toggleVisibility()});this.setIcon("chapters"),this.playlist().on("statechanged",this.onPlaylistStateChanged_)}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-chapters",!0)}dispose(){this.playlist().off("statechanged",this.onPlaylistStateChanged_),super.dispose()}buildCSSClass(){return`pbw-playlist-button vjs-hidden ${super.buildCSSClass()}`}handleClick(t){super.handleClick(t),this.player().getChild("PillarboxPlaylistMenuDialog").open()}toggleVisibility(){if(this.playlist().items.length>0){this.show();return}this.hide()}}A.registerComponent("PillarboxPlaylistButton",PA);const LA=A.getComponent("Button");let OA=class extends LA{constructor(e,t){var s,r;super(e,t),this.selected(t.index===this.playlist().currentIndex),this.controlText(`${(s=this.options_.item.data)==null?void 0:s.title} - ${A.formatTime((r=this.options_.item.data)==null?void 0:r.duration)}`)}playlist(){return this.player().pillarboxPlaylist()}handleClick(e){super.handleClick(e),this.playlist().select(this.options_.index)}selected(e){this.toggleClass("vjs-selected",e)}buildCSSClass(){return`pbw-playlist-item-button vjs-visible-text ${super.buildCSSClass()}`}};A.registerComponent("PillarboxPlaylistMenuItem",OA);const RA=A.getComponent("Button");class MA extends RA{constructor(e,t){t=A.mergeOptions({controlText:"Next Item"},t),super(e,t),this.setIcon("next-item")}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-next-item",!0)}handleClick(e){super.handleClick(e),this.playlist().next()}}A.registerComponent("PillarboxPlaylistNextItemButton",MA);const NA=A.getComponent("Button");class BA extends NA{constructor(e,t){t=A.mergeOptions({controlText:"Previous Item"},t),super(e,t),this.setIcon("previous-item")}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-previous-item",!0)}handleClick(e){super.handleClick(e),this.playlist().previous()}}A.registerComponent("PillarboxPlaylistPreviousItemButton",BA);const FA=A.getComponent("Button");class UA extends FA{constructor(e,t){t=A.mergeOptions({controlText:"Repeat"},t),super(e,t),this.controlText(this.repeatModeAsString()),this.setIcon("repeat")}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-repeat",!0)}repeatModeAsString(){switch(this.playlist().repeat){case _t.NO_REPEAT:return"No Repeat";case _t.REPEAT_ALL:return"Repeat All";case _t.REPEAT_ONE:return"Repeat One"}}buildCSSClass(){return`${this.playlist().repeat?"vjs-selected":""} ${super.buildCSSClass()}`}handleClick(e){super.handleClick(e),this.playlist().toggleRepeat(),this.toggleClass("vjs-selected",!this.playlist().isNoRepeatMode()),this.toggleClass("pbw-repeat-one",this.playlist().isRepeatOneMode()),this.controlText(this.repeatModeAsString()),this.setAttribute("aria-pressed",!this.playlist().isNoRepeatMode())}}A.registerComponent("PillarboxPlaylistRepeatButton",UA);const $A=A.getComponent("Button");class jA extends $A{constructor(e,t){t=A.mergeOptions({controlText:"Shuffle"},t),super(e,t),this.setIcon("shuffle")}playlist(){return this.player().pillarboxPlaylist()}ready(){this.$(".vjs-icon-placeholder").classList.toggle("vjs-icon-shuffle",!0)}handleClick(e){super.handleClick(e),this.playlist().shuffle()}}A.registerComponent("PillarboxPlaylistShuffleButton",jA);const qA=A.getComponent("Component");class Zy extends qA{}Zy.prototype.options_={className:"pbw-playlist-controls",children:["pillarboxPlaylistRepeatButton","pillarboxPlaylistShuffleButton","pillarboxPlaylistPreviousItemButton","pillarboxPlaylistNextItemButton"]};A.registerComponent("PillarboxPlaylistControls",Zy);const VA=A.getComponent("PillarboxPlaylistMenuItem"),bd=A.getComponent("Component"),HA=A.getComponent("ModalDialog");class GA extends HA{constructor(t,s){s.temporary=!1,s=A.mergeOptions({pauseOnOpen:!1},s);super(t,s);Rt(this,"onPlaylistStateChanged_",({changes:t})=>{"items"in t&&(this.removeItems(),this.renderItems()),"currentIndex"in t&&this.select(t.currentIndex.to)});this.fill(),this.addChild("PillarboxPlaylistControls",s.pillarboxPlaylistControls),this.renderItems(),this.playlist().on("statechanged",this.onPlaylistStateChanged_)}buildCSSClass(){return`pbw-playlist-dialog ${super.buildCSSClass()}`}dispose(){this.playlist().off("statechanged",this.onPlaylistStateChanged_),super.dispose()}playlist(){return this.player().pillarboxPlaylist()}select(t){this.getChild("PillarboxPlaylistMenuItemsList").children().filter(r=>r.name()==="PillarboxPlaylistMenuItem").map(r=>r.getChild("PillarboxPlaylistMenuItemButton")).forEach(r=>r.selected(t===r.options().index))}removeItems(){this.removeChild(this.getChild("PillarboxPlaylistMenuItemsList"))}renderItems(){const t=new bd(this.player(),{name:"PillarboxPlaylistMenuItemsList",el:A.dom.createEl("ol",{className:"pbw-playlist-items"})});this.playlist().items.forEach((s,r)=>{const n=new bd(this.player(),{name:"PillarboxPlaylistMenuItem",el:A.dom.createEl("li",{className:"pbw-playlist-item"})});n.addChild(new VA(this.player(),{item:s,index:r,name:"PillarboxPlaylistMenuItemButton"})),t.addChild(n)}),this.addChild(t)}}A.registerComponent("PillarboxPlaylistMenuDialog",GA);const zA="Wiedergabeliste",WA="Mischen",KA={"Next Item":"Nächstes element","No Repeat":"Keine Wiederholung",Playlist:zA,"Previous Item":"Vorheriges Element","Repeat All":"Alle Wiederholen","Repeat One":"Einzelnes Wiederholen",Shuffle:WA},XA="Playlist",YA="Shuffle",QA={"Next Item":"Next Item","No Repeat":"No Repeat",Playlist:XA,"Previous Item":"Previous Item","Repeat All":"Repeat All","Repeat One":"Repeat One",Shuffle:YA},JA="Liste de lecture",ZA="Mélanger",eD={"Next Item":"Élément suivant","No Repeat":"Pas de Répétition",Playlist:JA,"Previous Item":"Élément précédent","Repeat All":"Répéter Tout","Repeat One":"Répéter Un",Shuffle:ZA},tD="Playlist",iD="Mescola",sD={"Next Item":"Elemento successivo","No Repeat":"Nessuna Ripetizione",Playlist:tD,"Previous Item":"Elemento precedente","Repeat All":"Ripeti Tutto","Repeat One":"Ripeti Uno",Shuffle:iD},rD="Glista da reprodukziun",nD="Maschadar",aD={"Next Item":"Element proxim","No Repeat":"Nagins Repeter",Playlist:rD,"Previous Item":"Element precedent","Repeat All":"Repeter Tut","Repeat One":"Repeter In",Shuffle:nD};function mr(i,e){A.addLanguage(i,{...A.options.language[i]??{},...e})}mr("de",KA);mr("en",QA);mr("fr",eD);mr("it",sD);mr("rm",aD);const oD=A.getPlugin("plugin"),uD=A.log.createLogger("pillarbox-playlist-ui");class e_ extends oD{constructor(e,t){if(super(e),!e.usingPlugin("pillarboxPlaylist")){uD.error("pillarbox-playlist plugin is required");return}t=this.options_=A.obj.merge(this.options_,t),e.options({pillarboxPlaylistMenuDialog:t.pillarboxPlaylistMenuDialog??!0,controlBar:this.mergeControlBarOptions(e,t)})}mergeControlBarOptions(e,t){if(e.options_.controlBar===!1)return e.options_.controlBar;const s=A.obj.merge(A.getComponent("ControlBar").prototype.options_,e.options_.controlBar),r=s.children.findIndex(n=>n===t.insertChildBefore);if(t.insertChildBefore&&r!==-1){const n=[...s.children];return n.splice(r,0,"pillarboxPlaylistButton"),s.children=n,s}return s.pillarboxPlaylistButton=t.pillarboxPlaylistButton??!0,s}}e_.prototype.options_={insertChildBefore:"fullscreenToggle"};A.registerPlugin("pillarboxPlaylistUI",e_);const Nu=new URLSearchParams(location.search),lD=Nu.has("debug"),cD=Nu.get("ilHost")||void 0,dD=Nu.get("language");window.player=ye("player",{debug:lD,language:dD,autoplay:!0,srgOptions:{dataProviderHost:cD},plugins:{pillarboxPlaylist:{autoadvance:!0,repeat:_t.REPEAT_ALL},pillarboxPlaylistUI:!0}});const hD=["urn:rts:video:14827742","urn:srf:video:05457f66-fd67-4131-8e0a-6d85743efc39","urn:rtr:video:33136b80-bec6-40cd-a771-b8954c805098","urn:rts:video:9883196"];Promise.all(hD.map(async i=>{const t=(await Q.getMediaComposition(i,Q.dataProvider(player))).getMainChapter();return{sources:[{src:i,type:"srgssr/urn"}],data:{title:t.title,duration:t.duration/1e3},poster:t.imageUrl}})).then(i=>{player.pillarboxPlaylist().load(i)});window.player=player;window.pillarbox=ye; diff --git a/pr-preview/pr-31/packages/pillarbox-playlist/index.html b/pr-preview/pr-31/packages/pillarbox-playlist/index.html new file mode 100644 index 0000000..13592fb --- /dev/null +++ b/pr-preview/pr-31/packages/pillarbox-playlist/index.html @@ -0,0 +1,26 @@ + + + + + + + Pillarbox-Playlist Demo + + + + + + + + + diff --git a/pr-preview/pr-31/packages/skip-button/assets/index-9QwUlAKx.css b/pr-preview/pr-31/packages/skip-button/assets/index-9QwUlAKx.css new file mode 100644 index 0000000..a1f89c5 --- /dev/null +++ b/pr-preview/pr-31/packages/skip-button/assets/index-9QwUlAKx.css @@ -0,0 +1 @@ +.vjs-control.vjs-button.pbw-skip-button{position:absolute;bottom:5em;padding-left:1.333em;color:#fff;font-size:1.2em;background-color:#000000b3;cursor:pointer}.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-svg-icon:hover,.vjs-control:focus .vjs-svg-icon{filter:drop-shadow(0 0 .25em #fff)}.vjs-modal-dialog .vjs-modal-dialog-content,.video-js .vjs-modal-dialog,.pillarbox-js .vjs-modal-dialog,.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-button>.vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-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}.vjs-icon-play,.video-js .vjs-play-control .vjs-icon-placeholder,.pillarbox-js .vjs-play-control .vjs-icon-placeholder,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play:before,.video-js .vjs-play-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control .vjs-icon-placeholder:before,.video-js .vjs-big-play-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{content:""}.vjs-icon-play-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-play-circle:before{content:""}.vjs-icon-pause,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder,.pillarbox-js .vjs-play-control.vjs-playing .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pause:before,.video-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control.vjs-playing .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mute,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mute:before,.video-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-0 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-low,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-low:before,.video-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-1 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-mid,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-mid:before,.video-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control.vjs-vol-2 .vjs-icon-placeholder:before{content:""}.vjs-icon-volume-high,.video-js .vjs-mute-control .vjs-icon-placeholder,.pillarbox-js .vjs-mute-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-volume-high:before,.video-js .vjs-mute-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-mute-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-enter,.video-js .vjs-fullscreen-control .vjs-icon-placeholder,.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-enter:before,.video-js .vjs-fullscreen-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-fullscreen-exit,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder,.vjs-fullscreen.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-fullscreen-exit:before,.video-js.vjs-fullscreen .vjs-fullscreen-control .vjs-icon-placeholder:before,.vjs-fullscreen.pillarbox-js .vjs-fullscreen-control .vjs-icon-placeholder:before{content:""}.vjs-icon-spinner{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-spinner:before{content:""}.vjs-icon-subtitles,.video-js .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js .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-AU) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-subtitles-button .vjs-icon-placeholder,.pillarbox-js .vjs-subtitles-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-subtitles:before,.video-js .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js .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-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-subtitles-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-subtitles-button .vjs-icon-placeholder:before{content:""}.vjs-icon-captions,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.pillarbox-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder,.video-js .vjs-captions-button .vjs-icon-placeholder,.pillarbox-js .vjs-captions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-captions:before,.video-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js:lang(en) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.pillarbox-js:lang(fr-CA) .vjs-subs-caps-button .vjs-icon-placeholder:before,.video-js .vjs-captions-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-captions-button .vjs-icon-placeholder:before{content:""}.vjs-icon-hd{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-hd:before{content:""}.vjs-icon-chapters,.video-js .vjs-chapters-button .vjs-icon-placeholder,.pillarbox-js .vjs-chapters-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-chapters:before,.video-js .vjs-chapters-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-chapters-button .vjs-icon-placeholder:before{content:""}.vjs-icon-downloading{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-downloading:before{content:""}.vjs-icon-file-download{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download:before{content:""}.vjs-icon-file-download-done{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-done:before{content:""}.vjs-icon-file-download-off{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-file-download-off:before{content:""}.vjs-icon-share{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-share:before{content:""}.vjs-icon-cog{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cog:before{content:""}.vjs-icon-square{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-square:before{content:""}.vjs-icon-circle,.vjs-seek-to-live-control .vjs-icon-placeholder,.video-js .vjs-volume-level,.pillarbox-js .vjs-volume-level,.video-js .vjs-play-progress,.pillarbox-js .vjs-play-progress{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle:before,.vjs-seek-to-live-control .vjs-icon-placeholder:before,.video-js .vjs-volume-level:before,.pillarbox-js .vjs-volume-level:before,.video-js .vjs-play-progress:before,.pillarbox-js .vjs-play-progress:before{content:""}.vjs-icon-circle-outline{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-outline:before{content:""}.vjs-icon-circle-inner-circle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-circle-inner-circle:before{content:""}.vjs-icon-cancel,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder,.pillarbox-js .vjs-control.vjs-close-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cancel:before,.video-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-control.vjs-close-button .vjs-icon-placeholder:before{content:""}.vjs-icon-repeat{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-repeat:before{content:""}.vjs-icon-replay,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder,.pillarbox-js .vjs-play-control.vjs-ended .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay:before,.video-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before,.pillarbox-js .vjs-play-control.vjs-ended .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-5,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-5:before,.video-js .vjs-skip-backward-5 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-10,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-10:before,.video-js .vjs-skip-backward-10 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-replay-30,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-backward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-replay-30:before,.video-js .vjs-skip-backward-30 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-backward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-5,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-5 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-5:before,.video-js .vjs-skip-forward-5 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-5 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-10,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-10 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-10:before,.video-js .vjs-skip-forward-10 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-10 .vjs-icon-placeholder:before{content:""}.vjs-icon-forward-30,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder,.pillarbox-js .vjs-skip-forward-30 .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-forward-30:before,.video-js .vjs-skip-forward-30 .vjs-icon-placeholder:before,.pillarbox-js .vjs-skip-forward-30 .vjs-icon-placeholder:before{content:""}.vjs-icon-audio,.video-js .vjs-audio-button .vjs-icon-placeholder,.pillarbox-js .vjs-audio-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio:before,.video-js .vjs-audio-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-audio-button .vjs-icon-placeholder:before{content:""}.vjs-icon-next-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-next-item:before{content:""}.vjs-icon-previous-item{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-previous-item:before{content:""}.vjs-icon-shuffle{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-shuffle:before{content:""}.vjs-icon-cast{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-cast:before{content:""}.vjs-icon-picture-in-picture-enter,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder,.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-enter:before,.video-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-picture-in-picture-exit,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder,.vjs-picture-in-picture.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-picture-in-picture-exit:before,.video-js.vjs-picture-in-picture .vjs-picture-in-picture-control .vjs-icon-placeholder:before,.vjs-picture-in-picture.pillarbox-js .vjs-picture-in-picture-control .vjs-icon-placeholder:before{content:""}.vjs-icon-facebook{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-facebook:before{content:""}.vjs-icon-linkedin{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-linkedin:before{content:""}.vjs-icon-twitter{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-twitter:before{content:""}.vjs-icon-tumblr{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-tumblr:before{content:""}.vjs-icon-pinterest{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-pinterest:before{content:""}.vjs-icon-audio-description,.video-js .vjs-descriptions-button .vjs-icon-placeholder,.pillarbox-js .vjs-descriptions-button .vjs-icon-placeholder{font-family:VideoJS;font-weight:400;font-style:normal}.vjs-icon-audio-description:before,.video-js .vjs-descriptions-button .vjs-icon-placeholder:before,.pillarbox-js .vjs-descriptions-button .vjs-icon-placeholder:before{content:""}.video-js,.pillarbox-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,.pillarbox-js:-moz-full-screen{position:absolute}.video-js:-webkit-full-screen,.pillarbox-js:-webkit-full-screen{width:100%!important;height:100%!important}.video-js[tabindex="-1"],[tabindex="-1"].pillarbox-js{outline:none}.video-js *,.pillarbox-js *,.video-js *:before,.pillarbox-js *:before,.video-js *:after,.pillarbox-js *:after{box-sizing:inherit}.video-js ul,.pillarbox-js ul{font-family:inherit;font-size:inherit;line-height:inherit;list-style-position:outside;margin:0}.video-js.vjs-fluid,.vjs-fluid.pillarbox-js,.video-js.vjs-16-9,.vjs-16-9.pillarbox-js,.video-js.vjs-4-3,.vjs-4-3.pillarbox-js,.video-js.vjs-9-16,.vjs-9-16.pillarbox-js,.video-js.vjs-1-1,.vjs-1-1.pillarbox-js{width:100%;max-width:100%}.video-js.vjs-fluid:not(.vjs-audio-only-mode),.vjs-fluid.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-16-9:not(.vjs-audio-only-mode),.vjs-16-9.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-4-3:not(.vjs-audio-only-mode),.vjs-4-3.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-9-16:not(.vjs-audio-only-mode),.vjs-9-16.pillarbox-js:not(.vjs-audio-only-mode),.video-js.vjs-1-1:not(.vjs-audio-only-mode),.vjs-1-1.pillarbox-js:not(.vjs-audio-only-mode){height:0}.video-js.vjs-16-9:not(.vjs-audio-only-mode),.vjs-16-9.pillarbox-js:not(.vjs-audio-only-mode){padding-top:56.25%}.video-js.vjs-4-3:not(.vjs-audio-only-mode),.vjs-4-3.pillarbox-js:not(.vjs-audio-only-mode){padding-top:75%}.video-js.vjs-9-16:not(.vjs-audio-only-mode),.vjs-9-16.pillarbox-js:not(.vjs-audio-only-mode){padding-top:177.7777777778%}.video-js.vjs-1-1:not(.vjs-audio-only-mode),.vjs-1-1.pillarbox-js:not(.vjs-audio-only-mode){padding-top:100%}.video-js.vjs-fill:not(.vjs-audio-only-mode),.vjs-fill.pillarbox-js:not(.vjs-audio-only-mode){width:100%;height:100%}.video-js .vjs-tech,.pillarbox-js .vjs-tech{position:absolute;top:0;left:0;width:100%;height:100%}.video-js.vjs-audio-only-mode .vjs-tech,.vjs-audio-only-mode.pillarbox-js .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,.vjs-full-window .vjs-fullscreen.pillarbox-js,body.vjs-pip-window .video-js,body.vjs-pip-window .pillarbox-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),.vjs-fullscreen.pillarbox-js:not(.vjs-ios-native-fs),body.vjs-pip-window .video-js,body.vjs-pip-window .pillarbox-js{width:100%!important;height:100%!important;padding-top:0!important;display:block}.video-js.vjs-fullscreen.vjs-user-inactive,.vjs-fullscreen.vjs-user-inactive.pillarbox-js{cursor:none}.vjs-pip-container .vjs-pip-text{position:absolute;bottom:10%;font-size:2em;background-color:#000000b3;padding:.5em;text-align:center;width:100%}.vjs-layout-tiny.vjs-pip-container .vjs-pip-text,.vjs-layout-x-small.vjs-pip-container .vjs-pip-text,.vjs-layout-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,.pillarbox-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,.pillarbox-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:#2b333fb3;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:hover .vjs-big-play-button,.pillarbox-js:hover .vjs-big-play-button,.video-js .vjs-big-play-button:focus,.pillarbox-js .vjs-big-play-button:focus{border-color:#fff;background-color:#73859f;background-color:#73859f80;transition:all 0s}.vjs-controls-disabled .vjs-big-play-button,.vjs-has-started .vjs-big-play-button,.vjs-using-native-controls .vjs-big-play-button,.vjs-error .vjs-big-play-button{display:none}.vjs-has-started.vjs-paused.vjs-show-big-play-button-on-pause:not(.vjs-seeking,.vjs-scrubbing,.vjs-error) .vjs-big-play-button{display:block}.video-js button,.pillarbox-js button{background:none;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,.pillarbox-js .vjs-control.vjs-close-button{cursor:pointer;height:3em;position:absolute;right:0;top:.5em;z-index:2}.video-js .vjs-modal-dialog,.pillarbox-js .vjs-modal-dialog{background:#000c;background:linear-gradient(180deg,#000c,#fff0);overflow:auto}.video-js .vjs-modal-dialog>*,.pillarbox-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}.vjs-menu li.vjs-menu-item:focus,.vjs-menu li.vjs-menu-item:hover,.js-focus-visible .vjs-menu li.vjs-menu-item:hover{background-color:#73859f;background-color:#73859f80}.vjs-menu li.vjs-selected,.vjs-menu li.vjs-selected:focus,.vjs-menu li.vjs-selected:hover,.js-focus-visible .vjs-menu li.vjs-selected:hover{background-color:#fff;color:#2b333f}.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,.js-focus-visible .vjs-menu li.vjs-selected:hover .vjs-svg-icon{fill:#000}.video-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.pillarbox-js .vjs-menu *:not(.vjs-selected):focus:not(:focus-visible),.js-focus-visible .vjs-menu *:not(.vjs-selected):focus:not(.focus-visible){background:none}.vjs-menu li.vjs-menu-title{text-align:center;text-transform:uppercase;font-size:1em;line-height:2em;padding:0;margin:0 0 .3em;font-weight:700;cursor:default}.vjs-menu-button-popup .vjs-menu{display:none;position:absolute;bottom:0;width:10em;left:-3em;height:0em;margin-bottom:1.5em;border-top-color:#2b333fb3}.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:#2b333fb3;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-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-x-large .vjs-menu-button-popup .vjs-menu .vjs-menu-content,.vjs-layout-huge .vjs-menu-button-popup .vjs-menu .vjs-menu-content{max-height:25em}.vjs-workinghover .vjs-menu-button-popup.vjs-hover .vjs-menu,.vjs-menu-button-popup .vjs-menu.vjs-lock-showing{display:block}.video-js .vjs-menu-button-inline,.pillarbox-js .vjs-menu-button-inline{transition:all .4s;overflow:hidden}.video-js .vjs-menu-button-inline:before,.pillarbox-js .vjs-menu-button-inline:before{width:2.222222222em}.video-js .vjs-menu-button-inline:hover,.pillarbox-js .vjs-menu-button-inline:hover,.video-js .vjs-menu-button-inline:focus,.pillarbox-js .vjs-menu-button-inline:focus,.video-js .vjs-menu-button-inline.vjs-slider-active,.pillarbox-js .vjs-menu-button-inline.vjs-slider-active{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:hover .vjs-menu,.vjs-menu-button-inline:focus .vjs-menu,.vjs-menu-button-inline.vjs-slider-active .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,.pillarbox-js .vjs-control-bar{display:none;width:100%;position:absolute;bottom:0;left:0;right:0;height:3em;background-color:#2b333f;background-color:#2b333fb3}.video-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing,.pillarbox-js:not(.vjs-controls-disabled,.vjs-using-native-controls,.vjs-error) .vjs-control-bar.vjs-lock-showing{display:flex!important}.vjs-has-started .vjs-control-bar,.vjs-audio-only-mode .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-using-native-controls .vjs-control-bar,.vjs-error .vjs-control-bar{display:none!important}.vjs-audio.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar,.vjs-audio-only-mode.vjs-has-started.vjs-user-inactive.vjs-playing .vjs-control-bar{opacity:1;visibility:visible;pointer-events:auto}.video-js .vjs-control,.pillarbox-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,.pillarbox-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:before,.pillarbox-js .vjs-control:focus:before,.video-js .vjs-control:hover:before,.pillarbox-js .vjs-control:hover:before,.video-js .vjs-control:focus,.pillarbox-js .vjs-control:focus{text-shadow:0em 0em 1em white}.video-js *:not(.vjs-visible-text)>.vjs-control-text,.pillarbox-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,.pillarbox-js .vjs-custom-control-spacer{display:none}.video-js .vjs-progress-control,.pillarbox-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,.pillarbox-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,.pillarbox-js .vjs-progress-holder{flex:auto;transition:all .2s;height:.3em}.video-js .vjs-progress-control .vjs-progress-holder,.pillarbox-js .vjs-progress-control .vjs-progress-holder{margin:0 10px}.video-js .vjs-progress-control:hover .vjs-progress-holder,.pillarbox-js .vjs-progress-control:hover .vjs-progress-holder{font-size:1.6666666667em}.video-js .vjs-progress-control:hover .vjs-progress-holder.disabled,.pillarbox-js .vjs-progress-control:hover .vjs-progress-holder.disabled{font-size:1em}.video-js .vjs-progress-holder .vjs-play-progress,.pillarbox-js .vjs-progress-holder .vjs-play-progress,.video-js .vjs-progress-holder .vjs-load-progress,.pillarbox-js .vjs-progress-holder .vjs-load-progress,.video-js .vjs-progress-holder .vjs-load-progress div,.pillarbox-js .vjs-progress-holder .vjs-load-progress div{position:absolute;display:block;height:100%;margin:0;padding:0;width:0}.video-js .vjs-play-progress,.pillarbox-js .vjs-play-progress{background-color:#fff}.video-js .vjs-play-progress:before,.pillarbox-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,.pillarbox-js .vjs-load-progress{background:#73859f80}.video-js .vjs-load-progress div,.pillarbox-js .vjs-load-progress div{background:#73859fbf}.video-js .vjs-time-tooltip,.pillarbox-js .vjs-time-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-progress-holder:focus .vjs-time-tooltip,.pillarbox-js .vjs-progress-holder:focus .vjs-time-tooltip{display:none}.video-js .vjs-progress-control:hover .vjs-time-tooltip,.pillarbox-js .vjs-progress-control:hover .vjs-time-tooltip,.video-js .vjs-progress-control:hover .vjs-progress-holder:focus .vjs-time-tooltip{display:block;font-size:.6em;visibility:visible}.video-js .vjs-progress-control.disabled:hover .vjs-time-tooltip,.pillarbox-js .vjs-progress-control.disabled:hover .vjs-time-tooltip{font-size:1em}.video-js .vjs-progress-control .vjs-mouse-display,.pillarbox-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,.pillarbox-js .vjs-progress-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-progress-control .vjs-mouse-display,.vjs-user-inactive.pillarbox-js .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:#000c}.video-js .vjs-slider,.pillarbox-js .vjs-slider{position:relative;cursor:pointer;padding:0;margin:0 .45em;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;background-color:#73859f;background-color:#73859f80}.video-js .vjs-slider.disabled,.pillarbox-js .vjs-slider.disabled{cursor:default}.video-js .vjs-slider:focus,.pillarbox-js .vjs-slider:focus{text-shadow:0em 0em 1em white;box-shadow:0 0 1em #fff}.video-js .vjs-mute-control,.pillarbox-js .vjs-mute-control{cursor:pointer;flex:none}.video-js .vjs-volume-control,.pillarbox-js .vjs-volume-control{cursor:pointer;margin-right:1em;display:flex}.video-js .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-control.vjs-volume-horizontal{width:5em}.video-js .vjs-volume-panel .vjs-volume-control,.pillarbox-js .vjs-volume-panel .vjs-volume-control{visibility:visible;opacity:0;width:1px;height:1px;margin-left:-1px}.video-js .vjs-volume-panel,.pillarbox-js .vjs-volume-panel{transition:width 1s}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control,.video-js .vjs-volume-panel:active .vjs-volume-control,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control,.video-js .vjs-volume-panel:focus .vjs-volume-control,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control,.video-js .vjs-volume-panel .vjs-volume-control:active,.pillarbox-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-volume-control.vjs-slider-active,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active{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-hover .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-horizontal,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-horizontal,.pillarbox-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-volume-control.vjs-slider-active.vjs-volume-horizontal,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-horizontal{width:5em;height:3em;margin-right:0}.video-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel.vjs-hover .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel:active .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel:focus .vjs-volume-control.vjs-volume-vertical,.video-js .vjs-volume-panel .vjs-volume-control:active.vjs-volume-vertical,.pillarbox-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-volume-control.vjs-slider-active.vjs-volume-vertical,.pillarbox-js .vjs-volume-panel .vjs-volume-control.vjs-slider-active.vjs-volume-vertical{left:-3.5em;transition:left 0s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active{width:10em;transition:width .1s}.video-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-mute-toggle-only,.pillarbox-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,.pillarbox-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,.pillarbox-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,.pillarbox-js .vjs-volume-panel{display:flex}.video-js .vjs-volume-bar,.pillarbox-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,.pillarbox-js .vjs-volume-level{position:absolute;bottom:0;left:0;background-color:#fff}.video-js .vjs-volume-level:before,.pillarbox-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:translate(-50%)}.video-js .vjs-volume-panel.vjs-volume-panel-vertical,.pillarbox-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,.pillarbox-js .vjs-volume-vertical{width:3em;height:8em;bottom:8em;background-color:#2b333f;background-color:#2b333fb3}.video-js .vjs-volume-horizontal .vjs-menu,.pillarbox-js .vjs-volume-horizontal .vjs-menu{left:-2em}.video-js .vjs-volume-tooltip,.pillarbox-js .vjs-volume-tooltip{background-color:#fff;background-color:#fffc;border-radius:.3em;color:#000;float:right;font-family:Arial,Helvetica,sans-serif;font-size:1em;padding:6px 8px 8px;pointer-events:none;position:absolute;top:-3.4em;visibility:hidden;z-index:1}.video-js .vjs-volume-control:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-control:hover .vjs-volume-tooltip,.video-js .vjs-volume-control:hover .vjs-progress-holder:focus .vjs-volume-tooltip{display:block;font-size:1em;visibility:visible}.video-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-vertical:hover .vjs-volume-tooltip,.video-js .vjs-volume-vertical:hover .vjs-progress-holder:focus .vjs-volume-tooltip{left:1em;top:-12px}.video-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip,.pillarbox-js .vjs-volume-control.disabled:hover .vjs-volume-tooltip{font-size:1em}.video-js .vjs-volume-control .vjs-mouse-display,.pillarbox-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,.pillarbox-js .vjs-volume-horizontal .vjs-mouse-display{width:1px;height:100%}.video-js .vjs-volume-control:hover .vjs-mouse-display,.pillarbox-js .vjs-volume-control:hover .vjs-mouse-display{display:block}.video-js.vjs-user-inactive .vjs-volume-control .vjs-mouse-display,.vjs-user-inactive.pillarbox-js .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:#000c}.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,.pillarbox-js .vjs-live-control{display:flex;align-items:flex-start;flex:auto;font-size:1em;line-height:3em}.video-js:not(.vjs-live) .vjs-live-control,.pillarbox-js:not(.vjs-live) .vjs-live-control,.video-js.vjs-liveui .vjs-live-control,.vjs-liveui.pillarbox-js .vjs-live-control{display:none}.video-js .vjs-seek-to-live-control,.pillarbox-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,.vjs-live.pillarbox-js:not(.vjs-liveui) .vjs-seek-to-live-control,.video-js:not(.vjs-live) .vjs-seek-to-live-control,.pillarbox-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,.pillarbox-js .vjs-time-control{flex:none;font-size:1em;line-height:3em;min-width:2em;width:auto;padding-left:1em;padding-right:1em}.vjs-live .vjs-time-control,.vjs-live .vjs-time-divider,.video-js .vjs-current-time,.pillarbox-js .vjs-current-time,.video-js .vjs-duration,.pillarbox-js .vjs-duration{display:none}.vjs-time-divider{display:none;line-height:3em}.video-js .vjs-play-control,.pillarbox-js .vjs-play-control{cursor:pointer}.video-js .vjs-play-control .vjs-icon-placeholder,.pillarbox-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,.vjs-controls-disabled.pillarbox-js .vjs-text-track-display,.video-js.vjs-user-inactive.vjs-playing .vjs-text-track-display,.vjs-user-inactive.vjs-playing.pillarbox-js .vjs-text-track-display{bottom:1em}.video-js .vjs-text-track,.pillarbox-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,.vjs-controls-disabled.pillarbox-js video::-webkit-media-text-track-display,.video-js.vjs-user-inactive.vjs-playing video::-webkit-media-text-track-display,.vjs-user-inactive.vjs-playing.pillarbox-js video::-webkit-media-text-track-display{transform:translateY(-1.5em)}.video-js .vjs-picture-in-picture-control,.pillarbox-js .vjs-picture-in-picture-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-picture-in-picture-control,.vjs-audio-only-mode.pillarbox-js .vjs-picture-in-picture-control,.vjs-pip-window .vjs-picture-in-picture-control{display:none}.video-js .vjs-fullscreen-control,.pillarbox-js .vjs-fullscreen-control{cursor:pointer;flex:none}.video-js.vjs-audio-only-mode .vjs-fullscreen-control,.vjs-audio-only-mode.pillarbox-js .vjs-fullscreen-control,.vjs-pip-window .vjs-fullscreen-control{display:none}.vjs-playback-rate>.vjs-menu-button,.vjs-playback-rate .vjs-playback-rate-value{position:absolute;top:0;left:0;width:100%;height:100%}.vjs-playback-rate .vjs-playback-rate-value{pointer-events:none;font-size:1.5em;line-height:2;text-align:center}.vjs-playback-rate .vjs-menu{width:4em;left:0}.vjs-error .vjs-error-display .vjs-modal-dialog-content{font-size:1.4em;text-align:center}.vjs-loading-spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);opacity:.85;text-align:left;border:.6em solid rgba(43,51,63,.7);box-sizing:border-box;background-clip:padding-box;width:5em;height:5em;border-radius:50%;visibility:hidden}.vjs-seeking .vjs-loading-spinner,.vjs-waiting .vjs-loading-spinner{display:flex;justify-content:center;align-items:center;animation:vjs-spinner-show 0s linear .3s forwards}.vjs-error .vjs-loading-spinner{display:none}.vjs-loading-spinner:before,.vjs-loading-spinner:after{content:"";position:absolute;box-sizing:inherit;width:inherit;height:inherit;border-radius:inherit;opacity:1;border:inherit;border-color:transparent;border-top-color:#fff}.vjs-seeking .vjs-loading-spinner:before,.vjs-seeking .vjs-loading-spinner:after,.vjs-waiting .vjs-loading-spinner:before,.vjs-waiting .vjs-loading-spinner:after{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{to{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}to{border-top-color:#73859f}}.video-js.vjs-audio-only-mode .vjs-captions-button,.vjs-audio-only-mode.pillarbox-js .vjs-captions-button{display:none}.vjs-chapters-button .vjs-menu ul{width:24em}.video-js.vjs-audio-only-mode .vjs-descriptions-button,.vjs-audio-only-mode.pillarbox-js .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,.pillarbox-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,.pillarbox-js .vjs-subs-caps-button+.vjs-menu .vjs-captions-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:"";font-size:1.5em;line-height:inherit}.video-js.vjs-audio-only-mode .vjs-subs-caps-button,.vjs-audio-only-mode.pillarbox-js .vjs-subs-caps-button{display:none}.video-js .vjs-audio-button+.vjs-menu .vjs-description-menu-item .vjs-menu-item-text .vjs-icon-placeholder,.pillarbox-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,.pillarbox-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,.pillarbox-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,.pillarbox-js .vjs-audio-button+.vjs-menu .vjs-main-desc-menu-item .vjs-menu-item-text .vjs-icon-placeholder:before{font-family:VideoJS;content:" ";font-size:1.5em;line-height:inherit}.video-js.vjs-layout-small .vjs-current-time,.vjs-layout-small.pillarbox-js .vjs-current-time,.video-js.vjs-layout-small .vjs-time-divider,.vjs-layout-small.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-small .vjs-duration,.vjs-layout-small.pillarbox-js .vjs-duration,.video-js.vjs-layout-small .vjs-remaining-time,.vjs-layout-small.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-small .vjs-playback-rate,.vjs-layout-small.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-small .vjs-volume-control,.vjs-layout-small.pillarbox-js .vjs-volume-control,.video-js.vjs-layout-x-small .vjs-current-time,.vjs-layout-x-small.pillarbox-js .vjs-current-time,.video-js.vjs-layout-x-small .vjs-time-divider,.vjs-layout-x-small.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-x-small .vjs-duration,.vjs-layout-x-small.pillarbox-js .vjs-duration,.video-js.vjs-layout-x-small .vjs-remaining-time,.vjs-layout-x-small.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-x-small .vjs-playback-rate,.vjs-layout-x-small.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-x-small .vjs-volume-control,.vjs-layout-x-small.pillarbox-js .vjs-volume-control,.video-js.vjs-layout-tiny .vjs-current-time,.vjs-layout-tiny.pillarbox-js .vjs-current-time,.video-js.vjs-layout-tiny .vjs-time-divider,.vjs-layout-tiny.pillarbox-js .vjs-time-divider,.video-js.vjs-layout-tiny .vjs-duration,.vjs-layout-tiny.pillarbox-js .vjs-duration,.video-js.vjs-layout-tiny .vjs-remaining-time,.vjs-layout-tiny.pillarbox-js .vjs-remaining-time,.video-js.vjs-layout-tiny .vjs-playback-rate,.vjs-layout-tiny.pillarbox-js .vjs-playback-rate,.video-js.vjs-layout-tiny .vjs-volume-control,.vjs-layout-tiny.pillarbox-js .vjs-volume-control{display:none}.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-x-small .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-x-small.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:hover,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal:active,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal:active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,.video-js.vjs-layout-tiny .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover,.vjs-layout-tiny.pillarbox-js .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-hover{width:auto;width:initial}.video-js.vjs-layout-x-small .vjs-progress-control,.vjs-layout-x-small.pillarbox-js .vjs-progress-control,.video-js.vjs-layout-tiny .vjs-progress-control,.vjs-layout-tiny.pillarbox-js .vjs-progress-control{display:none}.video-js.vjs-layout-x-small .vjs-custom-control-spacer,.vjs-layout-x-small.pillarbox-js .vjs-custom-control-spacer{flex:auto;display:block}.vjs-modal-dialog.vjs-text-track-settings{background-color:#2b333f;background-color:#2b333fbf;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-font,.vjs-text-track-settings .vjs-track-settings-controls{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}.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-x-small .vjs-text-track-settings .vjs-modal-dialog-content,.vjs-layout-tiny .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:focus,.vjs-track-settings-controls button:active{outline-style:solid;outline-width:medium;background-image:linear-gradient(0deg,#fff 88%,#73859f)}.vjs-track-settings-controls button:hover{color:#2b333fbf}.vjs-track-settings-controls button{background-color:#fff;background-image:linear-gradient(-180deg,#fff 88%,#73859f);color:#2b333f;cursor:pointer;border-radius:2px}.vjs-track-settings-controls .vjs-default-button{margin-right:1em}.vjs-title-bar{background:#000000e6;background:linear-gradient(180deg,#000000e6,#000000b3 60%,#0000);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-title,.vjs-title-bar-description{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,.pillarbox-js .vjs-skip-forward-5,.video-js .vjs-skip-forward-10,.pillarbox-js .vjs-skip-forward-10,.video-js .vjs-skip-forward-30,.pillarbox-js .vjs-skip-forward-30,.video-js .vjs-skip-backward-5,.pillarbox-js .vjs-skip-backward-5,.video-js .vjs-skip-backward-10,.pillarbox-js .vjs-skip-backward-10,.video-js .vjs-skip-backward-30,.pillarbox-js .vjs-skip-backward-30{cursor:pointer}@media print{.video-js>*:not(.vjs-tech):not(.vjs-poster),.pillarbox-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),.js-focus-visible .pillarbox-js *:focus:not(.focus-visible){outline:none}.video-js *:focus:not(:focus-visible),.pillarbox-js *:focus:not(:focus-visible){outline:none}.pillarbox-js:hover .vjs-big-play-button{background-color:#16161688;transition:background-color .25s ease}.pillarbox-js .vjs-big-play-button{width:2em;height:2em;margin:0;font-size:2.25em;background:#0000;border:.1em solid #fff;border-radius:50%;transform:translate(-50%,-50%);transition:background-color .25s ease}.pillarbox-js .vjs-big-play-button .vjs-icon-placeholder:before{position:initial;display:flex;align-items:center;justify-content:center;font-size:1.75em}.pillarbox-js .vjs-modal-dialog.vjs-text-track-settings{top:50%;left:50%;max-width:25em;max-height:50em;background:#161616f2;border-radius:.5em;box-shadow:2px 2px 3px #0005;transform:translate(-50%,-50%);overscroll-behavior:contain}.pillarbox-js .vjs-text-track-settings .vjs-modal-dialog-content{display:flex;flex-direction:column;padding:1em 1.5em 0}.pillarbox-js .vjs-text-track-settings legend{font-size:1em}.pillarbox-js .vjs-text-track-settings fieldset span{padding-inline:0}.pillarbox-js .vjs-text-track-settings fieldset{display:flex;margin:0 0 1em;padding:0}.pillarbox-js.video-js .vjs-text-track-settings select,.pillarbox-js .vjs-text-track-settings select{margin:.25em 0 0;padding:.5em;color:#fff;background:#3f3f3f;border:none;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.pillarbox-js.video-js .vjs-text-track-settings select:focus-within,.pillarbox-js .vjs-text-track-settings select:focus-within{outline:solid}.pillarbox-js .vjs-track-settings-controls{display:flex;flex-direction:row;gap:1em;justify-content:end}.pillarbox-js .vjs-track-settings-controls button{margin-block:1em;padding:.25em .5em;color:#fff;background:#3f3f3f}.pillarbox-js .vjs-track-settings-controls button:hover{background:#5c5c5c}.pillarbox-js .vjs-track-settings-controls .vjs-default-button{margin-right:0}.pillarbox-js .vjs-control{height:3em}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-control-bar{align-items:flex-end;height:6em;padding-inline:1em;background:linear-gradient(#000,#0000 0%,#000000b3)}.pillarbox-js.vjs-audio-only-mode .vjs-control-bar{background-color:#1e232c}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-custom-control-spacer{display:block;flex:auto}.pillarbox-js .vjs-error-display .vjs-modal-dialog-content{display:flex;align-items:center;justify-content:center}.pillarbox-js.vjs-layout-tiny{font-size:8px}.pillarbox-js.vjs-layout-x-small{font-size:10px}.pillarbox-js.vjs-layout-small{font-size:12px}.pillarbox-js.vjs-layout-medium{font-size:14px}.pillarbox-js.vjs-layout-large{font-size:16px}.pillarbox-js.vjs-layout-x-large{font-size:18px}.pillarbox-js.vjs-layout-huge{font-size:20px}.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-time-divider,.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-current-time,.pillarbox-js:not(.vjs-layout-tiny,.vjs-layout-x-small,.vjs-live) .vjs-duration{display:block;padding:0;font-weight:700}.pillarbox-js.vjs-layout-tiny .vjs-progress-control,.pillarbox-js.vjs-layout-x-small .vjs-progress-control{display:flex}.pillarbox-js.vjs-layout-x-small.vjs-audio-only-mode .vjs-custom-control-spacer{display:none}.pillarbox-js .vjs-loading-spinner{border:.25em solid rgba(0,0,0,0)}.pillarbox-js .vjs-loading-spinner{display:flex;align-items:center;justify-content:center}@keyframes vjs-spinner-fade{0%{border-top-color:#333}20%{border-top-color:#333}35%{border-top-color:#fff}60%{border-top-color:#333}to{border-top-color:#333}}.pillarbox-js .vjs-menu .vjs-menu-item{border-radius:.25em}.pillarbox-js .vjs-menu .vjs-menu-item:not(.vjs-selected):focus,.pillarbox-js .vjs-menu .vjs-menu-item:not(.vjs-selected):hover{background-color:#3f3f3f}.pillarbox-js .vjs-menu .vjs-menu-item.vjs-texttrack-settings:focus,.pillarbox-js .vjs-menu .vjs-menu-item.vjs-texttrack-settings:hover{background-color:#0000}.pillarbox-js .vjs-menu .vjs-menu-item .vjs-selected{color:#222;background-color:#fff;pointer-events:none}.pillarbox-js .vjs-menu-button-popup.vjs-hover .vjs-menu{display:none}.pillarbox-js .vjs-menu-button-popup .vjs-menu{right:0;bottom:0;left:unset;width:100%;margin:0}.pillarbox-js .vjs-menu-button-popup .vjs-menu .vjs-menu-content{right:50%;bottom:5em;display:grid;gap:.25em;min-width:13em;padding:1em .5em;background:#161616f2;border-radius:.5em;transform:translate(50%);overscroll-behavior:contain}.pillarbox-js .vjs-slider{background-color:#ffffff4d;border-radius:1em}.pillarbox-js .vjs-text-track-display{top:0;right:0;bottom:4em;left:0}.pillarbox-js .vjs-current-time{margin-left:1em}.pillarbox-js .vjs-time-divider{min-width:1em;text-align:center}.pillarbox-js .vjs-remaining-time{display:none}.pillarbox-js.vjs-audio-only-mode .vjs-current-time,.pillarbox-js.vjs-audio-only-mode .vjs-time-divider,.pillarbox-js.vjs-audio-only-mode .vjs-duration{order:1}.pillarbox-js.vjs-audio-only-mode .vjs-duration{margin-right:1em}.pillarbox-js .vjs-title-bar{padding-bottom:2em;background:linear-gradient(rgba(0,0,0,.6) 0%,transparent 100%)}.pillarbox-js:not(.vjs-audio-only-mode) .vjs-progress-control{position:absolute;bottom:3em;width:calc(100% - 2em);height:1em}.pillarbox-js .vjs-progress-holder{margin:0}.pillarbox-js .vjs-load-progress{background:#ffffff4d;border-radius:1em}.pillarbox-js .vjs-load-progress div{background:#0000}.pillarbox-js.vjs-scrubbing .vjs-play-progress .vjs-time-tooltip,.pillarbox-js.vjs-seeking .vjs-play-progress .vjs-time-tooltip{display:none}.pillarbox-js .vjs-play-progress{color:#af001e;background:#af001e;border-radius:1em}.pillarbox-js .vjs-play-progress:before{font-size:0px;text-shadow:0px 0px 1px #000}.pillarbox-js .vjs-progress-control:hover .vjs-play-progress:before{font-size:.9em}.pillarbox-js .vjs-progress-control:hover .vjs-time-tooltip{right:0%!important;transform:translate(50%)}.pillarbox-js .vjs-progress-holder:focus-visible .vjs-play-progress:before{font-size:.9em}.pillarbox-js .vjs-time-tooltip,.pillarbox-js .vjs-mouse-display .vjs-time-tooltip{top:-3em;padding:.4em;color:#fff;font-weight:700;text-shadow:1px 1px 3px #000,1px 1px 2px #000;background-color:#0000}.pillarbox-js .vjs-volume-level{border-radius:1em}.pillarbox-js .vjs-volume-tooltip{top:-2em;padding:.4em;font-weight:700;text-shadow:1px 1px 3px #000;background-color:#0000} diff --git a/pr-preview/pr-31/packages/skip-button/assets/index-CihQ5nO6.js b/pr-preview/pr-31/packages/skip-button/assets/index-CihQ5nO6.js new file mode 100644 index 0000000..2852657 --- /dev/null +++ b/pr-preview/pr-31/packages/skip-button/assets/index-CihQ5nO6.js @@ -0,0 +1,220 @@ +var oT=Object.defineProperty;var uT=(i,e,t)=>e in i?oT(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var xa=(i,e,t)=>(uT(i,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const a of n.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function t(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerPolicy&&(n.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?n.credentials="include":r.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(r){if(r.ep)return;r.ep=!0;const n=t(r);fetch(r.href,n)}})();var en=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yt(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function gd(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(s){var r=Object.getOwnPropertyDescriptor(i,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:function(){return i[s]}})}),t}var Os;typeof window<"u"?Os=window:typeof en<"u"?Os=en:typeof self<"u"?Os=self:Os={};var An=Os;const E=Yt(An),lT={},cT=Object.freeze(Object.defineProperty({__proto__:null,default:lT},Symbol.toStringTag,{value:"Module"})),dT=gd(cT);var Il=typeof en<"u"?en:typeof window<"u"?window:{},hT=dT,Rs;typeof document<"u"?Rs=document:(Rs=Il["__GLOBAL_DOCUMENT_CACHE@4"],Rs||(Rs=Il["__GLOBAL_DOCUMENT_CACHE@4"]=hT));var yd=Rs;const F=Yt(yd);var Ya={exports:{}};(function(i,e){function t(l){if(l&&typeof l=="object"){var f=l.which||l.keyCode||l.charCode;f&&(l=f)}if(typeof l=="number")return a[l];var m=String(l),y=s[m.toLowerCase()];if(y)return y;var y=r[m.toLowerCase()];if(y)return y;if(m.length===1)return m.charCodeAt(0)}t.isEventKey=function(f,m){if(f&&typeof f=="object"){var y=f.which||f.keyCode||f.charCode;if(y==null)return!1;if(typeof m=="string"){var T=s[m.toLowerCase()];if(T)return T===y;var T=r[m.toLowerCase()];if(T)return T===y}else if(typeof m=="number")return m===y;return!1}},e=i.exports=t;var s=e.code=e.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},r=e.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};/*! + * Programatically add the following + */for(n=97;n<123;n++)s[String.fromCharCode(n)]=n-32;for(var n=48;n<58;n++)s[n-48]=n;for(n=1;n<13;n++)s["f"+n]=n+111;for(n=0;n<10;n++)s["numpad "+n]=n+96;var a=e.names=e.title={};for(n in s)a[s[n]]=n;for(var o in r)s[o]=r[o]})(Ya,Ya.exports);var fT=Ya.exports;const W=Yt(fT);var pT=mT;function mT(i,e){var t,s=null;try{t=JSON.parse(i,e)}catch(r){s=r}return[s,t]}const gT=Yt(pT);var Io={exports:{}};function rt(){return rt=Object.assign?Object.assign.bind():function(i){for(var e=1;e=400&&r.statusCode<=599){var a=n;if(t)if(ST.TextDecoder){var o=ET(r.headers&&r.headers["content-type"]);try{a=new TextDecoder(o).decode(n)}catch{}}else a=String.fromCharCode.apply(null,new Uint8Array(n));e({cause:a});return}e(null,n)}};function ET(i){return i===void 0&&(i=""),i.toLowerCase().split(";").reduce(function(e,t){var s=t.split("="),r=s[0],n=s[1];return r.trim()==="charset"?n.trim():e},"utf-8")}var CT=xT,_d=An,AT=_T,DT=vT;St.httpHandler=CT;/** + * @license + * slighly modified parse-headers 2.0.2 + * Copyright (c) 2014 David Björklund + * Available under the MIT license + * + */var wT=function(e){var t={};return e&&e.trim().split(` +`).forEach(function(s){var r=s.indexOf(":"),n=s.slice(0,r).trim().toLowerCase(),a=s.slice(r+1).trim();typeof t[n]>"u"?t[n]=a:Array.isArray(t[n])?t[n].push(a):t[n]=[t[n],a]}),t};Io.exports=St;Io.exports.default=St;St.XMLHttpRequest=_d.XMLHttpRequest||LT;St.XDomainRequest="withCredentials"in new St.XMLHttpRequest?St.XMLHttpRequest:_d.XDomainRequest;kT(["get","put","post","patch","head","delete"],function(i){St[i==="delete"?"del":i]=function(e,t,s){return t=vd(e,t,s),t.method=i.toUpperCase(),Td(t)}});function kT(i,e){for(var t=0;t"u")throw new Error("callback argument missing");var e=!1,t=function(M,R,P){e||(e=!0,i.callback(M,R,P))};function s(){o.readyState===4&&setTimeout(a,0)}function r(){var k=void 0;if(o.response?k=o.response:k=o.responseText||PT(o),A)try{k=JSON.parse(k)}catch{}return k}function n(k){return clearTimeout(D),k instanceof Error||(k=new Error(""+(k||"Unknown XMLHttpRequest Error"))),k.statusCode=0,t(k,w)}function a(){if(!f){var k;clearTimeout(D),i.useXDR&&o.status===void 0?k=200:k=o.status===1223?204:o.status;var M=w,R=null;return k!==0?(M={body:r(),statusCode:k,method:y,headers:{},url:m,rawRequest:o},o.getAllResponseHeaders&&(M.headers=wT(o.getAllResponseHeaders()))):R=new Error("Internal XMLHttpRequest Error"),t(R,M,M.body)}}var o=i.xhr||null;o||(i.cors||i.useXDR?o=new St.XDomainRequest:o=new St.XMLHttpRequest);var l,f,m=o.url=i.uri||i.url,y=o.method=i.method||"GET",T=i.body||i.data,S=o.headers=i.headers||{},_=!!i.sync,A=!1,D,w={body:void 0,headers:{},statusCode:0,method:y,url:m,rawRequest:o};if("json"in i&&i.json!==!1&&(A=!0,S.accept||S.Accept||(S.Accept="application/json"),y!=="GET"&&y!=="HEAD"&&(S["content-type"]||S["Content-Type"]||(S["Content-Type"]="application/json"),T=JSON.stringify(i.json===!0?T:i.json))),o.onreadystatechange=s,o.onload=a,o.onerror=n,o.onprogress=function(){},o.onabort=function(){f=!0},o.ontimeout=n,o.open(y,m,!_,i.username,i.password),_||(o.withCredentials=!!i.withCredentials),!_&&i.timeout>0&&(D=setTimeout(function(){if(!f){f=!0,o.abort("timeout");var k=new Error("XMLHttpRequest timeout");k.code="ETIMEDOUT",n(k)}},i.timeout)),o.setRequestHeader)for(l in S)S.hasOwnProperty(l)&&o.setRequestHeader(l,S[l]);else if(i.headers&&!IT(i.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in i&&(o.responseType=i.responseType),"beforeSend"in i&&typeof i.beforeSend=="function"&&i.beforeSend(o),o.send(T||null),o}function PT(i){try{if(i.responseType==="document")return i.responseXML;var e=i.responseXML&&i.responseXML.documentElement.nodeName==="parsererror";if(i.responseType===""&&!e)return i.responseXML}catch{}return null}function LT(){}var OT=Io.exports;const bd=Yt(OT);var Sd={exports:{}},Pl=yd,Po=Object.create||function(){function i(){}return function(e){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return i.prototype=e,new i}}();function Ze(i,e){this.name="ParsingError",this.code=i.code,this.message=e||i.message}Ze.prototype=Po(Error.prototype);Ze.prototype.constructor=Ze;Ze.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function Lo(i){function e(s,r,n,a){return(s|0)*3600+(r|0)*60+(n|0)+(a|0)/1e3}var t=i.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return t?t[3]?e(t[1],t[2],t[3].replace(":",""),t[4]):t[1]>59?e(t[1],t[2],0,t[4]):e(0,t[1],t[2],t[4]):null}function $s(){this.values=Po(null)}$s.prototype={set:function(i,e){!this.get(i)&&e!==""&&(this.values[i]=e)},get:function(i,e,t){return t?this.has(i)?this.values[i]:e[t]:this.has(i)?this.values[i]:e},has:function(i){return i in this.values},alt:function(i,e,t){for(var s=0;s=0&&e<=100)?(this.set(i,e),!0):!1}};function Ms(i,e,t,s){var r=s?i.split(s):[i];for(var n in r)if(typeof r[n]=="string"){var a=r[n].split(t);if(a.length===2){var o=a[0].trim(),l=a[1].trim();e(o,l)}}}function RT(i,e,t){var s=i;function r(){var o=Lo(i);if(o===null)throw new Ze(Ze.Errors.BadTimeStamp,"Malformed timestamp: "+s);return i=i.replace(/^[^\sa-zA-Z-]+/,""),o}function n(o,l){var f=new $s;Ms(o,function(m,y){switch(m){case"region":for(var T=t.length-1;T>=0;T--)if(t[T].id===y){f.set(m,t[T].region);break}break;case"vertical":f.alt(m,y,["rl","lr"]);break;case"line":var S=y.split(","),_=S[0];f.integer(m,_),f.percent(m,_)&&f.set("snapToLines",!1),f.alt(m,_,["auto"]),S.length===2&&f.alt("lineAlign",S[1],["start","center","end"]);break;case"position":S=y.split(","),f.percent(m,S[0]),S.length===2&&f.alt("positionAlign",S[1],["start","center","end"]);break;case"size":f.percent(m,y);break;case"align":f.alt(m,y,["start","center","end","left","right"]);break}},/:/,/\s/),l.region=f.get("region",null),l.vertical=f.get("vertical","");try{l.line=f.get("line","auto")}catch{}l.lineAlign=f.get("lineAlign","start"),l.snapToLines=f.get("snapToLines",!0),l.size=f.get("size",100);try{l.align=f.get("align","center")}catch{l.align=f.get("align","middle")}try{l.position=f.get("position","auto")}catch{l.position=f.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},l.align)}l.positionAlign=f.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},l.align)}function a(){i=i.replace(/^\s+/,"")}if(a(),e.startTime=r(),a(),i.substr(0,3)!=="-->")throw new Ze(Ze.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+s);i=i.substr(3),a(),e.endTime=r(),a(),n(i,e)}var Ea=Pl.createElement&&Pl.createElement("textarea"),MT={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Ll={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)"},NT={v:"title",lang:"lang"},Ol={rt:"ruby"};function xd(i,e){function t(){if(!e)return null;function _(D){return e=e.substr(D.length),D}var A=e.match(/^([^<]*)(<[^>]*>?)?/);return _(A[1]?A[1]:A[2])}function s(_){return Ea.innerHTML=_,_=Ea.textContent,Ea.textContent="",_}function r(_,A){return!Ol[A.localName]||Ol[A.localName]===_.localName}function n(_,A){var D=MT[_];if(!D)return null;var w=i.document.createElement(D),k=NT[_];return k&&A&&(w[k]=A.trim()),w}for(var a=i.document.createElement("div"),o=a,l,f=[];(l=t())!==null;){if(l[0]==="<"){if(l[1]==="/"){f.length&&f[f.length-1]===l.substr(2).replace(">","")&&(f.pop(),o=o.parentNode);continue}var m=Lo(l.substr(1,l.length-2)),y;if(m){y=i.document.createProcessingInstruction("timestamp",m),o.appendChild(y);continue}var T=l.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!T||(y=n(T[1],T[3]),!y)||!r(o,y))continue;if(T[2]){var S=T[2].split(".");S.forEach(function(_){var A=/^bg_/.test(_),D=A?_.slice(3):_;if(Ll.hasOwnProperty(D)){var w=A?"background-color":"color",k=Ll[D];y.style[w]=k}}),y.className=S.join(" ")}f.push(T[1]),o.appendChild(y),o=y;continue}o.appendChild(i.document.createTextNode(s(l)))}return a}var Rl=[[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 BT(i){for(var e=0;e=t[0]&&i<=t[1])return!0}return!1}function FT(i){var e=[],t="",s;if(!i||!i.childNodes)return"ltr";function r(o,l){for(var f=l.childNodes.length-1;f>=0;f--)o.push(l.childNodes[f])}function n(o){if(!o||!o.length)return null;var l=o.pop(),f=l.textContent||l.innerText;if(f){var m=f.match(/^.*(\n|\r)/);return m?(o.length=0,m[0]):f}if(l.tagName==="ruby")return n(o);if(l.childNodes)return r(o,l),n(o)}for(r(e,i);t=n(e);)for(var a=0;a=0&&i.line<=100))return i.line;if(!i.track||!i.track.textTrackList||!i.track.textTrackList.mediaElement)return-1;for(var e=i.track,t=e.textTrackList,s=0,r=0;ri.left&&this.topi.top};Fe.prototype.overlapsAny=function(i){for(var e=0;e=i.top&&this.bottom<=i.bottom&&this.left>=i.left&&this.right<=i.right};Fe.prototype.overlapsOppositeAxis=function(i,e){switch(e){case"+x":return this.lefti.right;case"+y":return this.topi.bottom}};Fe.prototype.intersectPercentage=function(i){var e=Math.max(0,Math.min(this.right,i.right)-Math.max(this.left,i.left)),t=Math.max(0,Math.min(this.bottom,i.bottom)-Math.max(this.top,i.top)),s=e*t;return s/(this.height*this.width)};Fe.prototype.toCSSCompatValues=function(i){return{top:this.top-i.top,bottom:i.bottom-this.bottom,left:this.left-i.left,right:i.right-this.right,height:this.height,width:this.width}};Fe.getSimpleBoxPosition=function(i){var e=i.div?i.div.offsetHeight:i.tagName?i.offsetHeight:0,t=i.div?i.div.offsetWidth:i.tagName?i.offsetWidth:0,s=i.div?i.div.offsetTop:i.tagName?i.offsetTop:0;i=i.div?i.div.getBoundingClientRect():i.tagName?i.getBoundingClientRect():i;var r={left:i.left,right:i.right,top:i.top||s,height:i.height||e,bottom:i.bottom||s+(i.height||e),width:i.width||t};return r};function $T(i,e,t,s){function r(D,w){for(var k,M=new Fe(D),R=1,P=0;PU&&(k=new Fe(D),R=U),D=new Fe(M)}return k||M}var n=new Fe(e),a=e.cue,o=UT(a),l=[];if(a.snapToLines){var f;switch(a.vertical){case"":l=["+y","-y"],f="height";break;case"rl":l=["+x","-x"],f="width";break;case"lr":l=["-x","+x"],f="width";break}var m=n.lineHeight,y=m*Math.round(o),T=t[f]+m,S=l[0];Math.abs(y)>T&&(y=y<0?-1:1,y*=Math.ceil(T/m)*m),o<0&&(y+=a.vertical===""?t.height:t.width,l=l.reverse()),n.move(S,y)}else{var _=n.lineHeight/t.height*100;switch(a.lineAlign){case"center":o-=_/2;break;case"end":o-=_;break}switch(a.vertical){case"":e.applyStyles({top:e.formatStyle(o,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(o,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(o,"%")});break}l=["+y","-x","+x","-y"],n=new Fe(e)}var A=r(n,l);e.move(A.toCSSCompatValues(t))}function ns(){}ns.StringDecoder=function(){return{decode:function(i){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))}}};ns.convertCueToDOMTree=function(i,e){return!i||!e?null:xd(i,e)};var qT=.05,jT="sans-serif",VT="1.5%";ns.processCues=function(i,e,t){if(!i||!e||!t)return null;for(;t.firstChild;)t.removeChild(t.firstChild);var s=i.document.createElement("div");s.style.position="absolute",s.style.left="0",s.style.right="0",s.style.top="0",s.style.bottom="0",s.style.margin=VT,t.appendChild(s);function r(m){for(var y=0;y")===-1){e.cue.id=a;continue}case"CUE":try{RT(a,e.cue,e.regionList)}catch(m){e.reportOrThrowError(m),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var f=a.indexOf("-->")!==-1;if(!a||f&&(l=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+=` +`),e.cue.text+=a.replace(/\u2028/g,` +`).replace(/u2029/g,` +`);continue;case"BADCUE":a||(e.state="ID");continue}}}catch(m){e.reportOrThrowError(m),e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var i=this;try{if(i.buffer+=i.decoder.decode(),(i.cue||i.state==="HEADER")&&(i.buffer+=` + +`,i.parse()),i.state==="INITIAL")throw new Ze(Ze.Errors.BadSignature)}catch(e){i.reportOrThrowError(e)}return i.onflush&&i.onflush(),this}};var HT=ns,GT="auto",zT={"":1,lr:1,rl:1},WT={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function KT(i){if(typeof i!="string")return!1;var e=zT[i.toLowerCase()];return e?i.toLowerCase():!1}function Ca(i){if(typeof i!="string")return!1;var e=WT[i.toLowerCase()];return e?i.toLowerCase():!1}function Ed(i,e,t){this.hasBeenReset=!1;var s="",r=!1,n=i,a=e,o=t,l=null,f="",m=!0,y="auto",T="start",S="auto",_="auto",A=100,D="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return s},set:function(w){s=""+w}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(w){r=!!w}},startTime:{enumerable:!0,get:function(){return n},set:function(w){if(typeof w!="number")throw new TypeError("Start time must be set to a number.");n=w,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return a},set:function(w){if(typeof w!="number")throw new TypeError("End time must be set to a number.");a=w,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return o},set:function(w){o=""+w,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return l},set:function(w){l=w,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return f},set:function(w){var k=KT(w);if(k===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");f=k,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return m},set:function(w){m=!!w,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return y},set:function(w){if(typeof w!="number"&&w!==GT)throw new SyntaxError("Line: an invalid number or illegal string was specified.");y=w,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return T},set:function(w){var k=Ca(w);k?(T=k,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return S},set:function(w){if(w<0||w>100)throw new Error("Position must be between 0 and 100.");S=w,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return _},set:function(w){var k=Ca(w);k?(_=k,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return A},set:function(w){if(w<0||w>100)throw new Error("Size must be between 0 and 100.");A=w,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return D},set:function(w){var k=Ca(w);if(!k)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");D=k,this.hasBeenReset=!0}}}),this.displayState=void 0}Ed.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var XT=Ed,YT={"":!0,up:!0};function QT(i){if(typeof i!="string")return!1;var e=YT[i.toLowerCase()];return e?i.toLowerCase():!1}function Cs(i){return typeof i=="number"&&i>=0&&i<=100}function JT(){var i=100,e=3,t=0,s=100,r=0,n=100,a="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return i},set:function(o){if(!Cs(o))throw new Error("Width must be between 0 and 100.");i=o}},lines:{enumerable:!0,get:function(){return e},set:function(o){if(typeof o!="number")throw new TypeError("Lines must be set to a number.");e=o}},regionAnchorY:{enumerable:!0,get:function(){return s},set:function(o){if(!Cs(o))throw new Error("RegionAnchorX must be between 0 and 100.");s=o}},regionAnchorX:{enumerable:!0,get:function(){return t},set:function(o){if(!Cs(o))throw new Error("RegionAnchorY must be between 0 and 100.");t=o}},viewportAnchorY:{enumerable:!0,get:function(){return n},set:function(o){if(!Cs(o))throw new Error("ViewportAnchorY must be between 0 and 100.");n=o}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(o){if(!Cs(o))throw new Error("ViewportAnchorX must be between 0 and 100.");r=o}},scroll:{enumerable:!0,get:function(){return a},set:function(o){var l=QT(o);l===!1?console.warn("Scroll: an invalid or illegal string was specified."):a=l}}})}var ZT=JT,Bt=An,Ti=Sd.exports={WebVTT:HT,VTTCue:XT,VTTRegion:ZT};Bt.vttjs=Ti;Bt.WebVTT=Ti.WebVTT;var e2=Ti.VTTCue,t2=Ti.VTTRegion,i2=Bt.VTTCue,s2=Bt.VTTRegion;Ti.shim=function(){Bt.VTTCue=e2,Bt.VTTRegion=t2};Ti.restore=function(){Bt.VTTCue=i2,Bt.VTTRegion=s2};Bt.VTTCue||Ti.shim();var r2=Sd.exports;const Ml=Yt(r2);var Cd={exports:{}};(function(i,e){(function(t){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,n=/(?:\/|^)\.(?=\/)/g,a=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,o={buildAbsoluteURL:function(l,f,m){if(m=m||{},l=l.trim(),f=f.trim(),!f){if(!m.alwaysNormalize)return l;var y=o.parseURL(l);if(!y)throw new Error("Error trying to parse base URL.");return y.path=o.normalizePath(y.path),o.buildURLFromParts(y)}var T=o.parseURL(f);if(!T)throw new Error("Error trying to parse relative URL.");if(T.scheme)return m.alwaysNormalize?(T.path=o.normalizePath(T.path),o.buildURLFromParts(T)):f;var S=o.parseURL(l);if(!S)throw new Error("Error trying to parse base URL.");if(!S.netLoc&&S.path&&S.path[0]!=="/"){var _=r.exec(S.path);S.netLoc=_[1],S.path=_[2]}S.netLoc&&!S.path&&(S.path="/");var A={scheme:S.scheme,netLoc:T.netLoc,path:null,params:T.params,query:T.query,fragment:T.fragment};if(!T.netLoc&&(A.netLoc=S.netLoc,T.path[0]!=="/"))if(!T.path)A.path=S.path,T.params||(A.params=S.params,T.query||(A.query=S.query));else{var D=S.path,w=D.substring(0,D.lastIndexOf("/")+1)+T.path;A.path=o.normalizePath(w)}return A.path===null&&(A.path=m.alwaysNormalize?o.normalizePath(T.path):T.path),o.buildURLFromParts(A)},parseURL:function(l){var f=s.exec(l);return f?{scheme:f[1]||"",netLoc:f[2]||"",path:f[3]||"",params:f[4]||"",query:f[5]||"",fragment:f[6]||""}:null},normalizePath:function(l){for(l=l.split("").reverse().join("").replace(n,"");l.length!==(l=l.replace(a,"")).length;);return l.split("").reverse().join("")},buildURLFromParts:function(l){return l.scheme+l.netLoc+l.path+l.params+l.query+l.fragment}};i.exports=o})()})(Cd);var n2=Cd.exports;const Nl=Yt(n2);var Bl="http://example.com",wn=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=E.location&&E.location.href||"");var s=typeof E.URL=="function",r=/^\/\//.test(e),n=!E.location&&!/\/\//i.test(e);if(s?e=new E.URL(e,E.location||Bl):/\/\//i.test(e)||(e=Nl.buildAbsoluteURL(E.location&&E.location.href||"",e)),s){var a=new URL(t,e);return n?a.href.slice(Bl.length):r?a.href.slice(a.protocol.length):a.href}return Nl.buildAbsoluteURL(e,t)},Oo=function(){function i(){this.listeners={}}var e=i.prototype;return e.on=function(s,r){this.listeners[s]||(this.listeners[s]=[]),this.listeners[s].push(r)},e.off=function(s,r){if(!this.listeners[s])return!1;var n=this.listeners[s].indexOf(r);return this.listeners[s]=this.listeners[s].slice(0),this.listeners[s].splice(n,1),n>-1},e.trigger=function(s){var r=this.listeners[s];if(r)if(arguments.length===2)for(var n=r.length,a=0;a-1;t=this.buffer.indexOf(` +`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const l2=" ",Aa=function(i){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(i||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},c2=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},Ye=function(i){const e={};if(!i)return e;const t=i.split(c2());let s=t.length,r;for(;s--;)t[s]!==""&&(r=/([^=]*)=(.*)/.exec(t[s]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e};class d2 extends Oo{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,s;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((n,a)=>{const o=a(e);return o===e?n:n.concat([o])},[e]).forEach(n=>{for(let a=0;an),this.customParsers.push(n=>{if(e.exec(n))return this.trigger("data",{type:"custom",data:s(n),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const s=r=>e.test(r)?t(r):r;this.tagMappers.push(s)}}const h2=i=>i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),Ht=function(i){const e={};return Object.keys(i).forEach(function(t){e[h2(t)]=i[t]}),e},Da=function(i){const{serverControl:e,targetDuration:t,partTargetDuration:s}=i;if(!e)return;const r="#EXT-X-SERVER-CONTROL",n="holdBack",a="partHoldBack",o=t&&t*3,l=s&&s*2;t&&!e.hasOwnProperty(n)&&(e[n]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[n]{s.uri||!s.parts&&!s.preloadHints||(!s.map&&r&&(s.map=r),!s.key&&n&&(s.key=n),!s.timeline&&typeof m=="number"&&(s.timeline=m),this.manifest.preloadSegment=s)}),this.parseStream.on("data",function(_){let A,D;({tag(){({version(){_.version&&(this.manifest.version=_.version)},"allow-cache"(){this.manifest.allowCache=_.allowed,"allowed"in _||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const w={};"length"in _&&(s.byterange=w,w.length=_.length,"offset"in _||(_.offset=y)),"offset"in _&&(s.byterange=w,w.offset=_.offset),y=w.offset+w.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),_.title&&(s.title=_.title),_.duration>0&&(s.duration=_.duration),_.duration===0&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=t},key(){if(!_.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(_.attributes.METHOD==="NONE"){n=null;return}if(!_.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(_.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:_.attributes};return}if(_.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:_.attributes.URI};return}if(_.attributes.KEYFORMAT===f){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(_.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(_.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),_.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(_.attributes.KEYID&&_.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:_.attributes.KEYFORMAT,keyId:_.attributes.KEYID.substring(2)},pssh:o2(_.attributes.URI.split(",")[1])};return}_.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),n={method:_.attributes.METHOD||"AES-128",uri:_.attributes.URI},typeof _.attributes.IV<"u"&&(n.iv=_.attributes.IV)},"media-sequence"(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+_.number});return}this.manifest.mediaSequence=_.number},"discontinuity-sequence"(){if(!isFinite(_.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+_.number});return}this.manifest.discontinuitySequence=_.number,m=_.number},"playlist-type"(){if(!/VOD|EVENT/.test(_.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+_.playlist});return}this.manifest.playlistType=_.playlistType},map(){r={},_.uri&&(r.uri=_.uri),_.byterange&&(r.byterange=_.byterange),n&&(r.key=n)},"stream-inf"(){if(this.manifest.playlists=t,this.manifest.mediaGroups=this.manifest.mediaGroups||l,!_.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}s.attributes||(s.attributes={}),rt(s.attributes,_.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||l,!(_.attributes&&_.attributes.TYPE&&_.attributes["GROUP-ID"]&&_.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const w=this.manifest.mediaGroups[_.attributes.TYPE];w[_.attributes["GROUP-ID"]]=w[_.attributes["GROUP-ID"]]||{},A=w[_.attributes["GROUP-ID"]],D={default:/yes/i.test(_.attributes.DEFAULT)},D.default?D.autoselect=!0:D.autoselect=/yes/i.test(_.attributes.AUTOSELECT),_.attributes.LANGUAGE&&(D.language=_.attributes.LANGUAGE),_.attributes.URI&&(D.uri=_.attributes.URI),_.attributes["INSTREAM-ID"]&&(D.instreamId=_.attributes["INSTREAM-ID"]),_.attributes.CHARACTERISTICS&&(D.characteristics=_.attributes.CHARACTERISTICS),_.attributes.FORCED&&(D.forced=/yes/i.test(_.attributes.FORCED)),A[_.attributes.NAME]=D},discontinuity(){m+=1,s.discontinuity=!0,this.manifest.discontinuityStarts.push(t.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=_.dateTimeString,this.manifest.dateTimeObject=_.dateTimeObject),s.dateTimeString=_.dateTimeString,s.dateTimeObject=_.dateTimeObject;const{lastProgramDateTime:w}=this;this.lastProgramDateTime=new Date(_.dateTimeString).getTime(),w===null&&this.manifest.segments.reduceRight((k,M)=>(M.programDateTime=k-M.duration*1e3,M.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(_.duration)||_.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+_.duration});return}this.manifest.targetDuration=_.duration,Da.call(this,this.manifest)},start(){if(!_.attributes||isNaN(_.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:_.attributes["TIME-OFFSET"],precise:_.attributes.PRECISE}},"cue-out"(){s.cueOut=_.data},"cue-out-cont"(){s.cueOutCont=_.data},"cue-in"(){s.cueIn=_.data},skip(){this.manifest.skip=Ht(_.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",_.attributes,["SKIPPED-SEGMENTS"])},part(){a=!0;const w=this.manifest.segments.length,k=Ht(_.attributes);s.parts=s.parts||[],s.parts.push(k),k.byterange&&(k.byterange.hasOwnProperty("offset")||(k.byterange.offset=T),T=k.byterange.offset+k.byterange.length);const M=s.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${M} for segment #${w}`,_.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((R,P)=>{R.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${P} lacks required attribute(s): LAST-PART`})})},"server-control"(){const w=this.manifest.serverControl=Ht(_.attributes);w.hasOwnProperty("canBlockReload")||(w.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),Da.call(this,this.manifest),w.canSkipDateranges&&!w.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 w=this.manifest.segments.length,k=Ht(_.attributes),M=k.type&&k.type==="PART";s.preloadHints=s.preloadHints||[],s.preloadHints.push(k),k.byterange&&(k.byterange.hasOwnProperty("offset")||(k.byterange.offset=M?T:0,M&&(T=k.byterange.offset+k.byterange.length)));const R=s.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${R} for segment #${w}`,_.attributes,["TYPE","URI"]),!!k.type)for(let P=0;PP.id===k.id);this.manifest.dateRanges[R]=rt(this.manifest.dateRanges[R],k),S[k.id]=rt(S[k.id],k),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"content-steering"(){this.manifest.contentSteering=Ht(_.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",_.attributes,["SERVER-URI"])}}[_.tagType]||o).call(e)},uri(){s.uri=_.uri,t.push(s),this.manifest.targetDuration&&!("duration"in s)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),s.duration=this.manifest.targetDuration),n&&(s.key=n),s.timeline=m,r&&(s.map=r),T=0,this.lastProgramDateTime!==null&&(s.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=s.duration*1e3),s={}},comment(){},custom(){_.segment?(s.custom=s.custom||{},s.custom[_.customType]=_.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[_.customType]=_.data)}})[_.type].call(e)})}warnOnMissingAttributes_(e,t,s){const r=[];s.forEach(function(n){t.hasOwnProperty(n)||r.push(n)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(` +`),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 pi={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^/},p2=["video","audio","text"],Fl=["Video","Audio","Text"],Ad=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,s,r){var n=("00"+Number(s).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+n+"00"+a})},gt=function(e){e===void 0&&(e="");var t=e.split(","),s=[];return t.forEach(function(r){r=r.trim();var n;p2.forEach(function(a){var o=pi[a].exec(r.toLowerCase());if(!(!o||o.length<=1)){n=a;var l=r.substring(0,o[1].length),f=r.replace(l,"");s.push({type:l,details:f,mediaType:a})}}),n||s.push({type:r,details:"",mediaType:"unknown"})}),s},m2=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var s=e.mediaGroups.AUDIO[t];if(!s)return null;for(var r in s){var n=s[r];if(n.default&&n.playlists)return gt(n.playlists[0].attributes.CODECS)}return null},Dd=function(e){return e===void 0&&(e=""),pi.audio.test(e.trim().toLowerCase())},g2=function(e){return e===void 0&&(e=""),pi.text.test(e.trim().toLowerCase())},Ws=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(n){return Ad(n.trim())}),s="video";t.length===1&&Dd(t[0])?s="audio":t.length===1&&g2(t[0])&&(s="application");var r="mp4";return t.every(function(n){return pi.mp4.test(n)})?r="mp4":t.every(function(n){return pi.webm.test(n)})?r="webm":t.every(function(n){return pi.ogg.test(n)})&&(r="ogg"),s+"/"+r+';codecs="'+e+'"'}},Yr=function(e){return e===void 0&&(e=""),E.MediaSource&&E.MediaSource.isTypeSupported&&E.MediaSource.isTypeSupported(Ws(e))||!1},wa=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var s=0;sy&&(m-=y,m-=y,m-=Ie(2))}return Number(m)},E2=function(e,t){var s={},r=s.le,n=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=Ie(e);for(var a=b2(e),o=new Uint8Array(new ArrayBuffer(a)),l=0;l=t.length&&f.call(t,function(m,y){var T=l[y]?l[y]&e[a+y]:e[a+y];return m===T})},A2=function(e,t,s){t.forEach(function(r){for(var n in e.mediaGroups[r])for(var a in e.mediaGroups[r][n]){var o=e.mediaGroups[r][n][a];s(o,r,n,a)}})},D2=function(e){return E.atob?E.atob(e):Buffer.from(e,"base64").toString("binary")};function w2(i){for(var e=D2(i),t=new Uint8Array(e.length),s=0;s=0&&i=0){for(var r=e.length-1;s0},lookupPrefix:function(i){for(var e=this;e;){var t=e._nsMap;if(t){for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&t[s]===i)return s}e=e.nodeType==zi?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(i){for(var e=this;e;){var t=e._nsMap;if(t&&Object.prototype.hasOwnProperty.call(t,i))return t[i];e=e.nodeType==zi?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(i){var e=this.lookupPrefix(i);return e==null}};function Vd(i){return i=="<"&&"<"||i==">"&&">"||i=="&"&&"&"||i=='"'&&"""||"&#"+i.charCodeAt()+";"}ir(Ke,ae);ir(Ke,ae.prototype);function Xs(i,e){if(e(i))return!0;if(i=i.firstChild)do if(Xs(i,e))return!0;while(i=i.nextSibling)}function sr(){this.ownerDocument=this}function B2(i,e,t){i&&i._inc++;var s=t.namespaceURI;s===Ks.XMLNS&&(e._nsMap[t.prefix?t.localName:""]=t.value)}function Hd(i,e,t,s){i&&i._inc++;var r=t.namespaceURI;r===Ks.XMLNS&&delete e._nsMap[t.prefix?t.localName:""]}function No(i,e,t){if(i&&i._inc){i._inc++;var s=e.childNodes;if(t)s[s.length++]=t;else{for(var r=e.firstChild,n=0;r;)s[n++]=r,r=r.nextSibling;s.length=n,delete s[s.length]}}}function Gd(i,e){var t=e.previousSibling,s=e.nextSibling;return t?t.nextSibling=s:i.firstChild=s,s?s.previousSibling=t:i.lastChild=t,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,No(i.ownerDocument,i),e}function F2(i){return i&&(i.nodeType===ae.DOCUMENT_NODE||i.nodeType===ae.DOCUMENT_FRAGMENT_NODE||i.nodeType===ae.ELEMENT_NODE)}function U2(i){return i&&(Et(i)||Bo(i)||Ut(i)||i.nodeType===ae.DOCUMENT_FRAGMENT_NODE||i.nodeType===ae.COMMENT_NODE||i.nodeType===ae.PROCESSING_INSTRUCTION_NODE)}function Ut(i){return i&&i.nodeType===ae.DOCUMENT_TYPE_NODE}function Et(i){return i&&i.nodeType===ae.ELEMENT_NODE}function Bo(i){return i&&i.nodeType===ae.TEXT_NODE}function Hl(i,e){var t=i.childNodes||[];if(xt(t,Et)||Ut(e))return!1;var s=xt(t,Ut);return!(e&&s&&t.indexOf(s)>t.indexOf(e))}function Gl(i,e){var t=i.childNodes||[];function s(n){return Et(n)&&n!==e}if(xt(t,s))return!1;var r=xt(t,Ut);return!(e&&r&&t.indexOf(r)>t.indexOf(e))}function $2(i,e,t){if(!F2(i))throw new xe(Ve,"Unexpected parent node type "+i.nodeType);if(t&&t.parentNode!==i)throw new xe($d,"child not in parent");if(!U2(e)||Ut(e)&&i.nodeType!==ae.DOCUMENT_NODE)throw new xe(Ve,"Unexpected node type "+e.nodeType+" for parent node type "+i.nodeType)}function q2(i,e,t){var s=i.childNodes||[],r=e.childNodes||[];if(e.nodeType===ae.DOCUMENT_FRAGMENT_NODE){var n=r.filter(Et);if(n.length>1||xt(r,Bo))throw new xe(Ve,"More than one element or text in fragment");if(n.length===1&&!Hl(i,t))throw new xe(Ve,"Element in fragment can not be inserted before doctype")}if(Et(e)&&!Hl(i,t))throw new xe(Ve,"Only one element can be added and only after doctype");if(Ut(e)){if(xt(s,Ut))throw new xe(Ve,"Only one doctype is allowed");var a=xt(s,Et);if(t&&s.indexOf(a)1||xt(r,Bo))throw new xe(Ve,"More than one element or text in fragment");if(n.length===1&&!Gl(i,t))throw new xe(Ve,"Element in fragment can not be inserted before doctype")}if(Et(e)&&!Gl(i,t))throw new xe(Ve,"Only one element can be added and only after doctype");if(Ut(e)){let l=function(f){return Ut(f)&&f!==t};var o=l;if(xt(s,l))throw new xe(Ve,"Only one doctype is allowed");var a=xt(s,Et);if(t&&s.indexOf(a)0&&Xs(t.documentElement,function(r){if(r!==t&&r.nodeType===dt){var n=r.getAttribute("class");if(n){var a=i===n;if(!a){var o=$l(n);a=e.every(R2(o))}a&&s.push(r)}}}),s})},createElement:function(i){var e=new _i;e.ownerDocument=this,e.nodeName=i,e.tagName=i,e.localName=i,e.childNodes=new Mt;var t=e.attributes=new rn;return t._ownerElement=e,e},createDocumentFragment:function(){var i=new In;return i.ownerDocument=this,i.childNodes=new Mt,i},createTextNode:function(i){var e=new Fo;return e.ownerDocument=this,e.appendData(i),e},createComment:function(i){var e=new Uo;return e.ownerDocument=this,e.appendData(i),e},createCDATASection:function(i){var e=new $o;return e.ownerDocument=this,e.appendData(i),e},createProcessingInstruction:function(i,e){var t=new jo;return t.ownerDocument=this,t.tagName=t.nodeName=t.target=i,t.nodeValue=t.data=e,t},createAttribute:function(i){var e=new an;return e.ownerDocument=this,e.name=i,e.nodeName=i,e.localName=i,e.specified=!0,e},createEntityReference:function(i){var e=new qo;return e.ownerDocument=this,e.nodeName=i,e},createElementNS:function(i,e){var t=new _i,s=e.split(":"),r=t.attributes=new rn;return t.childNodes=new Mt,t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.namespaceURI=i,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,r._ownerElement=t,t},createAttributeNS:function(i,e){var t=new an,s=e.split(":");return t.ownerDocument=this,t.nodeName=e,t.name=e,t.namespaceURI=i,t.specified=!0,s.length==2?(t.prefix=s[0],t.localName=s[1]):t.localName=e,t}};We(sr,ae);function _i(){this._nsMap={}}_i.prototype={nodeType:dt,hasAttribute:function(i){return this.getAttributeNode(i)!=null},getAttribute:function(i){var e=this.getAttributeNode(i);return e&&e.value||""},getAttributeNode:function(i){return this.attributes.getNamedItem(i)},setAttribute:function(i,e){var t=this.ownerDocument.createAttribute(i);t.value=t.nodeValue=""+e,this.setAttributeNode(t)},removeAttribute:function(i){var e=this.getAttributeNode(i);e&&this.removeAttributeNode(e)},appendChild:function(i){return i.nodeType===Ft?this.insertBefore(i,null):j2(this,i)},setAttributeNode:function(i){return this.attributes.setNamedItem(i)},setAttributeNodeNS:function(i){return this.attributes.setNamedItemNS(i)},removeAttributeNode:function(i){return this.attributes.removeNamedItem(i.nodeName)},removeAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);t&&this.removeAttributeNode(t)},hasAttributeNS:function(i,e){return this.getAttributeNodeNS(i,e)!=null},getAttributeNS:function(i,e){var t=this.getAttributeNodeNS(i,e);return t&&t.value||""},setAttributeNS:function(i,e,t){var s=this.ownerDocument.createAttributeNS(i,e);s.value=s.nodeValue=""+t,this.setAttributeNode(s)},getAttributeNodeNS:function(i,e){return this.attributes.getNamedItemNS(i,e)},getElementsByTagName:function(i){return new Wi(this,function(e){var t=[];return Xs(e,function(s){s!==e&&s.nodeType==dt&&(i==="*"||s.tagName==i)&&t.push(s)}),t})},getElementsByTagNameNS:function(i,e){return new Wi(this,function(t){var s=[];return Xs(t,function(r){r!==t&&r.nodeType===dt&&(i==="*"||r.namespaceURI===i)&&(e==="*"||r.localName==e)&&s.push(r)}),s})}};sr.prototype.getElementsByTagName=_i.prototype.getElementsByTagName;sr.prototype.getElementsByTagNameNS=_i.prototype.getElementsByTagNameNS;We(_i,ae);function an(){}an.prototype.nodeType=zi;We(an,ae);function rr(){}rr.prototype={data:"",substringData:function(i,e){return this.data.substring(i,i+e)},appendData:function(i){i=this.data+i,this.nodeValue=this.data=i,this.length=i.length},insertData:function(i,e){this.replaceData(i,0,e)},appendChild:function(i){throw new Error(ke[Ve])},deleteData:function(i,e){this.replaceData(i,e,"")},replaceData:function(i,e,t){var s=this.data.substring(0,i),r=this.data.substring(i+e);t=s+t+r,this.nodeValue=this.data=t,this.length=t.length}};We(rr,ae);function Fo(){}Fo.prototype={nodeName:"#text",nodeType:sn,splitText:function(i){var e=this.data,t=e.substring(i);e=e.substring(0,i),this.data=this.nodeValue=e,this.length=e.length;var s=this.ownerDocument.createTextNode(t);return this.parentNode&&this.parentNode.insertBefore(s,this.nextSibling),s}};We(Fo,rr);function Uo(){}Uo.prototype={nodeName:"#comment",nodeType:Bd};We(Uo,rr);function $o(){}$o.prototype={nodeName:"#cdata-section",nodeType:Rd};We($o,rr);function kn(){}kn.prototype.nodeType=Ud;We(kn,ae);function Wd(){}Wd.prototype.nodeType=N2;We(Wd,ae);function Kd(){}Kd.prototype.nodeType=M2;We(Kd,ae);function qo(){}qo.prototype.nodeType=Md;We(qo,ae);function In(){}In.prototype.nodeName="#document-fragment";In.prototype.nodeType=Ft;We(In,ae);function jo(){}jo.prototype.nodeType=Nd;We(jo,ae);function Xd(){}Xd.prototype.serializeToString=function(i,e,t){return Yd.call(i,e,t)};ae.prototype.toString=Yd;function Yd(i,e){var t=[],s=this.nodeType==9&&this.documentElement||this,r=s.prefix,n=s.namespaceURI;if(n&&r==null){var r=s.lookupPrefix(n);if(r==null)var a=[{namespace:n,prefix:null}]}return Ri(this,t,i,e,a),t.join("")}function zl(i,e,t){var s=i.prefix||"",r=i.namespaceURI;if(!r||s==="xml"&&r===Ks.XML||r===Ks.XMLNS)return!1;for(var n=t.length;n--;){var a=t[n];if(a.prefix===s)return a.namespace!==r}return!0}function ka(i,e,t){i.push(" ",e,'="',t.replace(/[<>&"\t\n\r]/g,Vd),'"')}function Ri(i,e,t,s,r){if(r||(r=[]),s)if(i=s(i),i){if(typeof i=="string"){e.push(i);return}}else return;switch(i.nodeType){case dt:var n=i.attributes,a=n.length,w=i.firstChild,o=i.tagName;t=Ks.isHTML(i.namespaceURI)||t;var l=o;if(!t&&!i.prefix&&i.namespaceURI){for(var f,m=0;m=0;y--){var T=r[y];if(T.prefix===""&&T.namespace===i.namespaceURI){f=T.namespace;break}}if(f!==i.namespaceURI)for(var y=r.length-1;y>=0;y--){var T=r[y];if(T.namespace===i.namespaceURI){T.prefix&&(l=T.prefix+":"+o);break}}}e.push("<",l);for(var S=0;S"),t&&/^script$/i.test(o))for(;w;)w.data?e.push(w.data):Ri(w,e,t,s,r.slice()),w=w.nextSibling;else for(;w;)Ri(w,e,t,s,r.slice()),w=w.nextSibling;e.push("")}else e.push("/>");return;case Fd:case Ft:for(var w=i.firstChild;w;)Ri(w,e,t,s,r.slice()),w=w.nextSibling;return;case zi:return ka(e,i.name,i.value);case sn:return e.push(i.data.replace(/[<&>]/g,Vd));case Rd:return e.push("");case Bd:return e.push("");case Ud:var k=i.publicId,M=i.systemId;if(e.push("");else if(M&&M!=".")e.push(" SYSTEM ",M,">");else{var R=i.internalSubset;R&&e.push(" [",R,"]"),e.push(">")}return;case Nd:return e.push("");case Md:return e.push("&",i.nodeName,";");default:e.push("??",i.nodeName)}}function Qd(i,e,t){var s;switch(e.nodeType){case dt:s=e.cloneNode(!1),s.ownerDocument=i;case Ft:break;case zi:t=!0;break}if(s||(s=e.cloneNode(!1)),s.ownerDocument=i,s.parentNode=null,t)for(var r=e.firstChild;r;)s.appendChild(Qd(i,r,t)),r=r.nextSibling;return s}function Ja(i,e,t){var s=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=e[r];typeof n!="object"&&n!=s[r]&&(s[r]=n)}switch(e.childNodes&&(s.childNodes=new Mt),s.ownerDocument=i,s.nodeType){case dt:var a=e.attributes,o=s.attributes=new rn,l=a.length;o._ownerElement=s;for(var f=0;f",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` +`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),i.entityMap=i.HTML_ENTITIES})(Zd);var Vo={},Ys=qt.NAMESPACE,Za=/[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]/,Wl=new RegExp("[\\-\\.0-9"+Za.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Kl=new RegExp("^"+Za.source+Wl.source+"*(?::"+Za.source+Wl.source+"*)?$"),As=0,Gt=1,Ci=2,Ds=3,Ai=4,Di=5,ws=6,Ur=7;function Ki(i,e){this.message=i,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Ki)}Ki.prototype=new Error;Ki.prototype.name=Ki.name;function eh(){}eh.prototype={parse:function(i,e,t){var s=this.domBuilder;s.startDocument(),th(e,e={}),V2(i,e,t,s,this.errorHandler),s.endDocument()}};function V2(i,e,t,s,r){function n(ie){if(ie>65535){ie-=65536;var Te=55296+(ie>>10),kt=56320+(ie&1023);return String.fromCharCode(Te,kt)}else return String.fromCharCode(ie)}function a(ie){var Te=ie.slice(1,-1);return Object.hasOwnProperty.call(t,Te)?t[Te]:Te.charAt(0)==="#"?n(parseInt(Te.substr(1).replace("x","0x"))):(r.error("entity not found:"+ie),ie)}function o(ie){if(ie>A){var Te=i.substring(A,ie).replace(/&#?\w+;/g,a);T&&l(A),s.characters(Te,0,ie-A),A=ie}}function l(ie,Te){for(;ie>=m&&(Te=y.exec(i));)f=Te.index,m=f+Te[0].length,T.lineNumber++;T.columnNumber=ie-f+1}for(var f=0,m=0,y=/.*(?:\r\n?|\n)|.*$/g,T=s.locator,S=[{currentNSMap:e}],_={},A=0;;){try{var D=i.indexOf("<",A);if(D<0){if(!i.substr(A).match(/^\s*$/)){var w=s.doc,k=w.createTextNode(i.substr(A));w.appendChild(k),s.currentElement=k}return}switch(D>A&&o(D),i.charAt(D+1)){case"/":var ee=i.indexOf(">",D+3),M=i.substring(D+2,ee).replace(/[ \t\n\r]+$/g,""),R=S.pop();ee<0?(M=i.substring(D+2).replace(/[\s<].*/,""),r.error("end tag name: "+M+" is not complete:"+R.tagName),ee=D+1+M.length):M.match(/\sA?A=ee:o(Math.max(D,A)+1)}}function Xl(i,e){return e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber,e}function H2(i,e,t,s,r,n){function a(T,S,_){t.attributeNames.hasOwnProperty(T)&&n.fatalError("Attribute "+T+" redefined"),t.addValue(T,S.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),_)}for(var o,l,f=++e,m=As;;){var y=i.charAt(f);switch(y){case"=":if(m===Gt)o=i.slice(e,f),m=Ds;else if(m===Ci)m=Ds;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(m===Ds||m===Gt)if(m===Gt&&(n.warning('attribute value must after "="'),o=i.slice(e,f)),e=f+1,f=i.indexOf(y,e),f>0)l=i.slice(e,f),a(o,l,e-1),m=Di;else throw new Error("attribute value no end '"+y+"' match");else if(m==Ai)l=i.slice(e,f),a(o,l,e),n.warning('attribute "'+o+'" missed start quot('+y+")!!"),e=f+1,m=Di;else throw new Error('attribute value must after "="');break;case"/":switch(m){case As:t.setTagName(i.slice(e,f));case Di:case ws:case Ur:m=Ur,t.closed=!0;case Ai:case Gt:break;case Ci:t.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return n.error("unexpected end of input"),m==As&&t.setTagName(i.slice(e,f)),f;case">":switch(m){case As:t.setTagName(i.slice(e,f));case Di:case ws:case Ur:break;case Ai:case Gt:l=i.slice(e,f),l.slice(-1)==="/"&&(t.closed=!0,l=l.slice(0,-1));case Ci:m===Ci&&(l=o),m==Ai?(n.warning('attribute "'+l+'" missed quot(")!'),a(o,l,e)):((!Ys.isHTML(s[""])||!l.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+l+'" missed value!! "'+l+'" instead!!'),a(l,l,e));break;case Ds:throw new Error("attribute value missed!!")}return f;case"€":y=" ";default:if(y<=" ")switch(m){case As:t.setTagName(i.slice(e,f)),m=ws;break;case Gt:o=i.slice(e,f),m=Ci;break;case Ai:var l=i.slice(e,f);n.warning('attribute "'+l+'" missed quot(")!!'),a(o,l,e);case Di:m=ws;break}else switch(m){case Ci:t.tagName,(!Ys.isHTML(s[""])||!o.match(/^(?:disabled|checked|selected)$/i))&&n.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),a(o,o,e),e=f,m=Gt;break;case Di:n.warning('attribute space is required"'+o+'"!!');case ws:m=Gt,e=f;break;case Ds:m=Ai,e=f;break;case Ur:throw new Error("elements closed character '/' and '>' must be connected to")}}f++}}function Yl(i,e,t){for(var s=i.tagName,r=null,y=i.length;y--;){var n=i[y],a=n.qName,o=n.value,T=a.indexOf(":");if(T>0)var l=n.prefix=a.slice(0,T),f=a.slice(T+1),m=l==="xmlns"&&f;else f=a,l=null,m=a==="xmlns"&&"";n.localName=f,m!==!1&&(r==null&&(r={},th(t,t={})),t[m]=r[m]=o,n.uri=Ys.XMLNS,e.startPrefixMapping(m,o))}for(var y=i.length;y--;){n=i[y];var l=n.prefix;l&&(l==="xml"&&(n.uri=Ys.XML),l!=="xmlns"&&(n.uri=t[l||""]))}var T=s.indexOf(":");T>0?(l=i.prefix=s.slice(0,T),f=i.localName=s.slice(T+1)):(l=null,f=i.localName=s);var S=i.uri=t[l||""];if(e.startElement(S,f,s,i),i.closed){if(e.endElement(S,f,s),r)for(l in r)Object.prototype.hasOwnProperty.call(r,l)&&e.endPrefixMapping(l)}else return i.currentNSMap=t,i.localNSMap=r,!0}function G2(i,e,t,s,r){if(/^(?:script|textarea)$/i.test(t)){var n=i.indexOf("",e),a=i.substring(e+1,n);if(/[&<]/.test(a))return/^script$/i.test(t)?(r.characters(a,0,a.length),n):(a=a.replace(/&#?\w+;/g,s),r.characters(a,0,a.length),n)}return e+1}function z2(i,e,t,s){var r=s[t];return r==null&&(r=i.lastIndexOf(""),r",e+4);return n>e?(t.comment(i,e+4,n-e-4),n+3):(s.error("Unclosed comment"),-1)}else return-1;default:if(i.substr(e+3,6)=="CDATA["){var n=i.indexOf("]]>",e+9);return t.startCDATA(),t.characters(i,e+9,n-e-9),t.endCDATA(),n+3}var a=X2(i,e),o=a.length;if(o>1&&/!doctype/i.test(a[0][0])){var l=a[1][0],f=!1,m=!1;o>3&&(/^public$/i.test(a[2][0])?(f=a[3][0],m=o>4&&a[4][0]):/^system$/i.test(a[2][0])&&(m=a[3][0]));var y=a[o-1];return t.startDTD(l,f,m),t.endDTD(),y.index+y[0].length}}return-1}function K2(i,e,t){var s=i.indexOf("?>",e);if(s){var r=i.substring(e,s).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,t.processingInstruction(r[1],r[2]),s+2):-1}return-1}function ih(){this.attributeNames={}}ih.prototype={setTagName:function(i){if(!Kl.test(i))throw new Error("invalid tagName:"+i);this.tagName=i},addValue:function(i,e,t){if(!Kl.test(i))throw new Error("invalid attribute:"+i);this.attributeNames[i]=this.length,this[this.length++]={qName:i,value:e,offset:t}},length:0,getLocalName:function(i){return this[i].localName},getLocator:function(i){return this[i].locator},getQName:function(i){return this[i].qName},getURI:function(i){return this[i].uri},getValue:function(i){return this[i].value}};function X2(i,e){var t,s=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(i);t=r.exec(i);)if(s.push(t),t[1])return s}Vo.XMLReader=eh;Vo.ParseError=Ki;var Y2=qt,Q2=Qt,Ql=Zd,sh=Vo,J2=Q2.DOMImplementation,Jl=Y2.NAMESPACE,Z2=sh.ParseError,eb=sh.XMLReader;function rh(i){return i.replace(/\r[\n\u0085]/g,` +`).replace(/[\r\u0085\u2028]/g,` +`)}function nh(i){this.options=i||{locator:{}}}nh.prototype.parseFromString=function(i,e){var t=this.options,s=new eb,r=t.domBuilder||new nr,n=t.errorHandler,a=t.locator,o=t.xmlns||{},l=/\/x?html?$/.test(e),f=l?Ql.HTML_ENTITIES:Ql.XML_ENTITIES;a&&r.setDocumentLocator(a),s.errorHandler=tb(n,r,a),s.domBuilder=t.domBuilder||r,l&&(o[""]=Jl.HTML),o.xml=o.xml||Jl.XML;var m=t.normalizeLineEndings||rh;return i&&typeof i=="string"?s.parse(m(i),o,f):s.errorHandler.error("invalid doc source"),r.doc};function tb(i,e,t){if(!i){if(e instanceof nr)return e;i=e}var s={},r=i instanceof Function;t=t||{};function n(a){var o=i[a];!o&&r&&(o=i.length==2?function(l){i(a,l)}:i),s[a]=o&&function(l){o("[xmldom "+a+"] "+l+eo(t))}||function(){}}return n("warning"),n("error"),n("fatalError"),s}function nr(){this.cdata=!1}function wi(i,e){e.lineNumber=i.lineNumber,e.columnNumber=i.columnNumber}nr.prototype={startDocument:function(){this.doc=new J2().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(i,e,t,s){var r=this.doc,n=r.createElementNS(i,t||e),a=s.length;$r(this,n),this.currentElement=n,this.locator&&wi(this.locator,n);for(var o=0;o=e+t||e?new java.lang.String(i,e,t)+"":i}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(i){nr.prototype[i]=function(){return null}});function $r(i,e){i.currentElement?i.currentElement.appendChild(e):i.doc.appendChild(e)}Pn.__DOMHandler=nr;Pn.normalizeLineEndings=rh;Pn.DOMParser=nh;var ib=Pn.DOMParser;/*! @name mpd-parser @version 1.3.0 @license Apache-2.0 */const ec=i=>!!i&&typeof i=="object",we=(...i)=>i.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(s=>{Array.isArray(e[s])&&Array.isArray(t[s])?e[s]=e[s].concat(t[s]):ec(e[s])&&ec(t[s])?e[s]=we(e[s],t[s]):e[s]=t[s]}),e),{}),ah=i=>Object.keys(i).map(e=>i[e]),sb=(i,e)=>{const t=[];for(let s=i;si.reduce((e,t)=>e.concat(t),[]),oh=i=>{if(!i.length)return[];const e=[];for(let t=0;ti.reduce((t,s,r)=>(s[e]&&t.push(r),t),[]),nb=(i,e)=>ah(i.reduce((t,s)=>(s.forEach(r=>{t[e(r)]=r}),t),{}));var Yi={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 Qs=({baseUrl:i="",source:e="",range:t="",indexRange:s=""})=>{const r={uri:e,resolvedUri:wn(i||"",e)};if(t||s){const a=(t||s).split("-");let o=E.BigInt?E.BigInt(a[0]):parseInt(a[0],10),l=E.BigInt?E.BigInt(a[1]):parseInt(a[1],10);o{let e;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=E.BigInt(i.offset)+E.BigInt(i.length)-E.BigInt(1):e=i.offset+i.length-1,`${i.offset}-${e}`},tc=i=>(i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i),ob={static(i){const{duration:e,timescale:t=1,sourceDuration:s,periodDuration:r}=i,n=tc(i.endNumber),a=e/t;return typeof n=="number"?{start:0,end:n}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:s/a}},dynamic(i){const{NOW:e,clientOffset:t,availabilityStartTime:s,timescale:r=1,duration:n,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:l=1/0}=i,f=tc(i.endNumber),m=(e+t)/1e3,y=s+a,S=m+o-y,_=Math.ceil(S*r/n),A=Math.floor((m-y-l)*r/n),D=Math.floor((m-y)*r/n);return{start:Math.max(0,A),end:typeof f=="number"?f:Math.min(_,D)}}},ub=i=>e=>{const{duration:t,timescale:s=1,periodStart:r,startNumber:n=1}=i;return{number:n+e,duration:t/s,timeline:r,time:e*t}},Ho=i=>{const{type:e,duration:t,timescale:s=1,periodDuration:r,sourceDuration:n}=i,{start:a,end:o}=ob[e](i),l=sb(a,o).map(ub(i));if(e==="static"){const f=l.length-1,m=typeof r=="number"?r:n;l[f].duration=m-t/s*f}return l},uh=i=>{const{baseUrl:e,initialization:t={},sourceDuration:s,indexRange:r="",periodStart:n,presentationTime:a,number:o=0,duration:l}=i;if(!e)throw new Error(Yi.NO_BASE_URL);const f=Qs({baseUrl:e,source:t.sourceURL,range:t.range}),m=Qs({baseUrl:e,source:e,indexRange:r});if(m.map=f,l){const y=Ho(i);y.length&&(m.duration=y[0].duration,m.timeline=y[0].timeline)}else s&&(m.duration=s,m.timeline=n);return m.presentationTime=a||n,m.number=o,[m]},Go=(i,e,t)=>{const s=i.sidx.map?i.sidx.map:null,r=i.sidx.duration,n=i.timeline||0,a=i.sidx.byterange,o=a.offset+a.length,l=e.timescale,f=e.references.filter(D=>D.referenceType!==1),m=[],y=i.endList?"static":"dynamic",T=i.sidx.timeline;let S=T,_=i.mediaSequence||0,A;typeof e.firstOffset=="bigint"?A=E.BigInt(o)+e.firstOffset:A=o+e.firstOffset;for(let D=0;Dnb(i,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),db=(i,e)=>{for(let t=0;t{let e=[];return A2(i,lb,(t,s,r,n)=>{e=e.concat(t.playlists||[])}),e},sc=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((t,s)=>{t.number=i.mediaSequence+s})},hb=({oldPlaylists:i,newPlaylists:e,timelineStarts:t})=>{e.forEach(s=>{s.discontinuitySequence=t.findIndex(function({timeline:l}){return l===s.timeline});const r=db(i,s.attributes.NAME);if(!r||s.sidx)return;const n=s.segments[0],a=r.segments.findIndex(function(l){return Math.abs(l.presentationTime-n.presentationTime)r.timeline||r.segments.length&&s.timeline>r.segments[r.segments.length-1].timeline)&&s.discontinuitySequence--;return}r.segments[a].discontinuity&&!n.discontinuity&&(n.discontinuity=!0,s.discontinuityStarts.unshift(0),s.discontinuitySequence--),sc({playlist:s,mediaSequence:r.segments[a].number})})},fb=({oldManifest:i,newManifest:e})=>{const t=i.playlists.concat(ic(i)),s=e.playlists.concat(ic(e));return e.timelineStarts=lh([i.timelineStarts,e.timelineStarts]),hb({oldPlaylists:t,newPlaylists:s,timelineStarts:e.timelineStarts}),e},Ln=i=>i&&i.uri+"-"+ab(i.byterange),Ia=i=>{const e=i.reduce(function(s,r){return s[r.attributes.baseUrl]||(s[r.attributes.baseUrl]=[]),s[r.attributes.baseUrl].push(r),s},{});let t=[];return Object.values(e).forEach(s=>{const r=ah(s.reduce((n,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return n[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),n[o].segments.push(...a.segments)),a.attributes.contentProtection&&(n[o].attributes.contentProtection=a.attributes.contentProtection)):(n[o]=a,n[o].attributes.timelineStarts=[]),n[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),n},{}));t=t.concat(r)}),t.map(s=>(s.discontinuityStarts=rb(s.segments||[],"discontinuity"),s))},zo=(i,e)=>{const t=Ln(i.sidx),s=t&&e[t]&&e[t].sidx;return s&&Go(i,s,i.sidx.resolvedUri),i},pb=(i,e={})=>{if(!Object.keys(e).length)return i;for(const t in i)i[t]=zo(i[t],e);return i},mb=({attributes:i,segments:e,sidx:t,mediaSequence:s,discontinuitySequence:r,discontinuityStarts:n},a)=>{const o={attributes:{NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuitySequence:r,discontinuityStarts:n,timelineStarts:i.timelineStarts,mediaSequence:s,segments:e};return i.contentProtection&&(o.contentProtection=i.contentProtection),i.serviceLocation&&(o.attributes.serviceLocation=i.serviceLocation),t&&(o.sidx=t),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},gb=({attributes:i,segments:e,mediaSequence:t,discontinuityStarts:s,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);const n={NAME:i.id,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1};i.codecs&&(n.CODECS=i.codecs);const a={attributes:n,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:s,discontinuitySequence:r,mediaSequence:t,segments:e};return i.serviceLocation&&(a.attributes.serviceLocation=i.serviceLocation),a},yb=(i,e={},t=!1)=>{let s;const r=i.reduce((n,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",l=a.attributes.lang||"";let f=a.attributes.label||"main";if(l&&!a.attributes.label){const y=o?` (${o})`:"";f=`${a.attributes.lang}${y}`}n[f]||(n[f]={language:l,autoselect:!0,default:o==="main",playlists:[],uri:""});const m=zo(mb(a,t),e);return n[f].playlists.push(m),typeof s>"u"&&o==="main"&&(s=a,s.default=!0),n},{});if(!s){const n=Object.keys(r)[0];r[n].default=!0}return r},_b=(i,e={})=>i.reduce((t,s)=>{const r=s.attributes.label||s.attributes.lang||"text";return t[r]||(t[r]={language:r,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(zo(gb(s),e)),t},{}),vb=i=>i.reduce((e,t)=>(t&&t.forEach(s=>{const{channel:r,language:n}=s;e[n]={autoselect:!1,default:!1,instreamId:r,language:n},s.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=s.aspectRatio),s.hasOwnProperty("easyReader")&&(e[n].easyReader=s.easyReader),s.hasOwnProperty("3D")&&(e[n]["3D"]=s["3D"])}),e),{}),Tb=({attributes:i,segments:e,sidx:t,discontinuityStarts:s})=>{const r={attributes:{NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuityStarts:s,timelineStarts:i.timelineStarts,segments:e};return i.frameRate&&(r.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(r.contentProtection=i.contentProtection),i.serviceLocation&&(r.attributes.serviceLocation=i.serviceLocation),t&&(r.sidx=t),r},bb=({attributes:i})=>i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video",Sb=({attributes:i})=>i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio",xb=({attributes:i})=>i.mimeType==="text/vtt"||i.contentType==="text",Eb=(i,e)=>{i.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:s}){return s===t.timeline}),t.segments&&t.segments.forEach((s,r)=>{s.number=r})})},rc=i=>i?Object.keys(i).reduce((e,t)=>{const s=i[t];return e.concat(s.playlists)},[]):[],Cb=({dashPlaylists:i,locations:e,contentSteering:t,sidxMapping:s={},previousManifest:r,eventStream:n})=>{if(!i.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:l,minimumUpdatePeriod:f}=i[0].attributes,m=Ia(i.filter(bb)).map(Tb),y=Ia(i.filter(Sb)),T=Ia(i.filter(xb)),S=i.map(R=>R.attributes.captionServices).filter(Boolean),_={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:pb(m,s)};f>=0&&(_.minimumUpdatePeriod=f*1e3),e&&(_.locations=e),t&&(_.contentSteering=t),o==="dynamic"&&(_.suggestedPresentationDelay=l),n&&n.length>0&&(_.eventStream=n);const A=_.playlists.length===0,D=y.length?yb(y,s,A):null,w=T.length?_b(T,s):null,k=m.concat(rc(D),rc(w)),M=k.map(({timelineStarts:R})=>R);return _.timelineStarts=lh(M),Eb(k,_.timelineStarts),D&&(_.mediaGroups.AUDIO.audio=D),w&&(_.mediaGroups.SUBTITLES.subs=w),S.length&&(_.mediaGroups["CLOSED-CAPTIONS"].cc=vb(S)),r?fb({oldManifest:r,newManifest:_}):_},Ab=(i,e,t)=>{const{NOW:s,clientOffset:r,availabilityStartTime:n,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:l=0}=i,f=(s+r)/1e3,m=n+o,T=f+l-m;return Math.ceil((T*a-e)/t)},ch=(i,e)=>{const{type:t,minimumUpdatePeriod:s=0,media:r="",sourceDuration:n,timescale:a=1,startNumber:o=1,periodStart:l}=i,f=[];let m=-1;for(let y=0;ym&&(m=A);let D;if(_<0){const M=y+1;M===e.length?t==="dynamic"&&s>0&&r.indexOf("$Number$")>0?D=Ab(i,m,S):D=(n*a-m)/S:D=(e[M].t-m)/S}else D=_+1;const w=o+f.length+D;let k=o+f.length;for(;k(e,t,s,r)=>{if(e==="$$")return"$";if(typeof i[t]>"u")return e;const n=""+i[t];return t==="RepresentationID"||(s?r=parseInt(r,10):r=1,n.length>=r)?n:`${new Array(r-n.length+1).join("0")}${n}`},nc=(i,e)=>i.replace(Db,wb(e)),kb=(i,e)=>!i.duration&&!e?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?Ho(i):ch(i,e),Ib=(i,e)=>{const t={RepresentationID:i.id,Bandwidth:i.bandwidth||0},{initialization:s={sourceURL:"",range:""}}=i,r=Qs({baseUrl:i.baseUrl,source:nc(s.sourceURL,t),range:s.range});return kb(i,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=nc(i.media||"",t),l=i.timescale||1,f=i.presentationTimeOffset||0,m=i.periodStart+(a.time-f)/l;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:wn(i.baseUrl||"",o),map:r,number:a.number,presentationTime:m}})},Pb=(i,e)=>{const{baseUrl:t,initialization:s={}}=i,r=Qs({baseUrl:t,source:s.sourceURL,range:s.range}),n=Qs({baseUrl:t,source:e.media,range:e.mediaRange});return n.map=r,n},Lb=(i,e)=>{const{duration:t,segmentUrls:s=[],periodStart:r}=i;if(!t&&!e||t&&e)throw new Error(Yi.SEGMENT_TIME_UNSPECIFIED);const n=s.map(l=>Pb(i,l));let a;return t&&(a=Ho(i)),e&&(a=ch(i,e)),a.map((l,f)=>{if(n[f]){const m=n[f],y=i.timescale||1,T=i.presentationTimeOffset||0;return m.timeline=l.timeline,m.duration=l.duration,m.number=l.number,m.presentationTime=r+(l.time-T)/y,m}}).filter(l=>l)},Ob=({attributes:i,segmentInfo:e})=>{let t,s;e.template?(s=Ib,t=we(i,e.template)):e.base?(s=uh,t=we(i,e.base)):e.list&&(s=Lb,t=we(i,e.list));const r={attributes:i};if(!s)return r;const n=s(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:o=1}=t;t.duration=a/o}else n.length?t.duration=n.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):t.duration=0;return r.attributes=t,r.segments=n,e.base&&t.indexRange&&(r.sidx=n[0],r.segments=[]),r},Rb=i=>i.map(Ob),ge=(i,e)=>oh(i.childNodes).filter(({tagName:t})=>t===e),ar=i=>i.textContent.trim(),Mb=i=>parseFloat(i.split("/").reduce((e,t)=>e/t)),ki=i=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(i);if(!o)return 0;const[l,f,m,y,T,S]=o.slice(1);return parseFloat(l||0)*31536e3+parseFloat(f||0)*2592e3+parseFloat(m||0)*86400+parseFloat(y||0)*3600+parseFloat(T||0)*60+parseFloat(S||0)},Nb=i=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)),ac={mediaPresentationDuration(i){return ki(i)},availabilityStartTime(i){return Nb(i)/1e3},minimumUpdatePeriod(i){return ki(i)},suggestedPresentationDelay(i){return ki(i)},type(i){return i},timeShiftBufferDepth(i){return ki(i)},start(i){return ki(i)},width(i){return parseInt(i,10)},height(i){return parseInt(i,10)},bandwidth(i){return parseInt(i,10)},frameRate(i){return Mb(i)},startNumber(i){return parseInt(i,10)},timescale(i){return parseInt(i,10)},presentationTimeOffset(i){return parseInt(i,10)},duration(i){const e=parseInt(i,10);return isNaN(e)?ki(i):e},d(i){return parseInt(i,10)},t(i){return parseInt(i,10)},r(i){return parseInt(i,10)},presentationTime(i){return parseInt(i,10)},DEFAULT(i){return i}},Ee=i=>i&&i.attributes?oh(i.attributes).reduce((e,t)=>{const s=ac[t.name]||ac.DEFAULT;return e[t.name]=s(t.value),e},{}):{},Bb={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},On=(i,e)=>e.length?Xi(i.map(function(t){return e.map(function(s){const r=ar(s),n=wn(t.baseUrl,r),a=we(Ee(s),{baseUrl:n});return n!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):i,Wo=i=>{const e=ge(i,"SegmentTemplate")[0],t=ge(i,"SegmentList")[0],s=t&&ge(t,"SegmentURL").map(y=>we({tag:"SegmentURL"},Ee(y))),r=ge(i,"SegmentBase")[0],n=t||e,a=n&&ge(n,"SegmentTimeline")[0],o=t||r||e,l=o&&ge(o,"Initialization")[0],f=e&&Ee(e);f&&l?f.initialization=l&&Ee(l):f&&f.initialization&&(f.initialization={sourceURL:f.initialization});const m={template:f,segmentTimeline:a&&ge(a,"S").map(y=>Ee(y)),list:t&&we(Ee(t),{segmentUrls:s,initialization:Ee(l)}),base:r&&we(Ee(r),{initialization:Ee(l)})};return Object.keys(m).forEach(y=>{m[y]||delete m[y]}),m},Fb=(i,e,t)=>s=>{const r=ge(s,"BaseURL"),n=On(e,r),a=we(i,Ee(s)),o=Wo(s);return n.map(l=>({segmentInfo:we(t,o),attributes:we(a,l)}))},Ub=i=>i.reduce((e,t)=>{const s=Ee(t);s.schemeIdUri&&(s.schemeIdUri=s.schemeIdUri.toLowerCase());const r=Bb[s.schemeIdUri];if(r){e[r]={attributes:s};const n=ge(t,"cenc:pssh")[0];if(n){const a=ar(n);e[r].pssh=a&&w2(a)}}return e},{}),$b=i=>{if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let s,r;return r=t,/^CC\d=/.test(t)?[s,r]=t.split("="):/^CC\d$/.test(t)&&(s=t),{channel:s,language:r}});if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{const s={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,n=""]=t.split("=");s.channel=r,s.language=t,n.split(",").forEach(a=>{const[o,l]=a.split(":");o==="lang"?s.language=l:o==="er"?s.easyReader=Number(l):o==="war"?s.aspectRatio=Number(l):o==="3D"&&(s["3D"]=Number(l))})}else s.language=t;return s.channel&&(s.channel="SERVICE"+s.channel),s})},qb=i=>Xi(ge(i.node,"EventStream").map(e=>{const t=Ee(e),s=t.schemeIdUri;return ge(e,"Event").map(r=>{const n=Ee(r),a=n.presentationTime||0,o=t.timescale||1,l=n.duration||0,f=a/o+i.attributes.start;return{schemeIdUri:s,value:t.value,id:n.id,start:f,end:f+l/o,messageData:ar(r)||n.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),jb=(i,e,t)=>s=>{const r=Ee(s),n=On(e,ge(s,"BaseURL")),a=ge(s,"Role")[0],o={role:Ee(a)};let l=we(i,r,o);const f=ge(s,"Accessibility")[0],m=$b(Ee(f));m&&(l=we(l,{captionServices:m}));const y=ge(s,"Label")[0];if(y&&y.childNodes.length){const D=y.childNodes[0].nodeValue.trim();l=we(l,{label:D})}const T=Ub(ge(s,"ContentProtection"));Object.keys(T).length&&(l=we(l,{contentProtection:T}));const S=Wo(s),_=ge(s,"Representation"),A=we(t,S);return Xi(_.map(Fb(l,n,A)))},Vb=(i,e)=>(t,s)=>{const r=On(e,ge(t.node,"BaseURL")),n=we(i,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(n.periodDuration=t.attributes.duration);const a=ge(t.node,"AdaptationSet"),o=Wo(t.node);return Xi(a.map(jb(n,r,o)))},Hb=(i,e)=>{if(i.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!i.length)return null;const t=we({serverURL:ar(i[0])},Ee(i[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},Gb=({attributes:i,priorPeriodAttributes:e,mpdType:t})=>typeof i.start=="number"?i.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,zb=(i,e={})=>{const{manifestUri:t="",NOW:s=Date.now(),clientOffset:r=0,eventHandler:n=function(){}}=e,a=ge(i,"Period");if(!a.length)throw new Error(Yi.INVALID_NUMBER_OF_PERIOD);const o=ge(i,"Location"),l=Ee(i),f=On([{baseUrl:t}],ge(i,"BaseURL")),m=ge(i,"ContentSteering");l.type=l.type||"static",l.sourceDuration=l.mediaPresentationDuration||0,l.NOW=s,l.clientOffset=r,o.length&&(l.locations=o.map(ar));const y=[];return a.forEach((T,S)=>{const _=Ee(T),A=y[S-1];_.start=Gb({attributes:_,priorPeriodAttributes:A?A.attributes:null,mpdType:l.type}),y.push({node:T,attributes:_})}),{locations:l.locations,contentSteeringInfo:Hb(m,n),representationInfo:Xi(y.map(Vb(l,f))),eventStream:Xi(y.map(qb))}},dh=i=>{if(i==="")throw new Error(Yi.DASH_EMPTY_MANIFEST);const e=new ib;let t,s;try{t=e.parseFromString(i,"application/xml"),s=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!s||s&&s.getElementsByTagName("parsererror").length>0)throw new Error(Yi.DASH_INVALID_XML);return s},Wb=i=>{const e=ge(i,"UTCTiming")[0];if(!e)return null;const t=Ee(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Yi.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},Kb=(i,e={})=>{const t=zb(dh(i),e),s=Rb(t.representationInfo);return Cb({dashPlaylists:s,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},Xb=i=>Wb(dh(i));var hh=Math.pow(2,32),Yb=function(i){var e=new DataView(i.buffer,i.byteOffset,i.byteLength),t;return e.getBigUint64?(t=e.getBigUint64(0),t0;s+=12,r--)t.references.push({referenceType:(i[s]&128)>>>7,referencedSize:e.getUint32(s)&2147483647,subsegmentDuration:e.getUint32(s+4),startsWithSap:!!(i[s+8]&128),sapType:(i[s+8]&112)>>>4,sapDeltaTime:e.getUint32(s+8)&268435455});return t},Zb=Jb;const e1=Yt(Zb);var t1=H([73,68,51]),i1=function(e,t){t===void 0&&(t=0),e=H(e);var s=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],n=(s&16)>>4;return n?r+20:r+10},Ns=function i(e,t){return t===void 0&&(t=0),e=H(e),e.length-t<10||!me(e,t1,{offset:t})?t:(t+=i1(e,t),i(e,t))},uc=function(e){return typeof e=="string"?Id(e):e},s1=function(e){return Array.isArray(e)?e.map(function(t){return uc(t)}):[uc(e)]},r1=function i(e,t,s){s===void 0&&(s=!1),t=s1(t),e=H(e);var r=[];if(!t.length)return r;for(var n=0;n>>0,o=e.subarray(n+4,n+8);if(a===0)break;var l=n+a;if(l>e.length){if(s)break;l=e.length}var f=e.subarray(n+8,l);me(o,t[0])&&(t.length===1?r.push(f):r.push.apply(r,i(f,t.slice(1),s))),n=l}return r},qr={EBML:H([26,69,223,163]),DocType:H([66,130]),Segment:H([24,83,128,103]),SegmentInfo:H([21,73,169,102]),Tracks:H([22,84,174,107]),Track:H([174]),TrackNumber:H([215]),DefaultDuration:H([35,227,131]),TrackEntry:H([174]),TrackType:H([131]),FlagDefault:H([136]),CodecID:H([134]),CodecPrivate:H([99,162]),VideoTrack:H([224]),AudioTrack:H([225]),Cluster:H([31,67,182,117]),Timestamp:H([231]),TimestampScale:H([42,215,177]),BlockGroup:H([160]),BlockDuration:H([155]),Block:H([161]),SimpleBlock:H([163])},to=[128,64,32,16,8,4,2,1],n1=function(e){for(var t=1,s=0;s=t.length)return t.length;var r=on(t,s,!1);if(me(e.bytes,r.bytes))return s;var n=on(t,s+r.length);return i(e,t,s+n.length+n.value+r.length)},cc=function i(e,t){t=a1(t),e=H(e);var s=[];if(!t.length)return s;for(var r=0;re.length?e.length:o+a.value,f=e.subarray(o,l);me(t[0],n.bytes)&&(t.length===1?s.push(f):s=s.concat(i(f,t.slice(1))));var m=n.length+a.length+f.length;r+=m}return s},u1=H([0,0,0,1]),l1=H([0,0,1]),c1=H([0,0,3]),d1=function(e){for(var t=[],s=1;s>1&63),s.indexOf(f)!==-1&&(a=n+l),n+=l+(t==="h264"?1:2)}return e.subarray(0,0)},h1=function(e,t,s){return fh(e,"h264",t,s)},f1=function(e,t,s){return fh(e,"h265",t,s)},Ne={webm:H([119,101,98,109]),matroska:H([109,97,116,114,111,115,107,97]),flac:H([102,76,97,67]),ogg:H([79,103,103,83]),ac3:H([11,119]),riff:H([82,73,70,70]),avi:H([65,86,73]),wav:H([87,65,86,69]),"3gp":H([102,116,121,112,51,103]),mp4:H([102,116,121,112]),fmp4:H([115,116,121,112]),mov:H([102,116,121,112,113,116]),moov:H([109,111,111,118]),moof:H([109,111,111,102])},Qi={aac:function(e){var t=Ns(e);return me(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Ns(e);return me(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=cc(e,[qr.EBML,qr.DocType])[0];return me(t,Ne.webm)},mkv:function(e){var t=cc(e,[qr.EBML,qr.DocType])[0];return me(t,Ne.matroska)},mp4:function(e){if(Qi["3gp"](e)||Qi.mov(e))return!1;if(me(e,Ne.mp4,{offset:4})||me(e,Ne.fmp4,{offset:4})||me(e,Ne.moof,{offset:4})||me(e,Ne.moov,{offset:4}))return!0},mov:function(e){return me(e,Ne.mov,{offset:4})},"3gp":function(e){return me(e,Ne["3gp"],{offset:4})},ac3:function(e){var t=Ns(e);return me(e,Ne.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+1880},Xo=9e4,Yo,Qo,Rn,Jo,ph,mh,gh;Yo=function(i){return i*Xo};Qo=function(i,e){return i*e};Rn=function(i){return i/Xo};Jo=function(i,e){return i/e};ph=function(i,e){return Yo(Jo(i,e))};mh=function(i,e){return Qo(Rn(i),e)};gh=function(i,e,t){return Rn(t?i:i-e)};var hi={ONE_SECOND_IN_TS:Xo,secondsToVideoTs:Yo,secondsToAudioTs:Qo,videoTsToSeconds:Rn,audioTsToSeconds:Jo,audioTsToVideoTs:ph,videoTsToAudioTs:mh,metadataTsToSeconds:gh};/** + * @license + * Video.js 8.12.0 + * Copyright Brightcove, Inc. + * Available under Apache License Version 2.0 + * + * + * Includes vtt.js + * Available under Apache License Version 2.0 + * + */var so="8.12.0";const Ot={},Kt=function(i,e){return Ot[i]=Ot[i]||[],e&&(Ot[i]=Ot[i].concat(e)),Ot[i]},g1=function(i,e){Kt(i,e)},yh=function(i,e){const t=Kt(i).indexOf(e);return t<=-1?!1:(Ot[i]=Ot[i].slice(),Ot[i].splice(t,1),!0)},y1=function(i,e){Kt(i,[].concat(e).map(t=>{const s=(...r)=>(yh(i,s),t(...r));return s}))},un={prefixed:!0},Qr=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],dc=Qr[0];let Bs;for(let i=0;i(s,r,n)=>{const a=e.levels[r],o=new RegExp(`^(${a})$`);let l=i;if(s!=="log"&&n.unshift(s.toUpperCase()+":"),t&&(l=`%c${i}`,n.unshift(t)),n.unshift(l+":"),je){je.push([].concat(n));const m=je.length-1e3;je.splice(0,m>0?m:0)}if(!E.console)return;let f=E.console[s];!f&&s==="debug"&&(f=E.console.info||E.console.log),!(!f||!a||!o.test(s))&&f[Array.isArray(n)?"apply":"call"](E.console,n)};function ro(i,e=":",t=""){let s="info",r;const n=function(...a){r("log",s,a)};return r=_1(i,n,t),n.createLogger=(a,o,l)=>{const f=o!==void 0?o:e,m=l!==void 0?l:t,y=`${i} ${f} ${a}`;return ro(y,f,m)},n.createNewLogger=(a,o,l)=>ro(a,o,l),n.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:s},n.level=a=>{if(typeof a=="string"){if(!n.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);s=a}return s},n.history=()=>je?[].concat(je):[],n.history.filter=a=>(je||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),n.history.clear=()=>{je&&(je.length=0)},n.history.disable=()=>{je!==null&&(je.length=0,je=null)},n.history.enable=()=>{je===null&&(je=[])},n.error=(...a)=>r("error",s,a),n.warn=(...a)=>r("warn",s,a),n.debug=(...a)=>r("debug",s,a),n}const Z=ro("VIDEOJS"),_h=Z.createLogger,v1=Object.prototype.toString,vh=function(i){return Ct(i)?Object.keys(i):[]};function Ui(i,e){vh(i).forEach(t=>e(i[t],t))}function Th(i,e,t=0){return vh(i).reduce((s,r)=>e(s,i[r],r),t)}function Ct(i){return!!i&&typeof i=="object"}function Ji(i){return Ct(i)&&v1.call(i)==="[object Object]"&&i.constructor===Object}function ce(...i){const e={};return i.forEach(t=>{t&&Ui(t,(s,r)=>{if(!Ji(s)){e[r]=s;return}Ji(e[r])||(e[r]={}),e[r]=ce(e[r],s)})}),e}function bh(i={}){const e=[];for(const t in i)if(i.hasOwnProperty(t)){const s=i[t];e.push(s)}return e}function Mn(i,e,t,s=!0){const r=a=>Object.defineProperty(i,e,{value:a,enumerable:!0,writable:!0}),n={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return s&&(n.set=r),Object.defineProperty(i,e,n)}var T1=Object.freeze({__proto__:null,each:Ui,reduce:Th,isObject:Ct,isPlain:Ji,merge:ce,values:bh,defineLazyProperty:Mn});let Zo=!1,Sh=null,At=!1,xh,Eh=!1,$i=!1,qi=!1,Dt=!1,eu=null,Nn=null,Ch=null,ln=!1,Bn=!1,cn=!1,Fn=!1,no=!1,ao=!1,oo=!1;const Js=!!(as()&&("ontouchstart"in E||E.navigator.maxTouchPoints||E.DocumentTouch&&E.document instanceof E.DocumentTouch)),zt=E.navigator&&E.navigator.userAgentData;zt&&zt.platform&&zt.brands&&(At=zt.platform==="Android",$i=!!zt.brands.find(i=>i.brand==="Microsoft Edge"),qi=!!zt.brands.find(i=>i.brand==="Chromium"),Dt=!$i&&qi,eu=Nn=(zt.brands.find(i=>i.brand==="Chromium")||{}).version||null,Bn=zt.platform==="Windows");if(!qi){const i=E.navigator&&E.navigator.userAgent||"";Zo=/iPod/i.test(i),Sh=function(){const e=i.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),At=/Android/i.test(i),xh=function(){const e=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),s=e[2]&&parseFloat(e[2]);return t&&s?parseFloat(e[1]+"."+e[2]):t||null}(),Eh=/Firefox/i.test(i),$i=/Edg/i.test(i),qi=/Chrome/i.test(i)||/CriOS/i.test(i),Dt=!$i&&qi,eu=Nn=function(){const e=i.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),Ch=function(){const e=/MSIE\s(\d+)\.\d/.exec(i);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(i)&&/rv:11.0/.test(i)&&(t=11),t}(),no=/Tizen/i.test(i),ao=/Web0S/i.test(i),oo=no||ao,ln=/Safari/i.test(i)&&!Dt&&!At&&!$i&&!oo,Bn=/Windows/i.test(i),cn=/iPad/i.test(i)||ln&&Js&&!/iPhone/i.test(i),Fn=/iPhone/i.test(i)&&!cn}const $e=Fn||cn||Zo,Un=(ln||$e)&&!Dt;var Ah=Object.freeze({__proto__:null,get IS_IPOD(){return Zo},get IOS_VERSION(){return Sh},get IS_ANDROID(){return At},get ANDROID_VERSION(){return xh},get IS_FIREFOX(){return Eh},get IS_EDGE(){return $i},get IS_CHROMIUM(){return qi},get IS_CHROME(){return Dt},get CHROMIUM_VERSION(){return eu},get CHROME_VERSION(){return Nn},get IE_VERSION(){return Ch},get IS_SAFARI(){return ln},get IS_WINDOWS(){return Bn},get IS_IPAD(){return cn},get IS_IPHONE(){return Fn},get IS_TIZEN(){return no},get IS_WEBOS(){return ao},get IS_SMART_TV(){return oo},TOUCH_ENABLED:Js,IS_IOS:$e,IS_ANY_SAFARI:Un});function hc(i){return typeof i=="string"&&!!i.trim()}function b1(i){if(i.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function as(){return F===E.document}function os(i){return Ct(i)&&i.nodeType===1}function Dh(){try{return E.parent!==E.self}catch{return!0}}function wh(i){return function(e,t){if(!hc(e))return F[i](null);hc(t)&&(t=F.querySelector(t));const s=os(t)?t:F;return s[i]&&s[i](e)}}function Y(i="div",e={},t={},s){const r=F.createElement(i);return Object.getOwnPropertyNames(e).forEach(function(n){const a=e[n];n==="textContent"?Jt(r,a):(r[n]!==a||n==="tabIndex")&&(r[n]=a)}),Object.getOwnPropertyNames(t).forEach(function(n){r.setAttribute(n,t[n])}),s&&tu(r,s),r}function Jt(i,e){return typeof i.textContent>"u"?i.innerText=e:i.textContent=e,i}function uo(i,e){e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}function qs(i,e){return b1(e),i.classList.contains(e)}function mi(i,...e){return i.classList.add(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i}function $n(i,...e){return i?(i.classList.remove(...e.reduce((t,s)=>t.concat(s.split(/\s+/)),[])),i):(Z.warn("removeClass was called with an element that doesn't exist"),null)}function kh(i,e,t){return typeof t=="function"&&(t=t(i,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(s=>i.classList.toggle(s,t)),i}function Ih(i,e){Object.getOwnPropertyNames(e).forEach(function(t){const s=e[t];s===null||typeof s>"u"||s===!1?i.removeAttribute(t):i.setAttribute(t,s===!0?"":s)})}function Wt(i){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(i&&i.attributes&&i.attributes.length>0){const s=i.attributes;for(let r=s.length-1;r>=0;r--){const n=s[r].name;let a=s[r].value;t.includes(n)&&(a=a!==null),e[n]=a}}return e}function Ph(i,e){return i.getAttribute(e)}function Zi(i,e,t){i.setAttribute(e,t)}function qn(i,e){i.removeAttribute(e)}function Lh(){F.body.focus(),F.onselectstart=function(){return!1}}function Oh(){F.onselectstart=function(){return!0}}function es(i){if(i&&i.getBoundingClientRect&&i.parentNode){const e=i.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(s=>{e[s]!==void 0&&(t[s]=e[s])}),t.height||(t.height=parseFloat(ts(i,"height"))),t.width||(t.width=parseFloat(ts(i,"width"))),t}}function Zs(i){if(!i||i&&!i.offsetParent)return{left:0,top:0,width:0,height:0};const e=i.offsetWidth,t=i.offsetHeight;let s=0,r=0;for(;i.offsetParent&&i!==F[un.fullscreenElement];)s+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return{left:s,top:r,width:e,height:t}}function jn(i,e){const t={x:0,y:0};if($e){let m=i;for(;m&&m.nodeName.toLowerCase()!=="html";){const y=ts(m,"transform");if(/^matrix/.test(y)){const T=y.slice(7,-1).split(/,\s/).map(Number);t.x+=T[4],t.y+=T[5]}else if(/^matrix3d/.test(y)){const T=y.slice(9,-1).split(/,\s/).map(Number);t.x+=T[12],t.y+=T[13]}m=m.parentNode}}const s={},r=Zs(e.target),n=Zs(i),a=n.width,o=n.height;let l=e.offsetY-(n.top-r.top),f=e.offsetX-(n.left-r.left);return e.changedTouches&&(f=e.changedTouches[0].pageX-n.left,l=e.changedTouches[0].pageY+n.top,$e&&(f-=t.x,l-=t.y)),s.y=1-Math.max(0,Math.min(1,l/o)),s.x=Math.max(0,Math.min(1,f/a)),s}function Rh(i){return Ct(i)&&i.nodeType===3}function Vn(i){for(;i.firstChild;)i.removeChild(i.firstChild);return i}function Mh(i){return typeof i=="function"&&(i=i()),(Array.isArray(i)?i:[i]).map(e=>{if(typeof e=="function"&&(e=e()),os(e)||Rh(e))return e;if(typeof e=="string"&&/\S/.test(e))return F.createTextNode(e)}).filter(e=>e)}function tu(i,e){return Mh(e).forEach(t=>i.appendChild(t)),i}function Nh(i,e){return tu(Vn(i),e)}function er(i){return i.button===void 0&&i.buttons===void 0||i.button===0&&i.buttons===void 0||i.type==="mouseup"&&i.button===0&&i.buttons===0?!0:!(i.button!==0||i.buttons!==1)}const Xt=wh("querySelector"),Bh=wh("querySelectorAll");function ts(i,e){if(!i||!e)return"";if(typeof E.getComputedStyle=="function"){let t;try{t=E.getComputedStyle(i)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function Fh(i){[...F.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),s=F.createElement("style");s.textContent=t,i.document.head.appendChild(s)}catch{const s=F.createElement("link");s.rel="stylesheet",s.type=e.type,s.media=e.media.mediaText,s.href=e.href,i.document.head.appendChild(s)}})}var Uh=Object.freeze({__proto__:null,isReal:as,isEl:os,isInFrame:Dh,createEl:Y,textContent:Jt,prependTo:uo,hasClass:qs,addClass:mi,removeClass:$n,toggleClass:kh,setAttributes:Ih,getAttributes:Wt,getAttribute:Ph,setAttribute:Zi,removeAttribute:qn,blockTextSelection:Lh,unblockTextSelection:Oh,getBoundingClientRect:es,findPosition:Zs,getPointerPosition:jn,isTextNode:Rh,emptyEl:Vn,normalizeContent:Mh,appendContent:tu,insertContent:Nh,isSingleLeftClick:er,$:Xt,$$:Bh,computedStyle:ts,copyStyleSheetsToWindow:Fh});let $h=!1,lo;const S1=function(){if(lo.options.autoSetup===!1)return;const i=Array.prototype.slice.call(F.getElementsByTagName("video")),e=Array.prototype.slice.call(F.getElementsByTagName("audio")),t=Array.prototype.slice.call(F.getElementsByTagName("video-js")),s=i.concat(e,t);if(s&&s.length>0)for(let r=0,n=s.length;r-1&&(r={passive:!0}),i.addEventListener(e,s.dispatcher,r)}else i.attachEvent&&i.attachEvent("on"+e,s.dispatcher)}function Oe(i,e,t){if(!Ue.has(i))return;const s=Ue.get(i);if(!s.handlers)return;if(Array.isArray(e))return iu(Oe,i,e,t);const r=function(a,o){s.handlers[o]=[],fc(a,o)};if(e===void 0){for(const a in s.handlers)Object.prototype.hasOwnProperty.call(s.handlers||{},a)&&r(i,a);return}const n=s.handlers[e];if(n){if(!t){r(i,e);return}if(t.guid)for(let a=0;a=e&&(i(...r),t=n)}},Vh=function(i,e,t,s=E){let r;const n=()=>{s.clearTimeout(r),r=null},a=function(){const o=this,l=arguments;let f=function(){r=null,f=null,t||i.apply(o,l)};!r&&t&&i.apply(o,l),s.clearTimeout(r),r=s.setTimeout(f,e)};return a.cancel=n,a};var w1=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:at,bind_:de,throttle:wt,debounce:Vh});let ks;class ot{on(e,t){const s=this.addEventListener;this.addEventListener=()=>{},tt(this,e,t),this.addEventListener=s}off(e,t){Oe(this,e,t)}one(e,t){const s=this.addEventListener;this.addEventListener=()=>{},Gn(this,e,t),this.addEventListener=s}any(e,t){const s=this.addEventListener;this.addEventListener=()=>{},su(this,e,t),this.addEventListener=s}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=Hn(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),us(this,e)}queueTrigger(e){ks||(ks=new Map);const t=e.type||e;let s=ks.get(this);s||(s=new Map,ks.set(this,s));const r=s.get(t);s.delete(t),E.clearTimeout(r);const n=E.setTimeout(()=>{s.delete(t),s.size===0&&(s=null,ks.delete(this)),this.trigger(e)},0);s.set(t,n)}}ot.prototype.allowedEvents_={};ot.prototype.addEventListener=ot.prototype.on;ot.prototype.removeEventListener=ot.prototype.off;ot.prototype.dispatchEvent=ot.prototype.trigger;const zn=i=>typeof i.name=="function"?i.name():typeof i.name=="string"?i.name:i.name_?i.name_:i.constructor&&i.constructor.name?i.constructor.name:typeof i,Nt=i=>i instanceof ot||!!i.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof i[e]=="function"),k1=(i,e)=>{Nt(i)?e():(i.eventedCallbacks||(i.eventedCallbacks=[]),i.eventedCallbacks.push(e))},fo=i=>typeof i=="string"&&/\S/.test(i)||Array.isArray(i)&&!!i.length,dn=(i,e,t)=>{if(!i||!i.nodeName&&!Nt(i))throw new Error(`Invalid target for ${zn(e)}#${t}; must be a DOM node or evented object.`)},Hh=(i,e,t)=>{if(!fo(i))throw new Error(`Invalid event type for ${zn(e)}#${t}; must be a non-empty string or array.`)},Gh=(i,e,t)=>{if(typeof i!="function")throw new Error(`Invalid listener for ${zn(e)}#${t}; must be a function.`)},Pa=(i,e,t)=>{const s=e.length<3||e[0]===i||e[0]===i.eventBusEl_;let r,n,a;return s?(r=i.eventBusEl_,e.length>=3&&e.shift(),[n,a]=e):[r,n,a]=e,dn(r,i,t),Hh(n,i,t),Gh(a,i,t),a=de(i,a),{isTargetingSelf:s,target:r,type:n,listener:a}},ui=(i,e,t,s)=>{dn(i,i,e),i.nodeName?D1[e](i,t,s):i[e](t,s)},I1={on(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Pa(this,i,"on");if(ui(t,"on",s,r),!e){const n=()=>this.off(t,s,r);n.guid=r.guid;const a=()=>this.off("dispose",n);a.guid=r.guid,ui(this,"on","dispose",n),ui(t,"on","dispose",a)}},one(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Pa(this,i,"one");if(e)ui(t,"one",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,ui(t,"one",s,n)}},any(...i){const{isTargetingSelf:e,target:t,type:s,listener:r}=Pa(this,i,"any");if(e)ui(t,"any",s,r);else{const n=(...a)=>{this.off(t,s,n),r.apply(null,a)};n.guid=r.guid,ui(t,"any",s,n)}},off(i,e,t){if(!i||fo(i))Oe(this.eventBusEl_,i,e);else{const s=i,r=e;dn(s,this,"off"),Hh(r,this,"off"),Gh(t,this,"off"),t=de(this,t),this.off("dispose",t),s.nodeName?(Oe(s,r,t),Oe(s,"dispose",t)):Nt(s)&&(s.off(r,t),s.off("dispose",t))}},trigger(i,e){dn(this.eventBusEl_,this,"trigger");const t=i&&typeof i!="string"?i.type:i;if(!fo(t))throw new Error(`Invalid event type for ${zn(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return us(this.eventBusEl_,i,e)}};function ru(i,e={}){const{eventBusKey:t}=e;if(t){if(!i[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);i.eventBusEl_=i[t]}else i.eventBusEl_=Y("span",{className:"vjs-event-bus"});return Object.assign(i,I1),i.eventedCallbacks&&i.eventedCallbacks.forEach(s=>{s()}),i.on("dispose",()=>{i.off(),[i,i.el_,i.eventBusEl_].forEach(function(s){s&&Ue.has(s)&&Ue.delete(s)}),E.setTimeout(()=>{i.eventBusEl_=null},0)}),i}const P1={state:{},setState(i){typeof i=="function"&&(i=i());let e;return Ui(i,(t,s)=>{this.state[s]!==t&&(e=e||{},e[s]={from:this.state[s],to:t}),this.state[s]=t}),e&&Nt(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function zh(i,e){return Object.assign(i,P1),i.state=Object.assign({},i.state,e),typeof i.handleStateChanged=="function"&&Nt(i)&&i.on("statechanged",i.handleStateChanged),i}const js=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toLowerCase())},ve=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},Wh=function(i,e){return ve(i)===ve(e)};var L1=Object.freeze({__proto__:null,toLowerCase:js,toTitleCase:ve,titleCaseEquals:Wh});class N{constructor(e,t,s){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=ce({},this.options_),t=this.options_=ce(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${ft()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&(ru(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),zh(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(s),t.reportTouchActivity!==!1&&this.enableTouchActivity()}on(e,t){}off(e,t){}one(e,t){}any(e,t){}trigger(e,t){}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=ce(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,s){return Y(e,t,s)}localize(e,t,s=e){const r=this.player_.language&&this.player_.language(),n=this.player_.languages&&this.player_.languages(),a=n&&n[r],o=r&&r.split("-")[0],l=n&&n[o];let f=s;return a&&a[e]?f=a[e]:l&&l[e]&&(f=l[e]),t&&(f=f.replace(/\{(\d+)\}/g,function(m,y){const T=t[y-1];let S=T;return typeof T>"u"&&(S=m),S})),f}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((s,r)=>s.concat(r),[]);let t=this;for(let s=0;s=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[ve(e.name())]=null,this.childNameIndex_[js(e.name())]=null;const s=e.el();s&&s.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,s=a=>{const o=a.name;let l=a.opts;if(t[o]!==void 0&&(l=t[o]),l===!1)return;l===!0&&(l={}),l.playerOptions=this.options_.playerOptions;const f=this.addChild(o,l);f&&(this[o]=f)};let r;const n=N.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(o){return typeof o=="string"?a===o:a===o.name})})).map(a=>{let o,l;return typeof a=="string"?(o=a,l=e[o]||this.options_[o]||{}):(o=a.name,l=a),{name:o,opts:l}}).filter(a=>{const o=N.getComponent(a.opts.componentClass||ve(a.name));return o&&!n.isTech(o)}).forEach(s)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return Xt(e,t||this.contentEl())}$$(e,t){return Bh(e,t||this.contentEl())}hasClass(e){return qs(this.el_,e)}addClass(...e){mi(this.el_,...e)}removeClass(...e){$n(this.el_,...e)}toggleClass(e,t){kh(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 Ph(this.el_,e)}setAttribute(e,t){Zi(this.el_,e,t)}removeAttribute(e){qn(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,s){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",s||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],n=r.indexOf("px");return parseInt(n!==-1?r.slice(0,n):this.el_["offset"+ve(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=ts(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const s=`offset${ve(e)}`;t=this.el_[s]}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){this.player_&&(W.isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const s=10,r=200;let n;this.on("touchstart",function(o){o.touches.length===1&&(t={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},e=E.performance.now(),n=!0)}),this.on("touchmove",function(o){if(o.touches.length>1)n=!1;else if(t){const l=o.touches[0].pageX-t.pageX,f=o.touches[0].pageY-t.pageY;Math.sqrt(l*l+f*f)>s&&(n=!1)}});const a=function(){n=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(o){t=null,n===!0&&E.performance.now()-e{this.setTimeoutIds_.has(s)&&this.setTimeoutIds_.delete(s),e()},t),this.setTimeoutIds_.add(s),s}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),E.clearTimeout(e)),e}setInterval(e,t){e=de(this,e),this.clearTimersOnDispose_();const s=E.setInterval(e,t);return this.setIntervalIds_.add(s),s}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),E.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=de(this,e),t=E.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){if(this.namedRafs_.has(e))return;this.clearTimersOnDispose_(),t=de(this,t);const s=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,s),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),E.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((s,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const s=N.getComponent("Tech"),r=s&&s.isTech(t),n=N===t||N.prototype.isPrototypeOf(t.prototype);if(r||!n){let o;throw r?o="techs must be registered using Tech.registerTech()":o="must be a Component subclass",new Error(`Illegal component, "${e}"; ${o}.`)}e=ve(e),N.components_||(N.components_={});const a=N.getComponent("Player");if(e==="Player"&&a&&a.players){const o=a.players,l=Object.keys(o);if(o&&l.length>0&&l.map(f=>o[f]).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return N.components_[e]=t,N.components_[js(e)]=t,t}static getComponent(e){if(!(!e||!N.components_))return N.components_[e]}}N.registerComponent("Component",N);function O1(i,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${i}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function pc(i,e,t,s){return O1(i,s,t.length-1),t[s][e]}function La(i){let e;return i===void 0||i.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:i.length,start:pc.bind(null,"start",0,i),end:pc.bind(null,"end",1,i)},E.Symbol&&E.Symbol.iterator&&(e[E.Symbol.iterator]=()=>(i||[]).values()),e}function ht(i,e){return Array.isArray(i)?La(i):i===void 0||e===void 0?La():La([[i,e]])}const Kh=function(i,e){i=i<0?0:i;let t=Math.floor(i%60),s=Math.floor(i/60%60),r=Math.floor(i/3600);const n=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(r=s=t="-"),r=r>0||a>0?r+":":"",s=((r||n>=10)&&s<10?"0"+s:s)+":",t=t<10?"0"+t:t,r+s+t};let nu=Kh;function Xh(i){nu=i}function Yh(){nu=Kh}function vi(i,e=i){return nu(i,e)}var R1=Object.freeze({__proto__:null,createTimeRanges:ht,createTimeRange:ht,setFormatTime:Xh,resetFormatTime:Yh,formatTime:vi});function Qh(i,e){let t=0,s,r;if(!e)return 0;(!i||!i.length)&&(i=ht(0,0));for(let n=0;ne&&(r=e),t+=r-s;return t/e}function _e(i){if(i instanceof _e)return i;typeof i=="number"?this.code=i:typeof i=="string"?this.message=i:Ct(i)&&(typeof i.code=="number"&&(this.code=i.code),Object.assign(this,i)),this.message||(this.message=_e.defaultMessages[this.code]||"")}_e.prototype.code=0;_e.prototype.message="";_e.prototype.status=null;_e.prototype.metadata=null;_e.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"];_e.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."};_e.MEDIA_ERR_CUSTOM=0;_e.prototype.MEDIA_ERR_CUSTOM=0;_e.MEDIA_ERR_ABORTED=1;_e.prototype.MEDIA_ERR_ABORTED=1;_e.MEDIA_ERR_NETWORK=2;_e.prototype.MEDIA_ERR_NETWORK=2;_e.MEDIA_ERR_DECODE=3;_e.prototype.MEDIA_ERR_DECODE=3;_e.MEDIA_ERR_SRC_NOT_SUPPORTED=4;_e.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4;_e.MEDIA_ERR_ENCRYPTED=5;_e.prototype.MEDIA_ERR_ENCRYPTED=5;function Vs(i){return i!=null&&typeof i.then=="function"}function _t(i){Vs(i)&&i.then(null,e=>{})}const po=function(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,s,r)=>(i[s]&&(t[s]=i[s]),t),{cues:i.cues&&Array.prototype.map.call(i.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})},M1=function(i){const e=i.$$("track"),t=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const n=po(r.track);return r.src&&(n.src=r.src),n}).concat(Array.prototype.filter.call(i.textTracks(),function(r){return t.indexOf(r)===-1}).map(po))},N1=function(i,e){return i.forEach(function(t){const s=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>s.addCue(r))}),e.textTracks()};var mc={textTracksToJson:M1,jsonToTextTracks:N1,trackToJson_:po};const Oa="vjs-modal-dialog";class ls extends N{constructor(e,t){super(e,t),this.handleKeyDown_=s=>this.handleKeyDown(s),this.close_=s=>this.close(s),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=Y("div",{className:`${Oa}-content`},{role:"document"}),this.descEl_=Y("p",{className:`${Oa}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),Jt(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Oa} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger("modalclose"),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let s=this.getChild("closeButton");if(t&&!s){const r=this.contentEl_;this.contentEl_=this.el_,s=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(s,"close",this.close_)}!t&&s&&(this.off(s,"close",this.close_),this.removeChild(s),s.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),s=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,s.removeChild(t),this.empty(),Nh(t,e),this.trigger("modalfill"),r?s.insertBefore(t,r):s.appendChild(t);const n=this.getChild("closeButton");n&&s.appendChild(n.el_)}empty(){this.trigger("beforemodalempty"),Vn(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=F.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(e.stopPropagation(),W.isEventKey(e,"Escape")&&this.closeable()){e.preventDefault(),this.close();return}if(!W.isEventKey(e,"Tab"))return;const t=this.focusableEls_(),s=this.el_.querySelector(":focus");let r;for(let n=0;n(t instanceof E.HTMLAnchorElement||t instanceof E.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof E.HTMLInputElement||t instanceof E.HTMLSelectElement||t instanceof E.HTMLTextAreaElement||t instanceof E.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof E.HTMLIFrameElement||t instanceof E.HTMLObjectElement||t instanceof E.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}ls.prototype.options_={pauseOnOpen:!0,temporary:!0};N.registerComponent("ModalDialog",ls);class is extends ot{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t{this.trigger({track:e,type:"labelchange",target:this})},Nt(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let s=0,r=this.length;s=0;t--)if(e[t].enabled){Ra(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Ra(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Ra(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Ma=function(i,e){for(let t=0;t=0;t--)if(e[t].selected){Ma(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t{this.changing_||(this.changing_=!0,Ma(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class Jh extends is{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class U1{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,s=e.length;t0&&(E.console&&E.console.groupCollapsed&&E.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),s.forEach(r=>Z.error(r)),E.console&&E.console.groupEnd&&E.console.groupEnd()),t.flush()},_c=function(i,e){const t={uri:i},s=Wn(i);s&&(t.cors=s);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),bd(t,de(this,function(n,a,o){if(n)return Z.error(n,a);e.loaded_=!0,typeof E.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],l=>{if(l.type==="vttjserror"){Z.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return yc(o,e)}):yc(o,e)}))};class or extends au{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=ce(e,{kind:j1[e.kind]||"subtitles",language:e.language||e.srclang||""});let s=gc[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(s="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const n=new hn(this.cues_),a=new hn(this.activeCues_);let o=!1;this.timeupdateHandler=de(this,function(f={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),f.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const l=()=>{this.stopTracking()};this.tech_.one("dispose",l),s!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return s},set(f){gc[f]&&s!==f&&(s=f,!this.preload_&&s!=="disabled"&&this.cues.length===0&&_c(this.src,this),this.stopTracking(),s!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?n:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const f=this.tech_.currentTime(),m=[];for(let y=0,T=this.cues.length;y=f&&m.push(S)}if(o=!1,m.length!==this.activeCues_.length)o=!0;else for(let y=0;y{t=$t.LOADED,this.trigger({type:"load",target:this})})}}$t.prototype.allowedEvents_={load:"load"};$t.NONE=0;$t.LOADING=1;$t.LOADED=2;$t.ERROR=3;const nt={audio:{ListClass:B1,TrackClass:ef,capitalName:"Audio"},video:{ListClass:F1,TrackClass:tf,capitalName:"Video"},text:{ListClass:Jh,TrackClass:or,capitalName:"Text"}};Object.keys(nt).forEach(function(i){nt[i].getterName=`${i}Tracks`,nt[i].privateName=`${i}Tracks_`});const ss={remoteText:{ListClass:Jh,TrackClass:or,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:U1,TrackClass:$t,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Be=Object.assign({},nt,ss);ss.names=Object.keys(ss);nt.names=Object.keys(nt);Be.names=[].concat(ss.names).concat(nt.names);function H1(i,e,t,s,r={}){const n=i.textTracks();r.kind=e,t&&(r.label=t),s&&(r.language=s),r.tech=i;const a=new Be.text.TrackClass(r);return n.addTrack(a),a}class K extends N{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=s=>this.onDurationChange(s),this.trackProgress_=s=>this.trackProgress(s),this.trackCurrentTime_=s=>this.trackCurrentTime(s),this.stopTrackingCurrentTime_=s=>this.stopTrackingCurrentTime(s),this.disposeSourceHandler_=s=>this.disposeSourceHandler(s),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),Be.names.forEach(s=>{const r=Be[s];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(s=>{e[`native${s}Tracks`]===!1&&(this[`featuresNative${s}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new Be.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(de(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return ht(0,0)}bufferedPercent(){return Qh(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(nt.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const s=this[`${t}Tracks`]()||[];let r=s.length;for(;r--;){const n=s[r];t==="text"&&this.removeRemoteTextTrack(n),s.removeTrack(n)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const s=e[t];this.removeRemoteTextTrack(s)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new _e(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?ht(0,0):ht()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){nt.names.forEach(e=>{const t=nt[e],s=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",s),r.addEventListener("addtrack",s),this.on("dispose",()=>{r.removeEventListener("removetrack",s),r.removeEventListener("addtrack",s)})})}addWebVttScript_(){if(!E.WebVTT)if(F.body.contains(this.el())){if(!this.options_["vtt.js"]&&Ji(Ml)&&Object.keys(Ml).length>0){this.trigger("vttjsloaded");return}const e=F.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}),E.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),s=o=>e.addTrack(o.track),r=o=>e.removeTrack(o.track);t.on("addtrack",s),t.on("removetrack",r),this.addWebVttScript_();const n=()=>this.trigger("texttrackchange"),a=()=>{n();for(let o=0;othis.autoRemoteTextTracks_.addTrack(s.track)),s}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=ft();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return K.canPlayType(e.type)}static isTech(e){return e.prototype instanceof K||e instanceof K||e===K}static registerTech(e,t){if(K.techs_||(K.techs_={}),!K.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!K.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!K.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=ve(e),K.techs_[e]=t,K.techs_[js(e)]=t,e!=="Tech"&&K.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(K.techs_&&K.techs_[e])return K.techs_[e];if(e=ve(e),E&&E.videojs&&E.videojs[e])return Z.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),E.videojs[e]}}}Be.names.forEach(function(i){const e=Be[i];K.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}});K.prototype.featuresVolumeControl=!0;K.prototype.featuresMuteControl=!0;K.prototype.featuresFullscreenResize=!1;K.prototype.featuresPlaybackRate=!1;K.prototype.featuresProgressEvents=!1;K.prototype.featuresSourceset=!1;K.prototype.featuresTimeupdateEvents=!1;K.prototype.featuresNativeTextTracks=!1;K.prototype.featuresVideoFrameCallback=!1;K.withSourceHandlers=function(i){i.registerSourceHandler=function(t,s){let r=i.sourceHandlers;r||(r=i.sourceHandlers=[]),s===void 0&&(s=r.length),r.splice(s,0,t)},i.canPlayType=function(t){const s=i.sourceHandlers||[];let r;for(let n=0;nli(e,gi[e.type],t,i),1)}function W1(i,e){i.forEach(t=>t.setTech&&t.setTech(e))}function K1(i,e,t){return i.reduceRight(lu(t),e[t]())}function X1(i,e,t,s){return e[t](i.reduce(lu(t),s))}function vc(i,e,t,s=null){const r="call"+ve(t),n=i.reduce(lu(r),s),a=n===fn,o=a?null:e[t](n);return J1(i,t,o,a),o}const Y1={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},Q1={setCurrentTime:1,setMuted:1,setVolume:1},Tc={play:1,pause:1};function lu(i){return(e,t)=>e===fn?fn:t[i]?t[i](e):e}function J1(i,e,t,s){for(let r=i.length-1;r>=0;r--){const n=i[r];n[e]&&n[e](s,t)}}function Z1(i){mo[i.id()]=null}function eS(i,e){const t=mo[i.id()];let s=null;if(t==null)return s=e(i),mo[i.id()]=[[e,s]],s;for(let r=0;r{if(!e)return"";if(i.cache_.source.src===e&&i.cache_.source.type)return i.cache_.source.type;const t=i.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const s=i.$$("source");for(let r=0;r + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +`;class rS extends N{constructor(e,t,s){const r=ce({createEl:!1},t);if(super(e,r,s),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let n=0,a=t.playerOptions.techOrder;nthis.handleMouseOver(s),this.handleMouseOut_=s=>this.handleMouseOut(s),this.handleClick_=s=>this.handleClick(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.emitTapEvents(),this.enable()}createEl(e="div",t={},s={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&Z.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),s=Object.assign({role:"button"},s),this.tabIndex_=t.tabIndex;const r=Y(e,t,s);return this.player_.options_.experimentalSvgIcons||r.appendChild(Y("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=Y("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const s=this.localize(e);this.controlText_=e,Jt(this.controlTextEl_,s),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",s)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){W.isEventKey(e,"Space")||W.isEventKey(e,"Enter")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}N.registerComponent("ClickableComponent",Kn);class go extends Kn{constructor(e,t){super(e,t),this.update(),this.update_=s=>this.update(s),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return Y("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(Y("picture",{className:"vjs-poster",tabIndex:-1},{},Y("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?_t(this.player_.play()):this.player_.pause())}}go.prototype.crossorigin=go.prototype.crossOrigin;N.registerComponent("PosterImage",go);const st="#222",Sc="#ccc",nS={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 Na(i,e){let t;if(i.length===4)t=i[1]+i[1]+i[2]+i[2]+i[3]+i[3];else if(i.length===7)t=i.slice(1);else throw new Error("Invalid color code provided, "+i+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function Is(i,e,t){try{i.style[e]=t}catch{return}}function xc(i){return i?`${i}px`:""}class aS extends N{constructor(e,t,s){super(e,t,s);const r=a=>this.updateDisplay(a),n=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(de(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",n),e.on("playerresize",n);const a=E.screen.orientation||E,o=E.screen.orientation?"change":"orientationchange";a.addEventListener(o,n),e.on("dispose",()=>a.removeEventListener(o,n));const l=this.options_.playerOptions.tracks||[];for(let f=0;f.1&&(s>r?n=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),Is(this.el_,"insetInline",xc(n)),Is(this.el_,"insetBlock",xc(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),s=e.activeCues;let r=s.length;for(;r--;){const n=s[r];if(!n)continue;const a=n.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&Is(a.firstChild,"color",Na(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&Is(a.firstChild,"backgroundColor",Na(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?Is(a,"backgroundColor",Na(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${st}, 2px 2px 4px ${st}, 2px 2px 5px ${st}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${st}, 2px 2px ${st}, 3px 3px ${st}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${Sc}, 0 1px ${Sc}, -1px -1px ${st}, 0 -1px ${st}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${st}, 0 0 4px ${st}, 0 0 4px ${st}, 0 0 4px ${st}`)),t.fontPercent&&t.fontPercent!==1){const o=E.parseFloat(a.style.fontSize);a.style.fontSize=o*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=nS[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof E.WebVTT!="function"||e.every(s=>!s.activeCues))return;const t=[];for(let s=0;sthis.handleMouseDown(s))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){_t(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const s=this.player_.getChild("controlBar"),r=s&&s.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const n=()=>r.focus();Vs(t)?t.then(n,()=>{}):this.setTimeout(n,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}rf.prototype.controlText_="Play Video";N.registerComponent("BigPlayButton",rf);class uS extends et{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){W.isEventKey(e,"Esc")?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}N.registerComponent("CloseButton",uS);class nf extends et{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",s=>this.handlePlay(s)),this.on(e,"pause",s=>this.handlePause(s)),t.replay&&this.on(e,"ended",s=>this.handleEnded(s))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?_t(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}nf.prototype.controlText_="Play";N.registerComponent("PlayToggle",nf);class cs extends N{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],s=>this.update(s)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),s=Y("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(s),this.contentEl_=Y("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=vi(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,Z.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_=F.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}cs.prototype.labelText_="Time";cs.prototype.controlText_="Time";N.registerComponent("TimeDisplay",cs);class cu extends cs{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}cu.prototype.labelText_="Current Time";cu.prototype.controlText_="Current Time";N.registerComponent("CurrentTimeDisplay",cu);class du extends cs{constructor(e,t){super(e,t);const s=r=>this.updateContent(r);this.on(e,"durationchange",s),this.on(e,"loadstart",s),this.on(e,"loadedmetadata",s)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}du.prototype.labelText_="Duration";du.prototype.controlText_="Duration";N.registerComponent("DurationDisplay",du);class lS extends N{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),s=super.createEl("span",{textContent:"/"});return t.appendChild(s),e.appendChild(t),e}}N.registerComponent("TimeDivider",lS);class hu extends cs{constructor(e,t){super(e,t),this.on(e,"durationchange",s=>this.updateContent(s))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(Y("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}hu.prototype.labelText_="Remaining Time";hu.prototype.controlText_="Remaining Time";N.registerComponent("RemainingTimeDisplay",hu);class cS extends N{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",s=>this.updateShowing(s))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=Y("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(Y("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(F.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}N.registerComponent("LiveDisplay",cS);class af extends et{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=s=>this.updateLiveEdgeStatus(s),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=Y("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}af.prototype.controlText_="Seek to live, currently playing live";N.registerComponent("SeekToLive",af);function ur(i,e,t){return i=Number(i),Math.min(t,Math.max(e,isNaN(i)?e:i))}var dS=Object.freeze({__proto__:null,clamp:ur});class fu extends N{constructor(e,t){super(e,t),this.handleMouseDown_=s=>this.handleMouseDown(s),this.handleMouseUp_=s=>this.handleMouseUp(s),this.handleKeyDown_=s=>this.handleKeyDown(s),this.handleClick_=s=>this.handleClick(s),this.handleMouseMove_=s=>this.handleMouseMove(s),this.update_=s=>this.update(s),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},s={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),s=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},s),super.createEl(e,t,s)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!Dt&&e.preventDefault(),Lh(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;Oh(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(ur(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=jn(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){W.isEventKey(e,"Left")||W.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepBack()):W.isEventKey(e,"Right")||W.isEventKey(e,"Up")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}N.registerComponent("Slider",fu);const Ba=(i,e)=>ur(i/e*100,0,100).toFixed(2)+"%";class hS extends N{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",s=>this.update(s))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=Y("span",{className:"vjs-control-text"}),s=Y("span",{textContent:this.localize("Loaded")}),r=F.createTextNode(": ");return this.percentageEl_=Y("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(s),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,s=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),n=this.player_.bufferedEnd(),a=this.partEls_,o=Ba(n,r);this.percent_!==o&&(this.el_.style.width=o,Jt(this.percentageEl_,o),this.percent_=o);for(let l=0;ls.length;l--)this.el_.removeChild(a[l-1]);a.length=s.length})}}N.registerComponent("LoadProgressBar",hS);class fS extends N{constructor(e,t){super(e,t),this.update=wt(de(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,s){const r=Zs(this.el_),n=es(this.player_.el()),a=e.width*t;if(!n||!r)return;let o=e.left-n.left+a,l=e.width-a+(n.right-e.right);l||(l=e.width-a,o=a);let f=r.width/2;or.width&&(f=r.width),f=Math.round(f),this.el_.style.right=`-${f}px`,this.write(s)}write(e){Jt(this.el_,e)}updateTime(e,t,s,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let n;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const o=this.player_.liveTracker.liveWindow(),l=o-t*o;n=(l<1?"":"-")+vi(l,o)}else n=vi(s,a);this.update(e,t,n),r&&r()})}}N.registerComponent("TimeTooltip",fS);class pu extends N{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=wt(de(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t){const s=this.getChild("timeTooltip");if(!s)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();s.updateTime(e,t,r)}}pu.prototype.options_={children:[]};!$e&&!At&&pu.prototype.options_.children.push("timeTooltip");N.registerComponent("PlayProgressBar",pu);class of extends N{constructor(e,t){super(e,t),this.update=wt(de(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const s=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,s,()=>{this.el_.style.left=`${e.width*t}px`})}}of.prototype.options_={children:["timeTooltip"]};N.registerComponent("MouseTimeDisplay",of);const Vr=5,Ec=12;class mu extends fu{constructor(e,t){super(e,t),this.setEventHandlers_()}setEventHandlers_(){this.update_=de(this,this.update),this.update=wt(this.update_,at),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in F&&"visibilityState"in F&&this.on(F,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){F.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,at))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(F.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const s=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let n=this.player_.duration();r&&r.isLive()&&(n=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==s||this.duration_!==n)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[vi(s,n),vi(n,n)],"{1} of {2}")),this.currentTime_=s,this.duration_=n),this.bar&&this.bar.update(es(this.el()),this.getProgress())}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){const e=this.getCurrentTime_();let t;const s=this.player_.liveTracker;return s&&s.isLive()?(t=(e-s.seekableStart())/s.liveWindow(),s.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){er(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!er(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let s;const r=this.calculateDistance(e),n=this.player_.liveTracker;if(!n||!n.isLive())s=r*this.player_.duration(),s===this.player_.duration()&&(s=s-.1);else{if(r>=.99){n.seekToLiveEdge();return}const a=n.seekableStart(),o=n.liveCurrentTime();if(s=a+r*n.liveWindow(),s>=o&&(s=o),s<=a&&(s=a+.1),s===1/0)return}this.userSeek_(s),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?_t(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+Vr)}stepBack(){this.userSeek_(this.player_.currentTime()-Vr)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(W.isEventKey(e,"Space")||W.isEventKey(e,"Enter"))e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(W.isEventKey(e,"Home"))e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(W.isEventKey(e,"End"))e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(W(e))){e.preventDefault(),e.stopPropagation();const s=(W.codes[W(e)]-W.codes[0])*10/100;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*s):this.userSeek_(this.player_.duration()*s)}else W.isEventKey(e,"PgDn")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-Vr*Ec)):W.isEventKey(e,"PgUp")?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+Vr*Ec)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in F&&"visibilityState"in F&&this.off(F,"visibilitychange",this.toggleVisibility_),super.dispose()}}mu.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"};!$e&&!At&&mu.prototype.options_.children.splice(1,0,"mouseTimeDisplay");N.registerComponent("SeekBar",mu);class uf extends N{constructor(e,t){super(e,t),this.handleMouseMove=wt(de(this,this.handleMouseMove),at),this.throttledHandleMouseSeek=wt(de(this,this.handleMouseSeek),at),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.handleMouseDownHandler_=s=>this.handleMouseDown(s),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const s=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!s&&!r)return;const n=t.el(),a=Zs(n);let o=jn(n,e).x;o=ur(o,0,1),r&&r.update(a,o),s&&s.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,"mousemove",this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&_t(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,"mousemove",this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,s=this.getChild("seekBar");s&&s.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}uf.prototype.options_={children:["seekBar"]};N.registerComponent("ProgressControl",uf);class lf extends et{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],s=>this.handlePictureInPictureChange(s)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],s=>this.handlePictureInPictureEnabledChange(s)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){F.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in E?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof F.exitPictureInPicture=="function"&&super.show()}}lf.prototype.controlText_="Picture-in-Picture";N.registerComponent("PictureInPictureToggle",lf);class cf extends et{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",s=>this.handleFullscreenChange(s)),F[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}cf.prototype.controlText_="Fullscreen";N.registerComponent("FullscreenToggle",cf);const pS=function(i,e){e.tech_&&!e.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class mS extends N{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}N.registerComponent("VolumeLevel",mS);class gS extends N{constructor(e,t){super(e,t),this.update=wt(de(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,s,r){if(!s){const n=es(this.el_),a=es(this.player_.el()),o=e.width*t;if(!a||!n)return;const l=e.left-a.left+o,f=e.width-o+(a.right-e.right);let m=n.width/2;ln.width&&(m=n.width),this.el_.style.right=`-${m}px`}this.write(`${r}%`)}write(e){Jt(this.el_,e)}updateVolume(e,t,s,r,n){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,s,r.toFixed(0)),n&&n()})}}N.registerComponent("VolumeLevelTooltip",gS);class df extends N{constructor(e,t){super(e,t),this.update=wt(de(this,this.update),at)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,s){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,s,r,()=>{s?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}df.prototype.options_={children:["volumeLevelTooltip"]};N.registerComponent("MouseVolumeLevelDisplay",df);class Xn extends fu{constructor(e,t){super(e,t),this.on("slideractive",s=>this.updateLastVolume_(s)),this.on(e,"volumechange",s=>this.updateARIAAttributes(s)),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){er(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const s=this.el(),r=es(s),n=this.vertical();let a=jn(s,e);a=n?a.y:a.x,a=ur(a,0,1),t.update(r,a,n)}er(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Xn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"};!$e&&!At&&Xn.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay");Xn.prototype.playerEvent="volumechange";N.registerComponent("VolumeBar",Xn);class hf extends N{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||Ji(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),pS(this,e),this.throttledHandleMouseMove=wt(de(this,this.handleMouseMove),at),this.handleMouseUpHandler_=s=>this.handleMouseUp(s),this.on("mousedown",s=>this.handleMouseDown(s)),this.on("touchstart",s=>this.handleMouseDown(s)),this.on("mousemove",s=>this.handleMouseMove(s)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}hf.prototype.options_={children:["volumeBar"]};N.registerComponent("VolumeControl",hf);const yS=function(i,e){e.tech_&&!e.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class ff extends et{constructor(e,t){super(e,t),yS(this,e),this.on(e,["loadstart","volumechange"],s=>this.update(s))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),s=this.player_.lastVolume_();if(t===0){const r=s<.1?.1:s;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),$e&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),$n(this.el_,[0,1,2,3].reduce((s,r)=>s+`${r?" ":""}vjs-vol-${r}`,"")),mi(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}ff.prototype.controlText_="Mute";N.registerComponent("MuteToggle",ff);class pf extends N{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||Ji(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=s=>this.handleKeyPress(s),this.on(e,["loadstart"],s=>this.volumePanelState_(s)),this.on(this.muteToggle,"keyup",s=>this.handleKeyPress(s)),this.on(this.volumeControl,"keyup",s=>this.handleVolumeControlKeyUp(s)),this.on("keydown",s=>this.handleKeyPress(s)),this.on("mouseover",s=>this.handleMouseOver(s)),this.on("mouseout",s=>this.handleMouseOut(s)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){W.isEventKey(e,"Esc")&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),tt(F,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Oe(F,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){W.isEventKey(e,"Esc")&&this.handleMouseOut()}}pf.prototype.options_={children:["muteToggle","volumeControl"]};N.registerComponent("VolumePanel",pf);class mf extends et{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()?s.seekableEnd():this.player_.duration();let n;t+this.skipTime<=r?n=t+this.skipTime:n=r,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}mf.prototype.controlText_="Skip Forward";N.registerComponent("SkipForward",mf);class gf extends et{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),s=this.player_.liveTracker,r=s&&s.isLive()&&s.seekableStart();let n;r&&t-this.skipTime<=r?n=r:t>=this.skipTime?n=t-this.skipTime:n=0,this.player_.currentTime(n)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}gf.prototype.controlText_="Skip Backward";N.registerComponent("SkipBackward",gf);class yf extends N{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",s=>this.handleKeyDown(s)),this.boundHandleBlur_=s=>this.handleBlur(s),this.boundHandleTapClick_=s=>this.handleTapClick(s)}addEventListenerForItem(e){e instanceof N&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof N&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=Y(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),tt(t,"click",function(s){s.preventDefault(),s.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||F.activeElement;if(!this.children().some(s=>s.el()===t)){const s=this.menuButton_;s&&s.buttonPressed_&&t!==s.el().firstChild&&s.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const s=t.filter(r=>r.el()===e.target)[0];if(!s)return;s.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){W.isEventKey(e,"Left")||W.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(W.isEventKey(e,"Right")||W.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}N.registerComponent("Menu",yf);class gu extends N{constructor(e,t={}){super(e,t),this.menuButton_=new et(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const s=et.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+s,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=n=>this.handleClick(n);this.handleMenuKeyUp_=n=>this.handleMenuKeyUp(n),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",n=>this.handleKeyDown(n)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),tt(F,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",n=>this.handleMouseLeave(n)),this.on("keydown",n=>this.handleSubmenuKeyDown(n))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new yf(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=Y("li",{className:"vjs-menu-title",textContent:ve(this.options_.title),tabIndex:-1}),s=new N(this.player_,{el:t});e.addItem(s)}if(this.items=this.createItems(),this.items)for(let t=0;tW.isEventKey(e,t))||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}N.registerComponent("MenuItem",lr);class cr extends lr{constructor(e,t){const s=t.track,r=e.textTracks();t.label=s.label||s.language||"Unknown",t.selected=s.mode==="showing",super(e,t),this.track=s,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const n=(...o)=>{this.handleTracksChange.apply(this,o)},a=(...o)=>{this.handleSelectedLanguageChange.apply(this,o)};if(e.on(["loadstart","texttrackchange"],n),r.addEventListener("change",n),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],n),r.removeEventListener("change",n),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let o;this.on(["tap","click"],function(){if(typeof E.Event!="object")try{o=new E.Event("change")}catch{}o||(o=F.createEvent("Event"),o.initEvent("change",!0,!0)),r.dispatchEvent(o)})}this.handleTracksChange()}handleClick(e){const t=this.track,s=this.player_.textTracks();if(super.handleClick(e),!!s)for(let r=0;r-1&&a.mode==="showing"){s=!1;break}}s!==this.isSelected_&&this.selected(s)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let s=!0;for(let r=0,n=t.length;r-1&&a.mode==="showing"){s=!1;break}}s&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}N.registerComponent("OffTextTrackMenuItem",_f);class ds extends yu{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=cr){let s;this.label_&&(s=`${this.label_} off`),e.push(new _f(this.player_,{kinds:this.kinds_,kind:this.kind_,label:s})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let n=0;n-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return e}}N.registerComponent("TextTrackButton",ds);class vf extends lr{constructor(e,t){const s=t.track,r=t.cue,n=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=n&&n{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const s=e[t];if(s.kind===this.kind_)return s}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(ve(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let s=0,r=t.length;s-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(ve(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new bu(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Tf),e}}xu.prototype.kinds_=["captions","subtitles"];xu.prototype.controlText_="Subtitles";N.registerComponent("SubsCapsButton",xu);class bf extends lr{constructor(e,t){const s=t.track,r=e.audioTracks();t.label=s.label||s.language||"Unknown",t.selected=s.enabled,super(e,t),this.track=s,this.addClass(`vjs-${s.kind}-menu-item`);const n=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",n),this.on("dispose",()=>{r.removeEventListener("change",n)})}createEl(e,t,s){const r=super.createEl(e,t,s),n=r.querySelector(".vjs-menu-item-text");return["main-desc","description"].indexOf(this.options_.track.kind)>=0&&(n.appendChild(Y("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),n.appendChild(Y("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let s=0;sthis.update(n))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}Eu.prototype.contentElType="button";N.registerComponent("PlaybackRateMenuItem",Eu);class xf extends gu{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",s=>this.updateVisibility(s)),this.on(e,"ratechange",s=>this.updateLabel(s)),this.on(e,"playbackrateschange",s=>this.handlePlaybackRateschange(s))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=Y("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let s=e.length-1;s>=0;s--)t.push(new Eu(this.player(),{rate:e[s]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}xf.prototype.controlText_="Playback Rate";N.registerComponent("PlaybackRateMenuButton",xf);class Ef extends N{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},s={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,s)}}N.registerComponent("Spacer",Ef);class vS extends Ef{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}N.registerComponent("CustomControlSpacer",vS);class Cf extends N{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Cf.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]};N.registerComponent("ControlBar",Cf);class Af extends ls{constructor(e,t){super(e,t),this.on(e,"error",s=>{this.open(s)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Af.prototype.options_=Object.assign({},ls.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0});N.registerComponent("ErrorDisplay",Af);const Fa="vjs-text-track-settings",Cc=["#000","Black"],Ac=["#00F","Blue"],Dc=["#0FF","Cyan"],wc=["#0F0","Green"],kc=["#F0F","Magenta"],Ic=["#F00","Red"],Pc=["#FFF","White"],Lc=["#FF0","Yellow"],Ua=["1","Opaque"],$a=["0.5","Semi-Transparent"],Oc=["0","Transparent"],ci={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Cc,Pc,Ic,wc,Ac,Lc,kc,Dc]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Ua,$a,Oc]},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Pc,Cc,Ic,wc,Ac,Lc,kc,Dc]},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:i=>i==="1.00"?null:Number(i)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Ua,$a]},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:[Oc,$a,Ua]}};ci.windowColor.options=ci.backgroundColor.options;function Df(i,e){if(e&&(i=e(i)),i&&i!=="none")return i}function TS(i,e){const t=i.options[i.options.selectedIndex].value;return Df(t,e)}function bS(i,e,t){if(e){for(let s=0;s{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),"click",()=>{this.setDefaults(),this.updateDisplay()}),Ui(ci,s=>{this.on(this.$(s.selector),"change",this.updateDisplay)}),this.options_.persistTextTrackSettings&&this.restoreSettings()}dispose(){this.endDialog=null,super.dispose()}createElSelect_(e,t="",s="label"){const r=ci[e],n=r.id.replace("%s",this.id_),a=[t,n].join(" ").trim(),o=`vjs_select_${ft()}`;return[`<${s} id="${n}"${s==="label"?` for="${o}" class="vjs-label"`:""}>`,this.localize(r.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 Y("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})}createElFont_(){return Y("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 Y("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 Th(ci,(e,t,s)=>{const r=TS(this.$(t.selector),t.parser);return r!==void 0&&(e[s]=r),e},{})}setValues(e){Ui(ci,(t,s)=>{bS(this.$(t.selector),e[s],t.parser)})}setDefaults(){Ui(ci,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(E.localStorage.getItem(Fa))}catch(t){Z.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?E.localStorage.setItem(Fa,JSON.stringify(e)):E.localStorage.removeItem(Fa)}catch(t){Z.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}conditionalBlur_(){this.previouslyActiveEl_=null;const e=this.player_.controlBar,t=e&&e.subsCapsButton,s=e&&e.captionsButton;t?t.focus():s&&s.focus()}handleLanguagechange(){this.fill()}}N.registerComponent("TextTrackSettings",SS);class xS extends N{constructor(e,t){let s=t.ResizeObserver||E.ResizeObserver;t.ResizeObserver===null&&(s=!1);const r=ce({createEl:!s,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||E.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=Vh(()=>{this.resizeHandler()},100,!1,this),s?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const n=this.debouncedHandler_;let a=this.unloadListener_=function(){Oe(this,"resize",n),Oe(this,"unload",a),a=null};tt(this.el_.contentWindow,"unload",a),tt(this.el_.contentWindow,"resize",n)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}N.registerComponent("ResizeManager",xS);const ES={trackingThreshold:20,liveTolerance:15};class CS extends N{constructor(e,t){const s=ce(ES,t,{createEl:!1});super(e,s),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(E.performance.now().toFixed(4)),s=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+s;const r=this.liveCurrentTime(),n=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-n)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,at),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.end(s));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let s=e?e.length:0;for(;s--;)t.push(e.start(s));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}N.registerComponent("LiveTracker",CS);class AS extends N{constructor(e,t){super(e,t),this.on("statechanged",s=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:Y("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${ft()}`}),description:Y("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${ft()}`})},Y("div",{className:"vjs-title-bar"},{},bh(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,s={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const n=this.state[r],a=this.els[r],o=s[r];Vn(a),n&&Jt(a,n),t&&(t.removeAttribute(o),n&&t.setAttribute(o,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}N.registerComponent("TitleBar",AS);const yo=i=>{const e=i.el();if(e.hasAttribute("src"))return i.triggerSourceset(e.src),!0;const t=i.$$("source"),s=[];let r="";if(!t.length)return!1;for(let n=0;n{let t={};for(let s=0;swf([i.el(),E.HTMLMediaElement.prototype,E.Element.prototype,DS],"innerHTML"),Rc=function(i){const e=i.el();if(e.resetSourceWatch_)return;const t={},s=wS(i),r=n=>(...a)=>{const o=n.apply(e,a);return yo(i),o};["append","appendChild","insertAdjacentHTML"].forEach(n=>{e[n]&&(t[n]=e[n],e[n]=r(t[n]))}),Object.defineProperty(e,"innerHTML",ce(s,{set:r(s.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(n=>{e[n]=t[n]}),Object.defineProperty(e,"innerHTML",s)},i.one("sourceset",e.resetSourceWatch_)},kS=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?Zh(E.Element.prototype.getAttribute.call(this,"src")):""},set(i){return E.Element.prototype.setAttribute.call(this,"src",i),i}}),IS=i=>wf([i.el(),E.HTMLMediaElement.prototype,kS],"src"),PS=function(i){if(!i.featuresSourceset)return;const e=i.el();if(e.resetSourceset_)return;const t=IS(i),s=e.setAttribute,r=e.load;Object.defineProperty(e,"src",ce(t,{set:n=>{const a=t.set.call(e,n);return i.triggerSourceset(e.src),a}})),e.setAttribute=(n,a)=>{const o=s.call(e,n,a);return/src/i.test(n)&&i.triggerSourceset(e.src),o},e.load=()=>{const n=r.call(e);return yo(i)||(i.triggerSourceset(""),Rc(i)),n},e.currentSrc?i.triggerSourceset(e.currentSrc):yo(i)||Rc(i),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=s,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class q extends K{constructor(e,t){super(e,t);const s=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",s&&(this.el_.currentSrc!==s.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(s):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const n=this.el_.childNodes;let a=n.length;const o=[];for(;a--;){const l=n[a];l.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(l),this.remoteTextTracks().addTrack(l.track),this.textTracks().addTrack(l.track),!r&&!this.el_.hasAttribute("crossorigin")&&Wn(l.src)&&(r=!0)):o.push(l))}for(let l=0;l{t=[];for(let n=0;ne.removeEventListener("change",s));const r=()=>{for(let n=0;n{e.removeEventListener("change",s),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",s),e.addEventListener("change",s),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const s=e.toLowerCase();this[`${s}TracksListeners_`]&&Object.keys(this[`${s}TracksListeners_`]).forEach(r=>{this.el()[`${s}Tracks`].removeEventListener(r,this[`${s}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${s}TracksListeners_`]=null,this.proxyNativeTracksForType_(s)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=nt[e],s=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!s||!s.addEventListener)return;const n={change:o=>{const l={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(l),e==="text"&&this[ss.remoteText.getterName]().trigger(l)},addtrack(o){r.addTrack(o.track)},removetrack(o){r.removeTrack(o.track)}},a=function(){const o=[];for(let l=0;l{const l=n[o];s.addEventListener(o,l),this.on("dispose",f=>s.removeEventListener(o,l))}),this.on("loadstart",a),this.on("dispose",o=>this.off("loadstart",a))}proxyNativeTracks_(){nt.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const s=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(s,e),q.disposeMediaElement(e),e=s}else{e=F.createElement("video");const s=this.options_.tag&&Wt(this.options_.tag),r=ce({},s);(!Js||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,Ih(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&Zi(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let s=0;s=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(s){this.trigger(s)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Un?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){Z(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&At&&Dt&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)_t(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}reset(){q.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,s){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,s):super.addTextTrack(e,t,s)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=F.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const s=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(s),s}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let s=t.length;for(;s--;)(e===t[s]||e===t[s].track)&&this.el().removeChild(t[s])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),E.performance&&(e.creationTime=E.performance.now()),e}}Mn(q,"TEST_VID",function(){if(!as())return;const i=F.createElement("video"),e=F.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",i.appendChild(e),i});q.isSupported=function(){try{q.TEST_VID.volume=.5}catch{return!1}return!!(q.TEST_VID&&q.TEST_VID.canPlayType)};q.canPlayType=function(i){return q.TEST_VID.canPlayType(i)};q.canPlaySource=function(i,e){return q.canPlayType(i.type)};q.canControlVolume=function(){try{const i=q.TEST_VID.volume;q.TEST_VID.volume=i/2+.1;const e=i!==q.TEST_VID.volume;return e&&$e?(E.setTimeout(()=>{q&&q.prototype&&(q.prototype.featuresVolumeControl=i!==q.TEST_VID.volume)}),!1):e}catch{return!1}};q.canMuteVolume=function(){try{const i=q.TEST_VID.muted;return q.TEST_VID.muted=!i,q.TEST_VID.muted?Zi(q.TEST_VID,"muted","muted"):qn(q.TEST_VID,"muted","muted"),i!==q.TEST_VID.muted}catch{return!1}};q.canControlPlaybackRate=function(){if(At&&Dt&&Nn<58)return!1;try{const i=q.TEST_VID.playbackRate;return q.TEST_VID.playbackRate=i/2+.1,i!==q.TEST_VID.playbackRate}catch{return!1}};q.canOverrideAttributes=function(){try{const i=()=>{};Object.defineProperty(F.createElement("video"),"src",{get:i,set:i}),Object.defineProperty(F.createElement("audio"),"src",{get:i,set:i}),Object.defineProperty(F.createElement("video"),"innerHTML",{get:i,set:i}),Object.defineProperty(F.createElement("audio"),"innerHTML",{get:i,set:i})}catch{return!1}return!0};q.supportsNativeTextTracks=function(){return Un||$e&&Dt};q.supportsNativeVideoTracks=function(){return!!(q.TEST_VID&&q.TEST_VID.videoTracks)};q.supportsNativeAudioTracks=function(){return!!(q.TEST_VID&&q.TEST_VID.audioTracks)};q.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([i,e]){Mn(q.prototype,i,()=>q[e](),!0)});q.prototype.featuresVolumeControl=q.canControlVolume();q.prototype.movingMediaElementInDOM=!$e;q.prototype.featuresFullscreenResize=!0;q.prototype.featuresProgressEvents=!0;q.prototype.featuresTimeupdateEvents=!0;q.prototype.featuresVideoFrameCallback=!!(q.TEST_VID&&q.TEST_VID.requestVideoFrameCallback);q.disposeMediaElement=function(i){if(i){for(i.parentNode&&i.parentNode.removeChild(i);i.hasChildNodes();)i.removeChild(i.firstChild);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()}};q.resetMediaElement=function(i){if(!i)return;const e=i.querySelectorAll("source");let t=e.length;for(;t--;)i.removeChild(e[t]);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()};["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(i){q.prototype[i]=function(){return this.el_[i]||this.el_.hasAttribute(i)}});["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(i){q.prototype["set"+ve(i)]=function(e){this.el_[i]=e,e?this.el_.setAttribute(i,i):this.el_.removeAttribute(i)}});["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(i){q.prototype[i]=function(){return this.el_[i]}});["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(i){q.prototype["set"+ve(i)]=function(e){this.el_[i]=e}});["pause","load","play"].forEach(function(i){q.prototype[i]=function(){return this.el_[i]()}});K.withSourceHandlers(q);q.nativeSourceHandler={};q.nativeSourceHandler.canPlayType=function(i){try{return q.TEST_VID.canPlayType(i)}catch{return""}};q.nativeSourceHandler.canHandleSource=function(i,e){if(i.type)return q.nativeSourceHandler.canPlayType(i.type);if(i.src){const t=uu(i.src);return q.nativeSourceHandler.canPlayType(`video/${t}`)}return""};q.nativeSourceHandler.handleSource=function(i,e,t){e.setSrc(i.src)};q.nativeSourceHandler.dispose=function(){};q.registerSourceHandler(q.nativeSourceHandler);K.registerTech("Html5",q);const kf=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],qa={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},_o=["tiny","xsmall","small","medium","large","xlarge","huge"],Jr={};_o.forEach(i=>{const e=i.charAt(0)==="x"?`x-${i.substring(1)}`:i;Jr[i]=`vjs-layout-${e}`});const LS={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};let Ae=class Li extends N{constructor(e,t,s){if(e.id=e.id||t.id||`vjs_video_${ft()}`,t=Object.assign(Li.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,s),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.isFullscreen_=!1,this.log=_h(this.id_),this.fsApi_=un,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&Wt(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(o){a[o.toLowerCase()]=t.languages[o]}),this.languages_=a}else this.languages_=Li.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),ru(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(tt(F,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=ce(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const o=new E.DOMParser().parseFromString(sS,"image/svg+xml");if(o.querySelector("parsererror"))Z.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const f=o.documentElement;f.style.display="none",this.el_.appendChild(f),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),Js&&this.addClass("vjs-touch-enabled"),$e||this.addClass("vjs-workinghover"),Li.players[this.id_]=this;const n=so.split(".")[0];this.addClass(`vjs-v${n}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),Oe(F,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Oe(F,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Li.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),Z1(this),Be.names.forEach(e=>{const t=Be[e],s=this[t.getterName]();s&&s.off&&s.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,s=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";s?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const n=Wt(e);if(r){for(t=this.el_=e,e=this.tag=F.createElement("video");t.children.length;)e.appendChild(t.firstChild);qs(t,"video-js")||mi(t,"video-js"),t.appendChild(e),s=this.playerElIngest_=t,Object.keys(t).forEach(l=>{try{e[l]=t[l]}catch{}})}e.setAttribute("tabindex","-1"),n.tabindex="-1",Dt&&Bn&&(e.setAttribute("role","application"),n.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in n&&delete n.width,"height"in n&&delete n.height,Object.getOwnPropertyNames(n).forEach(function(l){r&&l==="class"||t.setAttribute(l,n[l]),r&&e.setAttribute(l,n[l])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE"].filter(l=>Ah[l]).map(l=>"vjs-device-"+l.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),E.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=qh("vjs-styles-dimensions");const l=Xt(".vjs-styles-defaults"),f=Xt("head");f.insertBefore(this.styleEl_,l?l.nextSibling:f.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=e.getElementsByTagName("a");for(let l=0;l"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){Z.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const s=e+"_";if(t===void 0)return this[s]||0;if(t===""||t==="auto"){this[s]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){Z.error(`Improper value "${t}" supplied for for ${e}`);return}this[s]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Nt(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),k1(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(E.VIDEOJS_NO_DYNAMIC_STYLE===!0){const o=typeof this.width_=="number"?this.width_:this.options_.width,l=typeof this.height_=="number"?this.height_:this.options_.height,f=this.tech_&&this.tech_.el();f&&(o>=0&&(f.width=o),l>=0&&(f.height=l));return}let e,t,s,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?s=this.aspectRatio_:this.videoWidth()>0?s=this.videoWidth()+":"+this.videoHeight():s="16:9";const n=s.split(":"),a=n[1]/n[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),jh(this.styleEl_,` + .${r} { + width: ${e}px; + height: ${t}px; + } + + .${r}.vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: ${a*100}%; + } + `)}loadTech_(e,t){this.tech_&&this.unloadTech_();const s=ve(e),r=e.charAt(0).toLowerCase()+e.slice(1);s!=="Html5"&&this.tag&&(K.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=s,this.isReady_=!1;let n=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(n=!1);const a={source:t,autoplay:n,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};Be.names.forEach(l=>{const f=Be[l];a[f.getterName]=this[f.privateName]}),Object.assign(a,this.options_[s]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const o=K.getTech(e);if(!o)throw new Error(`No Tech named '${s}' exists! '${s}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(de(this,this.handleTechReady_),!0),mc.jsonToTextTracks(this.textTracksJson_||[],this.tech_),kf.forEach(l=>{this.on(this.tech_,l,f=>this[`handleTech${ve(l)}_`](f))}),Object.keys(qa).forEach(l=>{this.on(this.tech_,l,f=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${qa[l]}_`].bind(this),event:f});return}this[`handleTech${qa[l]}_`](f)})}),this.on(this.tech_,"loadstart",l=>this.handleTechLoadStart_(l)),this.on(this.tech_,"sourceset",l=>this.handleTechSourceset_(l)),this.on(this.tech_,"waiting",l=>this.handleTechWaiting_(l)),this.on(this.tech_,"ended",l=>this.handleTechEnded_(l)),this.on(this.tech_,"seeking",l=>this.handleTechSeeking_(l)),this.on(this.tech_,"play",l=>this.handleTechPlay_(l)),this.on(this.tech_,"pause",l=>this.handleTechPause_(l)),this.on(this.tech_,"durationchange",l=>this.handleTechDurationChange_(l)),this.on(this.tech_,"fullscreenchange",(l,f)=>this.handleTechFullscreenChange_(l,f)),this.on(this.tech_,"fullscreenerror",(l,f)=>this.handleTechFullscreenError_(l,f)),this.on(this.tech_,"enterpictureinpicture",l=>this.handleTechEnterPictureInPicture_(l)),this.on(this.tech_,"leavepictureinpicture",l=>this.handleTechLeavePictureInPicture_(l)),this.on(this.tech_,"error",l=>this.handleTechError_(l)),this.on(this.tech_,"posterchange",l=>this.handleTechPosterChange_(l)),this.on(this.tech_,"textdata",l=>this.handleTechTextData_(l)),this.on(this.tech_,"ratechange",l=>this.handleTechRateChange_(l)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(s!=="Html5"||!this.tag)&&uo(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){Be.names.forEach(e=>{const t=Be[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=mc.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&Z.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. +See https://github.com/videojs/video.js/issues/2617 for more info. +`),this.tech_}version(){return{"video.js":so}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const n=()=>{this.muted(r)};this.playTerminatedQueue_.push(n);const a=this.play();if(Vs(a))return a.catch(o=>{throw n(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${o||""}`)})};let s;if(e==="any"&&!this.muted()?(s=this.play(),Vs(s)&&(s=s.catch(t))):e==="muted"&&!this.muted()?s=t():s=this.play(),!!Vs(s))return s.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,s="";typeof t!="string"&&(t=e.src,s=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!s&&(s=iS(this,t)),this.cache_.source=ce({},e,{src:t,type:s});const r=this.cache_.sources.filter(l=>l.src&&l.src===t),n=[],a=this.$$("source"),o=[];for(let l=0;lthis.updateSourceCaches_(n);const s=this.currentSource().src,r=e.src;s&&!/^blob:/.test(s)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==s)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],n=>{if(n.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?_t(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),s=>s.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const s=this.el();let r=F[this.fsApi_.fullscreenElement]===s;!r&&s.matches&&(r=s.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in Q1)return X1(this.middleware_,this.tech_,e,t);if(e in Tc)return vc(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(s){throw Z(s),s}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in Y1)return K1(this.middleware_,this.tech_,e);if(e in Tc)return vc(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(Z(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(Z(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(Z(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=_t){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),s=!!(Un||$e);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&s&&this.load();return}const r=this.techGet_("play");s&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(s){s(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||ht(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=ht(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=ht(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Qh(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let s=e.end(e.length-1);return s>t&&(s=t),s}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((s,r)=>{function n(){t.off("fullscreenerror",o),t.off("fullscreenchange",a)}function a(){n(),s()}function o(f,m){n(),r(m)}t.one("fullscreenchange",a),t.one("fullscreenerror",o);const l=t.requestFullscreenHelper_(e);l&&(l.then(n,n),l.then(s,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const s=this.el_[this.fsApi_.requestFullscreen](t);return s&&s.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),s}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,s)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",n)}function n(){r(),t()}function a(l,f){r(),s(f)}e.one("fullscreenchange",n),e.one("fullscreenerror",a);const o=e.exitFullscreenHelper_();o&&(o.then(r,r),o.then(t,s))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=F[this.fsApi_.exitFullscreen]();return e&&_t(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=F.documentElement.style.overflow,tt(F,"keydown",this.boundFullWindowOnEscKey_),F.documentElement.style.overflow="hidden",mi(F.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){W.isEventKey(e,"Esc")&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Oe(F,"keydown",this.boundFullWindowOnEscKey_),F.documentElement.style.overflow=this.docOrigOverflow,$n(F.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&E.documentPictureInPicture){const e=F.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(Y("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),E.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(Fh(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",s=>{const r=s.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in F&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(E.documentPictureInPicture&&E.documentPictureInPicture.window)return E.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in F)return F.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(r=>{const n=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return n==="input"?a.indexOf(r.type)===-1:["textarea"].indexOf(n)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:s=a=>W.isEventKey(a,"f"),muteKey:r=a=>W.isEventKey(a,"m"),playPauseKey:n=a=>W.isEventKey(a,"k")||W.isEventKey(a,"Space")}=t;if(s.call(this,e)){e.preventDefault(),e.stopPropagation();const a=N.getComponent("FullscreenToggle");F[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),N.getComponent("MuteToggle").prototype.handleClick.call(this,e)):n.call(this,e)&&(e.preventDefault(),e.stopPropagation(),N.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let s=0,r=this.options_.techOrder;s[o,K.getTech(o)]).filter(([o,l])=>l?l.isSupported():(Z.error(`The "${o}" tech is undefined. Skipped browser support check for that tech.`),!1)),s=function(o,l,f){let m;return o.some(y=>l.some(T=>{if(m=f(y,T),m)return!0})),m};let r;const n=o=>(l,f)=>o(f,l),a=([o,l],f)=>{if(l.canPlaySource(f,this.options_[o.toLowerCase()]))return{source:f,tech:o}};return this.options_.sourceOrder?r=s(e,t,n(a)):r=s(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const s=sf(e);if(!s.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=s),this.updateSourceCaches_(s[0]),z1(this,s[0],(r,n)=>{if(this.middleware_=n,t||(this.cache_.sources=s),this.updateSourceCaches_(r),this.src_(r)){if(s.length>1)return this.handleSrc_(s.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}W1(n,this.tech_)}),s.length>1){const r=()=>{this.error(null),this.handleSrc_(s.slice(1),!0)},n=()=>{this.off("error",r)};this.one("error",r),this.one("playing",n),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",n)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?Wh(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}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();_t(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),Nt(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:s,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:n}=s||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),n&&(n.update(),n.loadProgressBar&&n.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(Kt("beforeerror").forEach(t=>{const s=t(this,e);if(!(Ct(s)&&!Array.isArray(s)||typeof s=="string"||typeof s=="number"||s===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=s}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new _e(e),this.addClass("vjs-error"),Z.error(`(CODE:${this.error_.code} ${_e.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),Kt("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,s;const r=de(this,this.reportUserActivity),n=function(y){(y.screenX!==t||y.screenY!==s)&&(t=y.screenX,s=y.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},o=function(y){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",n),this.on("mouseup",o),this.on("mouseleave",o);const l=this.getChild("controlBar");l&&!$e&&!At&&(l.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),l.on("mouseleave",function(y){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let f;const m=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(f);const y=this.options_.inactivityTimeout;y<=0||(f=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))};this.setInterval(m,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),s=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(s),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_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,s){if(this.tech_)return this.tech_.addTextTrack(e,t,s)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Nt(this)&&this.trigger("languagechange"))}languages(){return ce(Li.prototype.options_.languages,this.languages_)}toJSON(){const e=ce(this.options_),t=e.tracks;e.tracks=[];for(let s=0;s{this.removeChild(s)}),s.open(),s}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let s=0;s<_o.length;s++){const r=_o[s],n=this.breakpoints_[r];if(t<=n){if(e===r)return;e&&this.removeClass(Jr[e]),this.addClass(Jr[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Object.assign({},LS,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;const t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Jr[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const s=this.crossOrigin();this.reset(),this.cache_.media=ce(e);const{artist:r,artwork:n,description:a,poster:o,src:l,textTracks:f,title:m}=this.cache_.media;!n&&o&&(this.cache_.media.artwork=[{src:o,type:pn(o)}]),s&&this.crossOrigin(s),l&&this.src(l),o&&this.poster(o),Array.isArray(f)&&f.forEach(y=>this.addRemoteTextTrack(y,!1)),this.titleBar&&this.titleBar.update({title:m,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),s=Array.prototype.map.call(this.remoteTextTracks(),n=>({kind:n.kind,label:n.label,language:n.language,src:n.src})),r={src:t,textTracks:s};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:pn(r.poster)}]),r}return ce(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},s=Wt(e),r=s["data-setup"];if(qs(e,"vjs-fill")&&(s.fill=!0),qs(e,"vjs-fluid")&&(s.fluid=!0),r!==null){const[n,a]=gT(r||"{}");n&&Z.error(n),Object.assign(s,a)}if(Object.assign(t,s),e.hasChildNodes()){const n=e.childNodes;for(let a=0,o=n.length;atypeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}};Be.names.forEach(function(i){const e=Be[i];Ae.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}});Ae.prototype.crossorigin=Ae.prototype.crossOrigin;Ae.players={};const Ps=E.navigator;Ae.prototype.options_={techOrder:K.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:Ps&&(Ps.languages&&Ps.languages[0]||Ps.userLanguage||Ps.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,enableSmoothSeeking:!1};kf.forEach(function(i){Ae.prototype[`handleTech${ve(i)}_`]=function(){return this.trigger(i)}});N.registerComponent("Player",Ae);const mn="plugin",ji="activePlugins_",Mi={},gn=i=>Mi.hasOwnProperty(i),Zr=i=>gn(i)?Mi[i]:void 0,If=(i,e)=>{i[ji]=i[ji]||{},i[ji][e]=!0},yn=(i,e,t)=>{const s=(t?"before":"")+"pluginsetup";i.trigger(s,e),i.trigger(s+":"+e.name,e)},OS=function(i,e){const t=function(){yn(this,{name:i,plugin:e,instance:null},!0);const s=e.apply(this,arguments);return If(this,i),yn(this,{name:i,plugin:e,instance:s}),s};return Object.keys(e).forEach(function(s){t[s]=e[s]}),t},Mc=(i,e)=>(e.prototype.name=i,function(...t){yn(this,{name:i,plugin:e,instance:null},!0);const s=new e(this,...t);return this[i]=()=>s,yn(this,s.getEventHash()),s});class ze{constructor(e){if(this.constructor===ze)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),ru(this),delete this.trigger,zh(this,this.constructor.defaultState),If(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return us(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[ji][e]=!1,this.player=this.state=null,t[e]=Mc(e,Mi[e])}static isBasic(e){const t=typeof e=="string"?Zr(e):e;return typeof t=="function"&&!ze.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(gn(e))Z.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Ae.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return Mi[e]=t,e!==mn&&(ze.isBasic(t)?Ae.prototype[e]=OS(e,t):Ae.prototype[e]=Mc(e,t)),t}static deregisterPlugin(e){if(e===mn)throw new Error("Cannot de-register base plugin.");gn(e)&&(delete Mi[e],delete Ae.prototype[e])}static getPlugins(e=Object.keys(Mi)){let t;return e.forEach(s=>{const r=Zr(s);r&&(t=t||{},t[s]=r)}),t}static getPluginVersion(e){const t=Zr(e);return t&&t.VERSION||""}}ze.getPlugin=Zr;ze.BASE_PLUGIN_NAME=mn;ze.registerPlugin(mn,ze);Ae.prototype.usingPlugin=function(i){return!!this[ji]&&this[ji][i]===!0};Ae.prototype.hasPlugin=function(i){return!!gn(i)};function RS(i,e){let t=!1;return function(...s){return t||Z.warn(i),t=!0,e.apply(this,s)}}function pt(i,e,t,s){return RS(`${e} is deprecated and will be removed in ${i}.0; please use ${t} instead.`,s)}var MS={UnsupportedSidxContainer:"unsupported-sidx-container-error",DashManifestSidxParsingError:"dash-manifest-sidx-parsing-error",HlsPlaylistRequestError:"hls-playlist-request-error",SegmentUnsupportedMediaFormat:"segment-unsupported-media-format-error",UnsupportedMediaInitialization:"unsupported-media-initialization-error",SegmentSwitchError:"segment-switch-error",SegmentExceedsSourceBufferQuota:"segment-exceeds-source-buffer-quota-error",SegmentAppendError:"segment-append-error",VttLoadError:"vtt-load-error",VttCueParsingError:"vtt-cue-parsing-error",AdsBeforePrerollError:"ads-before-preroll-error",AdsPrerollError:"ads-preroll-error",AdsMidrollError:"ads-midroll-error",AdsPostrollError:"ads-postroll-error",AdsMacroReplacementFailed:"ads-macro-replacement-failed",AdsResumeContentFailed:"ads-resume-content-failed",EMEFailedToRequestMediaKeySystemAccess:"eme-failed-request-media-key-system-access",EMEFailedToCreateMediaKeys:"eme-failed-create-media-keys",EMEFailedToAttachMediaKeysToVideoElement:"eme-failed-attach-media-keys-to-video",EMEFailedToCreateMediaKeySession:"eme-failed-create-media-key-session",EMEFailedToSetServerCertificate:"eme-failed-set-server-certificate",EMEFailedToGenerateLicenseRequest:"eme-failed-generate-license-request",EMEFailedToUpdateSessionWithReceivedLicenseKeys:"eme-failed-update-session",EMEFailedToCloseSession:"eme-failed-close-session",EMEFailedToRemoveKeysFromSession:"eme-failed-remove-keys",EMEFailedToLoadSessionBySessionId:"eme-failed-load-session"};const Pf=i=>i.indexOf("#")===0?i.slice(1):i;function L(i,e,t){let s=L.getPlayer(i);if(s)return e&&Z.warn(`Player "${i}" is already initialised. Options will not be applied.`),t&&s.ready(t),s;const r=typeof i=="string"?Xt("#"+Pf(i)):i;if(!os(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof E.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&Z.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),Kt("beforesetup").forEach(l=>{const f=l(r,ce(e));if(!Ct(f)||Array.isArray(f)){Z.error("please return an object in beforesetup hooks");return}e=ce(e,f)});const o=N.getComponent("Player");return s=new o(r,e,t),Kt("setup").forEach(l=>l(s)),s}L.hooks_=Ot;L.hooks=Kt;L.hook=g1;L.hookOnce=y1;L.removeHook=yh;if(E.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&as()){let i=Xt(".vjs-styles-defaults");if(!i){i=qh("vjs-styles-defaults");const e=Xt("head");e&&e.insertBefore(i,e.firstChild),jh(i,` + .video-js { + width: 300px; + height: 150px; + } + + .vjs-fluid:not(.vjs-audio-only-mode) { + padding-top: 56.25% + } + `)}}co(1,L);L.VERSION=so;L.options=Ae.prototype.options_;L.getPlayers=()=>Ae.players;L.getPlayer=i=>{const e=Ae.players;let t;if(typeof i=="string"){const s=Pf(i),r=e[s];if(r)return r;t=Xt("#"+s)}else t=i;if(os(t)){const{player:s,playerId:r}=t;if(s||e[r])return s||e[r]}};L.getAllPlayers=()=>Object.keys(Ae.players).map(i=>Ae.players[i]).filter(Boolean);L.players=Ae.players;L.getComponent=N.getComponent;L.registerComponent=(i,e)=>(K.isTech(e)&&Z.warn(`The ${i} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),N.registerComponent.call(N,i,e));L.getTech=K.getTech;L.registerTech=K.registerTech;L.use=G1;Object.defineProperty(L,"middleware",{value:{},writeable:!1,enumerable:!0});Object.defineProperty(L.middleware,"TERMINATOR",{value:fn,writeable:!1,enumerable:!0});L.browser=Ah;L.obj=T1;L.mergeOptions=pt(9,"videojs.mergeOptions","videojs.obj.merge",ce);L.defineLazyProperty=pt(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Mn);L.bind=pt(9,"videojs.bind","native Function.prototype.bind",de);L.registerPlugin=ze.registerPlugin;L.deregisterPlugin=ze.deregisterPlugin;L.plugin=(i,e)=>(Z.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ze.registerPlugin(i,e));L.getPlugins=ze.getPlugins;L.getPlugin=ze.getPlugin;L.getPluginVersion=ze.getPluginVersion;L.addLanguage=function(i,e){return i=(""+i).toLowerCase(),L.options.languages=ce(L.options.languages,{[i]:e}),L.options.languages[i]};L.log=Z;L.createLogger=_h;L.time=R1;L.createTimeRange=pt(9,"videojs.createTimeRange","videojs.time.createTimeRanges",ht);L.createTimeRanges=pt(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",ht);L.formatTime=pt(9,"videojs.formatTime","videojs.time.formatTime",vi);L.setFormatTime=pt(9,"videojs.setFormatTime","videojs.time.setFormatTime",Xh);L.resetFormatTime=pt(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",Yh);L.parseUrl=pt(9,"videojs.parseUrl","videojs.url.parseUrl",ou);L.isCrossOrigin=pt(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Wn);L.EventTarget=ot;L.any=su;L.on=tt;L.one=Gn;L.off=Oe;L.trigger=us;L.xhr=bd;L.TextTrack=or;L.AudioTrack=ef;L.VideoTrack=tf;["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(i=>{L[i]=function(){return Z.warn(`videojs.${i}() is deprecated; use videojs.dom.${i}() instead`),Uh[i].apply(null,arguments)}});L.computedStyle=pt(9,"videojs.computedStyle","videojs.dom.computedStyle",ts);L.dom=Uh;L.fn=w1;L.num=dS;L.str=L1;L.url=V1;L.Error=MS;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class NS{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(s){t.enabled_(s)}}),t}}class _n extends L.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const s=this.levels_.length;return t=new NS(e),""+s in this||Object.defineProperty(this,s,{get(){return this.levels_[s]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let s=0,r=this.length;ss&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,s=this.length;ts,i.qualityLevels.VERSION=Lf,s},Of=function(i){return BS(this,L.obj.merge({},i))};L.registerPlugin("qualityLevels",Of);Of.VERSION=Lf;/*! @name @videojs/http-streaming @version 3.12.1 @license Apache-2.0 */const He=wn,vn=(i,e)=>e&&e.responseURL&&i!==e.responseURL?e.responseURL:i,ut=i=>L.log.debug?L.log.debug.bind(L,"VHS:",`${i} >`):function(){};function se(...i){const e=L.obj||L;return(e.merge||e.mergeOptions).apply(e,i)}function Le(...i){const e=L.time||L;return(e.createTimeRanges||e.createTimeRanges).apply(e,i)}function FS(i){if(i.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: +`;for(let t=0;t ${r}. Duration (${r-s}) +`}return e}const vt=1/30,Tt=vt*3,Rf=function(i,e){const t=[];let s;if(i&&i.length)for(s=0;s=e})},Hr=function(i,e){return Rf(i,function(t){return t-vt>=e})},US=function(i){if(i.length<2)return Le();const e=[];for(let t=1;t{const e=[];if(!i||!i.length)return"";for(let t=0;t "+i.end(t));return e.join(", ")},qS=function(i,e,t=1){return((i.length?i.end(i.length-1):0)-e)/t},fi=i=>{const e=[];for(let t=0;tn)){if(e>r&&e<=n){t+=n-e;continue}t+=n-r}}return t},Au=(i,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(s){t+=s.duration}),(e.preloadHints||[]).forEach(function(s){s.type==="PART"&&(t+=i.partTargetDuration)}),t},vo=i=>(i.segments||[]).reduce((e,t,s)=>(t.parts?t.parts.forEach(function(r,n){e.push({duration:r.duration,segmentIndex:s,partIndex:n,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:s,partIndex:null,segment:t,part:null}),e),[]),Nf=i=>{const e=i.segments&&i.segments.length&&i.segments[i.segments.length-1];return e&&e.parts||[]},Bf=({preloadSegment:i})=>{if(!i)return;const{parts:e,preloadHints:t}=i;let s=(t||[]).reduce((r,n)=>r+(n.type==="PART"?1:0),0);return s+=e&&e.length?e.length:0,s},Ff=(i,e)=>{if(e.endList)return 0;if(i&&i.suggestedPresentationDelay)return i.suggestedPresentationDelay;const t=Nf(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},VS=function(i,e){let t=0,s=e-i.mediaSequence,r=i.segments[s];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;s--;){if(r=i.segments[s],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=Au(i,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},HS=function(i,e){let t=0,s,r=e-i.mediaSequence;for(;r"u"&&(e=i.mediaSequence+i.segments.length),e"u"){if(i.totalDuration)return i.totalDuration;if(!i.endList)return E.Infinity}return Uf(i,e,t)},Hs=function({defaultDuration:i,durationList:e,startIndex:t,endIndex:s}){let r=0;if(t>s&&([t,s]=[s,t]),t<0){for(let n=t;n0)for(let f=l-1;f>=0;f--){const m=o[f];if(a+=m.duration,n){if(a<0)continue}else if(a+vt<=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r-Hs({defaultDuration:i.targetDuration,durationList:o,startIndex:l,endIndex:f})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e}}if(l<0){for(let f=l;f<0;f++)if(a-=i.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e};l=0}for(let f=l;fvt,T=a===0,S=y&&a+vt>=0;if(!((T||S)&&f!==o.length-1)){if(n){if(a>0)continue}else if(a-vt>=0)continue;return{partIndex:m.partIndex,segmentIndex:m.segmentIndex,startTime:r+Hs({defaultDuration:i.targetDuration,durationList:o,startIndex:l,endIndex:f})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},jf=function(i){return i.excludeUntil&&i.excludeUntil>Date.now()},Du=function(i){return i.excludeUntil&&i.excludeUntil===1/0},Yn=function(i){const e=jf(i);return!i.disabled&&!e},WS=function(i){return i.disabled},KS=function(i){for(let e=0;e{if(i.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return i.playlists.filter(s=>Yn(s)?(s.attributes.BANDWIDTH||0)!i&&!e||!i&&e||i&&!e?!1:!!(i===e||i.id&&e.id&&i.id===e.id||i.resolvedUri&&e.resolvedUri&&i.resolvedUri===e.resolvedUri||i.uri&&e.uri&&i.uri===e.uri),Nc=function(i,e){const t=i&&i.mediaGroups&&i.mediaGroups.AUDIO||{};let s=!1;for(const r in t){for(const n in t[r])if(s=e(t[r][n]),s)break;if(s)break}return!!s},dr=i=>{if(!i||!i.playlists||!i.playlists.length)return Nc(i,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;eDd(n))||Nc(i,n=>wu(t,n))))return!1}return!0};var Ge={liveEdgeDelay:Ff,duration:$f,seekable:GS,getMediaInfoForTime:zS,isEnabled:Yn,isDisabled:WS,isExcluded:jf,isIncompatible:Du,playlistEnd:qf,isAes:KS,hasAttribute:Vf,estimateSegmentRequestTime:XS,isLowestEnabledRendition:To,isAudioOnly:dr,playlistMatch:wu,segmentDurationWithParts:Au};const{log:Hf}=L,Vi=(i,e)=>`${i}-${e}`,Gf=(i,e,t)=>`placeholder-uri-${i}-${e}-${t}`,YS=({onwarn:i,oninfo:e,manifestString:t,customTagParsers:s=[],customTagMappers:r=[],llhls:n})=>{const a=new f2;i&&a.on("warn",i),e&&a.on("info",e),s.forEach(f=>a.addParser(f)),r.forEach(f=>a.addTagMapper(f)),a.push(t),a.end();const o=a.manifest;if(n||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(f){o.hasOwnProperty(f)&&delete o[f]}),o.segments&&o.segments.forEach(function(f){["parts","preloadHints"].forEach(function(m){f.hasOwnProperty(m)&&delete f[m]})})),!o.targetDuration){let f=10;o.segments&&o.segments.length&&(f=o.segments.reduce((m,y)=>Math.max(m,y.duration),0)),i&&i({message:`manifest has no targetDuration defaulting to ${f}`}),o.targetDuration=f}const l=Nf(o);if(l.length&&!o.partTargetDuration){const f=l.reduce((m,y)=>Math.max(m,y.duration),0);i&&(i({message:`manifest has no partTargetDuration defaulting to ${f}`}),Hf.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=f}return o},hs=(i,e)=>{i.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(i.mediaGroups[t])for(const s in i.mediaGroups[t])for(const r in i.mediaGroups[t][s]){const n=i.mediaGroups[t][s][r];e(n,t,s,r)}})},zf=({playlist:i,uri:e,id:t})=>{i.id=t,i.playlistErrors_=0,e&&(i.uri=e),i.attributes=i.attributes||{}},QS=i=>{let e=i.playlists.length;for(;e--;){const t=i.playlists[e];zf({playlist:t,id:Vi(e,t.uri)}),t.resolvedUri=He(i.uri,t.uri),i.playlists[t.id]=t,i.playlists[t.uri]=t,t.attributes.BANDWIDTH||Hf.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},JS=i=>{hs(i,e=>{e.uri&&(e.resolvedUri=He(i.uri,e.uri))})},ZS=(i,e)=>{const t=Vi(0,e),s={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:E.location.href,resolvedUri:E.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return s.playlists[t]=s.playlists[0],s.playlists[e]=s.playlists[0],s},Wf=(i,e,t=Gf)=>{i.uri=e;for(let r=0;r{if(!r.playlists||!r.playlists.length){if(s&&n==="AUDIO"&&!r.uri)for(let l=0;l(r.set(n.id,n),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((s,r)=>{if(!this.processedDateRanges_.has(r)&&(s.startTime=s.startDate.getTime()/1e3-this.offset_,s.processDateRange=()=>this.processDateRange(s),t.push(s),!!s.class))if(e[s.class]){const n=e[s.class].push(s);s.classListIndex=n-1}else e[s.class]=[s],s.classListIndex=0});for(const s of t){const r=e[s.class]||[];s.endDate?s.endTime=s.endDate.getTime()/1e3-this.offset_:s.endOnNext&&r[s.classListIndex+1]?s.endTime=r[s.classListIndex+1].startTime:s.duration?s.endTime=s.startTime+s.duration:s.plannedDuration?s.endTime=s.startTime+s.plannedDuration:s.endTime=s.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((s,r)=>{s.startDate.getTime(){if(e.endList||!e.serverControl)return i;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:s}=e;let r=e.mediaSequence+e.segments.length;if(s){const n=s.parts||[],a=Bf(e)-1;a>-1&&a!==n.length-1&&(t._HLS_part=a),(a>-1||n.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const s=new E.URL(i);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&s.searchParams.set(r,t[r])}),i=s.toString()}return i},ix=(i,e)=>{if(!i)return e;const t=se(i,e);if(i.preloadHints&&!e.preloadHints&&delete t.preloadHints,i.parts&&!e.parts)delete t.parts;else if(i.parts&&e.parts)for(let s=0;s{const s=i.slice(),r=e.slice();t=t||0;const n=[];let a;for(let o=0;o{!i.resolvedUri&&i.uri&&(i.resolvedUri=He(e,i.uri)),i.key&&!i.key.resolvedUri&&(i.key.resolvedUri=He(e,i.key.uri)),i.map&&!i.map.resolvedUri&&(i.map.resolvedUri=He(e,i.map.uri)),i.map&&i.map.key&&!i.map.key.resolvedUri&&(i.map.key.resolvedUri=He(e,i.map.key.uri)),i.parts&&i.parts.length&&i.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=He(e,t.uri))}),i.preloadHints&&i.preloadHints.length&&i.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=He(e,t.uri))})},Xf=function(i){const e=i.segments||[],t=i.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let s=0;si===e||i.segments&&e.segments&&i.segments.length===e.segments.length&&i.endList===e.endList&&i.mediaSequence===e.mediaSequence&&i.preloadSegment===e.preloadSegment,bo=(i,e,t=Yf)=>{const s=se(i,{}),r=s.playlists[e.id];if(!r||t(r,e))return null;e.segments=Xf(e);const n=se(r,e);if(n.preloadSegment&&!e.preloadSegment&&delete n.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a{Kf(a,n.resolvedUri)});for(let a=0;a{if(a.playlists)for(let m=0;m{const t=i.segments||[],s=t[t.length-1],r=s&&s.parts&&s.parts[s.parts.length-1],n=r&&r.duration||s&&s.duration;return e&&n?n*1e3:(i.partTargetDuration||i.targetDuration||10)*500};class Bi extends ex{constructor(e,t,s={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=ut("PlaylistLoader");const{withCredentials:r=!1}=s;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=s.addDateRangesToTextTrack;const n=t.options_;this.customTagParsers=n&&n.customTagParsers||[],this.customTagMappers=n&&n.customTagMappers||[],this.llhls=n&&n.llhls,this.dateRangesStorage_=new Bc,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=He(this.main.uri,e.uri);this.llhls&&(t=tx(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(s,r)=>{if(this.request){if(s)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,s){const{uri:r,id:n}=t;this.request=null,s&&(this.state=s),this.error={playlist:this.main.playlists[n],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:{errorType:L.Error.HlsPlaylistRequestError}},this.trigger("error")}parseManifest_({url:e,manifestString:t}){return YS({onwarn:({message:s})=>this.logger_(`m3u8-parser warn for ${e}: ${s}`),oninfo:({message:s})=>this.logger_(`m3u8-parser info for ${e}: ${s}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls})}haveMetadata({playlistString:e,playlistObject:t,url:s,id:r}){this.request=null,this.state="HAVE_METADATA";const n=t||this.parseManifest_({url:s,manifestString:e});n.lastRequest=Date.now(),zf({playlist:n,uri:s,id:r});const a=bo(this.main,n);this.targetDuration=n.partTargetDuration||n.targetDuration,this.pendingMedia_=null,a?(this.main=a,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(So(this.media(),!!a)),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),E.clearTimeout(this.mediaUpdateTimeout),E.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Bc,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(E.clearTimeout(this.finalRenditionTimeout),t){const a=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=E.setTimeout(this.media.bind(this,e,!1),a);return}const s=this.state,r=!this.media_||e.id!==this.media_.id,n=this.main.playlists[e.id];if(n&&n.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(So(e,!0)),!!r){if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e,this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(a,o)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=vn(e.resolvedUri,o),a)return this.playlistRequestError(this.request,e,s);this.haveMetadata({playlistString:o.responseText,url:e.uri,id:e.id}),s==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}}pause(){this.mediaUpdateTimeout&&(E.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(E.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const s=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=E.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},s);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(E.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=E.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=E.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,requestType:"hls-playlist"},(e,t)=>{if(!this.request)return;if(this.request=null,e)return this.error={status:t.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:t.responseText,code:2,metadata:{errorType:L.Error.HlsPlaylistRequestError}},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.src=vn(this.src,t);const s=this.parseManifest_({manifestString:t.responseText,url:this.src});this.setupInitialPlaylist(s)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,Wf(this.main,this.srcUri()),e.playlists.forEach(s=>{s.segments=Xf(s),s.segments.forEach(r=>{Kf(r,s.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||E.location.href;this.main=ZS(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const s=this.main,r=e.ID;let n=s.playlists.length;for(;n--;){const a=s.playlists[n];if(a.attributes["PATHWAY-ID"]===r){const o=a.resolvedUri,l=a.id;if(t){const f=this.createCloneURI_(a.resolvedUri,e),m=Vi(r,f),y=this.createCloneAttributes_(r,a.attributes),T=this.createClonePlaylist_(a,m,e,y);s.playlists[n]=T,s.playlists[m]=T,s.playlists[f]=T}else s.playlists.splice(n,1);delete s.playlists[l],delete s.playlists[o]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const s=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!s.mediaGroups[n]||!s.mediaGroups[n][r])){for(const a in s.mediaGroups[n])if(a===r){for(const o in s.mediaGroups[n][a])s.mediaGroups[n][a][o].playlists.forEach((f,m)=>{const y=s.playlists[f.id],T=y.id,S=y.resolvedUri;delete s.playlists[T],delete s.playlists[S]});delete s.mediaGroups[n][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const s=this.main,r=s.playlists.length,n=this.createCloneURI_(t.resolvedUri,e),a=Vi(e.ID,n),o=this.createCloneAttributes_(e.ID,t.attributes),l=this.createClonePlaylist_(t,a,e,o);s.playlists[r]=l,s.playlists[a]=l,s.playlists[n]=l,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,s=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(n=>{if(!(!r.mediaGroups[n]||r.mediaGroups[n][t]))for(const a in r.mediaGroups[n]){if(a===s)r.mediaGroups[n][t]={};else continue;for(const o in r.mediaGroups[n][a]){const l=r.mediaGroups[n][a][o];r.mediaGroups[n][t][o]=rt({},l);const f=r.mediaGroups[n][t][o],m=this.createCloneURI_(l.resolvedUri,e);f.resolvedUri=m,f.uri=m,f.playlists=[],l.playlists.forEach((y,T)=>{const S=r.playlists[y.id],_=Gf(n,t,o),A=Vi(t,_);if(S&&!r.playlists[A]){const D=this.createClonePlaylist_(S,A,e),w=D.resolvedUri;r.playlists[A]=D,r.playlists[w]=D}f.playlists[T]=this.createClonePlaylist_(y,A,e)})}}})}createClonePlaylist_(e,t,s,r){const n=this.createCloneURI_(e.resolvedUri,s),a={resolvedUri:n,uri:n,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),se(e,a)}createCloneURI_(e,t){const s=new URL(e);s.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const n of Object.keys(r))s.searchParams.set(n,r[n]);return s.href}createCloneAttributes_(e,t){const s={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(s[r]=e)}),s}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const xo=function(i,e,t,s){const r=i.responseType==="arraybuffer"?i.response:i.responseText;!e&&r&&(i.responseTime=Date.now(),i.roundTripTime=i.responseTime-i.requestTime,i.bytesReceived=r.byteLength||r.length,i.bandwidth||(i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3))),t.headers&&(i.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(i.timedout=!0),!e&&!i.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(i&&(r||i.responseText)))),s(e,i)},rx=(i,e)=>{if(!i||!i.size)return;let t=e;return i.forEach(s=>{t=s(t)}),t},nx=(i,e,t,s)=>{!i||!i.size||i.forEach(r=>{r(e,t,s)})},Qf=function(){const i=function e(t,s){t=se({timeout:45e3},t);const r=e.beforeRequest||L.Vhs.xhr.beforeRequest,n=e._requestCallbackSet||L.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||L.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(L.log.warn("beforeRequest is deprecated, use onRequest instead."),n.add(r));const o=L.Vhs.xhr.original===!0?L.xhr:L.Vhs.xhr,l=rx(n,t);n.delete(r);const f=o(l||t,function(y,T){return nx(a,f,y,T),xo(f,y,T,s)}),m=f.abort;return f.abort=function(){return f.aborted=!0,m.apply(f,arguments)},f.uri=t.uri,f.requestTime=Date.now(),f};return i.original=!0,i},ax=function(i){let e;const t=i.offset;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=E.BigInt(i.offset)+E.BigInt(i.length)-E.BigInt(1):e=i.offset+i.length-1,"bytes="+t+"-"+e},Eo=function(i){const e={};return i.byterange&&(e.Range=ax(i.byterange)),e},ox=function(i,e){return i.start(e)+"-"+i.end(e)},ux=function(i,e){const t=i.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},lx=function(i){return i>=32&&i<126?String.fromCharCode(i):"."},Jf=function(i){const e={};return Object.keys(i).forEach(t=>{const s=i[t];kd(s)?e[t]={bytes:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength}:e[t]=s}),e},Tn=function(i){const e=i.byterange||{length:1/0,offset:0};return[e.length,e.offset,i.resolvedUri].join(",")},Zf=function(i){return i.resolvedUri},ep=i=>{const e=Array.prototype.slice.call(i),t=16;let s="",r,n;for(let a=0;aep(i),dx=i=>{let e="",t;for(t=0;t{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,n=i-r;return new Date(e.dateTimeObject.getTime()+n*1e3)},px=i=>i.transmuxedPresentationEnd-i.transmuxedPresentationStart-i.transmuxerPrependedSeconds,mx=(i,e)=>{let t;try{t=new Date(i)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let s=e.segments[0];if(to?null:(t>new Date(n)&&(s=r),{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:Ge.duration(e,e.mediaSequence+e.segments.indexOf(s)),type:s.videoTimingInfo?"accurate":"estimate"})},gx=(i,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,s;for(let n=0;nt){if(i>t+r.duration*tp)return null;s=r}return{segment:s,estimatedStart:s.videoTimingInfo?s.videoTimingInfo.transmuxedPresentationStart:t-s.duration,type:s.videoTimingInfo?"accurate":"estimate"}},yx=(i,e)=>{let t,s;try{t=new Date(i),s=new Date(e)}catch{}const r=t.getTime();return(s.getTime()-r)/1e3},_x=i=>{if(!i.segments||i.segments.length===0)return!1;for(let e=0;e{if(!t)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const s=gx(e,i);if(!s)return t({message:"valid programTime was not found"});if(s.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:s.estimatedStart});const r={mediaSeconds:e},n=fx(e,s.segment);return n&&(r.programDateTime=n.toISOString()),t(null,r)},ip=({programTime:i,playlist:e,retryCount:t=2,seekTo:s,pauseAfterSeek:r=!0,tech:n,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof i>"u"||!e||!s)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!n.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!_x(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=mx(i,e);if(!o)return a({message:`${i} was not found in the stream`});const l=o.segment,f=yx(l.dateTimeObject,i);if(o.type==="estimate"){if(t===0)return a({message:`${i} is not buffered yet. Try again`});s(o.estimatedStart+f),n.one("seeked",()=>{ip({programTime:i,playlist:e,retryCount:t-1,seekTo:s,pauseAfterSeek:r,tech:n,callback:a})});return}const m=l.start+f,y=()=>a(null,n.currentTime());n.one("seeked",y),r&&n.pause(),s(m)},Va=(i,e)=>{if(i.readyState===4)return e()},Tx=(i,e,t)=>{let s=[],r,n=!1;const a=function(m,y,T,S){return y.abort(),n=!0,t(m,y,T,S)},o=function(m,y){if(n)return;if(m)return a(m,y,"",s);const T=y.responseText.substring(s&&s.byteLength||0,y.responseText.length);if(s=C2(s,Id(T,!0)),r=r||Ns(s),s.length<10||r&&s.lengtha(m,y,"",s));const S=Ko(s);return S==="ts"&&s.length<188?Va(y,()=>a(m,y,"",s)):!S&&s.length<376?Va(y,()=>a(m,y,"",s)):a(null,y,S,s)},f=e({uri:i,beforeSend(m){m.overrideMimeType("text/plain; charset=x-user-defined"),m.addEventListener("progress",function({total:y,loaded:T}){return xo(m,null,{statusCode:m.status},o)})}},function(m,y){return xo(f,m,y,o)});return f},{EventTarget:bx}=L,Fc=function(i,e){if(!Yf(i,e)||i.sidx&&e.sidx&&(i.sidx.offset!==e.sidx.offset||i.sidx.length!==e.sidx.length))return!1;if(!i.sidx&&e.sidx||i.sidx&&!e.sidx||i.segments&&!e.segments||!i.segments&&e.segments)return!1;if(!i.segments&&!e.segments)return!0;for(let t=0;t{const r=s.attributes.NAME||t;return`placeholder-uri-${i}-${e}-${r}`},xx=({mainXml:i,srcUrl:e,clientOffset:t,sidxMapping:s,previousManifest:r})=>{const n=Kb(i,{manifestUri:e,clientOffset:t,sidxMapping:s,previousManifest:r});return Wf(n,e,Sx),n},Ex=(i,e)=>{hs(i,(t,s,r,n)=>{n in e.mediaGroups[s][r]||delete i.mediaGroups[s][r][n]})},Cx=(i,e,t)=>{let s=!0,r=se(i,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let n=0;n{if(n.playlists&&n.playlists.length){const f=n.playlists[0].id,m=bo(r,n.playlists[0],Fc);m&&(r=m,l in r.mediaGroups[a][o]||(r.mediaGroups[a][o][l]=n),r.mediaGroups[a][o][l].playlists[0]=r.playlists[f],s=!1)}}),Ex(r,e),e.minimumUpdatePeriod!==i.minimumUpdatePeriod&&(s=!1),s?null:r},Ax=(i,e)=>(!i.map&&!e.map||!!(i.map&&e.map&&i.map.byterange.offset===e.map.byterange.offset&&i.map.byterange.length===e.map.byterange.length))&&i.uri===e.uri&&i.byterange.offset===e.byterange.offset&&i.byterange.length===e.byterange.length,Uc=(i,e)=>{const t={};for(const s in i){const n=i[s].sidx;if(n){const a=Ln(n);if(!e[a])break;const o=e[a].sidxInfo;Ax(o,n)&&(t[a]=e[a])}}return t},Dx=(i,e)=>{let s=Uc(i.playlists,e);return hs(i,(r,n,a,o)=>{if(r.playlists&&r.playlists.length){const l=r.playlists;s=se(s,Uc(l,e))}}),s};class Co extends bx{constructor(e,t,s={},r){super(),this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:n=!1}=s;if(this.vhs_=t,this.withCredentials=n,this.addMetadataToTextTrack=s.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=ut("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}requestErrored_(e,t,s){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},s&&(this.state=s),this.trigger("error"),!0}addSidxSegments_(e,t,s){const r=e.sidx&&Ln(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){this.mediaRequest_=E.setTimeout(()=>s(!1),0);return}const n=vn(e.sidx.resolvedUri),a=(o,l)=>{if(this.requestErrored_(o,l,t))return;const f=this.mainPlaylistLoader_.sidxMapping_;let m;try{m=e1(H(l.response).subarray(8))}catch(y){y.metadata={errorType:L.Error.DashManifestSidxParsingError},this.requestErrored_(y,l,t);return}return f[r]={sidxInfo:e.sidx,sidx:m},Go(e,m,e.sidx.resolvedUri),s(!0)};this.request=Tx(n,this.vhs_.xhr,(o,l,f,m)=>{if(o)return a(o,l);if(!f||f!=="mp4"){const S=f||"unknown";return a({status:l.status,message:`Unsupported ${S} container type for sidx segment at URL: ${n}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2,metadata:{errorType:L.Error.UnsupportedSidxContainer,sidxContainer:S}},l)}const{offset:y,length:T}=e.sidx.byterange;if(m.length>=T+y)return a(o,{response:m.subarray(y,y+T),status:l.status,uri:l.uri});this.request=this.vhs_.xhr({uri:n,responseType:"arraybuffer",headers:Eo({byterange:e.sidx.byterange})},a)})}dispose(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},E.clearTimeout(this.minimumUpdatePeriodTimeout_),E.clearTimeout(this.mediaRequest_),E.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const s=!this.media_||e.id!==this.media_.id;if(s&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,s&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}s&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),E.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(E.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){E.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const s=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=E.setTimeout(()=>this.load(),s);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){this.mediaRequest_=E.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(t,s)=>{if(this.requestErrored_(t,s)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}const r=s.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=s.responseText,s.responseHeaders&&s.responseHeaders.date?this.mainLoaded_=Date.parse(s.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=vn(this.mainPlaylistLoader_.srcUrl,s),r){this.handleMain_(),this.syncClientServerClock_(()=>e(s,r));return}return e(s,r)})}syncClientServerClock_(e){const t=Xb(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:He(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(s,r)=>{if(!this.request)return;if(s)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();let n;t.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?n=this.mainLoaded_:n=Date.parse(r.responseHeaders.date):n=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=n-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main;let t=xx({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e});e&&(t=Cx(e,t,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=t||e;const s=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];return s&&s!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=s),(!e||t&&t.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(t),!!t}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(E.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=E.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=Dx(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,s=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,s=!this.media_||this.media_!==t[e];if(s?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=E.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},So(this.media(),!!s)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(s=>({cueTime:s.start,frames:[{data:s.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const s in e.contentProtection){const r=e.contentProtection[s].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var De={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 wx=i=>{const e=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t-1):!1},this.trigger=function(c){var h,d,p,g;if(h=u[c],!!h)if(arguments.length===2)for(p=h.length,d=0;d"u")){for(u in V)V.hasOwnProperty(u)&&(V[u]=[u.charCodeAt(0),u.charCodeAt(1),u.charCodeAt(2),u.charCodeAt(3)]);te=new Uint8Array([105,115,111,109]),ie=new Uint8Array([97,118,99,49]),Xe=new Uint8Array([0,0,0,1]),Te=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),kt=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),Zt={video:Te,audio:kt},ii=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ti=new Uint8Array([0,0,0,0,0,0,0,0]),fr=new Uint8Array([0,0,0,0,0,0,0,0]),Ou=fr,Ru=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Mu=fr,ei=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(u){var c=[],h=0,d,p,g;for(d=1;d>>1,u.samplingfrequencyindex<<7|u.channelcount<<3,6,1,2]))},m=function(){return o(V.ftyp,te,Xe,te,ie)},U=function(u){return o(V.hdlr,Zt[u])},y=function(u){return o(V.mdat,u)},P=function(u){var c=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,u.duration>>>24&255,u.duration>>>16&255,u.duration>>>8&255,u.duration&255,85,196,0,0]);return u.samplerate&&(c[12]=u.samplerate>>>24&255,c[13]=u.samplerate>>>16&255,c[14]=u.samplerate>>>8&255,c[15]=u.samplerate&255),o(V.mdhd,c)},R=function(u){return o(V.mdia,P(u),U(u.type),S(u))},T=function(u){return o(V.mfhd,new Uint8Array([0,0,0,0,(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&255]))},S=function(u){return o(V.minf,u.type==="video"?o(V.vmhd,ei):o(V.smhd,ti),l(),Q(u))},_=function(u,c){for(var h=[],d=c.length;d--;)h[d]=le(c[d]);return o.apply(null,[V.moof,T(u)].concat(h))},A=function(u){for(var c=u.length,h=[];c--;)h[c]=k(u[c]);return o.apply(null,[V.moov,w(4294967295)].concat(h).concat(D(u)))},D=function(u){for(var c=u.length,h=[];c--;)h[c]=ee(u[c]);return o.apply(null,[V.mvex].concat(h))},w=function(u){var c=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(u&4278190080)>>24,(u&16711680)>>16,(u&65280)>>8,u&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return o(V.mvhd,c)},j=function(u){var c=u.samples||[],h=new Uint8Array(4+c.length),d,p;for(p=0;p>>8),g.push(d[b].byteLength&255),g=g.concat(Array.prototype.slice.call(d[b]));for(b=0;b>>8),v.push(p[b].byteLength&255),v=v.concat(Array.prototype.slice.call(p[b]));if(x=[V.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,(h.width&65280)>>8,h.width&255,(h.height&65280)>>8,h.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o(V.avcC,new Uint8Array([1,h.profileIdc,h.profileCompatibility,h.levelIdc,255].concat([d.length],g,[p.length],v))),o(V.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],h.sarRatio){var C=h.sarRatio[0],I=h.sarRatio[1];x.push(o(V.pasp,new Uint8Array([(C&4278190080)>>24,(C&16711680)>>16,(C&65280)>>8,C&255,(I&4278190080)>>24,(I&16711680)>>16,(I&65280)>>8,I&255])))}return o.apply(null,x)},c=function(h){return o(V.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(h.channelcount&65280)>>8,h.channelcount&255,(h.samplesize&65280)>>8,h.samplesize&255,0,0,0,0,(h.samplerate&65280)>>8,h.samplerate&255,0,0]),f(h))}}(),M=function(u){var c=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,0,(u.duration&4278190080)>>24,(u.duration&16711680)>>16,(u.duration&65280)>>8,u.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,(u.width&65280)>>8,u.width&255,0,0,(u.height&65280)>>8,u.height&255,0,0]);return o(V.tkhd,c)},le=function(u){var c,h,d,p,g,v,b;return c=o(V.tfhd,new Uint8Array([0,0,0,58,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),v=Math.floor(u.baseMediaDecodeTime/a),b=Math.floor(u.baseMediaDecodeTime%a),h=o(V.tfdt,new Uint8Array([1,0,0,0,v>>>24&255,v>>>16&255,v>>>8&255,v&255,b>>>24&255,b>>>16&255,b>>>8&255,b&255])),g=92,u.type==="audio"?(d=he(u,g),o(V.traf,c,h,d)):(p=j(u),d=he(u,p.length+g),o(V.traf,c,h,d,p))},k=function(u){return u.duration=u.duration||4294967295,o(V.trak,M(u),R(u))},ee=function(u){var c=new Uint8Array([0,0,0,0,(u.id&4278190080)>>24,(u.id&16711680)>>16,(u.id&65280)>>8,u.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return u.type!=="video"&&(c[c.length-1]=0),o(V.trex,c)},function(){var u,c,h;h=function(d,p){var g=0,v=0,b=0,x=0;return d.length&&(d[0].duration!==void 0&&(g=1),d[0].size!==void 0&&(v=2),d[0].flags!==void 0&&(b=4),d[0].compositionTimeOffset!==void 0&&(x=8)),[0,0,g|v|b|x,1,(d.length&4278190080)>>>24,(d.length&16711680)>>>16,(d.length&65280)>>>8,d.length&255,(p&4278190080)>>>24,(p&16711680)>>>16,(p&65280)>>>8,p&255]},c=function(d,p){var g,v,b,x,C,I;for(x=d.samples||[],p+=20+16*x.length,b=h(x,p),v=new Uint8Array(b.length+x.length*16),v.set(b),g=b.length,I=0;I>>24,v[g++]=(C.duration&16711680)>>>16,v[g++]=(C.duration&65280)>>>8,v[g++]=C.duration&255,v[g++]=(C.size&4278190080)>>>24,v[g++]=(C.size&16711680)>>>16,v[g++]=(C.size&65280)>>>8,v[g++]=C.size&255,v[g++]=C.flags.isLeading<<2|C.flags.dependsOn,v[g++]=C.flags.isDependedOn<<6|C.flags.hasRedundancy<<4|C.flags.paddingValue<<1|C.flags.isNonSyncSample,v[g++]=C.flags.degradationPriority&61440,v[g++]=C.flags.degradationPriority&15,v[g++]=(C.compositionTimeOffset&4278190080)>>>24,v[g++]=(C.compositionTimeOffset&16711680)>>>16,v[g++]=(C.compositionTimeOffset&65280)>>>8,v[g++]=C.compositionTimeOffset&255;return o(V.trun,v)},u=function(d,p){var g,v,b,x,C,I;for(x=d.samples||[],p+=20+8*x.length,b=h(x,p),g=new Uint8Array(b.length+x.length*8),g.set(b),v=b.length,I=0;I>>24,g[v++]=(C.duration&16711680)>>>16,g[v++]=(C.duration&65280)>>>8,g[v++]=C.duration&255,g[v++]=(C.size&4278190080)>>>24,g[v++]=(C.size&16711680)>>>16,g[v++]=(C.size&65280)>>>8,g[v++]=C.size&255;return o(V.trun,g)},he=function(d,p){return d.type==="audio"?u(d,p):c(d,p)}}();var Ky={ftyp:m,mdat:y,moof:_,moov:A,initSegment:function(u){var c=m(),h=A(u),d;return d=new Uint8Array(c.byteLength+h.byteLength),d.set(c),d.set(h,c.byteLength),d}},Xy=function(u){var c,h,d=[],p=[];for(p.byteLength=0,p.nalCount=0,p.duration=0,d.byteLength=0,c=0;c1&&(c=u.shift(),u.byteLength-=c.byteLength,u.nalCount-=c.nalCount,u[0][0].dts=c.dts,u[0][0].pts=c.pts,u[0][0].duration+=c.duration),u},Jy=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Nu=function(u,c){var h=Jy();return h.dataOffset=c,h.compositionTimeOffset=u.pts-u.dts,h.duration=u.duration,h.size=4*u.length,h.size+=u.byteLength,u.keyFrame&&(h.flags.dependsOn=2,h.flags.isNonSyncSample=0),h},Zy=function(u,c){var h,d,p,g,v,b=c||0,x=[];for(h=0;hmr.ONE_SECOND_IN_TS/2))){for(C=a_()[u.samplerate],C||(C=c[0].data),I=0;I=h?u:(c.minSegmentDts=1/0,u.filter(function(d){return d.dts>=h?(c.minSegmentDts=Math.min(c.minSegmentDts,d.dts),c.minSegmentPts=c.minSegmentDts,!0):!1}))},c_=function(u){var c,h,d=[];for(c=0;c=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(u),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},It.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},It.prototype.addText=function(u){this.rows[this.rowIdx]+=u},It.prototype.backspace=function(){if(!this.isEmpty()){var u=this.rows[this.rowIdx];this.rows[this.rowIdx]=u.substr(0,u.length-1)}};var _r=function(u,c,h){this.serviceNum=u,this.text="",this.currentWindow=new It(-1),this.windows=[],this.stream=h,typeof c=="string"&&this.createTextDecoder(c)};_r.prototype.init=function(u,c){this.startPts=u;for(var h=0;h<8;h++)this.windows[h]=new It(h),typeof c=="function"&&(this.windows[h].beforeRowOverflow=c)},_r.prototype.setCurrentWindow=function(u){this.currentWindow=this.windows[u]},_r.prototype.createTextDecoder=function(u){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(u)}catch(c){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+u+" encoding. "+c})}};var oe=function(u){u=u||{},oe.prototype.init.call(this);var c=this,h=u.captionServices||{},d={},p;Object.keys(h).forEach(g=>{p=h[g],/^SERVICE/.test(g)&&(d[g]=p.encoding)}),this.serviceEncodings=d,this.current708Packet=null,this.services={},this.push=function(g){g.type===3?(c.new708Packet(),c.add708Bytes(g)):(c.current708Packet===null&&c.new708Packet(),c.add708Bytes(g))}};oe.prototype=new na,oe.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},oe.prototype.add708Bytes=function(u){var c=u.ccData,h=c>>>8,d=c&255;this.current708Packet.ptsVals.push(u.pts),this.current708Packet.data.push(h),this.current708Packet.data.push(d)},oe.prototype.push708Packet=function(){var u=this.current708Packet,c=u.data,h=null,d=null,p=0,g=c[p++];for(u.seq=g>>6,u.sizeCode=g&63;p>5,d=g&31,h===7&&d>0&&(g=c[p++],h=g),this.pushServiceBlock(h,p,d),d>0&&(p+=d-1)},oe.prototype.pushServiceBlock=function(u,c,h){var d,p=c,g=this.current708Packet.data,v=this.services[u];for(v||(v=this.initService(u,p));p("0"+(G&255).toString(16)).slice(-2)).join("")}if(p?(O=[b,x],u++):O=[b],c.textDecoder_&&!d)I=c.textDecoder_.decode(new Uint8Array(O));else if(p){const B=$(O);I=String.fromCharCode(parseInt(B,16))}else I=E_(v|b);return C.pendingNewLine&&!C.isEmpty()&&C.newLine(this.getPts(u)),C.pendingNewLine=!1,C.addText(I),u},oe.prototype.multiByteCharacter=function(u,c){var h=this.current708Packet.data,d=h[u+1],p=h[u+2];return yr(d)&&yr(p)&&(u=this.handleText(++u,c,{isMultiByte:!0})),u},oe.prototype.setCurrentWindow=function(u,c){var h=this.current708Packet.data,d=h[u],p=d&7;return c.setCurrentWindow(p),u},oe.prototype.defineWindow=function(u,c){var h=this.current708Packet.data,d=h[u],p=d&7;c.setCurrentWindow(p);var g=c.currentWindow;return d=h[++u],g.visible=(d&32)>>5,g.rowLock=(d&16)>>4,g.columnLock=(d&8)>>3,g.priority=d&7,d=h[++u],g.relativePositioning=(d&128)>>7,g.anchorVertical=d&127,d=h[++u],g.anchorHorizontal=d,d=h[++u],g.anchorPoint=(d&240)>>4,g.rowCount=d&15,d=h[++u],g.columnCount=d&63,d=h[++u],g.windowStyle=(d&56)>>3,g.penStyle=d&7,g.virtualRowCount=g.rowCount+1,u},oe.prototype.setWindowAttributes=function(u,c){var h=this.current708Packet.data,d=h[u],p=c.currentWindow.winAttr;return d=h[++u],p.fillOpacity=(d&192)>>6,p.fillRed=(d&48)>>4,p.fillGreen=(d&12)>>2,p.fillBlue=d&3,d=h[++u],p.borderType=(d&192)>>6,p.borderRed=(d&48)>>4,p.borderGreen=(d&12)>>2,p.borderBlue=d&3,d=h[++u],p.borderType+=(d&128)>>5,p.wordWrap=(d&64)>>6,p.printDirection=(d&48)>>4,p.scrollDirection=(d&12)>>2,p.justify=d&3,d=h[++u],p.effectSpeed=(d&240)>>4,p.effectDirection=(d&12)>>2,p.displayEffect=d&3,u},oe.prototype.flushDisplayed=function(u,c){for(var h=[],d=0;d<8;d++)c.windows[d].visible&&!c.windows[d].isEmpty()&&h.push(c.windows[d].getText());c.endPts=u,c.text=h.join(` + +`),this.pushCaption(c),c.startPts=u},oe.prototype.pushCaption=function(u){u.text!==""&&(this.trigger("data",{startPts:u.startPts,endPts:u.endPts,text:u.text,stream:"cc708_"+u.serviceNum}),u.text="",u.startPts=u.endPts)},oe.prototype.displayWindows=function(u,c){var h=this.current708Packet.data,d=h[++u],p=this.getPts(u);this.flushDisplayed(p,c);for(var g=0;g<8;g++)d&1<>4,p.offset=(d&12)>>2,p.penSize=d&3,d=h[++u],p.italics=(d&128)>>7,p.underline=(d&64)>>6,p.edgeType=(d&56)>>3,p.fontStyle=d&7,u},oe.prototype.setPenColor=function(u,c){var h=this.current708Packet.data,d=h[u],p=c.currentWindow.penColor;return d=h[++u],p.fgOpacity=(d&192)>>6,p.fgRed=(d&48)>>4,p.fgGreen=(d&12)>>2,p.fgBlue=d&3,d=h[++u],p.bgOpacity=(d&192)>>6,p.bgRed=(d&48)>>4,p.bgGreen=(d&12)>>2,p.bgBlue=d&3,d=h[++u],p.edgeRed=(d&48)>>4,p.edgeGreen=(d&12)>>2,p.edgeBlue=d&3,u},oe.prototype.setPenLocation=function(u,c){var h=this.current708Packet.data,d=h[u],p=c.currentWindow.penLoc;return c.currentWindow.pendingNewLine=!0,d=h[++u],p.row=d&15,d=h[++u],p.column=d&63,u},oe.prototype.reset=function(u,c){var h=this.getPts(u);return this.flushDisplayed(h,c),this.initService(c.serviceNum,u)};var C_={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},vr=function(u){return u===null?"":(u=C_[u]||u,String.fromCharCode(u))},Tr=14,A_=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],si=function(){for(var u=[],c=Tr+1;c--;)u.push({text:"",indent:0,offset:0});return u},pe=function(u,c){pe.prototype.init.call(this),this.field_=u||0,this.dataChannel_=c||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(h){var d,p,g,v,b;if(d=h.ccData&32639,d===this.lastControlCode_){this.lastControlCode_=null;return}if((d&61440)===4096?this.lastControlCode_=d:d!==this.PADDING_&&(this.lastControlCode_=null),g=d>>>8,v=d&255,d!==this.PADDING_)if(d===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(d===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(h.pts),this.flushDisplayed(h.pts),p=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=p,this.startPts_=h.pts;else if(d===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(h.pts);else if(d===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(h.pts);else if(d===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(h.pts);else if(d===this.CARRIAGE_RETURN_)this.clearFormatting(h.pts),this.flushDisplayed(h.pts),this.shiftRowsUp_(),this.startPts_=h.pts;else if(d===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(d===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(h.pts),this.displayed_=si();else if(d===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=si();else if(d===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(h.pts),this.displayed_=si()),this.mode_="paintOn",this.startPts_=h.pts;else if(this.isSpecialCharacter(g,v))g=(g&3)<<8,b=vr(g|v),this[this.mode_](h.pts,b),this.column_++;else if(this.isExtCharacter(g,v))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),g=(g&3)<<8,b=vr(g|v),this[this.mode_](h.pts,b),this.column_++;else if(this.isMidRowCode(g,v))this.clearFormatting(h.pts),this[this.mode_](h.pts," "),this.column_++,(v&14)===14&&this.addFormatting(h.pts,["i"]),(v&1)===1&&this.addFormatting(h.pts,["u"]);else if(this.isOffsetControlCode(g,v)){const C=v&3;this.nonDisplayed_[this.row_].offset=C,this.column_+=C}else if(this.isPAC(g,v)){var x=A_.indexOf(d&7968);if(this.mode_==="rollUp"&&(x-this.rollUpRows_+1<0&&(x=this.rollUpRows_-1),this.setRollUp(h.pts,x)),x!==this.row_&&x>=0&&x<=14&&(this.clearFormatting(h.pts),this.row_=x),v&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(h.pts,["u"]),(d&16)===16){const C=(d&14)>>1;this.column_=C*4,this.nonDisplayed_[this.row_].indent+=C}this.isColorPAC(v)&&(v&14)===14&&this.addFormatting(h.pts,["i"])}else this.isNormalChar(g)&&(v===0&&(v=null),b=vr(g),b+=vr(v),this[this.mode_](h.pts,b),this.column_+=b.length)}};pe.prototype=new na,pe.prototype.flushDisplayed=function(u){const c=d=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+d+"."})},h=[];this.displayed_.forEach((d,p)=>{if(d&&d.text&&d.text.length){try{d.text=d.text.trim()}catch{c(p)}d.text.length&&h.push({text:d.text,line:p+1,position:10+Math.min(70,d.indent*10)+d.offset*2.5})}else d==null&&c(p)}),h.length&&this.trigger("data",{startPts:this.startPts_,endPts:u,content:h,stream:this.name_})},pe.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=si(),this.nonDisplayed_=si(),this.lastControlCode_=null,this.column_=0,this.row_=Tr,this.rollUpRows_=2,this.formatting_=[]},pe.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},pe.prototype.isSpecialCharacter=function(u,c){return u===this.EXT_&&c>=48&&c<=63},pe.prototype.isExtCharacter=function(u,c){return(u===this.EXT_+1||u===this.EXT_+2)&&c>=32&&c<=63},pe.prototype.isMidRowCode=function(u,c){return u===this.EXT_&&c>=32&&c<=47},pe.prototype.isOffsetControlCode=function(u,c){return u===this.OFFSET_&&c>=33&&c<=35},pe.prototype.isPAC=function(u,c){return u>=this.BASE_&&u=64&&c<=127},pe.prototype.isColorPAC=function(u){return u>=64&&u<=79||u>=96&&u<=127},pe.prototype.isNormalChar=function(u){return u>=32&&u<=127},pe.prototype.setRollUp=function(u,c){if(this.mode_!=="rollUp"&&(this.row_=Tr,this.mode_="rollUp",this.flushDisplayed(u),this.nonDisplayed_=si(),this.displayed_=si()),c!==void 0&&c!==this.row_)for(var h=0;h"},"");this[this.mode_](u,h)},pe.prototype.clearFormatting=function(u){if(this.formatting_.length){var c=this.formatting_.reverse().reduce(function(h,d){return h+""},"");this.formatting_=[],this[this.mode_](u,c)}},pe.prototype.popOn=function(u,c){var h=this.nonDisplayed_[this.row_].text;h+=c,this.nonDisplayed_[this.row_].text=h},pe.prototype.rollUp=function(u,c){var h=this.displayed_[this.row_].text;h+=c,this.displayed_[this.row_].text=h},pe.prototype.shiftRowsUp_=function(){var u;for(u=0;uc&&(h=-1);Math.abs(c-u)>k_;)u+=h*w_;return u},oa=function(u){var c,h;oa.prototype.init.call(this),this.type_=u||Vu,this.push=function(d){if(d.type==="metadata"){this.trigger("data",d);return}this.type_!==Vu&&d.type!==this.type_||(h===void 0&&(h=d.dts),d.dts=aa(d.dts,h),d.pts=aa(d.pts,h),c=d.dts,this.trigger("data",d))},this.flush=function(){h=c,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){h=void 0,c=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};oa.prototype=new D_;var Hu={TimestampRolloverStream:oa,handleRollover:aa},I_=(u,c,h)=>{if(!u)return-1;for(var d=h;d";u.data[0]===xr.Utf8&&(h=Sr(u.data,0,c),!(h<0)&&(u.mimeType=ps(u.data,c,h),c=h+1,u.pictureType=u.data[c],c++,d=Sr(u.data,0,c),!(d<0)&&(u.description=fs(u.data,c,d),c=d+1,u.mimeType===p?u.url=ps(u.data,c,u.data.length):u.pictureData=u.data.subarray(c,u.data.length))))},"T*":function(u){u.data[0]===xr.Utf8&&(u.value=fs(u.data,1,u.data.length).replace(/\0*$/,""),u.values=u.value.split("\0"))},TXXX:function(u){var c;u.data[0]===xr.Utf8&&(c=Sr(u.data,0,1),c!==-1&&(u.description=fs(u.data,1,c),u.value=fs(u.data,c+1,u.data.length).replace(/\0*$/,""),u.data=u.value))},"W*":function(u){u.url=ps(u.data,0,u.data.length).replace(/\0.*$/,"")},WXXX:function(u){var c;u.data[0]===xr.Utf8&&(c=Sr(u.data,0,1),c!==-1&&(u.description=fs(u.data,1,c),u.url=ps(u.data,c+1,u.data.length).replace(/\0.*$/,"")))},PRIV:function(u){var c;for(c=0;c>>2;G*=4,G+=B[7]&3,I.timeStamp=G,b.pts===void 0&&b.dts===void 0&&(b.pts=I.timeStamp,b.dts=I.timeStamp),this.trigger("timestamp",I)}b.frames.push(I),x+=10,x+=C}while(x>>4>1&&(v+=p[v]+1),g.pid===0)g.type="pat",u(p.subarray(v),g),this.trigger("data",g);else if(g.pid===this.pmtPid)for(g.type="pmt",u(p.subarray(v),g),this.trigger("data",g);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([p,v,g]):this.processPes_(p,v,g)},this.processPes_=function(p,g,v){v.pid===this.programMapTable.video?v.streamType=lt.H264_STREAM_TYPE:v.pid===this.programMapTable.audio?v.streamType=lt.ADTS_STREAM_TYPE:v.streamType=this.programMapTable["timed-metadata"][v.pid],v.type="pes",v.data=p.subarray(g),this.trigger("data",v)}},ys.prototype=new ua,ys.STREAM_TYPES={h264:27,adts:15},Ar=function(){var u=this,c=!1,h={data:[],size:0},d={data:[],size:0},p={data:[],size:0},g,v=function(x,C){var I;const O=x[0]<<16|x[1]<<8|x[2];C.data=new Uint8Array,O===1&&(C.packetLength=6+(x[4]<<8|x[5]),C.dataAlignmentIndicator=(x[6]&4)!==0,I=x[7],I&192&&(C.pts=(x[9]&14)<<27|(x[10]&255)<<20|(x[11]&254)<<12|(x[12]&255)<<5|(x[13]&254)>>>3,C.pts*=4,C.pts+=(x[13]&6)>>>1,C.dts=C.pts,I&64&&(C.dts=(x[14]&14)<<27|(x[15]&255)<<20|(x[16]&254)<<12|(x[17]&255)<<5|(x[18]&254)>>>3,C.dts*=4,C.dts+=(x[18]&6)>>>1)),C.data=x.subarray(9+x[8]))},b=function(x,C,I){var O=new Uint8Array(x.size),$={type:C},B=0,G=0,z=!1,Ce;if(!(!x.data.length||x.size<9)){for($.trackId=x.data[0].pid,B=0;B>5,x=((c[p+6]&3)+1)*1024,C=x*U_/Ku[(c[p+2]&60)>>>2],c.byteLength-p>>6&3)+1,channelcount:(c[p+2]&1)<<2|(c[p+3]&192)>>>6,samplerate:Ku[(c[p+2]&60)>>>2],samplingfrequencyindex:(c[p+2]&60)>>>2,samplesize:16,data:c.subarray(p+7+v,p+g)}),h++,p+=g}typeof I=="number"&&(this.skipWarn_(I,p),I=null),c=c.subarray(p)}},this.flush=function(){h=0,this.trigger("done")},this.reset=function(){c=void 0,this.trigger("reset")},this.endTimeline=function(){c=void 0,this.trigger("endedtimeline")}},Dr.prototype=new F_;var $_=Dr,Xu;Xu=function(u){var c=u.byteLength,h=0,d=0;this.length=function(){return 8*c},this.bitsAvailable=function(){return 8*c+d},this.loadWord=function(){var p=u.byteLength-c,g=new Uint8Array(4),v=Math.min(4,c);if(v===0)throw new Error("no bytes available");g.set(u.subarray(p,p+v)),h=new DataView(g.buffer).getUint32(0),d=v*8,c-=v},this.skipBits=function(p){var g;d>p?(h<<=p,d-=p):(p-=d,g=Math.floor(p/8),p-=g*8,c-=g,this.loadWord(),h<<=p,d-=p)},this.readBits=function(p){var g=Math.min(d,p),v=h>>>32-g;return d-=g,d>0?h<<=g:c>0&&this.loadWord(),g=p-g,g>0?v<>>p)return h<<=p,d-=p,p;return this.loadWord(),p+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var p=this.skipLeadingZeros();return this.readBits(p+1)-1},this.readExpGolomb=function(){var p=this.readUnsignedExpGolomb();return 1&p?1+p>>>1:-1*(p>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var q_=Xu,Yu=t,j_=q_,wr,_s,Qu;_s=function(){var u=0,c,h;_s.prototype.init.call(this),this.push=function(d){var p;h?(p=new Uint8Array(h.byteLength+d.data.byteLength),p.set(h),p.set(d.data,h.byteLength),h=p):h=d.data;for(var g=h.byteLength;u3&&this.trigger("data",h.subarray(u+3)),h=null,u=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},_s.prototype=new Yu,Qu={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},wr=function(){var u=new _s,c,h,d,p,g,v,b;wr.prototype.init.call(this),c=this,this.push=function(x){x.type==="video"&&(h=x.trackId,d=x.pts,p=x.dts,u.push(x))},u.on("data",function(x){var C={trackId:h,pts:d,dts:p,data:x,nalUnitTypeCode:x[0]&31};switch(C.nalUnitTypeCode){case 5:C.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:C.nalUnitType="sei_rbsp",C.escapedRBSP=g(x.subarray(1));break;case 7:C.nalUnitType="seq_parameter_set_rbsp",C.escapedRBSP=g(x.subarray(1)),C.config=v(C.escapedRBSP);break;case 8:C.nalUnitType="pic_parameter_set_rbsp";break;case 9:C.nalUnitType="access_unit_delimiter_rbsp";break}c.trigger("data",C)}),u.on("done",function(){c.trigger("done")}),u.on("partialdone",function(){c.trigger("partialdone")}),u.on("reset",function(){c.trigger("reset")}),u.on("endedtimeline",function(){c.trigger("endedtimeline")}),this.flush=function(){u.flush()},this.partialFlush=function(){u.partialFlush()},this.reset=function(){u.reset()},this.endTimeline=function(){u.endTimeline()},b=function(x,C){var I=8,O=8,$,B;for($=0;$>4;return h=h>=0?h:0,p?h+20:h+10},Zu=function(u,c){return u.length-c<10||u[c]!==73||u[c+1]!==68||u[c+2]!==51?c:(c+=Ju(u,c),Zu(u,c))},G_=function(u){var c=Zu(u,0);return u.length>=c+2&&(u[c]&255)===255&&(u[c+1]&240)===240&&(u[c+1]&22)===16},el=function(u){return u[0]<<21|u[1]<<14|u[2]<<7|u[3]},z_=function(u,c,h){var d,p="";for(d=c;d>5,d=u[c+4]<<3,p=u[c+3]&6144;return p|d|h},X_=function(u,c){return u[c]===73&&u[c+1]===68&&u[c+2]===51?"timed-metadata":u[c]&!0&&(u[c+1]&240)===240?"audio":null},Y_=function(u){for(var c=0;c+5>>2]}return null},Q_=function(u){var c,h,d,p;c=10,u[5]&64&&(c+=4,c+=el(u.subarray(10,14)));do{if(h=el(u.subarray(c+4,c+8)),h<1)return null;if(p=String.fromCharCode(u[c],u[c+1],u[c+2],u[c+3]),p==="PRIV"){d=u.subarray(c+10,c+h+10);for(var g=0;g>>2;return x*=4,x+=b[7]&3,x}break}}c+=10,c+=h}while(c=3;){if(u[p]===73&&u[p+1]===68&&u[p+2]===51){if(u.length-p<10||(d=tl.parseId3TagSize(u,p),p+d>u.length))break;v={type:"timed-metadata",data:u.subarray(p,p+d)},this.trigger("data",v),p+=d;continue}else if((u[p]&255)===255&&(u[p+1]&240)===240){if(u.length-p<7||(d=tl.parseAdtsSize(u,p),p+d>u.length))break;b={type:"audio",data:u.subarray(p,p+d),pts:c,dts:c},this.trigger("data",b),p+=d;continue}p++}g=u.length-p,g>0?u=u.subarray(p):u=new Uint8Array},this.reset=function(){u=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){u=new Uint8Array,this.trigger("endedtimeline")}},kr.prototype=new J_;var Z_=kr,ev=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],tv=ev,iv=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],sv=iv,Ir=t,vs=Ky,Ts=s_,Pr=h_,ct=y_,Pt=B_,Lr=fe,il=$_,rv=V_.H264Stream,nv=Z_,av=ha.isLikelyAacData,ov=fe.ONE_SECOND_IN_TS,fa=tv,pa=sv,bs,Si,Or,ri,uv=function(u,c){c.stream=u,this.trigger("log",c)},sl=function(u,c){for(var h=Object.keys(c),d=0;d=-C&&O<=x&&(!$||I>O)&&($=G,I=O)));return $?$.gop:null},this.alignGopsAtStart_=function(b){var x,C,I,O,$,B,G,z;for($=b.byteLength,B=b.nalCount,G=b.duration,x=C=0;xI.pts){x++;continue}C++,$-=O.byteLength,B-=O.nalCount,G-=O.duration}return C===0?b:C===b.length?null:(z=b.slice(C),z.byteLength=$,z.duration=G,z.nalCount=B,z.pts=z[0].pts,z.dts=z[0].dts,z)},this.alignGopsAtEnd_=function(b){var x,C,I,O,$,B;for(x=p.length-1,C=b.length-1,$=null,B=!1;x>=0&&C>=0;){if(I=p[x],O=b[C],I.pts===O.pts){B=!0;break}if(I.pts>O.pts){x--;continue}x===p.length-1&&($=C),C--}if(!B&&$===null)return null;var G;if(B?G=C:G=$,G===0)return b;var z=b.slice(G),Ce=z.reduce(function(it,ai){return it.byteLength+=ai.byteLength,it.duration+=ai.duration,it.nalCount+=ai.nalCount,it},{byteLength:0,duration:0,nalCount:0});return z.byteLength=Ce.byteLength,z.duration=Ce.duration,z.nalCount=Ce.nalCount,z.pts=z[0].pts,z.dts=z[0].dts,z},this.alignGopsWith=function(b){p=b}},bs.prototype=new Ir,ri=function(u,c){this.numberOfTracks=0,this.metadataStream=c,u=u||{},typeof u.remux<"u"?this.remuxTracks=!!u.remux:this.remuxTracks=!0,typeof u.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=u.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,ri.prototype.init.call(this),this.push=function(h){if(h.content||h.text)return this.pendingCaptions.push(h);if(h.frames)return this.pendingMetadata.push(h);this.pendingTracks.push(h.track),this.pendingBytes+=h.boxes.byteLength,h.track.type==="video"&&(this.videoTrack=h.track,this.pendingBoxes.push(h.boxes)),h.track.type==="audio"&&(this.audioTrack=h.track,this.pendingBoxes.unshift(h.boxes))}},ri.prototype=new Ir,ri.prototype.flush=function(u){var c=0,h={captions:[],captionStreams:{},metadata:[],info:{}},d,p,g,v=0,b;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(v=this.videoTrack.timelineStartInfo.pts,pa.forEach(function(x){h.info[x]=this.videoTrack[x]},this)):this.audioTrack&&(v=this.audioTrack.timelineStartInfo.pts,fa.forEach(function(x){h.info[x]=this.audioTrack[x]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?h.type=this.pendingTracks[0].type:h.type="combined",this.emittedTracks+=this.pendingTracks.length,g=vs.initSegment(this.pendingTracks),h.initSegment=new Uint8Array(g.byteLength),h.initSegment.set(g),h.data=new Uint8Array(this.pendingBytes),b=0;b=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},ri.prototype.setRemux=function(u){this.remuxTracks=u},Or=function(u){var c=this,h=!0,d,p;Or.prototype.init.call(this),u=u||{},this.baseMediaDecodeTime=u.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="aac",g.metadataStream=new Pt.MetadataStream,g.aacStream=new nv,g.audioTimestampRolloverStream=new Pt.TimestampRolloverStream("audio"),g.timedMetadataTimestampRolloverStream=new Pt.TimestampRolloverStream("timed-metadata"),g.adtsStream=new il,g.coalesceStream=new ri(u,g.metadataStream),g.headOfPipeline=g.aacStream,g.aacStream.pipe(g.audioTimestampRolloverStream).pipe(g.adtsStream),g.aacStream.pipe(g.timedMetadataTimestampRolloverStream).pipe(g.metadataStream).pipe(g.coalesceStream),g.metadataStream.on("timestamp",function(v){g.aacStream.setTimestamp(v.timeStamp)}),g.aacStream.on("data",function(v){v.type!=="timed-metadata"&&v.type!=="audio"||g.audioSegmentStream||(p=p||{timelineStartInfo:{baseMediaDecodeTime:c.baseMediaDecodeTime},codec:"adts",type:"audio"},g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new Si(p,u),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d}))}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),sl(this,g)},this.setupTsPipeline=function(){var g={};this.transmuxPipeline_=g,g.type="ts",g.metadataStream=new Pt.MetadataStream,g.packetStream=new Pt.TransportPacketStream,g.parseStream=new Pt.TransportParseStream,g.elementaryStream=new Pt.ElementaryStream,g.timestampRolloverStream=new Pt.TimestampRolloverStream,g.adtsStream=new il,g.h264Stream=new rv,g.captionStream=new Pt.CaptionStream(u),g.coalesceStream=new ri(u,g.metadataStream),g.headOfPipeline=g.packetStream,g.packetStream.pipe(g.parseStream).pipe(g.elementaryStream).pipe(g.timestampRolloverStream),g.timestampRolloverStream.pipe(g.h264Stream),g.timestampRolloverStream.pipe(g.adtsStream),g.timestampRolloverStream.pipe(g.metadataStream).pipe(g.coalesceStream),g.h264Stream.pipe(g.captionStream).pipe(g.coalesceStream),g.elementaryStream.on("data",function(v){var b;if(v.type==="metadata"){for(b=v.tracks.length;b--;)!d&&v.tracks[b].type==="video"?(d=v.tracks[b],d.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime):!p&&v.tracks[b].type==="audio"&&(p=v.tracks[b],p.timelineStartInfo.baseMediaDecodeTime=c.baseMediaDecodeTime);d&&!g.videoSegmentStream&&(g.coalesceStream.numberOfTracks++,g.videoSegmentStream=new bs(d,u),g.videoSegmentStream.on("log",c.getLogTrigger_("videoSegmentStream")),g.videoSegmentStream.on("timelineStartInfo",function(x){p&&!u.keepOriginalTimestamps&&(p.timelineStartInfo=x,g.audioSegmentStream.setEarliestDts(x.dts-c.baseMediaDecodeTime))}),g.videoSegmentStream.on("processedGopsInfo",c.trigger.bind(c,"gopInfo")),g.videoSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"videoSegmentTimingInfo")),g.videoSegmentStream.on("baseMediaDecodeTime",function(x){p&&g.audioSegmentStream.setVideoBaseMediaDecodeTime(x)}),g.videoSegmentStream.on("timingInfo",c.trigger.bind(c,"videoTimingInfo")),g.h264Stream.pipe(g.videoSegmentStream).pipe(g.coalesceStream)),p&&!g.audioSegmentStream&&(g.coalesceStream.numberOfTracks++,g.audioSegmentStream=new Si(p,u),g.audioSegmentStream.on("log",c.getLogTrigger_("audioSegmentStream")),g.audioSegmentStream.on("timingInfo",c.trigger.bind(c,"audioTimingInfo")),g.audioSegmentStream.on("segmentTimingInfo",c.trigger.bind(c,"audioSegmentTimingInfo")),g.adtsStream.pipe(g.audioSegmentStream).pipe(g.coalesceStream)),c.trigger("trackinfo",{hasAudio:!!p,hasVideo:!!d})}}),g.coalesceStream.on("data",this.trigger.bind(this,"data")),g.coalesceStream.on("id3Frame",function(v){v.dispatchType=g.metadataStream.dispatchType,c.trigger("id3Frame",v)}),g.coalesceStream.on("caption",this.trigger.bind(this,"caption")),g.coalesceStream.on("done",this.trigger.bind(this,"done")),sl(this,g)},this.setBaseMediaDecodeTime=function(g){var v=this.transmuxPipeline_;u.keepOriginalTimestamps||(this.baseMediaDecodeTime=g),p&&(p.timelineStartInfo.dts=void 0,p.timelineStartInfo.pts=void 0,ct.clearDtsInfo(p),v.audioTimestampRolloverStream&&v.audioTimestampRolloverStream.discontinuity()),d&&(v.videoSegmentStream&&(v.videoSegmentStream.gopCache_=[]),d.timelineStartInfo.dts=void 0,d.timelineStartInfo.pts=void 0,ct.clearDtsInfo(d),v.captionStream.reset()),v.timestampRolloverStream&&v.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(g){p&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(g)},this.setRemux=function(g){var v=this.transmuxPipeline_;u.remux=g,v&&v.coalesceStream&&v.coalesceStream.setRemux(g)},this.alignGopsWith=function(g){d&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(g)},this.getLogTrigger_=function(g){var v=this;return function(b){b.stream=g,v.trigger("log",b)}},this.push=function(g){if(h){var v=av(g);v&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!v&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),h=!1}this.transmuxPipeline_.headOfPipeline.push(g)},this.flush=function(){h=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Or.prototype=new Ir;var lv={Transmuxer:Or,VideoSegmentStream:bs,AudioSegmentStream:Si,AUDIO_PROPERTIES:fa,VIDEO_PROPERTIES:pa,generateSegmentTimingInfo:ma},cv=function(u){return u>>>0},dv=function(u){return("00"+u.toString(16)).slice(-2)},Rr={toUnsigned:cv,toHexString:dv},hv=function(u){var c="";return c+=String.fromCharCode(u[0]),c+=String.fromCharCode(u[1]),c+=String.fromCharCode(u[2]),c+=String.fromCharCode(u[3]),c},nl=hv,fv=Rr.toUnsigned,pv=nl,al=function(u,c){var h=[],d,p,g,v,b;if(!c.length)return null;for(d=0;d1?d+p:u.byteLength,g===c[0]&&(c.length===1?h.push(u.subarray(d+8,v)):(b=al(u.subarray(d+8,v),c.slice(1)),b.length&&(h=h.concat(b)))),d=v;return h},ol=al,mv=Rr.toUnsigned,gv=n.getUint64,yv=function(u){var c={version:u[0],flags:new Uint8Array(u.subarray(1,4))};return c.version===1?c.baseMediaDecodeTime=gv(u.subarray(4)):c.baseMediaDecodeTime=mv(u[4]<<24|u[5]<<16|u[6]<<8|u[7]),c},ul=yv,_v=function(u){return{isLeading:(u[0]&12)>>>2,dependsOn:u[0]&3,isDependedOn:(u[1]&192)>>>6,hasRedundancy:(u[1]&48)>>>4,paddingValue:(u[1]&14)>>>1,isNonSyncSample:u[1]&1,degradationPriority:u[2]<<8|u[3]}},vv=_v,ll=vv,Tv=function(u){var c={version:u[0],flags:new Uint8Array(u.subarray(1,4)),samples:[]},h=new DataView(u.buffer,u.byteOffset,u.byteLength),d=c.flags[2]&1,p=c.flags[2]&4,g=c.flags[1]&1,v=c.flags[1]&2,b=c.flags[1]&4,x=c.flags[1]&8,C=h.getUint32(4),I=8,O;for(d&&(c.dataOffset=h.getInt32(I),I+=4),p&&C&&(O={flags:ll(u.subarray(I,I+4))},I+=4,g&&(O.duration=h.getUint32(I),I+=4),v&&(O.size=h.getUint32(I),I+=4),x&&(c.version===1?O.compositionTimeOffset=h.getInt32(I):O.compositionTimeOffset=h.getUint32(I),I+=4),c.samples.push(O),C--);C--;)O={},g&&(O.duration=h.getUint32(I),I+=4),v&&(O.size=h.getUint32(I),I+=4),b&&(O.flags=ll(u.subarray(I,I+4)),I+=4),x&&(c.version===1?O.compositionTimeOffset=h.getInt32(I):O.compositionTimeOffset=h.getUint32(I),I+=4),c.samples.push(O);return c},cl=Tv,bv=function(u){var c=new DataView(u.buffer,u.byteOffset,u.byteLength),h={version:u[0],flags:new Uint8Array(u.subarray(1,4)),trackId:c.getUint32(4)},d=h.flags[2]&1,p=h.flags[2]&2,g=h.flags[2]&8,v=h.flags[2]&16,b=h.flags[2]&32,x=h.flags[0]&65536,C=h.flags[0]&131072,I;return I=8,d&&(I+=4,h.baseDataOffset=c.getUint32(12),I+=4),p&&(h.sampleDescriptionIndex=c.getUint32(I),I+=4),g&&(h.defaultSampleDuration=c.getUint32(I),I+=4),v&&(h.defaultSampleSize=c.getUint32(I),I+=4),b&&(h.defaultSampleFlags=c.getUint32(I)),x&&(h.durationIsEmpty=!0),!d&&C&&(h.baseDataOffsetIsMoof=!0),h},dl=bv,Ss;typeof window<"u"?Ss=window:typeof i<"u"?Ss=i:typeof self<"u"?Ss=self:Ss={};var hl=Ss,Sv=qu.discardEmulationPreventionBytes,xv=ju.CaptionStream,xs=ol,Ev=ul,Cv=cl,Av=dl,fl=hl,Dv=function(u,c){for(var h=u,d=0;d0?Ev($[0]).baseMediaDecodeTime:0,G=xs(x,["trun"]),z,Ce;c===O&&G.length>0&&(z=kv(G,B,I),Ce=wv(b,z,O),p[O]||(p[O]={seiNals:[],logs:[]}),p[O].seiNals=p[O].seiNals.concat(Ce.seiNals),p[O].logs=p[O].logs.concat(Ce.logs))}),p},Pv=function(u,c,h){var d;if(c===null)return null;d=Iv(u,c);var p=d[c]||{};return{seiNals:p.seiNals,logs:p.logs,timescale:h}},Lv=function(){var u=!1,c,h,d,p,g,v;this.isInitialized=function(){return u},this.init=function(b){c=new xv,u=!0,v=b?b.isPartial:!1,c.on("data",function(x){x.startTime=x.startPts/p,x.endTime=x.endPts/p,g.captions.push(x),g.captionStreams[x.stream]=!0}),c.on("log",function(x){g.logs.push(x)})},this.isNewInit=function(b,x){return b&&b.length===0||x&&typeof x=="object"&&Object.keys(x).length===0?!1:d!==b[0]||p!==x[d]},this.parse=function(b,x,C){var I;if(this.isInitialized()){if(!x||!C)return null;if(this.isNewInit(x,C))d=x[0],p=C[d];else if(d===null||!p)return h.push(b),null}else return null;for(;h.length>0;){var O=h.shift();this.parse(O,x,C)}return I=Pv(b,d,p),I&&I.logs&&(g.logs=g.logs.concat(I.logs)),I===null||!I.seiNals?g.logs.length?{logs:g.logs,captions:[],captionStreams:[]}:null:(this.pushNals(I.seiNals),this.flushStream(),g)},this.pushNals=function(b){if(!this.isInitialized()||!b||b.length===0)return null;b.forEach(function(x){c.push(x)})},this.flushStream=function(){if(!this.isInitialized())return null;v?c.partialFlush():c.flush()},this.clearParsedCaptions=function(){g.captions=[],g.captionStreams={},g.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;c.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){h=[],d=null,p=null,g?this.clearParsedCaptions():g={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Ov=Lv,Rv=function(u){for(var c=0,h=String.fromCharCode(u[c]),d="";h!=="\0";)d+=h,c++,h=String.fromCharCode(u[c]);return d+=h,d},Mv={uint8ToCString:Rv},Mr=Mv.uint8ToCString,Nv=n.getUint64,Bv=function(u){var c=4,h=u[0],d,p,g,v,b,x,C,I;if(h===0){d=Mr(u.subarray(c)),c+=d.length,p=Mr(u.subarray(c)),c+=p.length;var O=new DataView(u.buffer);g=O.getUint32(c),c+=4,b=O.getUint32(c),c+=4,x=O.getUint32(c),c+=4,C=O.getUint32(c),c+=4}else if(h===1){var O=new DataView(u.buffer);g=O.getUint32(c),c+=4,v=Nv(u.subarray(c)),c+=8,x=O.getUint32(c),c+=4,C=O.getUint32(c),c+=4,d=Mr(u.subarray(c)),c+=d.length,p=Mr(u.subarray(c)),c+=p.length}I=new Uint8Array(u.subarray(c,u.byteLength));var $={scheme_id_uri:d,value:p,timescale:g||1,presentation_time:v,presentation_time_delta:b,event_duration:x,id:C,message_data:I};return Uv(h,$)?$:void 0},Fv=function(u,c,h,d){return u||u===0?u/c:d+h/c},Uv=function(u,c){var h=c.scheme_id_uri!=="\0",d=u===0&&pl(c.presentation_time_delta)&&h,p=u===1&&pl(c.presentation_time)&&h;return!(u>1)&&d||p},pl=function(u){return u!==void 0||u!==null},$v={parseEmsgBox:Bv,scaleTime:Fv},Nr=Rr.toUnsigned,Es=Rr.toHexString,be=ol,xi=nl,ga=$v,qv=dl,jv=cl,Vv=ul,Hv=n.getUint64,ml,gl,yl,_l,vl,ya,Tl,_a=hl,Gv=zu.parseId3Frames;ml=function(u){var c={},h=be(u,["moov","trak"]);return h.reduce(function(d,p){var g,v,b,x,C;return g=be(p,["tkhd"])[0],!g||(v=g[0],b=v===0?12:20,x=Nr(g[b]<<24|g[b+1]<<16|g[b+2]<<8|g[b+3]),C=be(p,["mdia","mdhd"])[0],!C)?null:(v=C[0],b=v===0?12:20,d[x]=Nr(C[b]<<24|C[b+1]<<16|C[b+2]<<8|C[b+3]),d)},c)},gl=function(u,c){var h;h=be(c,["moof","traf"]);var d=h.reduce(function(p,g){var v=be(g,["tfhd"])[0],b=Nr(v[4]<<24|v[5]<<16|v[6]<<8|v[7]),x=u[b]||9e4,C=be(g,["tfdt"])[0],I=new DataView(C.buffer,C.byteOffset,C.byteLength),O;C[0]===1?O=Hv(C.subarray(4,12)):O=I.getUint32(4);let $;return typeof O=="bigint"?$=O/_a.BigInt(x):typeof O=="number"&&!isNaN(O)&&($=O/x),$11?(p.codec+=".",p.codec+=Es(B[9]),p.codec+=Es(B[10]),p.codec+=Es(B[11])):p.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(p.codec)?(B=$.subarray(28),G=xi(B.subarray(4,8)),G==="esds"&&B.length>20&&B[19]!==0?(p.codec+="."+Es(B[19]),p.codec+="."+Es(B[20]>>>2&63).replace(/^0/,"")):p.codec="mp4a.40.2"):p.codec=p.codec.toLowerCase())}var z=be(d,["mdia","mdhd"])[0];z&&(p.timescale=ya(z)),h.push(p)}),h},Tl=function(u,c=0){var h=be(u,["emsg"]);return h.map(d=>{var p=ga.parseEmsgBox(new Uint8Array(d)),g=Gv(p.message_data);return{cueTime:ga.scaleTime(p.presentation_time,p.timescale,p.presentation_time_delta,c),duration:ga.scaleTime(p.event_duration,p.timescale),frames:g}})};var va={findBox:be,parseType:xi,timescale:ml,startTime:gl,compositionStartTime:yl,videoTrackIds:_l,tracks:vl,getTimescaleFromMediaHeader:ya,getEmsgID3:Tl},Ta=br,bl=function(u){var c=u[1]&31;return c<<=8,c|=u[2],c},Br=function(u){return!!(u[1]&64)},Fr=function(u){var c=0;return(u[3]&48)>>>4>1&&(c+=u[4]+1),c},zv=function(u,c){var h=bl(u);return h===0?"pat":h===c?"pmt":c?"pes":null},Wv=function(u){var c=Br(u),h=4+Fr(u);return c&&(h+=u[h]+1),(u[h+10]&31)<<8|u[h+11]},Kv=function(u){var c={},h=Br(u),d=4+Fr(u);if(h&&(d+=u[d]+1),!!(u[d+5]&1)){var p,g,v;p=(u[d+1]&15)<<8|u[d+2],g=3+p-4,v=(u[d+10]&15)<<8|u[d+11];for(var b=12+v;b=u.byteLength)return null;var d=null,p;return p=u[h+7],p&192&&(d={},d.pts=(u[h+9]&14)<<27|(u[h+10]&255)<<20|(u[h+11]&254)<<12|(u[h+12]&255)<<5|(u[h+13]&254)>>>3,d.pts*=4,d.pts+=(u[h+13]&6)>>>1,d.dts=d.pts,p&64&&(d.dts=(u[h+14]&14)<<27|(u[h+15]&255)<<20|(u[h+16]&254)<<12|(u[h+17]&255)<<5|(u[h+18]&254)>>>3,d.dts*=4,d.dts+=(u[h+18]&6)>>>1)),d},ba=function(u){switch(u){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}},Qv=function(u){for(var c=4+Fr(u),h=u.subarray(c),d=0,p=0,g=!1,v;p3&&(v=ba(h[p+3]&31),v==="slice_layer_without_partitioning_rbsp_idr"&&(g=!0)),g},Jv={parseType:zv,parsePat:Wv,parsePmt:Kv,parsePayloadUnitStartIndicator:Br,parsePesType:Xv,parsePesTime:Yv,videoPacketContainsKeyFrame:Qv},Sl=br,Ei=Hu.handleRollover,ne={};ne.ts=Jv,ne.aac=ha;var ni=fe.ONE_SECOND_IN_TS,Me=188,mt=71,Zv=function(u,c){for(var h=0,d=Me,p,g;d=0;){if(u[d]===mt&&(u[p]===mt||p===u.byteLength)){switch(g=u.subarray(d,p),v=ne.ts.parseType(g,c.pid),v){case"pes":b=ne.ts.parsePesType(g,c.table),x=ne.ts.parsePayloadUnitStartIndicator(g),b==="audio"&&x&&(C=ne.ts.parsePesTime(g),C&&(C.type="audio",h.audio.push(C),I=!0));break}if(I)break;d-=Me,p-=Me;continue}d--,p--}},eT=function(u,c,h){for(var d=0,p=Me,g,v,b,x,C,I,O,$,B=!1,G={data:[],size:0};p=0;){if(u[d]===mt&&u[p]===mt){switch(g=u.subarray(d,p),v=ne.ts.parseType(g,c.pid),v){case"pes":b=ne.ts.parsePesType(g,c.table),x=ne.ts.parsePayloadUnitStartIndicator(g),b==="video"&&x&&(C=ne.ts.parsePesTime(g),C&&(C.type="video",h.video.push(C),B=!0));break}if(B)break;d-=Me,p-=Me;continue}d--,p--}},tT=function(u,c){if(u.audio&&u.audio.length){var h=c;(typeof h>"u"||isNaN(h))&&(h=u.audio[0].dts),u.audio.forEach(function(g){g.dts=Ei(g.dts,h),g.pts=Ei(g.pts,h),g.dtsTime=g.dts/ni,g.ptsTime=g.pts/ni})}if(u.video&&u.video.length){var d=c;if((typeof d>"u"||isNaN(d))&&(d=u.video[0].dts),u.video.forEach(function(g){g.dts=Ei(g.dts,d),g.pts=Ei(g.pts,d),g.dtsTime=g.dts/ni,g.ptsTime=g.pts/ni}),u.firstKeyFrame){var p=u.firstKeyFrame;p.dts=Ei(p.dts,d),p.pts=Ei(p.pts,d),p.dtsTime=p.dts/ni,p.ptsTime=p.pts/ni}}},iT=function(u){for(var c=!1,h=0,d=null,p=null,g=0,v=0,b;u.length-v>=3;){var x=ne.aac.parseType(u,v);switch(x){case"timed-metadata":if(u.length-v<10){c=!0;break}if(g=ne.aac.parseId3TagSize(u,v),g>u.length){c=!0;break}p===null&&(b=u.subarray(v,v+g),p=ne.aac.parseAacTimestamp(b)),v+=g;break;case"audio":if(u.length-v<7){c=!0;break}if(g=ne.aac.parseAdtsSize(u,v),g>u.length){c=!0;break}d===null&&(b=u.subarray(v,v+g),d=ne.aac.parseSampleRate(b)),h++,v+=g;break;default:v++;break}if(c)return null}if(d===null||p===null)return null;var C=ni/d,I={audio:[{type:"audio",dts:p,pts:p},{type:"audio",dts:p+h*1024*C,pts:p+h*1024*C}]};return I},sT=function(u){var c={pid:null,table:null},h={};Zv(u,c);for(var d in c.table)if(c.table.hasOwnProperty(d)){var p=c.table[d];switch(p){case Sl.H264_STREAM_TYPE:h.video=[],eT(u,c,h),h.video.length===0&&delete h.video;break;case Sl.ADTS_STREAM_TYPE:h.audio=[],xl(u,c,h),h.audio.length===0&&delete h.audio;break}}return h},rT=function(u,c){var h=ne.aac.isLikelyAacData(u),d;return h?d=iT(u):d=sT(u),!d||!d.audio&&!d.video?null:(tT(d,c),d)},nT={inspect:rT,parseAudioPes_:xl};const aT=function(u,c){c.on("data",function(h){const d=h.initSegment;h.initSegment={data:d.buffer,byteOffset:d.byteOffset,byteLength:d.byteLength};const p=h.data;h.data=p.buffer,u.postMessage({action:"data",segment:h,byteOffset:p.byteOffset,byteLength:p.byteLength},[h.data])}),c.on("done",function(h){u.postMessage({action:"done"})}),c.on("gopInfo",function(h){u.postMessage({action:"gopInfo",gopInfo:h})}),c.on("videoSegmentTimingInfo",function(h){const d={start:{decode:fe.videoTsToSeconds(h.start.dts),presentation:fe.videoTsToSeconds(h.start.pts)},end:{decode:fe.videoTsToSeconds(h.end.dts),presentation:fe.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:fe.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=fe.videoTsToSeconds(h.prependedContentDuration)),u.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:d})}),c.on("audioSegmentTimingInfo",function(h){const d={start:{decode:fe.videoTsToSeconds(h.start.dts),presentation:fe.videoTsToSeconds(h.start.pts)},end:{decode:fe.videoTsToSeconds(h.end.dts),presentation:fe.videoTsToSeconds(h.end.pts)},baseMediaDecodeTime:fe.videoTsToSeconds(h.baseMediaDecodeTime)};h.prependedContentDuration&&(d.prependedContentDuration=fe.videoTsToSeconds(h.prependedContentDuration)),u.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:d})}),c.on("id3Frame",function(h){u.postMessage({action:"id3Frame",id3Frame:h})}),c.on("caption",function(h){u.postMessage({action:"caption",caption:h})}),c.on("trackinfo",function(h){u.postMessage({action:"trackinfo",trackInfo:h})}),c.on("audioTimingInfo",function(h){u.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:fe.videoTsToSeconds(h.start),end:fe.videoTsToSeconds(h.end)}})}),c.on("videoTimingInfo",function(h){u.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:fe.videoTsToSeconds(h.start),end:fe.videoTsToSeconds(h.end)}})}),c.on("log",function(h){u.postMessage({action:"log",log:h})})};class El{constructor(c,h){this.options=h||{},this.self=c,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new lv.Transmuxer(this.options),aT(this.self,this.transmuxer)}pushMp4Captions(c){this.captionParser||(this.captionParser=new Ov,this.captionParser.init());const h=new Uint8Array(c.data,c.byteOffset,c.byteLength),d=this.captionParser.parse(h,c.trackIds,c.timescales);this.self.postMessage({action:"mp4Captions",captions:d&&d.captions||[],logs:d&&d.logs||[],data:h.buffer},[h.buffer])}probeMp4StartTime({timescales:c,data:h}){const d=va.startTime(c,h);this.self.postMessage({action:"probeMp4StartTime",startTime:d,data:h},[h.buffer])}probeMp4Tracks({data:c}){const h=va.tracks(c);this.self.postMessage({action:"probeMp4Tracks",tracks:h,data:c},[c.buffer])}probeEmsgID3({data:c,offset:h}){const d=va.getEmsgID3(c,h);this.self.postMessage({action:"probeEmsgID3",id3Frames:d,emsgData:c},[c.buffer])}probeTs({data:c,baseStartTime:h}){const d=typeof h=="number"&&!isNaN(h)?h*fe.ONE_SECOND_IN_TS:void 0,p=nT.inspect(c,d);let g=null;p&&(g={hasVideo:p.video&&p.video.length===2||!1,hasAudio:p.audio&&p.audio.length===2||!1},g.hasVideo&&(g.videoStart=p.video[0].ptsTime),g.hasAudio&&(g.audioStart=p.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:g,data:c},[c.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(c){const h=new Uint8Array(c.data,c.byteOffset,c.byteLength);this.transmuxer.push(h)}reset(){this.transmuxer.reset()}setTimestampOffset(c){const h=c.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(fe.secondsToVideoTs(h)))}setAudioAppendStart(c){this.transmuxer.setAudioAppendStart(Math.ceil(fe.secondsToVideoTs(c.appendStart)))}setRemux(c){this.transmuxer.setRemux(c.remux)}flush(c){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(c){this.transmuxer.alignGopsWith(c.gopsToAlignWith.slice())}}self.onmessage=function(u){if(u.data.action==="init"&&u.data.options){this.messageHandlers=new El(self,u.data.options);return}this.messageHandlers||(this.messageHandlers=new El(self)),u.data&&u.data.action&&u.data.action!=="init"&&this.messageHandlers[u.data.action]&&this.messageHandlers[u.data.action](u.data)}}));var Px=rp(Ix);const Lx=(i,e,t)=>{const{type:s,initSegment:r,captions:n,captionStreams:a,metadata:o,videoFrameDtsTime:l,videoFramePtsTime:f}=i.data.segment;e.buffer.push({captions:n,captionStreams:a,metadata:o});const m=i.data.segment.boxes||{data:i.data.segment.data},y={type:s,data:new Uint8Array(m.data,m.data.byteOffset,m.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof l<"u"&&(y.videoFrameDtsTime=l),typeof f<"u"&&(y.videoFramePtsTime=f),t(y)},Ox=({transmuxedData:i,callback:e})=>{i.buffer=[],e(i)},Rx=(i,e)=>{e.gopInfo=i.data.gopInfo},op=i=>{const{transmuxer:e,bytes:t,audioAppendStart:s,gopsToAlignWith:r,remux:n,onData:a,onTrackInfo:o,onAudioTimingInfo:l,onVideoTimingInfo:f,onVideoSegmentTimingInfo:m,onAudioSegmentTimingInfo:y,onId3:T,onCaptions:S,onDone:_,onEndedTimeline:A,onTransmuxerLog:D,isEndOfTimeline:w}=i,k={buffer:[]};let M=w;const R=P=>{e.currentTransmux===i&&(P.data.action==="data"&&Lx(P,k,a),P.data.action==="trackinfo"&&o(P.data.trackInfo),P.data.action==="gopInfo"&&Rx(P,k),P.data.action==="audioTimingInfo"&&l(P.data.audioTimingInfo),P.data.action==="videoTimingInfo"&&f(P.data.videoTimingInfo),P.data.action==="videoSegmentTimingInfo"&&m(P.data.videoSegmentTimingInfo),P.data.action==="audioSegmentTimingInfo"&&y(P.data.audioSegmentTimingInfo),P.data.action==="id3Frame"&&T([P.data.id3Frame],P.data.id3Frame.dispatchType),P.data.action==="caption"&&S(P.data.caption),P.data.action==="endedtimeline"&&(M=!1,A()),P.data.action==="log"&&D(P.data.log),P.data.type==="transmuxed"&&(M||(e.onmessage=null,Ox({transmuxedData:k,callback:_}),up(e))))};if(e.onmessage=R,s&&e.postMessage({action:"setAudioAppendStart",appendStart:s}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof n<"u"&&e.postMessage({action:"setRemux",remux:n}),t.byteLength){const P=t instanceof ArrayBuffer?t:t.buffer,U=t instanceof ArrayBuffer?0:t.byteOffset;e.postMessage({action:"push",data:P,byteOffset:U,byteLength:t.byteLength},[P])}w&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},up=i=>{i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():op(i.currentTransmux))},$c=(i,e)=>{i.postMessage({action:e}),up(i)},lp=(i,e)=>{if(!e.currentTransmux){e.currentTransmux=i,$c(e,i);return}e.transmuxQueue.push($c.bind(null,e,i))},Mx=i=>{lp("reset",i)},Nx=i=>{lp("endTimeline",i)},cp=i=>{if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,op(i);return}i.transmuxer.transmuxQueue.push(i)},Bx=i=>{const e=new Px;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:i}),e};var Ha={reset:Mx,endTimeline:Nx,transmux:cp,createTransmuxer:Bx};const Gs=function(i){const e=i.transmuxer,t=i.endAction||i.action,s=i.callback,r=rt({},i,{endAction:null,transmuxer:null,callback:null}),n=a=>{a.data.action===t&&(e.removeEventListener("message",n),a.data.data&&(a.data.data=new Uint8Array(a.data.data,i.byteOffset||0,i.byteLength||a.data.data.byteLength),i.data&&(i.data=a.data.data)),s(a.data))};if(e.addEventListener("message",n),i.data){const a=i.data instanceof ArrayBuffer;r.byteOffset=a?0:i.data.byteOffset,r.byteLength=i.data.byteLength;const o=[a?i.data:i.data.buffer];e.postMessage(r,o)}else e.postMessage(r)},bt={FAILURE:2,TIMEOUT:-101,ABORTED:-102},Ao=i=>{i.forEach(e=>{e.abort()})},Fx=i=>({bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}),Ux=i=>{const e=i.target,s={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return s.bytesReceived=i.loaded,s.bandwidth=Math.floor(s.bytesReceived/s.roundTripTime*8*1e3),s},ku=(i,e)=>e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:bt.TIMEOUT,xhr:e}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:bt.ABORTED,xhr:e}:i?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:bt.FAILURE,xhr:e}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:bt.FAILURE,xhr:e}:null,qc=(i,e,t)=>(s,r)=>{const n=r.response,a=ku(s,r);if(a)return t(a,i);if(n.byteLength!==16)return t({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:bt.FAILURE,xhr:r},i);const o=new DataView(n),l=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]);for(let f=0;f{const t=Ko(i.map.bytes);if(t!=="mp4"){const s=i.map.resolvedUri||i.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${s}`,code:bt.FAILURE,metadata:{errorType:L.Error.UnsupportedMediaInitialization,mediaType:r}})}Gs({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:s,data:r})=>(i.map.bytes=r,s.forEach(function(n){i.map.tracks=i.map.tracks||{},!i.map.tracks[n.type]&&(i.map.tracks[n.type]=n,typeof n.id=="number"&&n.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[n.id]=n.timescale))}),e(null))})},$x=({segment:i,finishProcessingFn:e})=>(t,s)=>{const r=ku(t,s);if(r)return e(r,i);const n=new Uint8Array(s.response);if(i.map.key)return i.map.encryptedBytes=n,e(null,i);i.map.bytes=n,dp(i,function(a){if(a)return a.xhr=s,a.status=s.status,e(a,i);e(null,i)})},qx=({segment:i,finishProcessingFn:e,responseType:t})=>(s,r)=>{const n=ku(s,r);if(n)return e(n,i);const a=t==="arraybuffer"||!r.responseText?r.response:wx(r.responseText.substring(i.lastReachedChar||0));return i.stats=Fx(r),i.key?i.encryptedBytes=new Uint8Array(a):i.bytes=new Uint8Array(a),e(null,i)},jx=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})=>{const S=i.map&&i.map.tracks||{},_=!!(S.audio&&S.video);let A=s.bind(null,i,"audio","start");const D=s.bind(null,i,"audio","end");let w=s.bind(null,i,"video","start");const k=s.bind(null,i,"video","end"),M=()=>cp({bytes:e,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:_,onData:R=>{R.type=R.type==="combined"?"video":R.type,m(i,R)},onTrackInfo:R=>{t&&(_&&(R.isMuxed=!0),t(i,R))},onAudioTimingInfo:R=>{A&&typeof R.start<"u"&&(A(R.start),A=null),D&&typeof R.end<"u"&&D(R.end)},onVideoTimingInfo:R=>{w&&typeof R.start<"u"&&(w(R.start),w=null),k&&typeof R.end<"u"&&k(R.end)},onVideoSegmentTimingInfo:R=>{r(R)},onAudioSegmentTimingInfo:R=>{n(R)},onId3:(R,P)=>{a(i,R,P)},onCaptions:R=>{o(i,[R])},isEndOfTimeline:l,onEndedTimeline:()=>{f()},onTransmuxerLog:T,onDone:R=>{y&&(R.type=R.type==="combined"?"video":R.type,y(null,i,R))}});Gs({action:"probeTs",transmuxer:i.transmuxer,data:e,baseStartTime:i.baseStartTime,callback:R=>{i.bytes=e=R.data;const P=R.result;P&&(t(i,{hasAudio:P.hasAudio,hasVideo:P.hasVideo,isMuxed:_}),t=null),M()}})},hp=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})=>{let S=new Uint8Array(e);if(m1(S)){i.isFmp4=!0;const{tracks:_}=i.map,A={isFmp4:!0,hasVideo:!!_.video,hasAudio:!!_.audio};_.audio&&_.audio.codec&&_.audio.codec!=="enca"&&(A.audioCodec=_.audio.codec),_.video&&_.video.codec&&_.video.codec!=="encv"&&(A.videoCodec=_.video.codec),_.video&&_.audio&&(A.isMuxed=!0),t(i,A);const D=(w,k)=>{m(i,{data:S,type:A.hasAudio&&!A.isMuxed?"audio":"video"}),k&&k.length&&a(i,k),w&&w.length&&o(i,w),y(null,i,{})};Gs({action:"probeMp4StartTime",timescales:i.map.timescales,data:S,transmuxer:i.transmuxer,callback:({data:w,startTime:k})=>{e=w.buffer,i.bytes=S=w,A.hasAudio&&!A.isMuxed&&s(i,"audio","start",k),A.hasVideo&&s(i,"video","start",k),Gs({action:"probeEmsgID3",data:S,transmuxer:i.transmuxer,offset:k,callback:({emsgData:M,id3Frames:R})=>{if(e=M.buffer,i.bytes=S=M,!_.video||!M.byteLength||!i.transmuxer){D(void 0,R);return}Gs({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:S,timescales:i.map.timescales,trackIds:[_.video.id],callback:P=>{e=P.data.buffer,i.bytes=S=P.data,P.logs.forEach(function(U){T(se(U,{stream:"mp4CaptionParser"}))}),D(P.captions,R)}})}})}});return}if(!i.transmuxer){y(null,i,{});return}if(typeof i.container>"u"&&(i.container=Ko(S)),i.container!=="ts"&&i.container!=="aac"){t(i,{hasAudio:!1,hasVideo:!1}),y(null,i,{});return}jx({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})},fp=function({id:i,key:e,encryptedBytes:t,decryptionWorker:s},r){const n=o=>{if(o.data.source===i){s.removeEventListener("message",n);const l=o.data.decrypted;r(new Uint8Array(l.bytes,l.byteOffset,l.byteLength))}};s.addEventListener("message",n);let a;e.bytes.slice?a=e.bytes.slice():a=new Uint32Array(Array.prototype.slice.call(e.bytes)),s.postMessage(Jf({source:i,encrypted:t,key:a,iv:e.iv}),[t.buffer,a.buffer])},Vx=({decryptionWorker:i,segment:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})=>{fp({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:i},S=>{e.bytes=S,hp({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})})},Hx=({activeXhrs:i,decryptionWorker:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})=>{let S=0,_=!1;return(A,D)=>{if(!_){if(A)return _=!0,Ao(i),y(A,D);if(S+=1,S===i.length){const w=function(){if(D.encryptedBytes)return Vx({decryptionWorker:e,segment:D,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T});hp({segment:D,bytes:D.bytes,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m,doneFn:y,onTransmuxerLog:T})};if(D.endOfAllRequests=Date.now(),D.map&&D.map.encryptedBytes&&!D.map.bytes)return fp({decryptionWorker:e,id:D.requestId+"-init",encryptedBytes:D.map.encryptedBytes,key:D.map.key},k=>{D.map.bytes=k,dp(D,M=>{if(M)return Ao(i),y(M,D);w()})});w()}}}},Gx=({loadendState:i,abortFn:e})=>t=>{t.target.aborted&&e&&!i.calledAbortFn&&(e(),i.calledAbortFn=!0)},zx=({segment:i,progressFn:e,trackInfoFn:t,timingInfoFn:s,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:n,id3Fn:a,captionsFn:o,isEndOfTimeline:l,endedTimelineFn:f,dataFn:m})=>y=>{if(!y.target.aborted)return i.stats=se(i.stats,Ux(y)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),e(y,i)},Wx=({xhr:i,xhrOptions:e,decryptionWorker:t,segment:s,abortFn:r,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:S,dataFn:_,doneFn:A,onTransmuxerLog:D})=>{const w=[],k=Hx({activeXhrs:w,decryptionWorker:t,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:S,dataFn:_,doneFn:A,onTransmuxerLog:D});if(s.key&&!s.key.bytes){const j=[s.key];s.map&&!s.map.bytes&&s.map.key&&s.map.key.resolvedUri===s.key.resolvedUri&&j.push(s.map.key);const Q=se(e,{uri:s.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),X=qc(s,j,k),le=i(Q,X);w.push(le)}if(s.map&&!s.map.bytes){if(s.map.key&&(!s.key||s.key.resolvedUri!==s.map.key.resolvedUri)){const ee=se(e,{uri:s.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),he=qc(s,[s.map.key],k),V=i(ee,he);w.push(V)}const Q=se(e,{uri:s.map.resolvedUri,responseType:"arraybuffer",headers:Eo(s.map),requestType:"segment-media-initialization"}),X=$x({segment:s,finishProcessingFn:k}),le=i(Q,X);w.push(le)}const M=se(e,{uri:s.part&&s.part.resolvedUri||s.resolvedUri,responseType:"arraybuffer",headers:Eo(s),requestType:"segment"}),R=qx({segment:s,finishProcessingFn:k,responseType:M.responseType}),P=i(M,R);P.addEventListener("progress",zx({segment:s,progressFn:n,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:f,id3Fn:m,captionsFn:y,isEndOfTimeline:T,endedTimelineFn:S,dataFn:_})),w.push(P);const U={};return w.forEach(j=>{j.addEventListener("loadend",Gx({loadendState:U,abortFn:r}))}),()=>Ao(w)},Kx=ut("CodecUtils"),Xx=function(i){const e=i.attributes||{};if(e.CODECS)return gt(e.CODECS)},pp=(i,e)=>{const t=e.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&t.AUDIO&&i.mediaGroups.AUDIO[t.AUDIO]},Yx=(i,e)=>{if(!pp(i,e))return!0;const t=e.attributes||{},s=i.mediaGroups.AUDIO[t.AUDIO];for(const r in s)if(!s[r].uri&&!s[r].playlists)return!0;return!1},bn=function(i){const e={};return i.forEach(({mediaType:t,type:s,details:r})=>{e[t]=e[t]||[],e[t].push(Ad(`${s}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){Kx(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},jc=function(i){let e=0;return i.audio&&e++,i.video&&e++,e},zs=function(i,e){const t=e.attributes||{},s=bn(Xx(e)||[]);if(pp(i,e)&&!s.audio&&!Yx(i,e)){const r=bn(m2(i,t.AUDIO)||[]);r.audio&&(s.audio=r.audio)}return s},Gr=ut("PlaylistSelector"),Vc=function(i){if(!i||!i.playlist)return;const e=i.playlist;return JSON.stringify({id:e.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:e.attributes&&e.attributes.CODECS||""})},Sn=function(i,e){if(!i)return"";const t=E.getComputedStyle(i);return t?t[e]:""},Hi=function(i,e){const t=i.slice();i.sort(function(s,r){const n=e(s,r);return n===0?t.indexOf(s)-t.indexOf(r):n})},Iu=function(i,e){let t,s;return i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),t=t||E.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(s=e.attributes.BANDWIDTH),s=s||E.Number.MAX_VALUE,t-s},Qx=function(i,e){let t,s;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),t=t||E.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(s=e.attributes.RESOLUTION.width),s=s||E.Number.MAX_VALUE,t===s&&i.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?i.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-s};let mp=function(i,e,t,s,r,n){if(!i)return;const a={bandwidth:e,width:t,height:s,limitRenditionByPlayerDimensions:r};let o=i.playlists;Ge.isAudioOnly(i)&&(o=n.getAudioTrackPlaylists_(),a.audioOnly=!0);let l=o.map(P=>{let U;const j=P.attributes&&P.attributes.RESOLUTION&&P.attributes.RESOLUTION.width,Q=P.attributes&&P.attributes.RESOLUTION&&P.attributes.RESOLUTION.height;return U=P.attributes&&P.attributes.BANDWIDTH,U=U||E.Number.MAX_VALUE,{bandwidth:U,width:j,height:Q,playlist:P}});Hi(l,(P,U)=>P.bandwidth-U.bandwidth),l=l.filter(P=>!Ge.isIncompatible(P.playlist));let f=l.filter(P=>Ge.isEnabled(P.playlist));f.length||(f=l.filter(P=>!Ge.isDisabled(P.playlist)));const m=f.filter(P=>P.bandwidth*De.BANDWIDTH_VARIANCEP.bandwidth===y.bandwidth)[0];if(r===!1){const P=T||f[0]||l[0];if(P&&P.playlist){let U="sortedPlaylistReps";return T&&(U="bandwidthBestRep"),f[0]&&(U="enabledPlaylistReps"),Gr(`choosing ${Vc(P)} using ${U} with options`,a),P.playlist}return Gr("could not choose a playlist with options",a),null}const S=m.filter(P=>P.width&&P.height);Hi(S,(P,U)=>P.width-U.width);const _=S.filter(P=>P.width===t&&P.height===s);y=_[_.length-1];const A=_.filter(P=>P.bandwidth===y.bandwidth)[0];let D,w,k;A||(D=S.filter(P=>P.width>t||P.height>s),w=D.filter(P=>P.width===D[0].width&&P.height===D[0].height),y=w[w.length-1],k=w.filter(P=>P.bandwidth===y.bandwidth)[0]);let M;if(n.leastPixelDiffSelector){const P=S.map(U=>(U.pixelDiff=Math.abs(U.width-t)+Math.abs(U.height-s),U));Hi(P,(U,j)=>U.pixelDiff===j.pixelDiff?j.bandwidth-U.bandwidth:U.pixelDiff-j.pixelDiff),M=P[0]}const R=M||k||A||T||f[0]||l[0];if(R&&R.playlist){let P="sortedPlaylistReps";return M?P="leastPixelDiffRep":k?P="resolutionPlusOneRep":A?P="resolutionBestRep":T?P="bandwidthBestRep":f[0]&&(P="enabledPlaylistReps"),Gr(`choosing ${Vc(R)} using ${P} with options`,a),R.playlist}return Gr("could not choose a playlist with options",a),null};const Hc=function(){let i=this.useDevicePixelRatio&&E.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),mp(this.playlists.main,this.systemBandwidth,parseInt(Sn(this.tech_.el(),"width"),10)*i,parseInt(Sn(this.tech_.el(),"height"),10)*i,this.limitRenditionByPlayerDimensions,this.playlistController_)},Jx=function(i){let e=-1,t=-1;if(i<0||i>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let s=this.useDevicePixelRatio&&E.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(s=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=i*this.systemBandwidth+(1-i)*e,t=this.systemBandwidth),mp(this.playlists.main,e,parseInt(Sn(this.tech_.el(),"width"),10)*s,parseInt(Sn(this.tech_.el(),"height"),10)*s,this.limitRenditionByPlayerDimensions,this.playlistController_)}},Zx=function(i){const{main:e,currentTime:t,bandwidth:s,duration:r,segmentDuration:n,timeUntilRebuffer:a,currentTimeline:o,syncController:l}=i,f=e.playlists.filter(_=>!Ge.isIncompatible(_));let m=f.filter(Ge.isEnabled);m.length||(m=f.filter(_=>!Ge.isDisabled(_)));const T=m.filter(Ge.hasAttribute.bind(null,"BANDWIDTH")).map(_=>{const D=l.getSyncPoint(_,r,o,t)?1:2,k=Ge.estimateSegmentRequestTime(n,s,_)*D-a;return{playlist:_,rebufferingImpact:k}}),S=T.filter(_=>_.rebufferingImpact<=0);return Hi(S,(_,A)=>Iu(A.playlist,_.playlist)),S.length?S[0]:(Hi(T,(_,A)=>_.rebufferingImpact-A.rebufferingImpact),T[0]||null)},eE=function(){const i=this.playlists.main.playlists.filter(Ge.isEnabled);return Hi(i,(t,s)=>Iu(t,s)),i.filter(t=>!!zs(this.playlists.main,t).video)[0]||null},tE=i=>{let e=0,t;return i.bytes&&(t=new Uint8Array(i.bytes),i.segments.forEach(s=>{t.set(s,e),e+=s.byteLength})),t};function gp(i){try{return new URL(i).pathname.split("/").slice(-2).join("/")}catch{return""}}const iE=function(i,e,t){if(!i[t]){e.trigger({type:"usage",name:"vhs-608"});let s=t;/^cc708_/.test(t)&&(s="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(s);if(r)i[t]=r;else{const n=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,o=t,l=!1;const f=n[s];f&&(a=f.label,o=f.language,l=f.default),i[t]=e.addRemoteTextTrack({kind:"captions",id:s,default:l,label:a,language:o},!1).track}}},sE=function({inbandTextTracks:i,captionArray:e,timestampOffset:t}){if(!e)return;const s=E.WebKitDataCue||E.VTTCue;e.forEach(r=>{const n=r.stream;r.content?r.content.forEach(a=>{const o=new s(r.startTime+t,r.endTime+t,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",i[n].addCue(o)}):i[n].addCue(new s(r.startTime+t,r.endTime+t,r.text))})},rE=function(i){Object.defineProperties(i.frame,{id:{get(){return L.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get(){return L.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get(){return L.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},nE=({inbandTextTracks:i,metadataArray:e,timestampOffset:t,videoDuration:s})=>{if(!e)return;const r=E.WebKitDataCue||E.VTTCue,n=i.metadataTrack_;if(!n||(e.forEach(m=>{const y=m.cueTime+t;typeof y!="number"||E.isNaN(y)||y<0||!(y<1/0)||!m.frames||!m.frames.length||m.frames.forEach(T=>{const S=new r(y,y,T.value||T.url||T.data||"");S.frame=T,S.value=T,rE(S),n.addCue(S)})}),!n.cues||!n.cues.length))return;const a=n.cues,o=[];for(let m=0;m{const T=m[y.startTime]||[];return T.push(y),m[y.startTime]=T,m},{}),f=Object.keys(l).sort((m,y)=>Number(m)-Number(y));f.forEach((m,y)=>{const T=l[m],S=isFinite(s)?s:m,_=Number(f[y+1])||S;T.forEach(A=>{A.endTime=_})})},aE={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"},oE=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),uE=({inbandTextTracks:i,dateRanges:e})=>{const t=i.metadataTrack_;if(!t)return;const s=E.WebKitDataCue||E.VTTCue;e.forEach(r=>{for(const n of Object.keys(r)){if(oE.has(n))continue;const a=new s(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:aE[n],data:r[n]},(n==="scte35Out"||n==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},Gc=(i,e,t)=>{i.metadataTrack_||(i.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,L.browser.IS_ANY_SAFARI||(i.metadataTrack_.inBandMetadataTrackDispatchType=e))},Fs=function(i,e,t){let s,r;if(t&&t.cues)for(s=t.cues.length;s--;)r=t.cues[s],r.startTime>=i&&r.endTime<=e&&t.removeCue(r)},lE=function(i){const e=i.cues;if(!e)return;const t={};for(let s=e.length-1;s>=0;s--){const r=e[s],n=`${r.startTime}-${r.endTime}-${r.text}`;t[n]?i.removeCue(r):t[n]=r}},cE=(i,e,t)=>{if(typeof e>"u"||e===null||!i.length)return[];const s=Math.ceil((e-t+3)*hi.ONE_SECOND_IN_TS);let r;for(r=0;rs);r++);return i.slice(r)},dE=(i,e,t)=>{if(!e.length)return i;if(t)return e.slice();const s=e[0].pts;let r=0;for(r;r=s);r++);return i.slice(0,r).concat(e)},hE=(i,e,t,s)=>{const r=Math.ceil((e-s)*hi.ONE_SECOND_IN_TS),n=Math.ceil((t-s)*hi.ONE_SECOND_IN_TS),a=i.slice();let o=i.length;for(;o--&&!(i[o].pts<=n););if(o===-1)return a;let l=o+1;for(;l--&&!(i[l].pts<=r););return l=Math.max(l,0),a.splice(l,o-l+1),a},fE=function(i,e){if(!i&&!e||!i&&e||i&&!e)return!1;if(i===e)return!0;const t=Object.keys(i).sort(),s=Object.keys(e).sort();if(t.length!==s.length)return!1;for(let r=0;rt))return n}return s.length===0?0:s[s.length-1]},Ls=1,mE=500,zc=i=>typeof i=="number"&&isFinite(i),zr=1/60,gE=(i,e,t)=>i!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,yE=(i,e,t)=>{let s=e-De.BACK_BUFFER_LENGTH;i.length&&(s=Math.max(s,i.start(0)));const r=e-t;return Math.min(r,s)},Ii=i=>{const{startOfSegment:e,duration:t,segment:s,part:r,playlist:{mediaSequence:n,id:a,segments:o=[]},mediaIndex:l,partIndex:f,timeline:m}=i,y=o.length-1;let T="mediaIndex/partIndex increment";i.getMediaInfoForTime?T=`getMediaInfoForTime (${i.getMediaInfoForTime})`:i.isSyncRequest&&(T="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(T+=` with independent ${i.independent}`);const S=typeof f=="number",_=i.segment.uri?"segment":"pre-segment",A=S?Bf({preloadSegment:s})-1:0;return`${_} [${n+l}/${n+y}]`+(S?` part [${f}/${A}]`:"")+` segment start/end [${s.start} => ${s.end}]`+(S?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${m}] selected by [${T}] playlist [${a}]`},Wc=i=>`${i}TimingInfo`,_E=({segmentTimeline:i,currentTimeline:e,startOfSegment:t,buffered:s,overrideCheck:r})=>!r&&i===e?null:i{if(e===t)return!1;if(s==="audio"){const n=i.lastTimelineChange({type:"main"});return!n||n.to!==t}if(s==="main"&&r){const n=i.pendingTimelineChange({type:"audio"});return!(n&&n.to===t)}return!1},vE=i=>{let e=0;return["video","audio"].forEach(function(t){const s=i[`${t}TimingInfo`];if(!s)return;const{start:r,end:n}=s;let a;typeof r=="bigint"||typeof n=="bigint"?a=E.BigInt(n)-E.BigInt(r):typeof r=="number"&&typeof n=="number"&&(a=n-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&ei?Math.round(i)>e+vt:!1,TE=(i,e)=>{if(e!=="hls")return null;const t=vE({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!t)return null;const s=i.playlist.targetDuration,r=Xc({segmentDuration:t,maxDuration:s*2}),n=Xc({segmentDuration:t,maxDuration:s}),a=`Segment with index ${i.mediaIndex} from playlist ${i.playlist.id} has a duration of ${t} when the reported duration is ${i.duration} and the target duration is ${s}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||n?{severity:r?"warn":"info",message:a}:null};class Do extends L.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=ut(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(s){s!==this.state_&&(this.logger_(`${this.state_} -> ${s}`),this.state_=s,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()&&this.processCallQueue_()}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",()=>{this.hasEnoughInfoToLoad_()&&this.processLoadQueue_(),this.hasEnoughInfoToAppend_()&&this.processCallQueue_()})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Ha.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&E.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,E.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Ha.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return Le();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:s,isMuxed:r}=e;if(s&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(s)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const s=Tn(e);let r=this.initSegments_[s];return t&&!r&&e.bytes&&(this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const s=Zf(e);let r=this.keyCache_[s];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[s]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const n={resolvedUri:(r||e).resolvedUri};return r&&(n.bytes=r.bytes),n}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e)return;const s=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let n=null;if(s&&(s.id?n=s.id:s.uri&&(n=s.uri)),this.logger_(`playlist update [${n} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: +currentTime: ${this.currentTime_()} +bufferedEnd: ${ja(this.buffered_())} +`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!s||s.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-s.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const l=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=l}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(s,e)}pause(){this.checkBufferTimeout_&&(E.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Ha.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,s=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let n=1;const a=()=>{n--,n===0&&s()};(r||!this.audioDisabled_)&&(n++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=hE(this.gopBuffer_,e,t,this.timeMapping_),n++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)Fs(e,t,this.inbandTextTracks_[o]);Fs(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&E.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=E.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&E.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=E.setTimeout(this.monitorBufferTick_.bind(this),mE)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();e&&(typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,s=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],n=e+1===t.segments.length,a=!r||!r.parts||s+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&n&&a}chooseNextRequest_(){const e=this.buffered_(),t=ja(e)||0,s=Cu(e,this.currentTime_()),r=!this.hasPlayed_()&&s>=1,n=s>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||n)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=pE(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const T=a[this.mediaIndex],S=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=T.end?T.end:t,T.parts&&T.parts[S+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=S+1):o.mediaIndex=this.mediaIndex+1}else{let T,S,_;const A=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: +For TargetTime: ${A}. +CurrentTime: ${this.currentTime_()} +BufferedEnd: ${t} +Fetch At Buffer: ${this.fetchAtBuffer_} +`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const D=this.getSyncInfoFromMediaSequenceSync_(A);if(!D)return this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null;this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${D.start} --> ${D.end})`),T=D.segmentIndex,S=D.partIndex,_=D.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const D=Ge.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:A,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});T=D.segmentIndex,S=D.partIndex,_=D.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${A}`:`currentTime ${A}`,o.mediaIndex=T,o.startOfSegment=_,o.partIndex=S,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const l=a[o.mediaIndex];let f=l&&typeof o.partIndex=="number"&&l.parts&&l.parts[o.partIndex];if(!l||typeof o.partIndex=="number"&&!f)return null;typeof o.partIndex!="number"&&l.parts&&(o.partIndex=0,f=l.parts[0]);const m=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!s&&f&&!m&&!f.independent)if(o.partIndex===0){const T=a[o.mediaIndex-1],S=T.parts&&T.parts.length&&T.parts[T.parts.length-1];S&&S.independent&&(o.mediaIndex-=1,o.partIndex=T.parts.length-1,o.independent="previous segment")}else l.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&y&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const s=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!s)return null;if(!s.isAppended)return s;const r=this.mediaSequenceSync_.getSyncInfoForTime(s.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:s,mediaIndex:r,startOfSegment:n,isSyncRequest:a,partIndex:o,forceTimestampOffset:l,getMediaInfoForTime:f}=e,m=s.segments[r],y=typeof o=="number"&&m.parts[o],T={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||m.resolvedUri,mediaIndex:r,partIndex:y?o:null,isSyncRequest:a,startOfSegment:n,playlist:s,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:m.timeline,duration:y&&y.duration||m.duration,segment:m,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:f,independent:t},S=typeof l<"u"?l:this.isPendingTimestampOffset_;T.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:m.timeline,currentTimeline:this.currentTimeline_,startOfSegment:n,buffered:this.buffered_(),overrideCheck:S});const _=ja(this.sourceUpdater_.audioBuffered());return typeof _=="number"&&(T.audioAppendStart=_-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(T.gopsToAlignWith=cE(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),T}timestampOffsetForSegment_(e){return _E(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),s=e.bandwidth,r=this.pendingSegment_.duration,n=Ge.estimateSegmentRequestTime(r,s,this.playlist_,e.bytesReceived),a=qS(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(n<=a)return;const o=Zx({main:this.vhs_.playlists.main,currentTime:t,bandwidth:s,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const f=n-a-o.rebufferingImpact;let m=.5;a<=vt&&(m=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||f{n[a.stream]=n[a.stream]||{startTime:1/0,captions:[],endTime:0};const o=n[a.stream];o.startTime=Math.min(o.startTime,a.startTime+r),o.endTime=Math.max(o.endTime,a.endTime+r),o.captions.push(a)}),Object.keys(n).forEach(a=>{const{startTime:o,endTime:l,captions:f}=n[a],m=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${l} for ${a}`),iE(m,this.vhs_.tech_,a),Fs(o,l,m[a]),sE({captionArray:f,inbandTextTracks:m,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,s){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,s));return}this.addMetadataToTextTrack(s,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!Kc({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:s,hasVideo:r,isMuxed:n}=t;return!(r&&!e.videoTimingInfo||s&&!this.audioDisabled_&&!n&&!e.audioTimingInfo||Kc({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){this.callQueue_.push(this.handleData_.bind(this,e,t));return}const s=this.pendingSegment_;if(this.setTimeMapping_(s.timeline),this.updateMediaSecondsLoaded_(s.part||s.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),s.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),s.isFmp4=e.isFmp4,s.timingInfo=s.timingInfo||{},s.isFmp4)this.trigger("fmp4"),s.timingInfo.start=s[Wc(t.type)].start;else{const r=this.getCurrentMediaInfo_(),n=this.loaderType_==="main"&&r&&r.hasVideo;let a;n&&(a=s.videoTimingInfo.start),s.timingInfo.start=this.trueSegmentStart_({currentStart:s.timingInfo.start,playlist:s.playlist,mediaIndex:s.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:n,firstVideoFrameTimeForData:a,videoTimingInfo:s.videoTimingInfo,audioTimingInfo:s.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(s,t.type),this.updateSourceBufferTimestampOffset_(s),s.isSyncRequest){this.updateTimingInfoEnd_(s),this.syncController_.saveSegmentTimingInfo({segmentInfo:s,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==s.mediaIndex||r.partIndex!==s.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}s.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(s,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:s,playlist:r}){if(s){const n=Tn(s);if(this.activeInitSegmentId_===n)return null;t=this.initSegmentForMap(s,!0).bytes,this.activeInitSegmentId_=n}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s},r){const n=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();n.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+fi(n).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+fi(a).join(", "));const o=n.length?n.start(0):0,l=n.length?n.end(n.length-1):0,f=a.length?a.start(0):0,m=a.length?a.end(a.length-1):0;if(l-o<=Ls&&m-f<=Ls){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${s.byteLength}, audio buffer: ${fi(n).join(", ")}, video buffer: ${fi(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0,metadata:{errorType:L.Error.SegmentExceedsSourceBufferQuota}}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:s}));const T=this.currentTime_()-Ls;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${T}`),this.remove(0,T,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Ls}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=E.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Ls*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:s},r){if(r){if(r.code===yp){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:s});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${s.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:L.Error.SegmentAppendError}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:s,data:r,bytes:n}){if(!n){const a=[r];let o=r.byteLength;s&&(a.unshift(s),o+=s.byteLength),n=tE({bytes:o,segments:a})}this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:n},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:n}))}handleSegmentTimingInfo_(e,t,s){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,n=`${e}TimingInfo`;r[n]||(r[n]={}),r[n].transmuxerPrependedSeconds=s.prependedContentDuration||0,r[n].transmuxedPresentationStart=s.start.presentation,r[n].transmuxedDecodeStart=s.start.decode,r[n].transmuxedPresentationEnd=s.end.presentation,r[n].transmuxedDecodeEnd=s.end.decode,r[n].baseMediaDecodeTime=s.baseMediaDecodeTime}appendData_(e,t){const{type:s,data:r}=t;if(!r||!r.byteLength||s==="audio"&&this.audioDisabled_)return;const n=this.getInitSegmentAndUpdateState_({type:s,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:s,initSegment:n,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){this.loadQueue_.push(()=>{const t=rt({},e,{forceTimestampOffset:!0});rt(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),s=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,n=e.timeline!==this.currentTimeline_&&e.timeline>0,a=s||r&&n;this.logger_(`Requesting +${gp(e.uri)} +${Ii(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=Wx({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:l,stream:f})=>{this.logger_(`${Ii(e)} logged from transmuxer stream ${f} as a ${l}: ${o}`)}})}trimBackBuffer_(e){const t=yE(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,s=e.part,r={resolvedUri:s?s.resolvedUri:t.resolvedUri,byterange:s?s.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},n=e.playlist.segments[e.mediaIndex-1];if(n&&n.timeline===t.timeline&&(n.videoTimingInfo?r.baseStartTime=n.videoTimingInfo.transmuxedDecodeEnd:n.audioTimingInfo&&(r.baseStartTime=n.audioTimingInfo.transmuxedDecodeEnd)),t.key){const a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);r.key=this.segmentKey(t.key),r.key.iv=a}return t.map&&(r.map=this.initSegmentForMap(t.map)),r}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e"u"||f.end!==r+n?r:o.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0,metadata:{errorType:L.Error.SegmentUnsupportedMediaFormat}}),this.trigger("error");return}const{hasAudio:s,hasVideo:r,isMuxed:n}=t,a=this.loaderType_==="main"&&r,o=!this.audioDisabled_&&s&&!n;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=gE(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0,metadata:{errorType:L.Error.SegmentSwitchError}}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:s}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:s.start:s.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=TE(e,this.sourceType_);if(t&&(t.severity==="warn"?L.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Ii(e)}`);return}this.logger_(`Appended ${Ii(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const s=e.segment,r=e.part,n=s.end&&this.currentTime_()-s.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(n||a){this.logger_(`bad ${n?"segment":"part"} ${Ii(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},bE=["video","audio"],wo=(i,e)=>{const t=e[`${i}Buffer`];return t&&t.updating||e.queuePending[i]},SE=(i,e)=>{for(let t=0;t{if(e.queue.length===0)return;let t=0,s=e.queue[t];if(s.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),s.action(e),s.doneFn&&s.doneFn(),Gi("audio",e),Gi("video",e));return}if(i!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||wo(i,e))){if(s.type!==i){if(t=SE(i,e.queue),t===null)return;s=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[i]=s,s.action(i,e),!s.doneFn){e.queuePending[i]=null,Gi(i,e);return}}},vp=(i,e)=>{const t=e[`${i}Buffer`],s=_p(i);t&&(t.removeEventListener("updateend",e[`on${s}UpdateEnd_`]),t.removeEventListener("error",e[`on${s}Error_`]),e.codecs[i]=null,e[`${i}Buffer`]=null)},yt=(i,e)=>i&&e&&Array.prototype.indexOf.call(i.sourceBuffers,e)!==-1,Qe={appendBuffer:(i,e,t)=>(s,r)=>{const n=r[`${s}Buffer`];if(yt(r.mediaSource,n)){r.logger_(`Appending segment ${e.mediaIndex}'s ${i.length} bytes to ${s}Buffer`);try{n.appendBuffer(i)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===yp?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${s}Buffer`),r.queuePending[s]=null,t(a)}}},remove:(i,e)=>(t,s)=>{const r=s[`${t}Buffer`];if(yt(s.mediaSource,r)){s.logger_(`Removing ${i} to ${e} from ${t}Buffer`);try{r.remove(i,e)}catch{s.logger_(`Remove ${i} to ${e} from ${t}Buffer failed`)}}},timestampOffset:i=>(e,t)=>{const s=t[`${e}Buffer`];yt(t.mediaSource,s)&&(t.logger_(`Setting ${e}timestampOffset to ${i}`),s.timestampOffset=i)},callback:i=>(e,t)=>{i()},endOfStream:i=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${i||""})`);try{e.mediaSource.endOfStream(i)}catch(t){L.log.warn("Failed to call media source endOfStream",t)}}},duration:i=>e=>{e.logger_(`Setting mediaSource duration to ${i}`);try{e.mediaSource.duration=i}catch(t){L.log.warn("Failed to set media source duration",t)}},abort:()=>(i,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${i}Buffer`];if(yt(e.mediaSource,t)){e.logger_(`calling abort on ${i}Buffer`);try{t.abort()}catch(s){L.log.warn(`Failed to abort on ${i}Buffer`,s)}}},addSourceBuffer:(i,e)=>t=>{const s=_p(i),r=Ws(e);t.logger_(`Adding ${i}Buffer with codec ${e} to mediaSource`);const n=t.mediaSource.addSourceBuffer(r);n.addEventListener("updateend",t[`on${s}UpdateEnd_`]),n.addEventListener("error",t[`on${s}Error_`]),t.codecs[i]=e,t[`${i}Buffer`]=n},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];if(vp(i,e),!!yt(e.mediaSource,t)){e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(s){L.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,s)}}},changeType:i=>(e,t)=>{const s=t[`${e}Buffer`],r=Ws(i);if(!yt(t.mediaSource,s))return;const n=i.substring(0,i.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))!==n){t.logger_(`changing ${e}Buffer codec from ${t.codecs[e]} to ${i}`);try{s.changeType(r),t.codecs[e]=i}catch(l){L.log.warn(`Failed to changeType on ${e}Buffer`,l)}}}},Je=({type:i,sourceUpdater:e,action:t,doneFn:s,name:r})=>{e.queue.push({type:i,action:t,doneFn:s,name:r}),Gi(i,e)},Yc=(i,e)=>t=>{const s=e[`${i}Buffered`](),r=FS(s);if(e.logger_(`received "updateend" event for ${i} Source Buffer: `,r),e.queuePending[i]){const n=e.queuePending[i].doneFn;e.queuePending[i]=null,n&&n(e[`${i}Error_`])}Gi(i,e)};class Tp extends L.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Gi("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=ut("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=Yc("video",this),this.onAudioUpdateEnd_=Yc("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){Je({type:"mediaSource",sourceUpdater:this,action:Qe.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){Je({type:e,sourceUpdater:this,action:Qe.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){L.log.error("removeSourceBuffer is not supported!");return}Je({type:"mediaSource",sourceUpdater:this,action:Qe.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!L.browser.IS_FIREFOX&&E.MediaSource&&E.MediaSource.prototype&&typeof E.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return E.SourceBuffer&&E.SourceBuffer.prototype&&typeof E.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){L.log.error("changeType is not supported!");return}Je({type:e,sourceUpdater:this,action:Qe.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const s=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,s);this.canChangeType()&&this.changeType(t,s)})}appendBuffer(e,t){const{segmentInfo:s,type:r,bytes:n}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${n.length} until video append`);return}const a=t;if(Je({type:r,sourceUpdater:this,action:Qe.appendBuffer(n,s||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(l=>{this.appendBuffer.apply(this,l)})}}audioBuffered(){return yt(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:Le()}videoBuffered(){return yt(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:Le()}buffered(){const e=yt(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=yt(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():$S(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Rt){Je({type:"mediaSource",sourceUpdater:this,action:Qe.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Rt){typeof e!="string"&&(e=void 0),Je({type:"mediaSource",sourceUpdater:this,action:Qe.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,s=Rt){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){s();return}Je({type:"audio",sourceUpdater:this,action:Qe.remove(e,t),doneFn:s,name:"remove"})}removeVideo(e,t,s=Rt){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){s();return}Je({type:"video",sourceUpdater:this,action:Qe.remove(e,t),doneFn:s,name:"remove"})}updating(){return!!(wo("audio",this)||wo("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(Je({type:"audio",sourceUpdater:this,action:Qe.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset!==e&&(Je({type:"video",sourceUpdater:this,action:Qe.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&Je({type:"audio",sourceUpdater:this,action:Qe.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&Je({type:"video",sourceUpdater:this,action:Qe.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),bE.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>vp(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const Qc=i=>decodeURIComponent(escape(String.fromCharCode.apply(null,i))),xE=i=>{const e=new Uint8Array(i);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},Jc=new Uint8Array(` + +`.split("").map(i=>i.charCodeAt(0)));class EE extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class CE extends Do{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}createTransmuxer_(){return null}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return Le();const e=this.subtitlesTrack_.cues,t=e[0].startTime,s=e[e.length-1].startTime;return Le([[t,s]])}initSegmentForMap(e,t=!1){if(!e)return null;const s=Tn(e);let r=this.initSegments_[s];if(t&&!r&&e.bytes){const n=Jc.byteLength+e.bytes.byteLength,a=new Uint8Array(n);a.set(e.bytes),a.set(Jc,e.bytes.byteLength),this.initSegments_[s]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){Fs(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,s){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===bt.TIMEOUT&&this.handleTimeout_(),e.code===bt.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const n=r.segment;if(n.map&&(n.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof E.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,s),()=>this.stopForError({message:"Error loading vtt.js",metadata:{errorType:L.Error.VttLoadError}}));return}n.requested=!0;try{this.parseVTTCues_(r)}catch(a){this.stopForError({message:a.message,metadata:{errorType:L.Error.VttCueParsingError}});return}if(this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=n.duration,r.cues.forEach(a=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new E.VTTCue(a.startTime,a.endTime,a.text):a)}),lE(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(){}updateTimingInfoEnd_(){}parseVTTCues_(e){let t,s=!1;if(typeof E.WebVTT!="function")throw new EE;typeof E.TextDecoder=="function"?t=new E.TextDecoder("utf8"):(t=E.WebVTT.StringDecoder(),s=!0);const r=new E.WebVTT.Parser(E,E.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{L.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;s&&(a=Qc(a)),r.parse(a)}let n=e.bytes;s&&(n=Qc(n)),r.parse(n),r.flush()}updateTimeMapping_(e,t,s){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:n,LOCAL:a}=e.timestampmap,l=n/hi.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(f=>{const m=f.endTime-f.startTime,y=n===0?f.startTime+l:this.handleRollover_(f.startTime+l,t.time);f.startTime=Math.max(y,0),f.endTime=Math.max(y+m,0)}),!s.syncInfo){const f=e.cues[0].startTime,m=e.cues[e.cues.length-1].startTime;s.syncInfo={mediaSequence:s.mediaSequence+e.mediaIndex,time:Math.min(f,m-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let s=e*hi.ONE_SECOND_IN_TS;const r=t*hi.ONE_SECOND_IN_TS;let n;for(r4294967296;)s+=n;return s/hi.ONE_SECOND_IN_TS}}const AE=function(i,e){const t=i.cues;for(let s=0;s=r.adStartTime&&e<=r.adEndTime)return r}return null},DE=function(i,e,t=0){if(!i.segments)return;let s=t,r;for(let n=0;n=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class Ga{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:s,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(s,r),!!this.isReliable_)return this.updateStorage_(r,s,this.calculateBaseTime_(s,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:s}of this.storage_.values())if(s.length){for(const r of s)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}updateStorage_(e,t,s){const r=new Map;let n=` +`,a=s,o=t;this.start_=a,e.forEach((l,f)=>{const m=this.storage_.get(o),y=a,T=y+l.duration,S=!!(m&&m.segmentSyncInfo&&m.segmentSyncInfo.isAppended),_=new Zc({start:y,end:T,appended:S,segmentIndex:f});l.syncInfo=_;let A=a;const D=(l.parts||[]).map((w,k)=>{const M=A,R=A+w.duration,P=!!(m&&m.partsSyncInfo&&m.partsSyncInfo[k]&&m.partsSyncInfo[k].isAppended),U=new Zc({start:M,end:R,appended:P,segmentIndex:f,partIndex:k});return A=R,n+=`Media Sequence: ${o}.${k} | Range: ${M} --> ${R} | Appended: ${P} +`,w.syncInfo=U,U});r.set(o,new wE(_,D)),n+=`${gp(l.resolvedUri)} | Media Sequence: ${o} | Range: ${y} --> ${T} | Appended: ${S} +`,o++,a=T}),this.end_=a,this.storage_=r,this.diagnostics_=n}calculateBaseTime_(e,t){return this.storage_.size?this.storage_.has(e)?this.storage_.get(e).segmentSyncInfo.start:t:0}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}const kE=86400,za=[{name:"VOD",run:(i,e,t,s,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(i,e,t,s,r,n)=>{const a=i.getMediaSequenceSync(n);if(!a||!a.isReliable)return null;const o=a.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(i,e,t,s,r)=>{if(!Object.keys(i.timelineToDatetimeMappings).length)return null;let n=null,a=null;const o=vo(e);r=r||0;for(let l=0;l{let n=null,a=null;r=r||0;const o=vo(e);for(let l=0;l=S)&&(a=S,n={time:T,segmentIndex:m.segmentIndex,partIndex:m.partIndex})}}return n}},{name:"Discontinuity",run:(i,e,t,s,r)=>{let n=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o=y)&&(a=y,n={time:m.time,segmentIndex:l,partIndex:null})}}}return n}},{name:"Playlist",run:(i,e,t,s,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class IE extends L.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={},this.mediaSequenceStorage_={main:new Ga,audio:new Ga,vtt:new Ga},this.logger_=ut("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,s,r,n){if(t!==1/0)return za.find(({name:l})=>l==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,s,r,n);if(!a.length)return null;for(const o of a){const{syncPoint:l,strategy:f}=o,{segmentIndex:m,time:y}=l;if(m<0)continue;const T=e.segments[m],S=y,_=S+T.duration;if(this.logger_(`Strategy: ${f}. Current time: ${r}. selected segment: ${m}. Time: [${S} -> ${_}]}`),r>=S&&r<_)return this.logger_("Found sync point with exact match: ",l),l}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const s=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!s.length)return null;const r=this.selectSyncPoint_(s,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+Hs({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,s,r,n){const a=[];for(let o=0;okE){L.log.warn(`Not saving expired segment info. Media sequence gap ${s} is too large.`);return}for(let r=s-1;r>=0;r--){const n=e.segments[r];if(n&&typeof n.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:n.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],s=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-s}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const s=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;s&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const n=r.dateTimeObject;r.discontinuity&&t&&n&&(this.timelineToDatetimeMappings[r.timeline]=-(n.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,s){const r=e.segment,n=e.part;let a=this.timelines[e.timeline],o,l;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},s&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,l=t.end+a.mapping;else if(a)o=t.start+a.mapping,l=t.end+a.mapping;else return!1;return n&&(n.start=o,n.end=l),(!r.start||ol){let f;o<0?f=s.start-Hs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:n}):f=s.end+Hs({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:n}),this.discontinuities[a]={time:f,accuracy:l}}}}dispose(){this.trigger("dispose"),this.off()}}class PE extends L.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:s}){return typeof t=="number"&&typeof s=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:s},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:s}){return typeof t=="number"&&typeof s=="number"&&(this.lastTimelineChanges_[e]={type:e,from:t,to:s},delete this.pendingTimelineChanges_[e],this.trigger("timelinechange")),this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const LE=np(ap(function(){var i=function(){function A(){this.listeners={}}var D=A.prototype;return D.on=function(k,M){this.listeners[k]||(this.listeners[k]=[]),this.listeners[k].push(M)},D.off=function(k,M){if(!this.listeners[k])return!1;var R=this.listeners[k].indexOf(M);return this.listeners[k]=this.listeners[k].slice(0),this.listeners[k].splice(R,1),R>-1},D.trigger=function(k){var M=this.listeners[k];if(M)if(arguments.length===2)for(var R=M.length,P=0;P>7)*283)^R]=R;for(P=U=0;!k[P];P^=X||1,U=Q[U]||1)for(he=U^U<<1^U<<2^U<<3^U<<4,he=he>>8^he&255^99,k[P]=he,M[he]=P,ee=j[le=j[X=j[P]]],te=ee*16843009^le*65537^X*257^P*16843008,V=j[he]*257^he*16843008,R=0;R<4;R++)D[R][P]=V=V<<24^V>>>8,w[R][he]=te=te<<24^te>>>8;for(R=0;R<5;R++)D[R]=D[R].slice(0),w[R]=w[R].slice(0);return A};let s=null;class r{constructor(D){s||(s=t()),this._tables=[[s[0][0].slice(),s[0][1].slice(),s[0][2].slice(),s[0][3].slice(),s[0][4].slice()],[s[1][0].slice(),s[1][1].slice(),s[1][2].slice(),s[1][3].slice(),s[1][4].slice()]];let w,k,M;const R=this._tables[0][4],P=this._tables[1],U=D.length;let j=1;if(U!==4&&U!==6&&U!==8)throw new Error("Invalid aes key size");const Q=D.slice(0),X=[];for(this._key=[Q,X],w=U;w<4*U+28;w++)M=Q[w-1],(w%U===0||U===8&&w%U===4)&&(M=R[M>>>24]<<24^R[M>>16&255]<<16^R[M>>8&255]<<8^R[M&255],w%U===0&&(M=M<<8^M>>>24^j<<24,j=j<<1^(j>>7)*283)),Q[w]=Q[w-U]^M;for(k=0;w;k++,w--)M=Q[k&3?w:w-4],w<=4||k<4?X[k]=M:X[k]=P[0][R[M>>>24]]^P[1][R[M>>16&255]]^P[2][R[M>>8&255]]^P[3][R[M&255]]}decrypt(D,w,k,M,R,P){const U=this._key[1];let j=D^U[0],Q=M^U[1],X=k^U[2],le=w^U[3],ee,he,V;const te=U.length/4-2;let Xe,ie=4;const Te=this._tables[1],kt=Te[0],Zt=Te[1],ei=Te[2],ti=Te[3],ii=Te[4];for(Xe=0;Xe>>24]^Zt[Q>>16&255]^ei[X>>8&255]^ti[le&255]^U[ie],he=kt[Q>>>24]^Zt[X>>16&255]^ei[le>>8&255]^ti[j&255]^U[ie+1],V=kt[X>>>24]^Zt[le>>16&255]^ei[j>>8&255]^ti[Q&255]^U[ie+2],le=kt[le>>>24]^Zt[j>>16&255]^ei[Q>>8&255]^ti[X&255]^U[ie+3],ie+=4,j=ee,Q=he,X=V;for(Xe=0;Xe<4;Xe++)R[(3&-Xe)+P]=ii[j>>>24]<<24^ii[Q>>16&255]<<16^ii[X>>8&255]<<8^ii[le&255]^U[ie++],ee=j,j=Q,Q=X,X=le,le=ee}}class n extends i{constructor(){super(i),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(D){this.jobs.push(D),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(A){return A<<24|(A&65280)<<8|(A&16711680)>>8|A>>>24},o=function(A,D,w){const k=new Int32Array(A.buffer,A.byteOffset,A.byteLength>>2),M=new r(Array.prototype.slice.call(D)),R=new Uint8Array(A.byteLength),P=new Int32Array(R.buffer);let U,j,Q,X,le,ee,he,V,te;for(U=w[0],j=w[1],Q=w[2],X=w[3],te=0;te{const k=A[w];T(k)?D[w]={bytes:k.buffer,byteOffset:k.byteOffset,byteLength:k.byteLength}:D[w]=k}),D};self.onmessage=function(A){const D=A.data,w=new Uint8Array(D.encrypted.bytes,D.encrypted.byteOffset,D.encrypted.byteLength),k=new Uint32Array(D.key.bytes,D.key.byteOffset,D.key.byteLength/4),M=new Uint32Array(D.iv.bytes,D.iv.byteOffset,D.iv.byteLength/4);new l(w,k,M,function(R,P){self.postMessage(_({source:D.source,decrypted:P}),[P.buffer])})}}));var OE=rp(LE);const RE=i=>{let e=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},bp=(i,e)=>{i.abort(),i.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},ko=(i,e)=>{e.activePlaylistLoader=i,i.load()},ME=(i,e)=>()=>{const{segmentLoaders:{[i]:t,main:s},mediaTypes:{[i]:r}}=e,n=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,l=r.lastGroup_;if(!(a&&l&&a.id===l.id)&&(r.lastGroup_=a,r.lastTrack_=n,bp(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&s.resetEverything();return}t.resyncLoader(),ko(a.playlistLoader,r)}},NE=(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:s}}=e;s.lastGroup_=null,t.abort(),t.pause()},BE=(i,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[i]:s,main:r},mediaTypes:{[i]:n}}=e,a=n.activeTrack(),o=n.getActiveGroup(),l=n.activePlaylistLoader,f=n.lastTrack_;if(!(f&&a&&f.id===a.id)&&(n.lastGroup_=o,n.lastTrack_=a,bp(s,n),!!o)){if(o.isMainPlaylist){if(!a||!f||a.id===f.id)return;const m=e.vhs.playlistController_,y=m.selectPlaylist();if(m.media()===y)return;n.logger_(`track change. Switching main audio from ${f.id} to ${a.id}`),t.pause(),r.resetEverything(),m.fastQualityChange_(y);return}if(i==="AUDIO"){if(!o.playlistLoader){r.setAudio(!0),r.resetEverything();return}s.setAudio(!0),r.setAudio(!1)}if(l===o.playlistLoader){ko(o.playlistLoader,n);return}s.track&&s.track(a),s.resetEverything(),ko(o.playlistLoader,n)}},xn={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:t},excludePlaylist:s}=e,r=t.activeTrack(),n=t.activeGroup(),a=(n.filter(l=>l.default)[0]||n[0]).id,o=t.tracks[a];if(r===o){s({error:{message:"Problem encountered loading the default audio track."}});return}L.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const l in t.tracks)t.tracks[l].enabled=t.tracks[l]===o;t.onTrackChanged()},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:t}}=e;L.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const s=t.activeTrack();s&&(s.mode="disabled"),t.onTrackChanged()}},ed={AUDIO:(i,e,t)=>{if(!e)return;const{tech:s,requestOptions:r,segmentLoaders:{[i]:n}}=t;e.on("loadedmetadata",()=>{const a=e.media();n.playlist(a,r),(!s.paused()||a.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",xn[i](i,t))},SUBTITLES:(i,e,t)=>{const{tech:s,requestOptions:r,segmentLoaders:{[i]:n},mediaTypes:{[i]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();n.playlist(o,r),n.track(a.activeTrack()),(!s.paused()||o.endList&&s.preload()!=="none")&&n.load()}),e.on("loadedplaylist",()=>{n.playlist(e.media(),r),s.paused()||n.load()}),e.on("error",xn[i](i,t))}},FE={AUDIO:(i,e)=>{const{vhs:t,sourceType:s,segmentLoaders:{[i]:r},requestOptions:n,main:{mediaGroups:a},mediaTypes:{[i]:{groups:o,tracks:l,logger_:f}},mainPlaylistLoader:m}=e,y=dr(m.main);(!a[i]||Object.keys(a[i]).length===0)&&(a[i]={main:{default:{default:!0}}},y&&(a[i].main.default.playlists=m.main.playlists));for(const T in a[i]){o[T]||(o[T]=[]);for(const S in a[i][T]){let _=a[i][T][S],A;if(y?(f(`AUDIO group '${T}' label '${S}' is a main playlist`),_.isMainPlaylist=!0,A=null):s==="vhs-json"&&_.playlists?A=new Bi(_.playlists[0],t,n):_.resolvedUri?A=new Bi(_.resolvedUri,t,n):_.playlists&&s==="dash"?A=new Co(_.playlists[0],t,n,m):A=null,_=se({id:S,playlistLoader:A},_),ed[i](i,_.playlistLoader,e),o[T].push(_),typeof l[S]>"u"){const D=new L.AudioTrack({id:S,kind:RE(_),enabled:!1,language:_.language,default:_.default,label:S});l[S]=D}}}r.on("error",xn[i](i,e))},SUBTITLES:(i,e)=>{const{tech:t,vhs:s,sourceType:r,segmentLoaders:{[i]:n},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[i]:{groups:l,tracks:f}},mainPlaylistLoader:m}=e;for(const y in o[i]){l[y]||(l[y]=[]);for(const T in o[i][y]){if(!s.options_.useForcedSubtitles&&o[i][y][T].forced)continue;let S=o[i][y][T],_;if(r==="hls")_=new Bi(S.resolvedUri,s,a);else if(r==="dash"){if(!S.playlists.filter(D=>D.excludeUntil!==1/0).length)return;_=new Co(S.playlists[0],s,a,m)}else r==="vhs-json"&&(_=new Bi(S.playlists?S.playlists[0]:S.resolvedUri,s,a));if(S=se({id:T,playlistLoader:_},S),ed[i](i,S.playlistLoader,e),l[y].push(S),typeof f[T]>"u"){const A=t.addRemoteTextTrack({id:T,kind:"subtitles",default:S.default&&S.autoselect,language:S.language,label:T},!1).track;f[T]=A}}}n.on("error",xn[i](i,e))},"CLOSED-CAPTIONS":(i,e)=>{const{tech:t,main:{mediaGroups:s},mediaTypes:{[i]:{groups:r,tracks:n}}}=e;for(const a in s[i]){r[a]||(r[a]=[]);for(const o in s[i][a]){const l=s[i][a][o];if(!/^(?:CC|SERVICE)/.test(l.instreamId))continue;const f=t.options_.vhs&&t.options_.vhs.captionServices||{};let m={label:o,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(f[m.instreamId]&&(m=se(m,f[m.instreamId])),m.default===void 0&&delete m.default,r[a].push(se({id:o},l)),typeof n[o]>"u"){const y=t.addRemoteTextTrack({id:m.instreamId,kind:"captions",default:m.default,language:m.language,label:m.label},!1).track;n[o]=y}}}}},Sp=(i,e)=>{for(let t=0;tt=>{const{mainPlaylistLoader:s,mediaTypes:{[i]:{groups:r}}}=e,n=s.media();if(!n)return null;let a=null;n.attributes[i]&&(a=r[n.attributes[i]]);const o=Object.keys(r);if(!a)if(i==="AUDIO"&&o.length>1&&dr(e.main))for(let l=0;l"u"?a:t===null||!a?null:a.filter(l=>l.id===t.id)[0]||null},$E={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].enabled)return t[s];return null},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const s in t)if(t[s].mode==="showing"||t[s].mode==="hidden")return t[s];return null}},qE=(i,{mediaTypes:e})=>()=>{const t=e[i].activeTrack();return t?e[i].activeGroup(t):null},jE=i=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(f=>{FE[f](f,i)});const{mediaTypes:e,mainPlaylistLoader:t,tech:s,vhs:r,segmentLoaders:{["AUDIO"]:n,main:a}}=i;["AUDIO","SUBTITLES"].forEach(f=>{e[f].activeGroup=UE(f,i),e[f].activeTrack=$E[f](f,i),e[f].onGroupChanged=ME(f,i),e[f].onGroupChanging=NE(f,i),e[f].onTrackChanged=BE(f,i),e[f].getActiveGroup=qE(f,i)});const o=e.AUDIO.activeGroup();if(o){const f=(o.filter(y=>y.default)[0]||o[0]).id;e.AUDIO.tracks[f].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),n.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(f=>e[f].onGroupChanging())});const l=()=>{e.AUDIO.onTrackChanged(),s.trigger({type:"usage",name:"vhs-audio-change"})};s.audioTracks().addEventListener("change",l),s.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{s.audioTracks().removeEventListener("change",l),s.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),s.clearTracks("audio");for(const f in e.AUDIO.tracks)s.audioTracks().addTrack(e.AUDIO.tracks[f])},VE=()=>{const i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Rt,activeTrack:Rt,getActiveGroup:Rt,onGroupChanged:Rt,onTrackChanged:Rt,lastTrack_:null,logger_:ut(`MediaGroups[${e}]`)}}),i};class td{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=He(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class HE extends L.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new td,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=ut("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const s=t.serverUri||t.serverURL;if(!s){this.logger_(`steering manifest URL is ${s}, cannot request steering manifest.`),this.trigger("error");return}if(s.startsWith("data:")){this.decodeDataUriManifest_(s.substring(s.indexOf(",")+1));return}this.steeringManifest.reloadUri=He(e,s),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const s=e?t:this.getRequestURI(t);if(!s){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}this.request_=this.xhr_({uri:s,requestType:"content-steering-manifest"},(r,n)=>{if(r){if(n.status===410){this.logger_(`manifest request 410 ${r}.`),this.logger_(`There will be no more content steering requests to ${s} this session.`),this.excludedSteeringManifestURLs.add(s);return}if(n.status===429){const o=n.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${r}.`),this.logger_(`content steering will retry in ${o} seconds.`),this.startTTLTimeout_(parseInt(o,10));return}this.logger_(`manifest failed to load ${r}.`),this.startTTLTimeout_();return}const a=JSON.parse(this.request_.responseText);this.assignSteeringProperties_(a),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new E.URL(e),s=new E.URL(this.proxyServerUrl_);return s.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(s.toString())}decodeDataUriManifest_(e){const t=JSON.parse(E.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new E.URL(e),s=this.getPathway(),r=this.getBandwidth_();if(s){const n=`_${this.manifestType_}_pathway`;t.searchParams.set(n,s)}if(r){const n=`_${this.manifestType_}_throughput`;t.searchParams.set(n,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const s=(r=>{for(const n of r)if(this.availablePathways_.has(n))return n;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==s&&(this.currentPathway=s,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const s=this.setSteeringParams_(e);return t(s)?null:s}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=E.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){E.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new td}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(He(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const GE=10;let Lt;const zE=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],WE=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},KE=function({currentPlaylist:i,buffered:e,currentTime:t,nextPlaylist:s,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:a,bufferBasedABR:o,log:l}){if(!s)return L.log.warn("We received no playlist to switch to. Please check your stream."),!1;const f=`allowing switch ${i&&i.id||"null"} -> ${s.id}`;if(!i)return l(`${f} as current playlist is not set`),!0;if(s.id===i.id)return!1;const m=!!Ni(e,t).length;if(!i.endList)return!m&&typeof i.partTargetDuration=="number"?(l(`not ${f} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(l(`${f} as current playlist is live`),!0);const y=Cu(e,t),T=o?De.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:De.MAX_BUFFER_LOW_WATER_LINE;if(a_)&&y>=r){let A=`${f} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return o&&(A+=` and next bandwidth > current bandwidth (${S} > ${_})`),l(A),!0}return l(`not ${f} as no switching criteria met`),!1};class XE extends L.EventTarget{constructor(e){super();const{src:t,withCredentials:s,tech:r,bandwidth:n,externVhs:a,useCueTags:o,playlistExclusionDuration:l,enableLowInitialPlaylist:f,sourceType:m,cacheEncryptionKeys:y,bufferBasedABR:T,leastPixelDiffSelector:S,captionServices:_}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:A}=e;(A===null||typeof A>"u")&&(A=1/0),Lt=a,this.bufferBasedABR=!!T,this.leastPixelDiffSelector=!!S,this.withCredentials=s,this.tech_=r,this.vhs_=r.vhs,this.sourceType_=m,this.useCueTags_=o,this.playlistExclusionDuration=l,this.maxPlaylistRetries=A,this.enableLowInitialPlaylist=f,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:s,maxPlaylistRetries:A,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=VE(),this.mediaSource=new E.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_=Le(),this.hasPlayed_=!1,this.syncController_=new IE(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.decrypter_=new OE,this.sourceUpdater_=new Tp(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new PE,this.keyStatusMap_=new Map;const D={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:_,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:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Co(t,this.vhs_,se(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Bi(t,this.vhs_,se(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Do(se(D,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Do(se(D,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new CE(se(D,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((M,R)=>{function P(){r.off("vttjserror",U),M()}function U(){r.off("vttjsloaded",P),R()}r.one("vttjsloaded",P),r.one("vttjserror",U),r.addWebVttScript_()})}),e);const w=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new HE(this.vhs_.xhr,w),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),zE.forEach(M=>{this[M+"_"]=WE.bind(this,M)}),this.logger_=ut("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const k=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(k,()=>{const M=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-M,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,s){const r=this.media(),n=r&&(r.id||r.uri),a=e&&(e.id||e.uri);n&&n!==a&&(this.logger_(`switch media ${n} -> ${a} from ${t}`),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})),this.mainPlaylistLoader_.media(e,s)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],s=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(s&&r){const a=(s.length?s[0].playlists:s.playlists).filter(o=>o.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=E.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(E.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const s=e.mediaGroups.AUDIO,r=Object.keys(s);let n;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)n=this.mediaTypes_.AUDIO.activeTrack();else{const o=s.main||r.length&&s[r[0]];for(const l in o)if(o[l].default){n={label:l};break}}if(!n)return t;const a=[];for(const o in s)if(s[o][n.label]){const l=s[o][n.label];if(l.playlists&&l.playlists.length)a.push.apply(a,l.playlists);else if(l.uri)a.push(l);else if(e.playlists.length)for(let f=0;f{const e=this.mainPlaylistLoader_.media(),t=e.targetDuration*1.5*1e3;To(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,e.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.mainSegmentLoader_.load()),jE({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(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let e=this.mainPlaylistLoader_.media();if(!e){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let t;if(this.enableLowInitialPlaylist&&(t=this.selectInitialPlaylist()),t||(t=this.selectPlaylist()),!t||!this.shouldSwitchToMedia_(t)||(this.initialMedia_=t,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;e=this.initialMedia_}this.handleUpdatedMediaPlaylist(e)}),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(),t=e.targetDuration*1.5*1e3;To(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=t,this.sourceType_==="dash"&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const e=this.mainPlaylistLoader_.media();if(e.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(e)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const s=e.mediaGroups||{};let r=!0;const n=Object.keys(s.AUDIO);for(const a in s.AUDIO)for(const o in s.AUDIO[a])s.AUDIO[a][o].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(s.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),Lt.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),n.length&&Object.keys(s.AUDIO[n[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,s=this.tech_.currentTime(),r=this.bufferLowWaterLine(),n=this.bufferHighWaterLine(),a=this.tech_.buffered();return KE({buffered:a,currentTime:s,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:n,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const t=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",t=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:GE}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const t=this.getCodecsOrExclude_();t&&this.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(()=>{this.tech_.setCurrentTime(this.tech_.currentTime())})}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const s=this.syncController_.getExpiredTime(e,this.duration());if(s===null)return!1;const r=Lt.Playlist.playlistEnd(e,s),n=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-n<=Tt;const o=a.end(a.length-1);return o-n<=Tt&&r-o<=Tt}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:s}){if(e=e||this.mainPlaylistLoader_.media(),s=s||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,n=r.filter(Yn),a=n.length===1&&n[0]===e;if(r.length===1&&s!==1/0)return L.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const _=this.pathwayAttribute_(e),A=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(_),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(_)},A);return}let S=!1;r.forEach(_=>{if(_===e)return;const A=_.excludeUntil;typeof A<"u"&&A!==1/0&&(S=!0,delete _.excludeUntil)}),S&&(L.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+s*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const l=this.selectPlaylist();if(!l){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const f=t.internal?this.logger_:L.log.warn,m=t.message?" "+t.message:"";f(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${m} Switching to playlist ${l.id}.`),l.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),l.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const y=l.targetDuration/2*1e3||5*1e3,T=typeof l.lastRequest=="number"&&Date.now()-l.lastRequest<=y;return this.switchMedia_(l,"exclude",a||T)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const s=[],r=e==="all";(r||e==="main")&&s.push(this.mainPlaylistLoader_);const n=[];(r||e==="audio")&&n.push("AUDIO"),(r||e==="subtitle")&&(n.push("CLOSED-CAPTIONS"),n.push("SUBTITLES")),n.forEach(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&s.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&s.push(o)}),s.forEach(a=>t.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const t=Ni(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Lt.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}onSyncInfoUpdate_(){let e;if(!this.mainPlaylistLoader_)return;let t=this.mainPlaylistLoader_.media();if(!t)return;let s=this.syncController_.getExpiredTime(t,this.duration());if(s===null)return;const r=this.mainPlaylistLoader_.main,n=Lt.Playlist.seekable(t,s,Lt.Playlist.liveEdgeDelay(r,t));if(n.length===0||this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),s=this.syncController_.getExpiredTime(t,this.duration()),s===null||(e=Lt.Playlist.seekable(t,s,Lt.Playlist.liveEdgeDelay(r,t)),e.length===0)))return;let a,o;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),o=this.seekable_.start(0)),e?e.start(0)>n.end(0)||n.start(0)>e.end(0)?this.seekable_=n:this.seekable_=Le([[e.start(0)>n.start(0)?e.start(0):n.start(0),e.end(0)0&&(s=Math.max(s,t.end(t.length-1))),this.mediaSource.duration!==s&&this.sourceUpdater_.setDuration(s)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const s in t)t[s].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),s=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!s)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const s=zs(this.main(),t),r={},n=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=s.video||e.main.videoCodec||y2),e.main.isMuxed&&(r.video+=`,${s.audio||e.main.audioCodec||Ul}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||n)&&(r.audio=s.audio||e.main.audioCodec||e.audio.audioCodec||Ul,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(f,m)=>f?Yr(m):wa(m),o={};let l;if(["video","audio"].forEach(function(f){if(r.hasOwnProperty(f)&&!a(e[f].isFmp4,r[f])){const m=e[f].isFmp4?"browser":"muxer";o[m]=o[m]||[],o[m].push(r[f]),f==="audio"&&(l=m)}}),n&&l&&t.attributes.AUDIO){const f=t.attributes.AUDIO;this.main().playlists.forEach(m=>{(m.attributes&&m.attributes.AUDIO)===f&&m!==t&&(m.excludeUntil=1/0)}),this.logger_(`excluding audio group ${f} as ${l} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){const f=Object.keys(o).reduce((m,y)=>(m&&(m+=", "),m+=`${y} does not support codec(s): "${o[y].join(",")}"`,m),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:f},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const f=[];if(["video","audio"].forEach(m=>{const y=(gt(this.sourceUpdater_.codecs[m]||"")[0]||{}).type,T=(gt(r[m]||"")[0]||{}).type;y&&T&&y.toLowerCase()!==T.toLowerCase()&&f.push(`"${this.sourceUpdater_.codecs[m]}" -> "${r[m]}"`)}),f.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${f.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(s=>{const r=e[s];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const n=zs(this.main,r),a=[];n.audio&&!wa(n.audio)&&!Yr(n.audio)&&a.push(`audio codec ${n.audio}`),n.video&&!wa(n.video)&&!Yr(n.video)&&a.push(`video codec ${n.video}`),n.text&&n.text==="stpp.ttml.im1t"&&a.push(`text codec ${n.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],s=this.main().playlists,r=bn(gt(e)),n=jc(r),a=r.video&>(r.video)[0]||null,o=r.audio&>(r.audio)[0]||null;Object.keys(s).forEach(l=>{const f=s[l];if(t.indexOf(f.id)!==-1||f.excludeUntil===1/0)return;t.push(f.id);const m=[],y=zs(this.mainPlaylistLoader_.main,f),T=jc(y);if(!(!y.audio&&!y.video)){if(T!==n&&m.push(`codec count "${T}" !== "${n}"`),!this.sourceUpdater_.canChangeType()){const S=y.video&>(y.video)[0]||null,_=y.audio&>(y.audio)[0]||null;S&&a&&S.type.toLowerCase()!==a.type.toLowerCase()&&m.push(`video codec "${S.type}" !== "${a.type}"`),_&&o&&_.type.toLowerCase()!==o.type.toLowerCase()&&m.push(`audio codec "${_.type}" !== "${o.type}"`)}m.length&&(f.excludeUntil=1/0,this.logger_(`excluding ${f.id}: ${m.join(" && ")}`))}})}updateAdCues_(e){let t=0;const s=this.seekable();s.length&&(t=s.start(0)),DE(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=De.GOAL_BUFFER_LENGTH,s=De.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,De.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*s,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=De.BUFFER_LOW_WATER_LINE,s=De.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,De.MAX_BUFFER_LOW_WATER_LINE),n=Math.max(t,De.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*s,this.bufferBasedABR?n:r)}bufferHighWaterLine(){return De.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){Gc(this.inbandTextTracks_,"com.apple.streaming",this.tech_),uE({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,s){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();Gc(this.inbandTextTracks_,e,this.tech_),nE({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:s})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const e=this.main();(this.contentSteeringController_.didDASHTagChange(e.uri,e.contentSteering)||(()=>{const r=this.contentSteeringController_.getAvailablePathways(),n=[];for(const a of e.playlists){const o=a.attributes.serviceLocation;if(o&&(n.push(o),!r.has(o)))return!0}return!!(!n.length&&r.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const s=this.main().playlists,r=new Set;let n=!1;Object.keys(s).forEach(a=>{const o=s[a],l=this.pathwayAttribute_(o),f=l&&e!==l;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!f&&(delete o.excludeUntil,delete o.lastExcludeReason_,n=!0);const y=!o.excludeUntil&&o.excludeUntil!==1/0;!r.has(o.id)&&f&&y&&(r.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const o=this.mediaTypes_[a];if(o.activePlaylistLoader){const l=o.activePlaylistLoader.media_;l&&l.attributes.serviceLocation!==e&&(n=!0)}}),n&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,s=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(s&&s.size||r&&r.size){for(const[a,o]of s.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(o),this.contentSteeringController_.excludePathway(a));for(const[a,o]of r.entries()){const l=s.get(a);if(!l){t.filter(m=>m.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(m=>{this.mainPlaylistLoader_.addClonePathway(o,m)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(l,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const s=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const n in s)if(s[n]!==r[n])return!1;for(const n in r)if(s[n]!==r[n])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=this.mainPlaylistLoader_.getKeyIdSet(s);!r||!r.size||r.forEach(n=>{const a="usable",o=this.keyStatusMap_.has(n)&&this.keyStatusMap_.get(n)===a,l=s.lastExcludeReason_===t&&s.excludeUntil===1/0;o?o&&l&&(delete s.excludeUntil,delete s.lastExcludeReason_,this.logger_(`enabling playlist ${s.id} because key ID ${n} is ${a}`)):(s.excludeUntil!==1/0&&s.lastExcludeReason_!==t&&(s.excludeUntil=1/0,s.lastExcludeReason_=t,this.logger_(`excluding playlist ${s.id} because the key ID ${n} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(s=>{const r=s&&s.attributes&&s.attributes.RESOLUTION&&s.attributes.RESOLUTION.height<720,n=s.excludeUntil===1/0&&s.lastExcludeReason_===t;r&&n&&(delete s.excludeUntil,L.log.warn(`enabling non-HD playlist ${s.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const n=(typeof e=="string"?e:xE(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${n} added to the keyStatusMap`),this.keyStatusMap_.set(n,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const YE=(i,e,t)=>s=>{const r=i.main.playlists[e],n=Du(r),a=Yn(r);return typeof s>"u"?a:(s?delete r.disabled:r.disabled=!0,s!==a&&!n&&(t(r),s?i.trigger("renditionenabled"):i.trigger("renditiondisabled")),s)};class QE{constructor(e,t,s){const{playlistController_:r}=e,n=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=zs(r.main(),t),this.playlist=t,this.id=s,this.enabled=YE(e.playlists,t.id,n)}}const JE=function(i){i.representations=()=>{const e=i.playlistController_.main(),t=dr(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(s=>!Du(s)).map((s,r)=>new QE(i,s,s.id)):[]}},id=["seeking","seeked","pause","playing","error"];class ZE{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_=ut("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),s=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),n=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],l={};o.forEach(m=>{l[m]={reset:()=>this.resetSegmentDownloads_(m),updateend:()=>this.checkSegmentDownloads_(m)},a[`${m}SegmentLoader_`].on("appendsdone",l[m].updateend),a[`${m}SegmentLoader_`].on("playlistupdate",l[m].reset),this.tech_.on(["seeked","seeking"],l[m].reset)});const f=m=>{["main","audio"].forEach(y=>{a[`${y}SegmentLoader_`][m]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),f("off"))},this.clearSeekingAppendCheck_=()=>f("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),f("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(id,n),this.tech_.on("canplay",s),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(id,n),this.tech_.off("canplay",s),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(m=>{a[`${m}SegmentLoader_`].off("appendsdone",l[m].updateend),a[`${m}SegmentLoader_`].off("playlistupdate",l[m].reset),this.tech_.off(["seeked","seeking"],l[m].reset)}),this.checkCurrentTimeTimeout_&&E.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&E.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=E.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,s=t[`${e}SegmentLoader_`],r=s.buffered_(),n=jS(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,n){this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:s.playlist_&&s.playlist_.id,buffered:fi(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+Tt>=t.end(t.length-1)))return this.techWaiting_();this.consecutiveUpdates>=5&&e===this.lastRecordedTime?(this.consecutiveUpdates++,this.waiting_()):e===this.lastRecordedTime?this.consecutiveUpdates++:(this.consecutiveUpdates=0,this.lastRecordedTime=e)}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),s=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,s,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let n;if(r&&(n=t.end(t.length-1)),this.beforeSeekableWindow_(t,s)){const _=t.start(0);n=_+(_===t.end(0)?0:Tt)}if(typeof n<"u")return this.logger_(`Trying to seek outside of seekable at time ${s} with seekable range ${Mf(t)}. Seeking to ${n}.`),this.tech_.setCurrentTime(n),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),l=a.audioBuffer?a.audioBuffered():null,f=a.videoBuffer?a.videoBuffered():null,m=this.media(),y=m.partTargetDuration?m.partTargetDuration:(m.targetDuration-vt)*2,T=[l,f];for(let _=0;_ ${s.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const s=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:s.audioBuffered(),videoBuffered:s.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Hr(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,s,r=!1){if(!e.length)return!1;let n=e.end(e.length-1)+Tt;const a=!s.endList,o=typeof s.partTargetDuration=="number";return a&&(o||r)&&(n=e.end(e.length-1)+s.targetDuration*3),t>n}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:n,end:a}}return null}}const eC={errorInterval:30,getSource(i){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return i(t)}},xp=function(i,e){let t=0,s=0;const r=se(eC,e);i.ready(()=>{i.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const n=function(){s&&i.currentTime(s)},a=function(m){m!=null&&(s=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",n),i.src(m),i.trigger({type:"usage",name:"vhs-error-reload"}),i.play())},o=function(){if(Date.now()-t{Object.defineProperty(ye,i,{get(){return L.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),De[i]},set(e){if(L.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){L.log.warn(`value of Vhs.${i} must be greater than or equal to 0`);return}De[i]=e}})});const Cp="videojs-vhs",Ap=function(i,e){const t=e.media();let s=-1;for(let r=0;r{i.addQualityLevel(t)}),Ap(i,e.playlists)};ye.canPlaySource=function(){return L.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const oC=(i,e,t)=>{if(!i)return i;let s={};e&&e.attributes&&e.attributes.CODECS&&(s=bn(gt(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(s.audio=t.attributes.CODECS);const r=Ws(s.video),n=Ws(s.audio),a={};for(const o in i)a[o]={},n&&(a[o].audioContentType=n),r&&(a[o].videoContentType=r),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof i[o]=="string"&&(a[o].url=i[o]);return se(i,a)},uC=(i,e)=>i.reduce((t,s)=>{if(!s.contentProtection)return t;const r=e.reduce((n,a)=>{const o=s.contentProtection[a];return o&&o.pssh&&(n[a]={pssh:o.pssh}),n},{});return Object.keys(r).length&&t.push(r),t},[]),lC=({player:i,sourceKeySystems:e,audioMedia:t,mainPlaylists:s})=>{if(!i.eme.initializeMediaKeys)return Promise.resolve();const r=t?s.concat([t]):s,n=uC(r,Object.keys(e)),a=[],o=[];return n.forEach(l=>{o.push(new Promise((f,m)=>{i.tech_.one("keysessioncreated",f)})),a.push(new Promise((f,m)=>{i.eme.initializeMediaKeys({keySystems:l},y=>{if(y){m(y);return}f()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},cC=({player:i,sourceKeySystems:e,media:t,audioMedia:s})=>{const r=oC(e,t,s);return r?(i.currentSource().keySystems=r,r&&!i.eme?(L.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},Dp=()=>{if(!E.localStorage)return null;const i=E.localStorage.getItem(Cp);if(!i)return null;try{return JSON.parse(i)}catch{return null}},dC=i=>{if(!E.localStorage)return!1;let e=Dp();e=e?se(e,i):i;try{E.localStorage.setItem(Cp,JSON.stringify(e))}catch{return!1}return e},hC=i=>i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i,wp=(i,e)=>{i._requestCallbackSet||(i._requestCallbackSet=new Set),i._requestCallbackSet.add(e)},kp=(i,e)=>{i._responseCallbackSet||(i._responseCallbackSet=new Set),i._responseCallbackSet.add(e)},Ip=(i,e)=>{i._requestCallbackSet&&(i._requestCallbackSet.delete(e),i._requestCallbackSet.size||delete i._requestCallbackSet)},Pp=(i,e)=>{i._responseCallbackSet&&(i._responseCallbackSet.delete(e),i._responseCallbackSet.size||delete i._responseCallbackSet)};ye.supportsNativeHls=function(){if(!F||!F.createElement)return!1;const i=F.createElement("video");return L.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(i.canPlayType(t))}):!1}();ye.supportsNativeDash=function(){return!F||!F.createElement||!L.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(F.createElement("video").canPlayType("application/dash+xml"))}();ye.supportsTypeNatively=i=>i==="hls"?ye.supportsNativeHls:i==="dash"?ye.supportsNativeDash:!1;ye.isSupported=function(){return L.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};ye.xhr.onRequest=function(i){wp(ye.xhr,i)};ye.xhr.onResponse=function(i){kp(ye.xhr,i)};ye.xhr.offRequest=function(i){Ip(ye.xhr,i)};ye.xhr.offResponse=function(i){Pp(ye.xhr,i)};const fC=L.getComponent("Component");class Lp extends fC{constructor(e,t,s){if(super(t,s.vhs),typeof s.initialBandwidth=="number"&&(this.options_.bandwidth=s.initialBandwidth),this.logger_=ut("VhsHandler"),t.options_&&t.options_.playerId){const r=L.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(F,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const n=F.fullscreenElement||F.webkitFullscreenElement||F.mozFullScreenElement||F.msFullscreenElement;n&&n.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=se(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=this.options_.useNetworkInformationApi||!1,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const s=Dp();s&&s.bandwidth&&(this.options_.bandwidth=s.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),s&&s.throughput&&(this.options_.throughput=s.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=De.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===De.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(s=>{typeof this.source_[s]<"u"&&(this.options_[s]=this.source_[s])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=hC(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=ye,this.options_.sourceType=wd(t),this.options_.seekTo=n=>{this.tech_.setCurrentTime(n)},this.playlistController_=new XE(this.options_);const s=se({liveRangeSafeTimeDelta:Tt},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new ZE(s),this.playlistController_.on("error",()=>{const n=L.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),n.error(a)});const r=this.options_.bufferBasedABR?ye.movingAverageBandwidthSelector(.55):ye.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=ye.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(n){this.playlistController_.selectPlaylist=n.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(n){this.playlistController_.mainSegmentLoader_.throughput.rate=n,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let n=this.playlistController_.mainSegmentLoader_.bandwidth;const a=E.navigator.connection||E.navigator.mozConnection||E.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const l=a.downlink*1e3*1e3;l>=o&&n>=o?n=Math.max(n,l):n=l}return n},set(n){this.playlistController_.mainSegmentLoader_.bandwidth=n,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const n=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(n+a))},set(){L.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>fi(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>fi(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&dC({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{JE(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=E.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"),lC({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3,metadata:{errorType:L.Error.EMEKeySessionCreationError}})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=cC({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",s=>{this.playlistController_.updatePlaylistByKeyStatus(s.keyId,s.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=L.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{aC(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{Ap(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":Ep,"mux.js":iC,"mpd-parser":sC,"m3u8-parser":rC,"aes-decrypter":nC}}version(){return this.constructor.version()}canChangeType(){return Tp.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&E.URL.revokeObjectURL&&(E.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return vx({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,s=!0,r=2){return ip({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:s,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{wp(this.xhr,e)},this.xhr.onResponse=e=>{kp(this.xhr,e)},this.xhr.offRequest=e=>{Ip(this.xhr,e)},this.xhr.offResponse=e=>{Pp(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}}const En={name:"videojs-http-streaming",VERSION:Ep,canHandleSource(i,e={}){const t=se(L.options,e);return En.canPlayType(i.type,t)},handleSource(i,e,t={}){const s=se(L.options,t);return e.vhs=new Lp(i,e,s),e.vhs.xhr=Qf(),e.vhs.setupXhrHooks_(),e.vhs.src(i.src,i.type),e.vhs},canPlayType(i,e){const t=wd(i);if(!t)return"";const s=En.getOverrideNative(e);return!ye.supportsTypeNatively(t)||s?"maybe":""},getOverrideNative(i={}){const{vhs:e={}}=i,t=!(L.browser.IS_ANY_SAFARI||L.browser.IS_IOS),{overrideNative:s=t}=e;return s}},pC=()=>Yr("avc1.4d400d,mp4a.40.2");pC()&&L.getTech("Html5").registerSourceHandler(En,0);L.VhsHandler=Lp;L.VhsSourceHandler=En;L.Vhs=ye;L.use||L.registerComponent("Vhs",ye);L.options.vhs=L.options.vhs||{};(!L.getPlugin||!L.getPlugin("reloadSourceOnError"))&&L.registerPlugin("reloadSourceOnError",tC);/*! @name videojs-contrib-eme @version 3.11.2 @license Apache-2.0 */function Cn(){return Cn=Object.assign||function(i){for(var e=1;e=400&&r.statusCode<=599){var a=n;t&&(a=String.fromCharCode.apply(null,new Uint8Array(n))),e({cause:a});return}e(null,n)}});var vC=function(e){var t=String.fromCharCode.apply(null,new Uint16Array(e)),s=new E.DOMParser().parseFromString(t,"application/xml"),r=s.getElementsByTagName("HttpHeaders")[0],n={};if(r)for(var a=r.getElementsByTagName("name"),o=r.getElementsByTagName("value"),l=0;l"u"){s.mediaKeysObject=null,s.pendingSessionData=[];var y,T;m=new Promise(function(S,_){if(s.keySystem=a.keySystem,T=rd(a.keySystem,o.keySystems[a.keySystem]),!T.getCertificate){S(a);return}T.getCertificate(o,function(A,D){if(A){_(A);return}y=D,S()})}).then(function(){return a.createMediaKeys()}).then(function(S){return xC({player:t,video:s,certificate:y,createdMediaKeys:S})}).catch(function(S){return S?Promise.reject(S):Promise.reject("Failed to create and initialize a MediaKeys object")})}return m.then(function(){var S=rd(s.keySystem,o.keySystems[s.keySystem]),_=S.getLicense;return SC({player:t,video:s,initDataType:r,initData:n,options:o,getLicense:s.keySystem?AC(_,f):null,removeSession:l,eventBus:f})})},Lu="com.apple.fps.1_0",wC=function(e){var t=e.initData,s=e.id,r=e.cert;typeof s=="string"&&(s=mC(s));var n=0,a=new ArrayBuffer(t.byteLength+4+s.byteLength+4+r.byteLength),o=new DataView(a),l=new Uint8Array(a,n,t.byteLength);l.set(t),n+=t.byteLength,o.setUint32(n,s.byteLength,!0),n+=4;var f=new Uint16Array(a,n,s.length);f.set(s),n+=f.byteLength,o.setUint32(n,r.byteLength,!0),n+=4;var m=new Uint8Array(a,n,r.byteLength);return m.set(r),new Uint8Array(a,0,a.byteLength)},kC=function(e){var t=e.video,s=e.contentId,r=e.initData,n=e.cert,a=e.options,o=e.getLicense,l=e.eventBus;return new Promise(function(f,m){if(!t.webkitKeys)try{t.webkitSetMediaKeys(new E.WebKitMediaKeys(Lu))}catch{m("Could not create MediaKeys");return}var y;try{y=t.webkitKeys.createSession("video/mp4",wC({id:s,initData:r,cert:n}))}catch{m("Could not create key session");return}l.trigger("keysessioncreated"),y.contentId=s,y.addEventListener("webkitkeymessage",function(T){o(a,s,T.message,function(S,_){if(l&&l.trigger("licenserequestattempted"),S){m(S);return}y.update(new Uint8Array(_))})}),y.addEventListener("webkitkeyadded",function(){f()}),y.addEventListener("webkitkeyerror",function(){var T=y.error;m("KeySession error: code "+T.code+", systemCode "+T.systemCode)})})},IC=function(e){return function(t,s){var r=Qn(t.emeHeaders,e.certificateHeaders);L.xhr({uri:e.certificateUri,responseType:"arraybuffer",headers:r},rs(function(n,a){if(n){s(n);return}s(null,new Uint8Array(a))}))}},PC=function(e,t){return yC(gC(t))},LC=function(e){return function(t,s,r,n){var a=Qn({"Content-type":"application/octet-stream"},t.emeHeaders,e.licenseHeaders);L.xhr({uri:e.licenseUri,method:"POST",responseType:"arraybuffer",body:r,headers:a},rs(n,!0))}},OC=function(e){var t=e.video,s=e.initData,r=e.options,n=e.eventBus,a=r.keySystems[Lu],o=a.getCertificate||IC(a),l=a.getContentId||PC,f=a.getLicense||LC(a);return new Promise(function(m,y){o(r,function(T,S){if(T){y(T);return}m(S)})}).then(function(m){return kC({video:t,cert:m,initData:s,getLicense:f,options:r,contentId:l(r,s),eventBus:n})})},Fi="com.microsoft.playready",RC=function(e,t,s,r){var n=e.keySystems[Fi];if(typeof n.getKey=="function"){n.getKey(e,s.destinationURL,s.message.buffer,function(o,l){if(o){r.trigger({message:"Unable to get key: "+o,target:t,type:"mskeyerror"});return}t.update(l)});return}typeof n=="string"?n={url:n}:typeof n=="boolean"&&(n={}),n.url||(n.url=s.destinationURL);var a=function(l,f){if(r&&r.trigger("licenserequestattempted"),l){r.trigger({message:"Unable to request key from url: "+n.url,target:t,type:"mskeyerror"});return}t.update(new Uint8Array(f))};n.getLicense?n.getLicense(e,s.message.buffer,a):Op(n,s.message.buffer,e,a)},MC=function(e,t,s,r){var n=e.msKeys.createSession("video/mp4",t);if(!n)throw new Error("Could not create key session.");r.trigger("keysessioncreated"),n.addEventListener("mskeymessage",function(a){RC(s,n,a,r)}),n.addEventListener("mskeyerror",function(a){r.trigger({message:"Unexpected key error from key session with "+("code: "+n.error.code+" and systemCode: "+n.error.systemCode),target:n,type:"mskeyerror"})}),n.addEventListener("mskeyadded",function(){r.trigger({target:n,type:"mskeyadded"})})},NC=function(i){var e=i.video,t=i.initData,s=i.options,r=i.eventBus;e.msKeys&&delete e.msKeys;try{e.msSetMediaKeys(new E.MSMediaKeys(Fi))}catch(n){throw new Error("Unable to create media keys for PlayReady key system. Error: "+n.message)}MC(e,t,s,r)},BC="3.11.2",FC=function(e,t){for(var s=0;s=0)&&(t[r]=i[r]);return t}function od(i,e){if(i==null)return{};var t=zC(i,e),s,r;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(i,s)&&(t[s]=i[s])}return t}var WC="1.12.1";const KC=L.getComponent("player");class XC extends KC{constructor(e,t,s){t=L.obj.merge(t,{plugins:{eme:!0}}),super(e,t,s)}audioTrack(e){const t=Array.from(this.player().audioTracks());if(!e)return t.find(a=>a.enabled);const{kind:s,language:r}=e,n=t.find(a=>a.language===r&&a.kind===s)||t.find(a=>a.language===r);return n&&(n.enabled=!0),n}bufferedRanges(){const e=[];for(let t=0;t!["chapters","metadata"].includes(a.kind));if(!e)return t.find(a=>a.mode==="showing");t.forEach(a=>a.mode="disabled");const{kind:s,language:r}=e;return t.find(a=>(a.language===r&&a.kind===s&&(a.mode="showing"),a.mode==="showing"))||t.find(a=>(a.language===r&&(a.mode="showing"),a.mode==="showing"))}}L.registerComponent("player",XC);const ue=L;ue.VERSION={pillarbox:WC,videojs:L.VERSION,[L.VhsSourceHandler.name]:L.VhsSourceHandler.VERSION,eme:L.getPlugin("eme").VERSION};ue.options.enableSmoothSeeking=!0;ue.options.fill=!0;ue.options.html5={vhs:{useForcedSubtitles:!0}};ue.options.liveTracker={trackingThreshold:120,liveTolerance:15};ue.options.liveui=!0;ue.options.playsinline=!0;ue.options.responsive=!0;ue.options.trackers={};class ud{constructor(e="il.srgssr.ch"){this.setIlHost(e)}setIlHost(e){this.baseUrl=`${e}/integrationlayer/2.1/`}handleRequest(e){var t=this;return function(){var s=Oi(function*(r){const n=typeof e=="function"?e(r):t.mediaCompositionUrlHandler(r),a=yield fetch(n);if(!a.ok)throw a;return yield a.json()});return function(r){return s.apply(this,arguments)}}()}mediaCompositionUrlHandler(e){return`https://${this.baseUrl}mediaComposition/byUrn/${e}?onlyChapters=true&vector=portalplay`}}const Pi={WIDTH_240:"240",WIDTH_320:"320",WIDTH_480:"480",WIDTH_960:"960",WIDTH_1920:"1920"},Kr={JPG:"jpg",WEBP:"webp",PNG:"png"},YC="https://il.srgssr.ch/images/";class QC{static scale({url:e,width:t=Pi.WIDTH_960,format:s=Kr.JPG}={},r=YC){if(!e)return;const n=new URL(r);return n.searchParams.set("imageUrl",e),n.searchParams.set("format",s),n.searchParams.set("width",t),decodeURIComponent(n.href)}static get JPG(){return Kr.JPG}static get PNG(){return Kr.PNG}static get WEBP(){return Kr.WEBP}static get WIDTH_240(){return Pi.WIDTH_240}static get WIDTH_320(){return Pi.WIDTH_320}static get WIDTH_480(){return Pi.WIDTH_480}static get WIDTH_960(){return Pi.WIDTH_960}static get WIDTH_1920(){return Pi.WIDTH_1920}}const JC={WIDEVINE:"com.widevine.alpha",FAIRPLAY:"com.apple.fps.1_0",PLAYREADY:"com.microsoft.playready"};class tr{static buildKeySystems(e=[]){const t={};return e.forEach(s=>{const r=tr.vendors[s.type];if(tr.vendors.FAIRPLAY===r){const{certificateUrl:n,licenseUrl:a}=s;t[r]={certificateUri:n,licenseUri:a}}else t[r]=s.licenseUrl}),{keySystems:t}}static hasDrm(e){return e.some(({drmList:t})=>t&&t.length>0)}static get vendors(){return JC}}const Xr={AKAMAI:"AKAMAI",NONE:"NONE"};class yi{static aclPath(e){const t=e.pathname;return`${t.substring(0,t.lastIndexOf("/")+1)}*`}static get AKAMAI(){return Xr.AKAMAI}static hasToken(e){return e.some(t=>yi.isAkamai(t.tokenType))}static isAkamai(e){return Xr.AKAMAI===e}static isNone(e){return Xr.NONE===e}static get NONE(){return Xr.NONE}static tokenize(e,t){const s=new URL(`${e.url}`),r=yi.aclPath(s),n=`${t}${encodeURIComponent(r)}`;return fetch(n).then(a=>a.ok?a.json():Promise.reject({status:a.status,statusText:a.statusText})).then(({token:{authparams:a}})=>(new URLSearchParams(a).forEach((l,f)=>s.searchParams.set(f,l)),Object.assign({},e,{url:s.toString()}))).catch(a=>Promise.reject(a))}static tokenizeSources(e,t="https://tp.srgssr.ch/akahd/token?acl="){const s=[];return e.forEach(r=>{const n=yi.tokenize(r,t);s.push(n)}),Promise.all(s).then(r=>r).catch(r=>Promise.reject(r))}}const ld="emptied",cd="ended",dd="loadeddata",hd="loadstart",Wa="pause",ZC="play",Ka="playing",fd="ratechange",pd="seeking",Xa="timeupdate",md="waiting";class di{constructor(e,{debug:t=!1,environment:s="prod",playerVersion:r="none",tagCommanderScriptURL:n="//colibri-js.akamaized.net/penguin/tc_SRGGD_11.js"}={}){this.isDebugEnabled=t,this.elapsedPlaybackTime=0,this.environment=s,this.hasStarted=!1,this.heartBeatIntervalId=void 0,this.initialized=!1,this.isSeeking=!1,this.isWaiting=!1,this.mediaSession=0,this.pendingQueue=[],this.pendingTagCommanderReload=!1,this.player=e,this.playerVersion=r,this.srcMediaData=void 0,this.startPlaybackSession=0,this.tagCommanderScriptURL=n,this.trackedCurrentTime=0,this.uptimeIntervalId=void 0,this.initScript(),this.initListeners()}beforeunload(){this.notify("stop")}clearTimers(){clearInterval(this.heartBeatIntervalId),clearInterval(this.uptimeIntervalId),clearTimeout(this.uptimeTimeoutId)}currentTime(){return Math.round(this.trackedCurrentTime)}debug(e){if(e===void 0)return this.isDebugEnabled||this.player.debug();this.isDebugEnabled=!!e}destroy(){this.clearTimers(),window.tc_vars||(window.tc_vars={}),this.elapsedPlaybackTime=0,this.hasStarted=!1,this.heartBeatIntervalId=void 0,this.initialized=!1,this.isWaiting=!1,this.mediaSession=0,this.pendingQueue=[],this.srcMediaData=void 0,this.startPlaybackSession=0,this.trackedCurrentTime=0,this.uptimeIntervalId=void 0}dispose(){this.beforeunload(),this.clearTimers(),window.removeEventListener("beforeunload",this.beforeunloadListener),this.player.off(ld,this.emptiedListener),this.player.off(cd,this.endedListener),this.player.off(hd,this.loadstartListener),this.player.off(dd,this.loadeddataListener),this.player.off(Ka,this.playListener),this.player.off(Wa,this.pauseListener),this.player.off(fd,this.rateChangeListener),this.player.off(pd,this.seekingListener),this.player.off(Xa,this.timeUpdateListener),this.player.off(md,this.waitingListener)}emptied(){this.player.ended()||this.notify("stop")}ended(){this.notify("eof"),this.mediaSession=0,this.clearTimers()}flush(){this.isTrackerDisabled()||(this.pendingTagCommanderReload&&window.tC&&(window.tC.container.reload(),this.pendingTagCommanderReload=!1),window.tc_events_11&&this.pendingQueue.length>0&&(this.pendingQueue.forEach(e=>{window.tc_events_11(this.player.el(),e.action,e.labels)}),this.pendingQueue=[]))}getCurrentAudioTrack(){const e=Array.from(this.player.audioTracks()).find(s=>s.enabled);let t="und";return e&&e.language&&(t=e.language),e?t.toUpperCase():""}getCurrentTextTrack(){const e=this.player.textTrack();let t="und";return e&&e.language&&(t=e.language),e?t.toUpperCase():""}getDvrWindowPosition(){const{liveTracker:e}=this.player,t=this.currentTime()-e.seekableStart()|0,s=e.liveWindow()-t;return s<0||s===1/0?0:s*1e3}getDvrWindowSize(){const e=this.player.liveTracker.liveWindow()===1/0,t=this.player.liveTracker.liveWindow()*1e3;return e?0:t}getElapsedPlaybackTime(){return this.startPlaybackSession?this.getElapsedPlayingTime():this.elapsedPlaybackTime}getElapsedPlayingTime(){const e=di.now()-this.startPlaybackSession|0;return this.elapsedPlaybackTime+e}getEventLabels(e){const t={event_id:e,event_timestamp:di.now(),media_dvr_window_length:0,media_dvr_window_offset:0,media_is_dvr:!1,media_is_live:!1,media_mute:this.player.muted()?"1":"0",media_playback_rate:this.player.playbackRate(),media_position:this.currentTime(),media_quality:this.srcMediaData.mediaData.quality,media_subtitles_on:this.isTextTrackEnabled(),media_volume:(this.player.volume()*100).toFixed(0),navigation_environment:this.environment};return this.isAudioTrackEnabled()&&(t.media_audio_track=this.getCurrentAudioTrack()),this.isTextTrackEnabled()&&(t.media_subtitle_selection=this.getCurrentTextTrack()),this.isMediaOnDemand()||(t.media_is_live=!0,t.media_position=this.getElapsedPlaybackTime()),this.isMediaDvr()&&(t.media_dvr_window_offset=this.getDvrWindowPosition()|0,t.media_dvr_window_length=this.getDvrWindowSize()|0,t.media_is_dvr=!0,t.media_timeshift=[ZC,Wa].includes(e)?this.timeShifted():0),t}getInternalLabels(){const e={media_bu_distributer:this.srcMediaData.mediaData.vendor,media_chromecast_selected:!!this.player.tech(!0).isCasting,media_embedding_url:document.referrer,media_player_display:"default",media_player_name:"pillarbox-web",media_player_version:this.playerVersion,media_url:this.srcMediaData.src},t=this.srcMediaData.mediaData.analyticsMetadata||{};window.tc_vars=Object.assign({},window.tc_vars,e,t)}heartBeat(){this.heartBeatIntervalId=setInterval(()=>{this.player.paused()||this.notify("pos")},3e4)}initCallbacks(){this.beforeunloadListener=this.beforeunload.bind(this),this.emptiedListener=this.emptied.bind(this),this.endedListener=this.ended.bind(this),this.loadstartListener=this.loadstart.bind(this),this.loadeddataListener=this.loadeddata.bind(this),this.playListener=this.play.bind(this),this.pauseListener=this.pause.bind(this),this.rateChangeListener=this.rateChange.bind(this),this.seekingListener=this.seeking.bind(this),this.timeUpdateListener=this.timeUpdate.bind(this),this.waitingListener=this.waiting.bind(this)}initListeners(){this.initCallbacks(),window.addEventListener("beforeunload",this.beforeunloadListener),this.player.on(ld,this.emptiedListener),this.player.on(cd,this.endedListener),this.player.on(hd,this.loadstartListener),this.player.on(dd,this.loadeddataListener),this.player.on(Ka,this.playListener),this.player.on(Wa,this.pauseListener),this.player.on(fd,this.rateChangeListener),this.player.on(pd,this.seekingListener),this.player.on(Xa,this.timeUpdateListener),this.player.on(md,this.waitingListener),this.player.one("dispose",this.dispose.bind(this))}initScript(){const e="tc_script__11";if(!document.querySelector(`#${e}`)){const t=document.createElement("script"),s=this.tagCommanderScriptURL;t.defer=!0,t.id=e,t.src=s,t.type="text/javascript",t.onload=r=>{this.flush()},document.body.appendChild(t)}}isAudioTrackEnabled(){return!!this.getCurrentAudioTrack()}isMediaDvr(){const{trackingThreshold:e}=this.player.liveTracker.options();return!this.isMediaOnDemand()&&ethis.player.liveTracker.liveWindow()}isMediaOnDemand(){return Number.isFinite(this.player.duration())}isTextTrackEnabled(){return!!this.getCurrentTextTrack()}isTrackerDisabled(){return!this.srcMediaData||!this.srcMediaData.mediaData?!0:Array.isArray(this.srcMediaData.disableTrackers)?!!this.srcMediaData.disableTrackers.find(e=>e.toLowerCase()===di.name.toLowerCase()):!!this.srcMediaData.disableTrackers}loadstart(){this.destroy(),this.updateSrcMediaData(this.player.currentSource()),!this.isTrackerDisabled()&&(this.getInternalLabels(),this.reloadTagCommanderContainer(),this.notify("buffer_start"),this.hasStarted=!1)}loadeddata(){this.notify("init"),this.initialized=!0,this.notify("buffer_stop")}log(e,t,s="log"){this.debug()&&console[s](`SRGAnalytics:${e}`,t,window.tc_vars)}notify(e,t){if(this.isTrackerDisabled())return;try{this.flush()}catch(r){this.log(e,r,"error")}const s=Object.assign({},this.getEventLabels(e),t);this.log(e,s);try{window.tc_events_11?window.tc_events_11(this.player.el(),e,s):this.pendingQueue.push({action:e,labels:s})}catch(r){this.log(e,r,"error")}}static now(){return(Date.now()/1e3).toFixed(0)}play(){this.hasStarted||(this.hasStarted=!0),!this.startPlaybackSession&&!this.isMediaOnDemand()&&(this.startPlaybackSession=di.now()),this.mediaSession===0&&(this.mediaSession=di.now(),this.heartBeat(),this.uptime()),this.timeUpdate(),this.notify("play"),this.isSeeking&&(this.isSeeking=!1)}pause(){if(this.isMediaOnDemand()||(this.elapsedPlaybackTime=this.getElapsedPlayingTime(),this.startPlaybackSession=0),!this.player.seeking()&&!this.isMediaLive()&&this.player.currentTime(){!this.player.paused()&&!this.isMediaOnDemand()&&this.notify("uptime")};this.uptimeTimeoutId=setTimeout(()=>{e(),this.uptimeIntervalId=setInterval(()=>{e()},6e4)},3e4)}waiting(){if(!this.initialized||this.isWaiting)return;const e=()=>{this.isWaiting=!1,this.notify("buffer_stop")};this.isWaiting=!0,this.notify("buffer_start"),ue.browser.IS_ANY_SAFARI?this.player.one(Xa,e):this.player.one(Ka,e)}}class eA{findChapterByUrn(e){if(this.chapterList){const[t]=this.chapterList.filter(s=>s.urn===e);return t}}findMainSegment(){if(!this.segmentUrn)return;const e=this.getMainSegments(),[t]=e.filter(s=>s.urn===this.segmentUrn);return t}findResourceListByUrn(e){const t=this.findChapterByUrn(e);if(t)return t.resourceList||[]}getChapters(){const e="AUDIO";return this.getMainChapter().mediaType===e?[]:this.chapterList.filter(({mediaType:t})=>t!==e)}getFilteredExternalSubtitles(){const{subtitleList:e}=this.getMainChapter(),[{subtitleInformationList:t}={}]=this.getResourceList().filter(({subtitleInformationList:n})=>n),s=e&&!t;if(!e)return[];const r=e.filter(n=>n.format!=="TTML");return s?r:r.filter(n=>!t.find(o=>o.locale===n.locale&&n.type===o.type))}getMainBlockReason(){const e=this.getMainChapter();if(!e)return;let{blockReason:t}=e;return!t&&new Datee.blockReason)}getMainChapter(){return this.mainChapter||(this.mainChapter=this.findChapterByUrn(this.chapterUrn)),!this.mainChapter&&this.chapterList&&this.chapterList.length>0&&([this.mainChapter]=this.chapterList),this.mainChapter}getMainChapterImageUrl(){const e=this.getMainChapter();if(!(!e||!e.imageUrl))return e.imageUrl}getMainResources(){const e=this.getResourceList();if(!(!e||!e.length))return e.map(t=>({analyticsData:this.getMergedAnalyticsData(t.analyticsData),analyticsMetadata:this.getMergedAnalyticsMetadata(t.analyticsMetadata),blockReason:this.getMainChapter().blockReason,blockedSegments:this.getMainBlockedSegments(),imageUrl:this.getMainChapterImageUrl(),chapters:this.getChapters(),drmList:t.drmList,dvr:t.dvr,eventData:this.getMainChapter().eventData,id:this.getMainChapter().id,imageCopyright:this.getMainChapter().imageCopyright,intervals:this.getMainTimeIntervals(),live:t.live,mediaType:this.getMainChapter().mediaType,mimeType:t.mimeType,presentation:t.presentation,quality:t.quality,streaming:t.streaming,streamOffset:t.streamOffset,subtitles:this.getFilteredExternalSubtitles(),title:this.getMainChapter().title,tokenType:t.tokenType,url:t.url,urn:this.chapterUrn,vendor:this.getMainChapter().vendor}))}getMainSegments(){const e=this.getMainChapter();return!this.mainSegments&&e&&e.segmentList&&(this.mainSegments=e.segmentList),this.mainSegments||[]}getMainTimeIntervals(){const{timeIntervalList:e=[]}=this.getMainChapter()||{};return e}getMainValidFromDate(){const e=this.getMainChapter();if(!e)return new Date(0);const{validFrom:t}=e;if(t)return new Date(t)}getMergedAnalyticsData(e){return Pe(Pe(Pe({},this.analyticsData),this.getMainChapter().analyticsData),e)}getMergedAnalyticsMetadata(e){return Pe(Pe(Pe({},this.analyticsMetadata),this.getMainChapter().analyticsMetadata),e)}getResourceList(){const{resourceList:e}=this.getMainChapter();return e||[]}}var Fp="Wiedergabe",Up="Pause",$p="Erneut abspielen",qp="Dauer",jp="LIVE",Vp="Geladen",Hp="Status",Gp="Vollbild",zp="Stumm schalten",Wp="Ton einschalten",Kp="Untertitel",Xp="Untertitel",Yp="Kapitel",Qp="Schließen",Jp="Beschreibungen",Zp="Schrift",em="Weiß",tm="Schwarz",im="Rot",sm="Grün",rm="Blau",nm="Gelb",am="Magenta",om="Türkis",um="Hintergrund",lm="Fenster",cm="Durchsichtig",dm="Undurchsichtig",hm="Kein",fm="Erhoben",pm="Gedrückt",mm="Uniform",gm="Zwanglos",ym="Schreibschrift",_m="Zurücksetzen",vm="Fertig",Tm="Farbe",bm="Deckkraft",tA={Play:Fp,Pause:Up,Replay:$p,"Current Time":"Aktueller Zeitpunkt",Duration:qp,"Remaining Time":"Verbleibende Zeit","Stream Type":"Streamtyp",LIVE:jp,Loaded:Vp,Progress:Hp,Fullscreen:Gp,"Exit Fullscreen":"Vollbildmodus beenden",Mute:zp,Unmute:Wp,"Playback Rate":"Wiedergabegeschwindigkeit",Subtitles:Kp,"subtitles off":"Untertitel aus",Captions:Xp,"captions off":"Untertitel aus",Chapters:Yp,"You aborted the media playback":"Sie haben die Videowiedergabe abgebrochen.","A network error caused the media download to fail part-way.":"Der Videodownload ist aufgrund eines Netzwerkfehlers fehlgeschlagen.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Das Video konnte nicht geladen werden, da entweder ein Server- oder Netzwerkfehler auftrat oder das Format nicht unterstützt wird.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"Die Videowiedergabe wurde entweder wegen eines Problems mit einem beschädigten Video oder wegen verwendeten Funktionen, die vom Browser nicht unterstützt werden, abgebrochen.","No compatible source was found for this media.":"Für dieses Video wurde keine kompatible Quelle gefunden.","Play Video":"Video abspielen",Close:Qp,"Modal Window":"Modales Fenster","This is a modal window":"Dies ist ein modales Fenster","This modal can be closed by pressing the Escape key or activating the close button.":'Durch Drücken der Esc-Taste bzw. Betätigung der Schaltfläche "Schließen" wird dieses modale Fenster geschlossen.',", opens captions settings dialog":", öffnet Einstellungen für Untertitel",", opens subtitles settings dialog":", öffnet Einstellungen für Untertitel",", selected":", ausgewählt","captions settings":"Untertiteleinstellungen","subtitles settings":"Untertiteleinstellungen","descriptions settings":"Einstellungen für Beschreibungen","Close Modal Dialog":"Modales Fenster schließen",Descriptions:Jp,"descriptions off":"Beschreibungen aus","The media is encrypted and we do not have the keys to decrypt it.":"Die Entschlüsselungsschlüssel für den verschlüsselten Medieninhalt sind nicht verfügbar.",", opens descriptions settings dialog":", öffnet Einstellungen für Beschreibungen","Audio Track":"Tonspur",Text:Zp,White:em,Black:tm,Red:im,Green:sm,Blue:rm,Yellow:nm,Magenta:am,Cyan:om,Background:um,Window:lm,Transparent:cm,"Semi-Transparent":"Halbdurchsichtig",Opaque:dm,"Font Size":"Schriftgröße","Text Edge Style":"Textkantenstil",None:hm,Raised:fm,Depressed:pm,Uniform:mm,"Drop shadow":"Schlagschatten","Font Family":"Schriftfamilie","Proportional Sans-Serif":"Proportionale Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportionale Serif","Monospace Serif":"Monospace Serif",Casual:gm,Script:ym,"Small Caps":"Small-Caps",Reset:_m,"restore all settings to the default values":"Alle Einstellungen auf die Standardwerte zurücksetzen",Done:vm,"Caption Settings Dialog":"Einstellungsdialog für Untertitel","Beginning of dialog window. Escape will cancel and close the window.":"Anfang des Dialogfensters. Esc bricht ab und schließt das Fenster.","End of dialog window.":"Ende des Dialogfensters.","Audio Player":"Audio-Player","Video Player":"Video-Player","Progress Bar":"Fortschrittsbalken","progress bar timing: currentTime={1} duration={2}":"{1} von {2}","Volume Level":"Lautstärke","{1} is loading.":"{1} wird geladen.","Seek to live, currently behind live":"Zur Live-Übertragung wechseln. Aktuell wird es nicht live abgespielt.","Seek to live, currently playing live":"Zur Live-Übertragung wechseln. Es wird aktuell live abgespielt.","Exit Picture-in-Picture":"Bild-im-Bild-Modus beenden","Picture-in-Picture":"Bild-im-Bild-Modus","No content":"Kein Inhalt",Color:Tm,Opacity:bm,"Text Background":"Texthintergrund","Caption Area Background":"Hintergrund des Untertitelbereichs","Playing in Picture-in-Picture":"Wird im Bild-im-Bild-Modus wiedergegeben","Skip forward {1} seconds":"{1} Sekunden vorwärts","Skip backward {1} seconds":"{1} Sekunden zurück"},iA=Object.freeze({__proto__:null,Background:um,Black:tm,Blue:rm,Captions:Xp,Casual:gm,Chapters:Yp,Close:Qp,Color:Tm,Cyan:om,Depressed:pm,Descriptions:Jp,Done:vm,Duration:qp,Fullscreen:Gp,Green:sm,LIVE:jp,Loaded:Vp,Magenta:am,Mute:zp,None:hm,Opacity:bm,Opaque:dm,Pause:Up,Play:Fp,Progress:Hp,Raised:fm,Red:im,Replay:$p,Reset:_m,Script:ym,Subtitles:Kp,Text:Zp,Transparent:cm,Uniform:mm,Unmute:Wp,White:em,Window:lm,Yellow:nm,default:tA}),Sm="Aus Gründen des Jugendschutzes steht dieser Inhalt nur zwischen 20:00 und 06:00 Uhr zur Verfügung.",xm="Aus Gründen des Jugendschutzes steht dieser Inhalt nur zwischen 23:00 und 05:00 Uhr zur Verfügung.",Em="Die Werbung wurde übersprungen.",Cm="Dieser Inhalt ist nicht mehr verfügbar.",Am="Dieser Inhalt ist ausserhalb der Schweiz nicht verfügbar.",Dm="Dieser Inhalt ist aus rechtlichen Gründen nicht verfügbar.",wm="Dieser Inhalt ist noch nicht verfügbar. Bitte probieren Sie es später noch einmal.",km="Dieser Inhalt ist nicht verfügbar.",sA={AGERATING12:Sm,AGERATING18:xm,COMMERCIAL:Em,ENDDATE:Cm,GEOBLOCK:Am,LEGAL:Dm,STARTDATE:wm,UNKNOWN:km},rA=Object.freeze({__proto__:null,AGERATING12:Sm,AGERATING18:xm,COMMERCIAL:Em,ENDDATE:Cm,GEOBLOCK:Am,LEGAL:Dm,STARTDATE:wm,UNKNOWN:km,default:sA});ue.addLanguage("de",Pe(Pe({},iA),rA));var Im="Play",Pm="Pause",Lm="Replay",Om="Duration",Rm="LIVE",Mm="Loaded",Nm="Progress",Bm="Fullscreen",Fm="Mute",Um="Unmute",$m="Subtitles",qm="Captions",jm="Chapters",Vm="Descriptions",Hm="Close",Gm="Text",zm="White",Wm="Black",Km="Red",Xm="Green",Ym="Blue",Qm="Yellow",Jm="Magenta",Zm="Cyan",eg="Background",tg="Window",ig="Transparent",sg="Opaque",rg="None",ng="Raised",ag="Depressed",og="Uniform",ug="Casual",lg="Script",cg="Reset",dg="Done",hg="Color",fg="Opacity",nA={"Audio Player":"Audio Player","Video Player":"Video Player",Play:Im,Pause:Pm,Replay:Lm,"Current Time":"Current Time",Duration:Om,"Remaining Time":"Remaining Time","Stream Type":"Stream Type",LIVE:Rm,"Seek to live, currently behind live":"Seek to live, currently behind live","Seek to live, currently playing live":"Seek to live, currently playing live",Loaded:Mm,Progress:Nm,"Progress Bar":"Progress Bar","progress bar timing: currentTime={1} duration={2}":"{1} of {2}",Fullscreen:Bm,"Exit Fullscreen":"Exit Fullscreen",Mute:Fm,Unmute:Um,"Playback Rate":"Playback Rate",Subtitles:$m,"subtitles off":"subtitles off",Captions:qm,"captions off":"captions off",Chapters:jm,Descriptions:Vm,"descriptions off":"descriptions off","Audio Track":"Audio Track","Volume Level":"Volume Level","You aborted the media playback":"You aborted the media playback","A network error caused the media download to fail part-way.":"A network error caused the media download to fail part-way.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"The media could not be loaded, either because the server or network failed or because the format is not supported.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.","No compatible source was found for this media.":"No compatible source was found for this media.","The media is encrypted and we do not have the keys to decrypt it.":"The media is encrypted and we do not have the keys to decrypt it.","Play Video":"Play Video",Close:Hm,"Close Modal Dialog":"Close Modal Dialog","Modal Window":"Modal Window","This is a modal window":"This is a modal window","This modal can be closed by pressing the Escape key or activating the close button.":"This modal can be closed by pressing the Escape key or activating the close button.",", opens captions settings dialog":", opens captions settings dialog",", opens subtitles settings dialog":", opens subtitles settings dialog",", opens descriptions settings dialog":", opens descriptions settings dialog",", selected":", selected","captions settings":"captions settings","subtitles settings":"subtitles settings","descriptions settings":"descriptions settings",Text:Gm,White:zm,Black:Wm,Red:Km,Green:Xm,Blue:Ym,Yellow:Qm,Magenta:Jm,Cyan:Zm,Background:eg,Window:tg,Transparent:ig,"Semi-Transparent":"Semi-Transparent",Opaque:sg,"Font Size":"Font Size","Text Edge Style":"Text Edge Style",None:rg,Raised:ng,Depressed:ag,Uniform:og,"Drop shadow":"Drop shadow","Font Family":"Font Family","Proportional Sans-Serif":"Proportional Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportional Serif","Monospace Serif":"Monospace Serif",Casual:ug,Script:lg,"Small Caps":"Small Caps",Reset:cg,"restore all settings to the default values":"restore all settings to the default values",Done:dg,"Caption Settings Dialog":"Caption Settings Dialog","Beginning of dialog window. Escape will cancel and close the window.":"Beginning of dialog window. Escape will cancel and close the window.","End of dialog window.":"End of dialog window.","{1} is loading.":"{1} is loading.","Exit Picture-in-Picture":"Exit Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture","No content":"No content",Color:hg,Opacity:fg,"Text Background":"Text Background","Caption Area Background":"Caption Area Background","Playing in Picture-in-Picture":"Playing in Picture-in-Picture","Skip backward {1} seconds":"Skip backward {1} seconds","Skip forward {1} seconds":"Skip forward {1} seconds"},aA=Object.freeze({__proto__:null,Background:eg,Black:Wm,Blue:Ym,Captions:qm,Casual:ug,Chapters:jm,Close:Hm,Color:hg,Cyan:Zm,Depressed:ag,Descriptions:Vm,Done:dg,Duration:Om,Fullscreen:Bm,Green:Xm,LIVE:Rm,Loaded:Mm,Magenta:Jm,Mute:Fm,None:rg,Opacity:fg,Opaque:sg,Pause:Pm,Play:Im,Progress:Nm,Raised:ng,Red:Km,Replay:Lm,Reset:cg,Script:lg,Subtitles:$m,Text:Gm,Transparent:ig,Uniform:og,Unmute:Um,White:zm,Window:tg,Yellow:Qm,default:nA}),pg="To protect children this content is only available between 8PM and 6AM.",mg="To protect children this content is only available between 10PM and 5AM.",gg="This commercial content is not available.",yg="This content is not available anymore.",_g="This content is not available outside Switzerland.",vg="This content is not available due to legal restrictions.",Tg="This content is not available yet.",bg="This content is not available.",oA={AGERATING12:pg,AGERATING18:mg,COMMERCIAL:gg,ENDDATE:yg,GEOBLOCK:_g,LEGAL:vg,STARTDATE:Tg,UNKNOWN:bg},uA=Object.freeze({__proto__:null,AGERATING12:pg,AGERATING18:mg,COMMERCIAL:gg,ENDDATE:yg,GEOBLOCK:_g,LEGAL:vg,STARTDATE:Tg,UNKNOWN:bg,default:oA});ue.addLanguage("en",Pe(Pe({},aA),uA));var Sg="Lecture",xg="Pause",Eg="Revoir",Cg="Durée",Ag="EN DIRECT",Dg="Chargé",wg="Progression",kg="Plein écran",Ig="Mettre en sourdine",Pg="Activer le son",Lg="Sous-titres",Og="Sous-titres transcrits",Rg="Chapitres",Mg="Descriptions",Ng="Fermer",Bg="Texte",Fg="Blanc",Ug="Noir",$g="Rouge",qg="Vert",jg="Bleu",Vg="Jaune",Hg="Magenta",Gg="Cyan",zg="Arrière-plan",Wg="Fenêtre",Kg="Transparent",Xg="Opaque",Yg="Aucun",Qg="Élevé",Jg="Enfoncé",Zg="Uniforme",e0="Manuscrite",t0="Scripte",i0="Réinitialiser",s0="Terminé",r0="Couleur",n0="Opacité",lA={"Audio Player":"Lecteur audio","Video Player":"Lecteur vidéo",Play:Sg,Pause:xg,Replay:Eg,"Current Time":"Temps actuel",Duration:Cg,"Remaining Time":"Temps restant","Stream Type":"Type de flux",LIVE:Ag,"Seek to live, currently behind live":"Rechercher le direct, actuellement après le direct","Seek to live, currently playing live":"Rechercher le direct, le direct actuellement en cours de lecture",Loaded:Dg,Progress:wg,"Progress Bar":"Barre de progression","progress bar timing: currentTime={1} duration={2}":"{1} de {2}",Fullscreen:kg,"Exit Fullscreen":"Fenêtré",Mute:Ig,Unmute:Pg,"Playback Rate":"Vitesse de lecture",Subtitles:Lg,"subtitles off":"Sous-titres désactivés",Captions:Og,"captions off":"Sous-titres transcrits désactivés",Chapters:Rg,Descriptions:Mg,"descriptions off":"descriptions désactivées","Audio Track":"Piste audio","Volume Level":"Niveau de volume","You aborted the media playback":"Vous avez interrompu la lecture de la vidéo.","A network error caused the media download to fail part-way.":"Une erreur de réseau a interrompu le téléchargement de la vidéo.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Cette vidéo n'a pas pu être chargée, soit parce que le serveur ou le réseau a échoué ou parce que le format n'est pas reconnu.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"La lecture de la vidéo a été interrompue à cause d'un problème de corruption ou parce que la vidéo utilise des fonctionnalités non prises en charge par votre navigateur.","No compatible source was found for this media.":"Aucune source compatible n'a été trouvée pour cette vidéo.","The media is encrypted and we do not have the keys to decrypt it.":"Le média est chiffré et nous n'avons pas les clés pour le déchiffrer.","Play Video":"Lire la vidéo",Close:Ng,"Close Modal Dialog":"Fermer la boîte de dialogue modale","Modal Window":"Fenêtre modale","This is a modal window":"Ceci est une fenêtre modale","This modal can be closed by pressing the Escape key or activating the close button.":"Ce modal peut être fermé en appuyant sur la touche Échap ou activer le bouton de fermeture.",", opens captions settings dialog":", ouvrir les paramètres des sous-titres transcrits",", opens subtitles settings dialog":", ouvrir les paramètres des sous-titres",", opens descriptions settings dialog":", ouvrir les paramètres des descriptions",", selected":", sélectionné","captions settings":"Paramètres des sous-titres transcrits","subtitles settings":"Paramètres des sous-titres","descriptions settings":"Paramètres des descriptions",Text:Bg,White:Fg,Black:Ug,Red:$g,Green:qg,Blue:jg,Yellow:Vg,Magenta:Hg,Cyan:Gg,Background:zg,Window:Wg,Transparent:Kg,"Semi-Transparent":"Semi-transparent",Opaque:Xg,"Font Size":"Taille des caractères","Text Edge Style":"Style des contours du texte",None:Yg,Raised:Qg,Depressed:Jg,Uniform:Zg,"Drop shadow":"Ombre portée","Font Family":"Famille de polices","Proportional Sans-Serif":"Polices à chasse variable sans empattement (Proportional Sans-Serif)","Monospace Sans-Serif":"Polices à chasse fixe sans empattement (Monospace Sans-Serif)","Proportional Serif":"Polices à chasse variable avec empattement (Proportional Serif)","Monospace Serif":"Polices à chasse fixe avec empattement (Monospace Serif)",Casual:e0,Script:t0,"Small Caps":"Petites capitales",Reset:i0,"restore all settings to the default values":"Restaurer tous les paramètres aux valeurs par défaut",Done:s0,"Caption Settings Dialog":"Boîte de dialogue des paramètres des sous-titres transcrits","Beginning of dialog window. Escape will cancel and close the window.":"Début de la fenêtre de dialogue. La touche d'échappement annulera et fermera la fenêtre.","End of dialog window.":"Fin de la fenêtre de dialogue.","Exit Picture-in-Picture":"Quitter le mode image dans l'image","Picture-in-Picture":"Image dans l'image","{1} is loading.":"{1} en cours de chargement.","No content":"Aucun contenu",Color:r0,Opacity:n0,"Text Background":"Arrière-plan du texte","Caption Area Background":"Arrière-plan de la zone de sous-titre","Skip backward {1} seconds":"Reculer de {1} secondes","Skip forward {1} seconds":"Avancer de {1} secondes"},cA=Object.freeze({__proto__:null,Background:zg,Black:Ug,Blue:jg,Captions:Og,Casual:e0,Chapters:Rg,Close:Ng,Color:r0,Cyan:Gg,Depressed:Jg,Descriptions:Mg,Done:s0,Duration:Cg,Fullscreen:kg,Green:qg,LIVE:Ag,Loaded:Dg,Magenta:Hg,Mute:Ig,None:Yg,Opacity:n0,Opaque:Xg,Pause:xg,Play:Sg,Progress:wg,Raised:Qg,Red:$g,Replay:Eg,Reset:i0,Script:t0,Subtitles:Lg,Text:Bg,Transparent:Kg,Uniform:Zg,Unmute:Pg,White:Fg,Window:Wg,Yellow:Vg,default:lA}),a0="Pour protéger les enfants, ce contenu est accessible entre 20h et 6h.",o0="Pour protéger les enfants, ce contenu est accessible entre 23h et 5h.",u0="Ce contenu n'est actuellement pas disponible.",l0="Ce contenu n'est plus disponible.",c0="La RTS ne dispose pas des droits de diffusion en dehors de la Suisse.",d0="Pour des raisons juridiques, ce contenu n'est pas disponible.",h0="Ce contenu n'est pas encore disponible. Veuillez réessayer plus tard.",f0="Ce contenu n'est actuellement pas disponible.",dA={AGERATING12:a0,AGERATING18:o0,COMMERCIAL:u0,ENDDATE:l0,GEOBLOCK:c0,LEGAL:d0,STARTDATE:h0,UNKNOWN:f0},hA=Object.freeze({__proto__:null,AGERATING12:a0,AGERATING18:o0,COMMERCIAL:u0,ENDDATE:l0,GEOBLOCK:c0,LEGAL:d0,STARTDATE:h0,UNKNOWN:f0,default:dA});ue.addLanguage("fr",Pe(Pe({},cA),hA));var p0="Play",m0="Pausa",g0="Replay",y0="Durata",_0="LIVE",v0="Caricato",T0="Stato",b0="Schermo intero",S0="Disattiva l’audio",x0="Attiva l’audio",E0="Sottotitoli",C0="Sottotitoli non udenti",A0="Capitolo",D0="Descrizioni",w0="Chiudi",k0="Testo",I0="Bianco",P0="Nero",L0="Rosso",O0="Verde",R0="Blu",M0="Giallo",N0="Magenta",B0="Ciano",F0="Sfondo",U0="Finestra",$0="Trasparente",q0="Opaco",j0="Nessuno",V0="Uniforme",H0="Reinizializza",G0="Fatto",z0="Colore",W0="Opacità",fA={"Audio Player":"Lettore audio","Video Player":"Lettore video",Play:p0,Pause:m0,Replay:g0,"Current Time":"Orario attuale",Duration:y0,"Remaining Time":"Tempo rimanente","Stream Type":"Tipo di streaming",LIVE:_0,Loaded:v0,Progress:T0,"Progress Bar":"Barra di avanzamento","progress bar timing: currentTime={1} duration={2}":"{1} di {2}",Fullscreen:b0,"Exit Fullscreen":"Chiudi Schermo intero",Mute:S0,Unmute:x0,"Playback Rate":"Velocità di riproduzione",Subtitles:E0,"subtitles off":"Senza sottotitoli",Captions:C0,"captions off":"Senza sottotitoli non udenti",Chapters:A0,Descriptions:D0,"descriptions off":"Descrizioni disattivate","Audio Track":"Traccia audio","Volume Level":"Livello del volume","You aborted the media playback":"La riproduzione del contenuto multimediale è stata interrotta.","A network error caused the media download to fail part-way.":"Il download del contenuto multimediale è stato interrotto a causa di un problema rete.","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Il contenuto multimediale non può essere caricato a causa di un errore nel server o nella rete o perché il formato non viene supportato.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"La riproduzione del contenuto multimediale è stata interrotta a causa di un file danneggiato o per l’utilizzo di impostazioni non supportate dal browser.","No compatible source was found for this media.":"Non ci sono fonti compatibili per questo contenuto multimediale.","The media is encrypted and we do not have the keys to decrypt it.":"Il contenuto multimediale è criptato e non disponiamo delle chiavi per decifrarlo.","Play Video":"Riproduci il video",Close:w0,"Close Modal Dialog":"Chiudi la finestra di dialogo","Modal Window":"Finestra di dialogo","This is a modal window":"Questa è una finestra di dialogo","This modal can be closed by pressing the Escape key or activating the close button.":"Questa finestra di dialogo può essere chiusa premendo sul tasto Esc o attivando il pulsante di chiusura.",", opens captions settings dialog":", aprire i parametri della trascrizione dei sottotitoli",", opens subtitles settings dialog":", aprire i parametri dei sottotitoli",", opens descriptions settings dialog":", aprire i parametri delle descrizioni",", selected":", selezionato","captions settings":"Parametri sottotitoli non udenti","subtitles settings":"Parametri sottotitoli","descriptions settings":"Parametri descrizioni",Text:k0,White:I0,Black:P0,Red:L0,Green:O0,Blue:R0,Yellow:M0,Magenta:N0,Cyan:B0,Background:F0,Window:U0,Transparent:$0,"Semi-Transparent":"Semi-Trasparente",Opaque:q0,"Font Size":"Dimensione dei caratteri","Text Edge Style":"Stile dei bordi del testo",None:j0,Uniform:V0,"Drop shadow":"Ombra","Font Family":"Carattere","Proportional Sans-Serif":"Sans-Serif proporzionale","Monospace Sans-Serif":"Sans-Serif monospaziato","Proportional Serif":"Serif proporzionale","Monospace Serif":"Serif monospaziato","Small Caps":"Maiuscoletto",Reset:H0,"restore all settings to the default values":"Ripristina i valori predefiniti per tutti i parametri",Done:G0,"Caption Settings Dialog":"Finestra di dialogo dei parametri della trascrizione dei sottotitoli","Beginning of dialog window. Escape will cancel and close the window.":"Inizio della finestra di dialogo. Il tasto Esc annullerà l’operazione e chiuderà la finestra.","End of dialog window.":"Fine della finestra di dialogo.","{1} is loading.":"{1} in fase di caricamento.","Exit Picture-in-Picture":"Esci dalla modalità Picture-in-Picture","Picture-in-Picture":"Picture-in-Picture",Color:z0,Opacity:W0,"Text Background":"Sfondo testo","Caption Area Background":"Sfondo area sottotitoli","Skip forward {1} seconds":"Avanti {1} secondi","Skip backward {1} seconds":"Indietro {1} secondi"},pA=Object.freeze({__proto__:null,Background:F0,Black:P0,Blue:R0,Captions:C0,Chapters:A0,Close:w0,Color:z0,Cyan:B0,Descriptions:D0,Done:G0,Duration:y0,Fullscreen:b0,Green:O0,LIVE:_0,Loaded:v0,Magenta:N0,Mute:S0,None:j0,Opacity:W0,Opaque:q0,Pause:m0,Play:p0,Progress:T0,Red:L0,Replay:g0,Reset:H0,Subtitles:E0,Text:k0,Transparent:$0,Uniform:V0,Unmute:x0,White:I0,Window:U0,Yellow:M0,default:fA}),K0="Per proteggere i bambini, questo media è disponibile solo fra le 20 e le 6.",X0="Per proteggere i bambini, questo media è disponibile solo fra le 23 le 5.",Y0="Questo contenuto commerciale non è disponibile.",Q0="Questo media non è più disponibile.",J0="Questo media non è disponibile fuori dalla Svizzera.",Z0="Il contenuto non è fruibile a causa di restrizioni legali.",ey="Il contenuto non è ancora disponibile. Per cortesia prova più tardi.",ty="Questo media non è disponibile.",mA={AGERATING12:K0,AGERATING18:X0,COMMERCIAL:Y0,ENDDATE:Q0,GEOBLOCK:J0,LEGAL:Z0,STARTDATE:ey,UNKNOWN:ty},gA=Object.freeze({__proto__:null,AGERATING12:K0,AGERATING18:X0,COMMERCIAL:Y0,ENDDATE:Q0,GEOBLOCK:J0,LEGAL:Z0,STARTDATE:ey,UNKNOWN:ty,default:mA});ue.addLanguage("it",Pe(Pe({},pA),gA));var iy="Laschar ir",sy="Pausa",ry="Mussar danovamain",ny="Durada",ay="LIVE",oy="Chargià",uy="Progress",ly="Entir visur",cy="Senza tun",dy="Cun tun",hy="Suttitels",fy="Suttitels",py="Chapitels",my="Descripziuns",gy="Serrar",yy="Text",_y="Alv",vy="Nair",Ty="Cotschn",by="Verd",Sy="Blau",xy="Mellen",Ey="Magenta",Cy="Cyan",Ay="Fund",Dy="Fanestra",wy="Transparent",ky="Betg transparent",Iy="Nagin",Py="Auzà",Ly="Sbassà",Oy="Uniform",Ry="Sumbriva",My="Casual",Ny="Script",By="Da nov",Fy="Fatg",Uy="Per proteger uffants, è quest cuntegn disponibel mo tranter las 20.00 e las 06.00.",$y="Per proteger uffants, è quest cuntegn disponibel mo tranter las 23.00 e las 05.00.",qy="Quest medium commerzial n'è betg disponibel.",jy="Quest cuntegn n'è betg pli disponibel.",Vy="Quest cuntegn n'è betg disponibel ordaifer la Svizra.",Hy="Quest cuntegn n'è betg disponibel perquai ch'el è scadì.",Gy="Quest cuntegn n'è betg anc disponibel. Empruvai pli tard.",zy="Quest cuntegn n'è betg disponibel.",yA={"Audio Player":"Audio-Player","Video Player":"Video-Player",Play:iy,Pause:sy,Replay:ry,"Current Time":"Temp actual",Duration:ny,"Remaining Time":"Temp restant","Stream Type":"Tip dal stream",LIVE:ay,Loaded:oy,Progress:uy,"Progress Bar":"Bar da progessiun","progress bar timing: currentTime={1} duration={2}":"{1} da {2}",Fullscreen:ly,"Non-Fullscreen":"Betg entir visur",Mute:cy,Unmute:dy,"Playback Rate":"Tempo ",Subtitles:hy,"subtitles off":"senza suttitels",Captions:fy,"captions off":"senza suttitels",Chapters:py,Descriptions:my,"descriptions off":"senza descripziuns","Audio Track":"Piese audio","Volume Level":"Nivel dal volumen","You aborted the media playback":"Vus avais interrut il vdieo","A network error caused the media download to fail part-way.":"In sbagl en la rait ha impedì il download","The media could not be loaded, either because the server or network failed or because the format is not supported.":"Il video n'è betg chargià - ubain per in sbagl da server / da la rait, ubain ch'il format n'è betg cumpatibel.","The media playback was aborted due to a corruption problem or because the media used features your browser did not support.":"Il video è interrut: Ubain ch'il video è donnegià, ubain che funcziuns n'èn betg cumpatiblas.","No compatible source was found for this media.":"Chattà nagina funtauna cumpatibla per quest video.","The media is encrypted and we do not have the keys to decrypt it.":"Il video è codifitgà da moda nunenconuschenta.","Play Video":"Aviar video",Close:gy,"Close Modal Dialog":"Serrar la fanestra modala","Modal Window":"Fanestra modala","This is a modal window":"Quai è ina fanestra modala","This modal can be closed by pressing the Escape key or activating the close button.":'Questa fanestra modala pudais serrar cun la tasta "Escape" ubain cun il buttun.',", opens captions settings dialog":", avra opziuns per ils suttitels",", opens subtitles settings dialog":", avra opziuns per ils suttitels",", opens descriptions settings dialog":", avra opziuns per la descripziun",", selected":", selecziunà","captions settings":"opziuns per ils suttitels","subtitles settings":"opziuns per ils suttitels","descriptions settings":"opziuns per la descripziun",Text:yy,White:_y,Black:vy,Red:Ty,Green:by,Blue:Sy,Yellow:xy,Magenta:Ey,Cyan:Cy,Background:Ay,Window:Dy,Transparent:wy,"Semi-Transparent":"Mez transparent",Opaque:ky,"Font Size":"Grandezza dal text","Text Edge Style":"Stil dal text",None:Iy,Raised:Py,Depressed:Ly,Uniform:Oy,Dropshadow:Ry,"Font Family":"Scrittira","Proportional Sans-Serif":"Proportionale Sans-Serif","Monospace Sans-Serif":"Monospace Sans-Serif","Proportional Serif":"Proportionale Serif","Monospace Serif":"Monospace Serif",Casual:My,Script:Ny,"Small Caps":"Bustabs pitschens",Reset:By,"restore all settings to the default values":"Enavos tar las opziuns da standard",Done:Fy,"Caption Settings Dialog":"Opziuns per suttitels","Beginning of dialog window. Escape will cancel and close the window.":"Entschatta da la fanestra da dialog. Escape stizza e serra la fanestra.","End of dialog window.":"Fin da la fanestra da dialog.",AGERATING12:Uy,AGERATING18:$y,COMMERCIAL:qy,ENDDATE:jy,GEOBLOCK:Vy,LEGAL:Hy,STARTDATE:Gy,UNKNOWN:zy},_A=Object.freeze({__proto__:null,AGERATING12:Uy,AGERATING18:$y,Background:Ay,Black:vy,Blue:Sy,COMMERCIAL:qy,Captions:fy,Casual:My,Chapters:py,Close:gy,Cyan:Cy,Depressed:Ly,Descriptions:my,Done:Fy,Dropshadow:Ry,Duration:ny,ENDDATE:jy,Fullscreen:ly,GEOBLOCK:Vy,Green:by,LEGAL:Hy,LIVE:ay,Loaded:oy,Magenta:Ey,Mute:cy,None:Iy,Opaque:ky,Pause:sy,Play:iy,Progress:uy,Raised:Py,Red:Ty,Replay:ry,Reset:By,STARTDATE:Gy,Script:Ny,Subtitles:hy,Text:yy,Transparent:wy,UNKNOWN:zy,Uniform:Oy,Unmute:dy,White:_y,Window:Dy,Yellow:xy,default:yA});ue.addLanguage("rm",Pe({},_A));const vA=["url","mimeType","keySystems"],TA=["src"];class J{static addBlockedSegments(e,t=[]){const s="srgssr-blocked-segments",r=e.textTracks().getTrackById(s);if(r&&e.textTracks().removeTrack(r),!Array.isArray(t)||!t.length)return;const n=t.filter(a=>a.blockReason);n.length&&J.createTextTrack(e,s).then(a=>{n.forEach(o=>{J.addTextTrackCue(a,o)}),e.textTracks().addTrack(a)})}static addRemoteTextTracks(e,t=[]){Array.isArray(t)&&t.forEach(({type:s,language:r,locale:n,url:a})=>{e.addRemoteTextTrack({kind:s==="SDH"?"captions":"subtitles",label:r,language:n,src:a})})}static addTextTrackCue(e,t){const s=(Number.isFinite(t.markIn)?t.markIn:t.fullLengthMarkIn)/1e3,r=(Number.isFinite(t.markOut)?t.markOut:t.fullLengthMarkOut)/1e3;e.addCue(new VTTCue(s,r,JSON.stringify(t)))}static addTextTracks(e,{mediaData:t}){J.addRemoteTextTracks(e,t.subtitles),J.addChapters(e,t.urn,t.chapters),J.addBlockedSegments(e,t.blockedSegments),J.addIntervals(e,t.intervals)}static addChapters(e,t,s=[]){const r="srgssr-chapters",n=e.textTracks().getTrackById(r);n&&e.textTracks().removeTrack(n),!(!Array.isArray(s)||!s.length)&&J.createTextTrack(e,r).then(a=>{s.forEach(o=>{t===o.fullLengthUrn&&J.addTextTrackCue(a,o)}),e.textTracks().addTrack(a)})}static addIntervals(e,t=[]){const s="srgssr-intervals",r=e.textTracks().getTrackById(s);r&&e.textTracks().removeTrack(r),!(!Array.isArray(t)||!t.length)&&J.createTextTrack(e,s).then(n=>{t.forEach(a=>{J.addTextTrackCue(n,a)}),e.textTracks().addTrack(n)})}static blockingReason(e,t){if(!t.mediaData.blockReason)return;const s=e.localize(t.mediaData.blockReason);return J.error(e,{code:MediaError.MEDIA_ERR_ABORTED,message:s,metadata:{errorType:t.mediaData.blockReason,src:t}}),!0}static composeAkamaiResources(e=[]){return Oi(function*(){return yi.hasToken(e)?yi.tokenizeSources(e):Promise.resolve(e)})()}static composeKeySystemsResources(e=[]){return tr.hasDrm(e),e.map(t=>Pe(Pe({},t),tr.buildKeySystems(t.drmList)))}static composeMainResources(e){return J.composeAkamaiResources(J.composeKeySystemsResources(J.filterIncompatibleResources(e.getMainResources())))}static composeSrcMediaData({mediaData:e,disableTrackers:t},s){const r=ue.obj.merge(s,e),{url:n,mimeType:a,keySystems:o}=r,l=od(r,vA);return{src:n,type:a,keySystems:o,disableTrackers:t,mediaData:l}}static createTextTrack(e,t){return new Promise(s=>{setTimeout(()=>{s(new ue.TextTrack({id:t,kind:"metadata",label:t,tech:e.tech(!0)}))},100)})}static cuechangeEventProxy(e){e.textTracks().on("addtrack",({track:t})=>{["srgssr-chapters","srgssr-intervals"].includes(t.id)&&t.on("cuechange",()=>{const[s]=Array.from(t.activeCues),r=t.id.includes("srgssr-chapters")?"srgssr/chapter":"srgssr/interval";e.trigger({type:r,data:s})})})}static dataProvider(e){if(!e.options().srgOptions.dataProvider){const{dataProviderHost:t,dataProviderUrlHandler:s}=e.options().srgOptions,n=new ud(t).handleRequest(s);e.options({srgOptions:{dataProvider:n}})}return e.options().srgOptions.dataProvider}static dataProviderError(e,t){if(!t)return;const s=t.statusText?t.statusText:t.message;return J.error(e,{code:0,message:e.localize("UNKNOWN"),metadata:{errorType:"UNKNOWN",urn:e.src(),status:t.status,statusText:s,url:t.url}}),!0}static error(e,{code:t,message:s,metadata:r}){e.error(null),e.error({code:t,message:s,metadata:r})}static filterIncompatibleResources(e=[]){return e.filter(t=>!["RTMP","HDS"].includes(t.streaming))}static getBlockedSegment(e){const s=e.textTracks().getTrackById("srgssr-blocked-segments");if(!s)return;const[r]=Array.from(s.activeCues);return r}static getBlockedSegmentByTime(e,t){const s=J.getBlockedSegment(e);return s&&t>=s.startTime&&tr===t)||e[0]}static getSrcMediaObj(e,t){return Oi(function*(){const{src:s}=t,r=od(t,TA),n=yield J.getMediaComposition(s,J.dataProvider(e)),a=yield J.composeMainResources(n),o=J.getMediaData(a);return J.composeSrcMediaData(r,o)})()}static handleCurrentTime(e,t){const s=J.getBlockedSegmentByTime(e,t);if(!s||!Number.isFinite(s.endTime))return t;const r=s.endTime+.1;return e.trigger({type:"srgssr/blocked-segment",data:s}),e.currentTime(r),r}static handleSetCurrentTime(e,t){const{endTime:s}=J.getBlockedSegmentByTime(e,t)||{};return Number.isFinite(s)?s:t}static handleSetSource(e,t,s){return Oi(function*(){try{const r=yield J.getSrcMediaObj(e,t);return J.srgAnalytics(e),J.updateTitleBar(e,r),J.updatePoster(e,r),J.blockingReason(e,r)?void 0:(J.addTextTracks(e,r),s(null,r))}catch(r){return J.dataProviderError(e,r)?void 0:s(r)}})()}static srgAnalytics(e){if(e.options().trackers.srgAnalytics!==!1&&!e.options().trackers.srgAnalytics){const t=new di(e,{debug:e.debug(),playerVersion:ue.VERSION.pillarbox,tagCommanderScriptURL:e.options().srgOptions.tagCommanderScriptURL});e.options({trackers:{srgAnalytics:t}})}}static updatePoster(e,t,s=QC){e.poster(s.scale({url:t.mediaData.imageUrl}))}static updateTitleBar(e,t){e.titleBar&&e.titleBar.update({title:t.mediaData.vendor,description:t.mediaData.title})}static middleware(e){return J.cuechangeEventProxy(e),{currentTime:t=>J.handleCurrentTime(e,t),setCurrentTime:t=>J.handleSetCurrentTime(e,t),setSource:function(){var t=Oi(function*(s,r){return J.handleSetSource(e,s,r)});return function(r,n){return t.apply(this,arguments)}}()}}}ue.use("srgssr/urn",J.middleware);ue.options.srgOptions={dataProvider:void 0,dataProviderHost:void 0,dataProviderUrlHandler:void 0,tagCommanderScriptURL:void 0};const bA="1.0.3",SA={"Skip credits":"Abspann überspringen","Skip intro":"Intro überspringen"},xA={"Skip credits":"Skip credits","Skip intro":"Skip intro"},EA={"Skip credits":"Passer","Skip intro":"Passer l’intro"},CA={"Skip credits":"Salta i credits","Skip intro":"Salta l'intro"},AA={"Skip credits":"Sursiglir credentials","Skip intro":"Sursiglir intro"};function hr(i,e){ue.addLanguage(i,{...ue.options.language[i]??{},...e})}hr("de",SA);hr("en",xA);hr("fr",EA);hr("it",CA);hr("rm",AA);const DA=ue.getComponent("Button");class Wy extends DA{constructor(t,s){super(t,s);xa(this,"activeInterval");xa(this,"onTimeIntervalChange_",({data:t})=>this.handleTimeIntervalChange(t));this.player().on("srgssr/interval",this.onTimeIntervalChange_)}dispose(){this.player().off("srgssr/interval",this.onTimeIntervalChange_),super.dispose()}buildCSSClass(){return`${super.buildCSSClass()} pbw-skip-button vjs-hidden vjs-visible-text`}handleClick(t){super.handleClick(t),this.player().currentTime(this.activeInterval.endTime)}handleTimeIntervalChange(t){if(this.activeInterval=t,!this.activeInterval){this.hide();return}const r=JSON.parse(this.activeInterval.text).type==="OPENING_CREDITS"?"Skip intro":"Skip credits";this.controlText(r),this.show()}}Wy.VERSION=bA;ue.registerComponent("SkipButton",Wy);const Jn=new URLSearchParams(location.search),wA=Jn.has("debug"),kA=Jn.get("ilHost")||void 0,IA=Jn.get("language"),PA=Jn.get("urn")||"urn:rts:video:14683290";window.player=ue("player",{debug:wA,language:IA,srgOptions:{dataProviderHost:kA},SkipButton:!0});player.src({src:PA,type:"srgssr/urn",disableTrackers:!0});window.player=player;window.pillarbox=ue; diff --git a/pr-preview/pr-31/packages/skip-button/index.html b/pr-preview/pr-31/packages/skip-button/index.html new file mode 100644 index 0000000..94e63bb --- /dev/null +++ b/pr-preview/pr-31/packages/skip-button/index.html @@ -0,0 +1,26 @@ + + + + + + + SkipButton Demo + + + + + + + + +