From 98f4ecc2c514dfd83fb496c49fd5ed5bf208ff1c Mon Sep 17 00:00:00 2001 From: Anton Afanasyeu Date: Sun, 28 Jun 2026 22:55:44 +0200 Subject: [PATCH] deploy: favicon, nuevo-player, ac-ms-broadcast, nginx notify/monitor/broadcast - favicon.ico (32px) + apple-touch-icon.ico (180px) added to composed backend seed - layout.php: add and in - nuevo-player (Video.js + Nuevo licensed plugin) into assets/vendor/nuevo-player/ - THIRD_PARTY_LICENSES.md: add Nuevo Player (commercial) + TipTap (MIT) entries - apps-port80.conf: full rewrite with all live fixes merged in: * map $http_upgrade $connection_upgrade (WebSocket upgrade) * 2FA location regex extended: api/two-factor * grafana-auth-check internal endpoint + @monitor_login_redirect * Grafana proxy (cast04:3000) + Alertmanager proxy (cast04:9093) * broadcast admin path /app/androidcast_project/broadcast/ (auth_request gated) * notify.f0xx.org server block: public /m/{slug} landing + API * favicon.ico at server root - deploy-ac-broadcast.sh: new app-phase script (DB schema, user, worker, rsync) - populate_lab_setup.sh: add deploy-ac-broadcast.sh to run_phase_app Co-authored-by: Cursor --- .../lab-seeds/backend/THIRD_PARTY_LICENSES.md | 23 +++ .../public/assets/apple-touch-icon.ico | Bin 0 -> 133982 bytes .../backend/public/assets/favicon.ico | Bin 0 -> 4286 bytes .../vendor/nuevo-player/js/nsvideo.min.js | 3 + .../vendor/nuevo-player/js/nuevo.min.js | 1 + .../vendor/nuevo-player/js/video.min.js | 21 +++ .../js/videojs-contrib-hls.min.js | 8 ++ .../js/videojs-landscape-fullscreen.min.js | 2 + .../vdjs/v10.0.0/skins/treso/videojs.min.css | 1 + .../lab-seeds/backend/views/layout.php | 2 + sim/cluster0/nginx/apps-port80.conf | 134 +++++++++++++++++- sim/cluster0/populate_lab_setup.sh | 1 + sim/cluster0/scripts/deploy-ac-broadcast.sh | 89 ++++++++++++ 13 files changed, 280 insertions(+), 5 deletions(-) create mode 100644 sim/cluster0/lab-seeds/backend/public/assets/apple-touch-icon.ico create mode 100644 sim/cluster0/lab-seeds/backend/public/assets/favicon.ico create mode 100644 sim/cluster0/lab-seeds/backend/public/assets/vendor/nuevo-player/js/nsvideo.min.js create mode 100644 sim/cluster0/lab-seeds/backend/public/assets/vendor/nuevo-player/js/nuevo.min.js create mode 100644 sim/cluster0/lab-seeds/backend/public/assets/vendor/nuevo-player/js/video.min.js create mode 100644 sim/cluster0/lab-seeds/backend/public/assets/vendor/nuevo-player/js/videojs-contrib-hls.min.js create mode 100644 sim/cluster0/lab-seeds/backend/public/assets/vendor/nuevo-player/js/videojs-landscape-fullscreen.min.js create mode 100644 sim/cluster0/lab-seeds/backend/public/assets/vendor/nuevo-player/vdjs/v10.0.0/skins/treso/videojs.min.css create mode 100755 sim/cluster0/scripts/deploy-ac-broadcast.sh diff --git a/sim/cluster0/lab-seeds/backend/THIRD_PARTY_LICENSES.md b/sim/cluster0/lab-seeds/backend/THIRD_PARTY_LICENSES.md index 9628cbe..48ab80c 100644 --- a/sim/cluster0/lab-seeds/backend/THIRD_PARTY_LICENSES.md +++ b/sim/cluster0/lab-seeds/backend/THIRD_PARTY_LICENSES.md @@ -44,3 +44,26 @@ Suggested public URL after deploy sync: `https://apps.f0xx.org/app/androidcast_project/crashes/THIRD_PARTY_LICENSES.md` (or render an HTML excerpt on the hub legal page linking mobile + BE lists). + +## Nuevo Player (Video.js + Nuevo Plugin) + +**Component:** HTML5 video player embedded in VOD/restreaming service (DR: `ac-docs/drafts/20260616_VOD_and_restreaming_service.txt`) +**Files:** `public/assets/vendor/nuevo-player/js/` and `public/assets/vendor/nuevo-player/vdjs/` + +| File | Library | License | +|------|---------|---------| +| `video.min.js` | [Video.js](https://videojs.com) | Apache-2.0 | +| `videojs-contrib-hls.min.js` | videojs-contrib-hls | Apache-2.0 | +| `videojs-landscape-fullscreen.min.js` | videojs-landscape-fullscreen | MIT | +| `nuevo.min.js` | [Nuevo Player](https://www.nuevodevel.com) | **Commercial license** — purchased; see `tmp/nuevo-player.tar.xz` (not in repo) | +| `nsvideo.min.js` | Nuevo Player (nsVideo module) | **Commercial license** (same purchase) | +| `vdjs/v10.0.0/skins/treso/videojs.min.css` | Treso skin (Nuevo) | **Commercial license** (same purchase) | + +**Note:** `nuevo.min.js` and `nsvideo.min.js` are proprietary (Nuevo Player commercial license). Binary distribution requires a valid Nuevo Player license. These files are included in the repo under the purchased license and must **not** be redistributed or open-sourced. The `video.min.js` (Video.js core) and HLS plugin are separately Apache-2.0 licensed and may be replaced with upstream npm builds. + +## TipTap Editor + +**Component:** Rich text editor in Broadcast admin compose view (`ac-ms-broadcast/views/admin/compose.php`) +**License:** MIT +**URL:** https://tiptap.dev | https://github.com/ueberdosis/tiptap +**Note:** Only open-source core extensions used. No Pro cloud extensions. Loaded from unpkg CDN in current implementation — for production, pin version and self-host bundle. diff --git a/sim/cluster0/lab-seeds/backend/public/assets/apple-touch-icon.ico b/sim/cluster0/lab-seeds/backend/public/assets/apple-touch-icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..544535c7519ee341810b999cc8bc0cab439e021b GIT binary patch literal 133982 zcmeI52Yggj+Qw1bwe5b^b?vA~QJSD2AP6dm3Id9Px+o~9s1)fSC?L{BI#NOjgc=|~ z0O=4QkluSjdO`?QnvKl+JUK+&ksUU4#EN zY$%8SKUD6eo3AZ*SGjWKsv@wdT(@hi?N~K`CIcn|CIcn|CIcn|CIcn|CIcn|CIcn| zCIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn| zCIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn| zCIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn| zCIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn| zCIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn|CIcn| zCIcn|mym&L%9XoD#Wh&E4QzJ&mBX&(ZbH;9e@(fX*nFKmuH~O&w=%9cztDA^kAIIS z<3}!T_u`Ux3ES;o43f>H>%gk{D7qR2arx1sN9{TUuW>jpN9psS+-$X;m6;~<=gp11 z@x~h~;d8Lhcs=(oO&Fe$r3?NH&%XoDEMq*le!b7}{Jb1n{^49(F4)e>N|(cjbA;>j z=XpfkbkmL1@mX$0luD-!&lkXq4Tk3{%ku@=?9l5rZCZUC7aLV@B>#{NTr1y^m6ZXm zGbA@FQ@j=}O2TJ(98oIoVR$w?UkbbKUQ=4{jEp;Y<~n@G)nskbZjy#`>I){#|j5NhFI0xUUvdVi|7IInzUo3gyc;W@z7@pl>Z+O0x zw&;Fbuyj0=&jJ1V`DU{g4bO21!J2e7d^Fc{b2246J6%?-S&{Y6fBv%y+Roqc887G~ z{#SUuwx~wCYiHPI^!XBMz?Z_|m3qx(@?0LD^!xZ znymaYG&(yoL-9;+ot~N^zH8U~Sg-C=t?(K$?a=AV;@L%Kd8`sc`)9qh?{9c6`&ir` zv0YrqbD7Su+6!OTzhB?w;I;r7Eji$q{)4_Fhg`F-n3*maV0zo;O$Ch_HhkO8v(jn9 zGqQ2PU!g8*js7F@^GEwkm%+1USuOGJx_|l7B`DpcLzmMe3w|RT45uDUQRCtC9PA&a z9ZV9xo!bj~_UPux*Wha`kC~`TY%_+D-TAE(sq z8@pb~Kg08-w3RExGrr04_ug|)i@*bWQGZTTk*hohyhd7zWT5Urjn2X{JvCXP!UAQ& z*x^U2JyzvEc&)>G@HoyOJrN~Os21_-@r${(tn2M|2EI~M$7l=@tH?z zay)oWSH8p2Yif2n`iKW5gKUH6)Z_$-jtG{yGbW#D*Xq?>RVr7073Wpxbh+#C@8I~0 z!;6&2^u>7Q^W?seeT!wyv;BE~b~k~Sl}ewn+m-$^JpU1R#%H)~{W_mtQ^73fb&z9g ztR+?HGPOA!o+B+KQ4S`>OKeoQ_^w&`Q~&OtoOrwa8|(44z-`1{Ob1oZoI@apgAJiJn{vcUqq=IK^bV_2J zB*aBYz`otKS(C<{{<7a^CqH|?gI~2Om0pFJ;JD)7kZ>%^{T*Uiq{il?xh3&j_?rJ= zp8rhDUCn>XRp9wL4-bzR^#5$EL1)4*J2Oo$%|2l&t^**?)MzrD7#A&ZQDL%cvroZV zkBPsnoHnXp(uhH+EuL@E761O*!SoIGz_nfF{#Jx#yT&@UX+5^|*_G$NDevs!H~3n6 zd(=y8DwWsZepmQU=?wmvg`VSTGVo_Q_Eq4y{NO=@JhL;>Y}DhlgYe2J(B#yEYK$cn zkJIR%={M{=Yo?Rpqrr8g#DxdS)_LFBmW=Fm-ebb>b7O`NKHj%y_Z4^Ear+1Oy!YC< zrpH!wY_jMGXSOfoncmrzX9w>%o@SX#a$4HJu2=G}kYmmCpNYAv`ER)zJpbe78(xo% ziue^g+qA#nG6O7Y#ud|eteH-+>$JsmlpIWmmF=q++dh8vnV;WnTIa{9BZmIG)@z|{ z=A>_rcJ27q1mvU|K0BB$cN4yIUXN?Bt#wy3t{)eA4b8LGc*C>t&(1n_!8%xbaL4wo zzo3p$pm>HBv;W7?x}2N{uaTT2NeOZA9PrV0o|D0GQhbc^ABphQd$w^O4uWx|}fig^ikY*2nLl+( z!IuO2CN`*7chn8nU*F=o^5t(uGU&Id-{jlsOH!*He&br|G`gH_c`mKb;C@%(uPD!# z^1c35UvrgsE6#KKQUha*BI zCTzd_uyDGpozP1>d$*A;&s4NEd!pj6?OuHL+=zj_e_l9iM!}+4-`hqF8Is-cjW+Y} zoxTBP?^bMET;G7le@B4pE5h^DVVT!jnZ6)W@Q2ao@}1s$cUXFAl8v}v0F>vM(&+P5V3~(3$}+jWl<)Pg`kJey&&X%T#P}E+^_4!Dy30@;+kFM~n4W`N zCu3WZVm$r=o_UNyro+`3Omswu1Z-U^>n9G7B}3ZFq+T7Q-7`xFVw9m^{Q2o#~!+0syuM7RDZOByxP2}Oc?Qn z&3n;o+m0W6Y&*92+7`^6`SZkaBM-dQzTG$AMqR&)CF>*>&*jQ-ez!ZlrjTBxzoPnV zcrIIezKT3o^xL&VVj=^-SpFx%xnr-$6wcjYpGnj_wh{ZAK zJ;=3cGm*g(vVE0opVeDd4tq<+g6sCrRg(raAC_8`ACjsS?vqFF|F=B$$bItMGj(NP zpPu6BF;li~TrJx+thUXYG0FDr$lDQ(qyO+QS%g(s1O zc(Tko9Rf?%Iuy(BDP&%0vqPVqc_!2LwnDC{-FTm{-Roq}yb8vW#@W8<-}l^C z{rhZxujAVz@NcQtut7t55&l~pfA+^$w#H#tzAS%*7vuYIjw{CVpxB52iHkg7iwX6U z=-{0a6OPAPPZfU=iecW@kt~yKhVmTb94tGu*_mhMIV_f4dA9nEmM@78+$H|2rpvZz z-NkcAXX*1sQ)yeTinOcuxQu?IxlDNHW%;ntW74)}C23Om0eR-}itW^%`~3>mtniYF<3{8U8Pt1Q!}@hUzU9_iDuU%}5!7$$HrKD?(gFLWt{9&G zkUV$!_=E9j$>{&Z!V^UJOH|NKi3;2y(V_mzCupw8Ecw+ebE!Q?5p4#~g{(#>UAFv2 zSYaDcbv?4|5@<&u8@`@b^R{??&{ljqy&xMuY$G1s+ROCLFUhoCU8QZE8dB@w z`{n+B-!6|l@Nap(aYGr{?{k?uYl_Wx%~IQXj8`u6oNk-;-SG3{M-GhX-J{FAiVs(4 zbK7mV{R=GfT3^L9mPK^DOlaGA#xXAId;P1v{%YxS>*t>I$VrJipOq9XsR{HJK@t_R zM@0Jt+R~uXgHrLHe@T@J_e#b4@0N$|y-R96Rz;qu_L#iav4c#V zG)7jh@UZRP;$5%@;fwX}Cw^V<-Ke2K-9P?d(skEg{|s3AKWB#Vxb(Vhc)qN5j2E-- z;p91#-=MzmJ18#PdS>kJ*#1JpC&wH*m{5?B5GlzqVGB>)hkP-3J*xV8r7w4 z&Bvu`#Rui3=bx1kL;B0IMc>0`e-`&I95JKt#4qW?`d zUtbkGD^KFgxcha}54_y-%2nW*ZJ>PD&Tp;DOpKI+U^y`=SZQNO-~rS-pr;6qn~=G9 z#VyAHEq=LVpRiDyEibIcQY>B8-r1^eIBFc~c+TT5RvS=l!QLKN^Nv9+gy#rGbU6Eu zTV&h(NwQ`9r?PtFdor#WC4>wNCI(ZhSkq(tqLfnpLDul?Uainq<7D)UES`)U91Z8rH2P?Otdot)8qTEuO9}1ABCl zd6P%Wx<#`JcC7aLZS%?nzie7D|F>lx(|;ZR%@+}a`h2>iY2yZ?@m<_v73ZvhK>~Ui zfA~88+I%~BF6uchi)ZBYwy9$W9ZLz{A_)<@B`$QQ#D<{05w;f*An{<2{XR06fVxIZ z6zX=0VfYNx=*W2?&-B_s;5GpJ?FWm{_$ags)a5Lu3wdUZMD;Du@+R|Iv&@ZH`LvSzA8cz-K<=Z_Gdu{~u{w>PCzlbX`}sj5;R z{^QxYPsxkVJT33EZ7x#=d?4TT?TGv$-^@U0FK4*;Xcx{`&mt#dCkz zzJA$HzTWfCu3R|%tk;}LC&!H#oY(V{u1oH{=imQ9-tM^!mYrYvm*v{dv#W=`T%Ie< z8b9zza@Zz`3)w6&0Y6Bz|3-;Euo?A@J}s#8I3~*up6zpyz^~#tl04g) zhUSw=%YRrNI+30QL2u5nnYh>(2?`95sBmb!U7z_p+mY7hB0BHjS&!G?_~^&RM&Ld7 zZxZ7SA=7FZz5^Fl+MIb8D7(oLswf-qFRgCZ6(`Hs;iKqlcd8 z-{YeVb!t`r1aRKx4CrO7|E1V2!m~r8OEo8l%(Fh_xE9;)Ij()^{yRR|xo*a(B=8&? zOqMrDl;3)Z#JN0jKQuc!MCqs+Cjnn^h*Up{F*F)& zBR10NWAb?PE#x^7Jd<5qR{$n0A5ErN1EhE7QjJ&Ix9K)z`4`PIj*ZW1c^FRsh>|z;+GPyx;5aM#0qaV@|JJG$((Pk5`WG@;P~)GbUsV>)Rvie0OXi`%FF%xOK@EZp7l7d8Z!X1y5_;{|HQ`o?z#J}*Lr^3dD7JJ!{@#7V$&gG zzwRHC814g2TP9&!z2HX|BfKPJ({c&jyh`FQ?~{E#)sKTFk}XSu@Mro z&rkMj_LXhxm&umZi)4%ULfNursbIWAc5LvGz1z1)WJr)C!;5o1NczEp>OMBqVe35# zc~;sDU!vH@dxzt7kzpaq-;n({2KZOr1KvGW`FDDF20S)3ob&t?=g@C>sHnX@60mxl z?4RFL0zE#JecyMNbz?u3X+2(-&t9$}t)H$ckKA*s)W966+EpKsM<2LHnl-K~58r!- zJdV2H(~nhxuGf}s?OPU189C_83Xf?=)-LhLSUPKJ+``G@0>^yOJL$6z-r3dknYx3J zbN-$Ozl+QH`_r=R%rg>1Mya`+lcPL`eH(pUy?g$BN9PYay*Xs$(7wwTeE)5n&$79{ zZC>MP3*EC$(qnc>W}F|Eev%rqQxe10OZfH$;_p3OwlDe)^Oh&c&K0vIVEqz_IpC-I zY}8%$(e(T|ORpnQqdp+p*DRMsBL~TtcUs7R=5?fZ)9TXW*~jFwXRFGmO{+=w7ivn6 zm+HyqEgMR|R?o;6Z5zv1?VgkI-8#yguLg?u)QPfj@dDYoah(M2*`+vD&|V?;@M)Iyj#rU--7;X)c&m!_QO&M_8KPvGkQw! z%mLyzbD(&R>?#vJc}cq9b2q8^s5E-~QK|Cq-BQ0+HF>2`J?ZjFWBKIOXXNeL56jz6 zRhG}%G%NU~$46(E&YYOPe%aiEK1=4rEt)w#dfc#n8U4C<32pmIvoZKi9z$Ht-=B_a z@{EL#<2w+wZ@=x#02_EY~UJOOpuQ)HgqGFYbA8M=lQ)WCl_p4Fjjo$j+M1@#>whg zV`Tlj$r2gp5B*Gr7F+#4#R?b--o0H`OdKU6-gr(1zFbfGx2P-qUwl&fK3_|EHL0d} z{RJL$j2`{C7(5`BYj@1D??f~kP&U4m67dRpdGZ7vG2B)QSY{r zksV)^37uY-`2#-_?}=Z_X3seixNVa}JzJrcRlb>C)*#JMTddy<5EkCZU);j(MN0P!6DkqmCvP})EFfV@(p zg1p_Zru1w3oJ{%XZTYVAt1_@vJ?YlGx;zi|+r0c-!O(%-&w9?Dl)rqz^i=PKGm{rg z8=E|QK+l{`Z?)S{r)Kpo`0j2+T+ZL0g6($g+U>#b2d2-QGU@R0MGKE%uGtBU51jP# zUGwAKEgMen_uu_(2ZPYB!jivDkpf@9+L@{~L#H>-pCO}O ze@+HKbNjsnju|cL$)Hyn$SAP6VAN3A;5A?TwrrBn1N)%2VUomtUp(gK!9S>433!YM z#@P1$y%L1B;lFj0Z1Y|!J|45gYr-g*-S<r?rqaJ@MfvopyJSe)n(|4jT2jBty_getuT;kTz$YHB zDleiY*tJvpU%wvG@8q0m6SC(||2ARLnBlSTdr{4sG@OF@+>HSB<@k~Rb*`KC>e+qn zcM~VBoiTm7@BH~58@v`T+_-GX;*Cqayf*gj+jrA|0Rz?y8#ZkE*CW0fKjN#w<9l}h zcznIOb-qO2Iu{eIvAy-nEnXbqvufpW{0@aJD>K7}-z&7`9m=ug;P)s}Qj#SRJST$7 zwPX6rcW*u?BXGVQ09|GbYtvXfh7Fe8zCNnISG102_tv~lK-IBPcg8YBjl;k*KMxd!`@U_M~ycE$SqZ-&U6FEFoTXkYOf)Lk}z(_i*4oF>8RSKu78QDQ^) z<5*-FeNwx3wsIrvUQ?IbR6w}h;pC;kh+ zlzs3gJ4bhujf3Bnc|F_7z%~t}edDUqpjt(#1@B#xQKcfTSEzt7_)79@y(gsO8?XNQ z&CvcQ=1u!HZPCo{5+;lol+nHGy9eskso4|X!EK1k`TJjFo7ZOiAL15!@Vw<5%!!WM zvF;pq;;|0S$#D+;UM%CWkGg(1$;Zd%$JDfgw!FODfv%tegUQLt zH^hOv(7^o?5`g|Gv_2Wfhz;H^(R;Q@$hwuX$7`-^pFUdrW_=?8-g6{$>l*muT{s_M zyc62&%yW$LEf&{gTRn&4$EoXc*p@g(1h!*YC$Y4f*X?k;G7i2wF6sd4^nMbBYZF43 zOp*N)d&oY_clDdlQ+$Vif_YT9wyb?)>GT|G-}P%q(|R?f)}s%gKY0(vc&bY4W{qqk z2K73-Y~J)EYnOUtdCvSUbM%)3kAC!ir`7-b$IUO|d-$tp_NDSnzpYv3(wSwhYo7m& z^}7-Gz4zXGV>fMFe+Kun!*3TJvK`LLl@RZF;xn+Lj7MMY`z~!IVAC2&1OrK6%fWIH zo~`<^@)vf7IVKZN@4*_K(&P*ES+@Z)#OnvhGBq?&dll723XjcNUou$ZXGp?x@fZh+ z-nTA zaY=e@D{w5V$48?c8N6E}wt9>Ig7Nah*Ii}n*WKj6q+YUTQeRop_gxv*y0-kM5$15$ zx>ufj=q_pa=za256P(++ymfx@Qm?nN!D|?$)(KQlkb>@SOTE;&T4} z=$d`0JX5F3!ZVp>RPNd1lj+;HY&?4ezrmRrA0g4c^JM?L;pkItMeUgNV=zZn$r8p~ z7#7>sxF0#-_@A0%s+iVejo^e_f>W)>tese49hbg?3@e_wui{uQ3wgGVZ};VTKgY4{ zp9@|&I+$Ml2MOE_UmxTr;g}B_$$8#*U)I#=u~qFv@yyS{dJeh9+!ox2H5q-2Sn{mu zfz)Y?9f9XqJ$8gK(O5)64BAuBF4Rs|OYq`}vUf}u+508*dt`UnG5kYWKjZ_^JB;it`)v9mV+#SB-YnXU#L0tp7C}@x|x+6Qljl#|3VXNWYc%4WTr3 zFZ49r$3We;z|Jx?jE|!^mx;Qm^wpX-&3n?M!i#g>1~rwQL-CF!+k@s>aZHvG9P_3> zVV}>zGun{We2aN|8{z(XzY>-_7Hiw&GdYpo8JZl;d-CD9U^)r4aqBqt_J#N3zT`R% zJ~}+uUv_L-C)+n~kYLYH#wdI?(4P}?_Qq&(gAMAjH1^b=fxPHai@nc6E zYTNpi@i+Ya@3ruKkkiuq8J=++H4^2@Gnsz4Z?BGP4yQ#*UUG!wWF$&{ey;kBEZ&op z_nNWpb70-KBa!|9d{M8-9`6-q-S;3)T_?_c)isEiw-FT)CgEYB5{h}K5m?58FLKOw zL4DTqo_HLKaZ8&O%l2(-8;bD~I4;7vy-o1^qT7bG={DE`X_$>sF1B_Zwq-;XdSC9Y?hX>waU(=cxOD zfWb2JY_*M|OzUlA-Qr!f9e94$NRqHEG9*C!G1j?enHR1ZSSmrNOK$nW7e0o51AR$V z*Jiy$^UT_zt_wo9)$^hD_8Fz>F=~E_V}7DFuS>J+s3qe0XpG};-Q@Gj)QMwHeA>11 zynp=T=KA>Fi_`2sGSe6H8zu34u|6R=*5Rzr+H+8&>w8Qdek3m^U6NzbuZxbtZ&IYl z@uP?3=n-&z5cK3n~sVGe#9oL+-kr+tOykW2DSmaV!rxwU(2<-aW-&eyRm=+OL= zYhK65rJi%jcEJ1XaUZSQg^b#{)T}E;t@DSo-WTp)lxKas_!w;GxkLMFj+bIx_ZwnR z&*V5NYliWvCdhgqHC@-iEzVg3R9*y2>OTEX;g~(=ZCUedt$DZPn%5`Ow>t;xitu!3 zUt2eCvP~F2IFU(Dgc3|Ln@MvqoPDp6_Y#T!Tre z$+16Yr5?0pq~LycNpbKVDbVK}IRd7SK(CJ+J|su-4&k@p@LS>d-HJ5aBTVV8)@WCr z!9BTD{Yd%;-M1vqc3-YFShWo>%l5$gkkP-Z-^Aek$e`hAxbJTg^qiWm+miD=LiBr( zUCrr*9J}(Y*|)9%)=U>!vM;MxC*z#IZD$$V_&(8?Yr=Djy2miMv^)v8#=Jt-Q&=;! z#(${cu0eKP!`g@Aw)AJLJMQ1J{g=t(zsYRb{DoP!-+tRG;DpynmWHb9A@v%5Z_*5_h92lDgCM_oI4hXn_oSHCff-+If*;QgZG1;2T(c+NkZr@Ti# zYJ3d-#vy+*D;4+QC5Jkw$)Ul4vTy;$DE94zhYptg{(J0fTe?n;Rc*wHYx-)|8`OP$ z(N=ITNk@=vEAaaQSf^$u;XTzHKGjyN`#xF6wAzj{;}+-S*9zsG)jId(oY_K+cF%L6 ze(QQ9d5*)mjMu3}L%+$OH5Uf&K@X$rM{ztmdk*@J zdmpM$;oZ4&XC-kgoSK}Oo+LRr_`Qmp9BB1n$p+`v{r)r6@7|+^ZS@^7E~7c4W^=yL z#`SAu+m_7|c)(wlE?S_jff+V*u=MNQQ|8V2UiSL!P<<_jZi6e%Bjvq6cr5<59DjGt zHMl*CZB4begQ}Lza|LVF$vCfAHEXmNn(HAs4UtBwObg-;;IJTG0yv#y16>CCoXC*xLd{s6~*3iX?ut1(VnRQQ44cJ0`B zW|8OIUxp7K8usk7jauG%>#ZECDUEhs);=ZiOqLn=9Gd5nYIeT|&x&b$o{F!wYSnA{ zw5fad`}-Hr)8?^X$bc>KwV)#>l~M zlk*%wo-@)I&~$jAEbWJ&<0-sG2Iqfza2~ga*U{$(yeFBr7`1ckhG+7w_1T$c-CtGh z1ip$nE173!wl7?#hq2gp^&^UD#WwwTM0lWW!}>Mn`}F!Wu+pOy-^YE5c|VfNVz#8$ zUnb9`@f_~-+1Ycr>T^k+L-Wk*GVZlU-FM!8YqGcZvYbPQvgGK|!#3(Kub;{QYxEra z{j3DAkP3zlp%%h=2t5mbQ;Tfzcb55k7dklKdH$T4(&3FZQoHu!QmtBL>Gok4*^YTm z+DBV8KzM2TXRylOxjl^Ea&`^=zB7YNQ?o7YrhZ!*uD0PbSie(uP!8HZ2R*oMH`das z%}{5pS|7B!7@i#(uAb+9PC*Y-glEe`7ss|^ek}5-*LiN^973zlY4tm;`vz+63;l}a z=fiE0VS&GH!u+)fW4_5~-Kynae0S`RU2(2md8QsS_+Dxqlbo?$oIbnq>`tRK&&7ET z=P?!SJBq7wkY|Q7&s?WRdt|_XzDol3?>W!kfs2X4JUYz5$NVPLKk~86hE{~hf&Kd= z+Ri%pS8T(7b3Pw`hloBRjlV^NHW3*XB-5sRCoeqTMCv_NTR!XdAv{Sq>Km4hvR=Y# z1GqnVq!zP(nxB_#53bV(F>)32teLxpMu?kI@<{)J$tn zqIh-oA$nc&u6ee5bMnj@jm5AvHpz9(tJ|er_pLE`whzuVvHZB=TJ=TQA9W4(PZ`#} zF%hA*K>xi33+Bx^-L=d6Q~13h6mOThB&Yhdz}2zNZG5gsT*z}-Jx6goYmIit^TjmU z9nWN%(R|#v(V>{1xr=WQH8J@44DBN&ItL+v_S)g!F=9Jr4Serq`oHIc*UOVW$z z-xjy@l6)s&oFQD+t@V*Ww1oiwy)ycnuW>)5nP@M;s(xbeoT7YmE|@;7c(yn`0*;TM zPR?5SVX)2f!XdOVXK%uFhd*)fZujN%ONh*LoIgp8++t~I zGyDn0Tb%ot^i~|7bZ|`GG}DSb`(wTCv}9kB{XvUSa(b~Kl=+Gktj zIqzJzZXd0`tRK&#u0sB#qWygG;il zHCi+M;0sL~PgpQ}=22Wfa-P28*wK7B2A#G7b!+f@nBy=wzmr$`ZFm*1&oP=DY=lOMvd zGL;A7vE2rFw|jBxeYKv0Z>8Oq|E4b?i_y3TPb9_&d5;JFK2i$C$CZBDeTl_38Aos% zg8rQ2Pu6^^i?Mj&^Q=j-oj4fPtd@F7y$+)m*l-M6G{$Lv*x*|*e$1F{ciwqtb9|qU zd!lJhOIluKo?Si1rSe>oMqi9)&2__0@4oA?bH~10rOXlV2ijLTD( z$+8aZJNQ0Dy|&ecif+q>hjH#}T5XHx0L!z0akMkGqk~D9KZW{26z*RV7O)3%T=!XX z5W%jlnOOZL3ferJK^`uNc!VD2!+jQx?DR za@r~`X3w#xZgtQVr@i2i|9FR^C%akTIS2Df=$q-EIX2I8 z1g^zVy05t{y2N>bKE>XqxNh|`E!JH%{4l)>`?d}bLr(*b4#s)@ImmioXb`SJ*e+q) zFxO){?hO&(r>={n2eoIUi#c-DMZuKdWOeZQOV?LNv~a#G_FN#|E0@dmZCf!89F6{EF7`iyeUC~u`f+*C zZjS97f;O`)WTc}ejdMQdQ1LOJWBWOVHc)szu+9MX!<)k8wl)9k^G-S_#JeA!7Dzmjui|)pKx*uno_mYvSs8d;OhlL4|srzTEE7 zReP}XR`aYFcIF%F)|k7sAN__7$9wDJ;rQ(1EMDZ9*`><|gTV`#BGV3^q1T=JgUV}I zw@9;mhvhd)%d@NJ_@ijF_R^YVcgy;%TD2NFZ{EDHeS7!(mYtPlJ9+##dA2F0q2Y?- zlgH)Mk0<2xk0(`-EoxvU=0F{!ALU$6Tzktn3O0Yl{-;l2-%}?fU-c1ll~(-e5 zL2g6el>3wM!ule0*RI*vu6}a?$G3cj%ele9GTTVu+=D3G7s%Ut#qpP3da0Ka*G^hZ zbe(*2$vm?L?yS$QKH6EIU3o6acQ{{rrL|huqV@7(^$usx;i}WcG41f!_;+c}Yu<9p zExo=SKYq>XRjX2?BO_HU?*w%jntci^pE-R>&YU?VXV09LA5R=dEihk=({TOl>C?uQy9D0{Rn6YsHngsD-j}`hr!=_;!$moEW}5Q^ zICp*S+}XLUUTOImG}$pWqxD&7Gr7Jzo{Q6H?KxbT*8M_#U7==KFEz`0>CCkD8+z&L zJ1)kwX51aqn(c?c`Ag955p!nG-nV7T=CcX#qO51rkC4wF5huZMdRnS23I01S4)>`J z3zKyC2|lk_K6h5m+2br&XFG5Xa-RcD&dr-*5LY^f5dyXfI>UA4koSOoQWG981;4;ZN9Kr5ER89xn@@ zhguyU!uveoo+N%7Bnj8Oq=V6Pj*p^msY5-+HoZ*a^9c3ZsMyc3OtI!DT624;zvS0B z3N=}K9lg|SbKZ^bs#U)Z`0V5OM)m9Qetr)kZblSp^u>9;m`1xY?L61cm1pgxHP5a( ztvS|9XP!&bH!O*1XP!%9nmN)@5$ms1t5&UdpFVwNPMS1n)#AmA4hIJZLD#ZzJvzqH z!3S$5$Kk!{BN$w#_po&Rv|ZaReb-#m$FR@&%TH(JXR!a1UDMB;{!z7`9B{>Xgp6GD zLvu0SNsVW%hTerizkUM2`Louw@z7jw&exKAj`ed)N!8*N=T^<~@F8n1BHNAjBJ|!C z*VeppjsdZDNd3;n*iH)O_Q&j8FEN`IOCs)vlZJcJli>{Lb_T|vIM*q5`0{l|s=nJkx;XZj9jeRgH~ax~hNX?Gf39Mi5mm&7#nS~IPej%^P-@WA_1rcB-! z5O4r2p=JWT*52e4{WF-Pj&uDKwD>gr%IQ; zKkpb1V*MO7_B`}8)539W%-Z>quzJ3v(Y7diZxG+wR5XqoQ8IwgX5so zan=;sk5!y=oQQthT|n2v1NRp!_4LT=@kzIw9-n=(9^Y351bub+BHjb{R>U^W&t`o? z^ITS@FGr*4J+waSWl1_+TBb|lT>A}oOIMzq_h~+0K>y_%H*PqYj2bPuCclx95w^GA zetXs6F9y%@^jx?D&u0W-9yjZ+sDazgoH}KrH#z+yxF@6V*jzt%_OuOQc^11~YcI~F zgL$X*b7$dg@R%OvsOo2eU+6hGXHA9kR21v<>iB&0{H)vP`2e`DkMcTcshB^4+DjD1 zn0S403fN*DlH;gs6YN{EA8Pp)j<+6?i~~C*a$0{$3D|+QfOf!h0)l=#M~(ZWVTpCL z0X@FYI(iO{$+0MB-t~L~YB}c|DAqOSPK-NhEOt+h-vqYp*uKr?<>hs%bLYfopCPw=I_x+^3k#=R*5A_ldPhvdlR$TJ!VZgOsnqd4Tr~qE}aQ zXzboy&uii9sN>|FoYTW7&Z+6zo3mePueH##M4}z8@mX`OLx&C{&?zKemR92)qFARs z(`P&D^W|!^JKynpGOc;mOLzXGI1i%tb!OOgUGJlpd|t1+TRJ~q8~e7dTD5BT&p+=q zX2OK=i#)O}u~LBHeZyW+7`d&ig(p0|8G`>NI)F2y?h zmC|AWA+VX%4H zhPj3|EYSum@8aAZ$UNH*+l`|wsdERmk_Z>TS z?7>l^M$R2I>g(OTdiBh2_xfvT$eZTb)kC}E*|jFE>m8-xnSH~HFzGJCFZDYG2@0|Z)`Jlr6$f)w= zVDT(8pSu6kPv;On$xlE3BtQTBlMNw1|MIi^^2^U$x8XU&Iko?Bv^|_ZY$|@jvS{Eq zJe~^u93OMN0Pkhff#VeH+P%y6;!75 z9IoEQxoz$?Vy)cduHt zDhkg%E;o-4)#E22ITC`}<3;&K92+b^)oVUTCm%dU#KYrB${IWlLozs%*7X&^7=WJa{ z@Uvga>)gHOs^#Gd=9u^QuY)Lw1D?NiQ2)5Uj@FebRqFiIQ%`oTSFc{@x^?TSCD)4! z?xUl6_3EAZdK|AkqP9!0tx{_lMfl`6VR3)h*Zi3bm<*T*yM5vo`PuFEYed{`FV{qNyM3a3F$XFqHn;nit5EELicx^#4>a8EJ6sP-o~eOt59WS~qLa5^bEtr|aLCBx*wC9cOrPd=-k$e8eV_mP zf8KL?D2jm}e}9S`sfJf5%9Em~w-D^2K0rvnJ?swH9k4sF+W`iHq9P;1sp9MTjJQkD z6azb~F!B3ttYf5o5kb<`a&I}$@}}cDJK7Eg1_WSAh6Ow@ck_4*o85trIr6Bp5wgS^ zH_9Cq3TYLsQVe!>w)^_~A782Zmko^{TNo)?T$bVt-OymfI>3A)ze&S`r%sQ&F|u)L!%?kz4lFfwDa4?j#~5M z&z^`EkpE_7xtl~dv!;?ufL6+g2AG`~fySzm&CJB8jm(4#-C3zu6LQ$8C-O4Cb-5A~ z>G1j?ABzawVw0gaCdFgSgP$9JgqkAuW@Sp8xjOHAPJ0XY)8+=wzNEx> z;_tJxxM0ojt%-6&JodY|cvY0-p3g9OCFIc&v1_NJOv0IiUMihz5C zXp;!}s0HhV{)kbZRK$NY$D5Fk4)>+h)l?rXE4jYskl#~1c{2Y2)ZpoHz}-7HJL~xL z)C5~iE7$Oz+#wo9h6Z3}avYY8dN7-oz__G?C7l|yYNbVo61^gN$bPYc9&L+-{ChK# zV>Nv}UGLY|ah=`?3bOct2hx)KuE?v1J3?L`y%6ssM*@9IONvg-@p*X)nRI%^Y`QO# ziZ-?C1=v_yfmO2!)>qBg8ezq30OO(-^r%Ixkbnwnwt)T+pJ;N9y5v&PAA(t4&(J{s z$L#cLPM#hfB>z5SKVq$c#REJ)hSmj*bpiYikSZ&YfQT&#Pbr2Zz`?wf%a#19k`g VM-ISqLWkr3cDVpsjOR=be*!Q1&oKZ1 literal 0 HcmV?d00001 diff --git a/sim/cluster0/lab-seeds/backend/public/assets/vendor/nuevo-player/js/nsvideo.min.js b/sim/cluster0/lab-seeds/backend/public/assets/vendor/nuevo-player/js/nsvideo.min.js new file mode 100644 index 0000000..b0f4920 --- /dev/null +++ b/sim/cluster0/lab-seeds/backend/public/assets/vendor/nuevo-player/js/nsvideo.min.js @@ -0,0 +1,3 @@ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).videojs=t()}(this,function(){"use strict";for(var e,t="7.20.3",i={},n=function(e,t){return i[e]=i[e]||[],t&&(i[e]=i[e].concat(t)),i[e]},r=function(e,t){var r=n(e).indexOf(t);return!(r<=-1||(i[e]=i[e].slice(),i[e].splice(r,1),0))},a={prefixed:!0},s=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"]],o=s[0],u=0;u0?o:0)}if(window.console){var u=window.console[i];u||"debug"!==i||(u=window.console.info||window.console.log),u&&a&&s.test(i)&&u[Array.isArray(r)?"apply":"call"](window.console,r)}}}(t,r),r.createLogger=function(i){return e(t+": "+i)},r.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},r.level=function(e){if("string"==typeof e){if(!r.levels.hasOwnProperty(e))throw new Error('"'+e+'" in not a valid log level');n=e}return n},(r.history=function(){return c?[].concat(c):[]}).filter=function(e){return(c||[]).filter(function(t){return new RegExp(".*"+e+".*").test(t[0])})},r.history.clear=function(){c&&(c.length=0)},r.history.disable=function(){null!==c&&(c.length=0,c=null)},r.history.enable=function(){null===c&&(c=[])},r.error=function(){for(var e=arguments.length,t=new Array(e),r=0;r1?t-1:0),n=1;n=0)throw new Error("class has illegal whitespace characters")}function X(){return document===window.document}function K(e){return b(e)&&1===e.nodeType}function Y(){try{return window.parent!==window.self}catch(e){return!0}}function Q(e){return function(t,i){if(!G(t))return document[e](null);G(i)&&(i=document.querySelector(i));var n=K(i)?i:document;return n[e]&&n[e](t)}}function $(e,t,i,n){void 0===e&&(e="div"),void 0===t&&(t={}),void 0===i&&(i={});var r=document.createElement(e);return Object.getOwnPropertyNames(t).forEach(function(e){var i=t[e];-1!==e.indexOf("aria-")||"role"===e||"type"===e?(d.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set "+e+" to "+i+"."),r.setAttribute(e,i)):"textContent"===e?J(r,i):r[e]===i&&"tabIndex"!==e||(r[e]=i)}),Object.getOwnPropertyNames(i).forEach(function(e){r.setAttribute(e,i[e])}),n&&ve(r,n),r}function J(e,t){return void 0===e.textContent?e.innerText=t:e.textContent=t,e}function Z(e,t){t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)}function ee(e,t){return z(t),e.classList?e.classList.contains(t):(i=t,new RegExp("(^|\\s)"+i+"($|\\s)")).test(e.className);var i}function te(e,t){return e.classList?e.classList.add(t):ee(e,t)||(e.className=(e.className+" "+t).trim()),e}function ie(e,t){return e?(e.classList?e.classList.remove(t):(z(t),e.className=e.className.split(/\s+/).filter(function(e){return e!==t}).join(" ")),e):(d.warn("removeClass was called with an element that doesn't exist"),null)}function ne(e,t,i){var n=ee(e,t);if("function"==typeof i&&(i=i(e,t)),"boolean"!=typeof i&&(i=!n),i!==n)return i?te(e,t):ie(e,t),e}function re(e,t){Object.getOwnPropertyNames(t).forEach(function(i){var n=t[i];null==n||!1===n?e.removeAttribute(i):e.setAttribute(i,!0===n?"":n)})}function ae(e){var t={};if(e&&e.attributes&&e.attributes.length>0)for(var i=e.attributes,n=i.length-1;n>=0;n--){var r=i[n].name,a=i[n].value;"boolean"!=typeof e[r]&&-1===",autoplay,controls,playsinline,loop,muted,default,defaultMuted,".indexOf(","+r+",")||(a=null!==a),t[r]=a}return t}function se(e,t){return e.getAttribute(t)}function oe(e,t,i){e.setAttribute(t,i)}function ue(e,t){e.removeAttribute(t)}function le(){document.body.focus(),document.onselectstart=function(){return!1}}function ce(){document.onselectstart=function(){return!0}}function de(e){if(e&&e.getBoundingClientRect&&e.parentNode){var t=e.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(function(e){void 0!==t[e]&&(i[e]=t[e])}),i.height||(i.height=parseFloat(w(e,"height"))),i.width||(i.width=parseFloat(w(e,"width"))),i}}function he(e){if(!e||e&&!e.offsetParent)return{left:0,top:0,width:0,height:0};for(var t=e.offsetWidth,i=e.offsetHeight,n=0,r=0;e.offsetParent&&e!==document[a.fullscreenElement];)n+=e.offsetLeft,r+=e.offsetTop,e=e.offsetParent;return{left:n,top:r,width:t,height:i}}function pe(e,t){var i={x:0,y:0};if(q)for(var n=e;n&&"html"!==n.nodeName.toLowerCase();){var r=w(n,"transform");if(/^matrix/.test(r)){var a=r.slice(7,-1).split(/,\s/).map(Number);i.x+=a[4],i.y+=a[5]}else if(/^matrix3d/.test(r)){var s=r.slice(9,-1).split(/,\s/).map(Number);i.x+=s[12],i.y+=s[13]}n=n.parentNode}var o={},u=he(t.target),l=he(e),c=l.width,d=l.height,h=t.offsetY-(l.top-u.top),p=t.offsetX-(l.left-u.left);return t.changedTouches&&(p=t.changedTouches[0].pageX-l.left,h=t.changedTouches[0].pageY+l.top,q&&(p-=i.x,h-=i.y)),o.y=1-Math.max(0,Math.min(1,h/d)),o.x=Math.max(0,Math.min(1,p/c)),o}function fe(e){return b(e)&&3===e.nodeType}function me(e){for(;e.firstChild;)e.removeChild(e.firstChild);return e}function ge(e){return"function"==typeof e&&(e=e()),(Array.isArray(e)?e:[e]).map(function(e){return"function"==typeof e&&(e=e()),K(e)||fe(e)?e:"string"==typeof e&&/\S/.test(e)?document.createTextNode(e):void 0}).filter(function(e){return e})}function ve(e,t){return ge(t).forEach(function(t){return e.appendChild(t)}),e}function ye(e,t){return ve(me(e),t)}function _e(e){return void 0===e.button&&void 0===e.buttons||0===e.button&&void 0===e.buttons||"mouseup"===e.type&&0===e.button&&0===e.buttons||0===e.button&&1===e.buttons}var be,Te=Q("querySelector"),we=Q("querySelectorAll"),Se=Object.freeze({__proto__:null,isReal:X,isEl:K,isInFrame:Y,createEl:$,textContent:J,prependTo:Z,hasClass:ee,addClass:te,removeClass:ie,toggleClass:ne,setAttributes:re,getAttributes:ae,getAttribute:se,setAttribute:oe,removeAttribute:ue,blockTextSelection:le,unblockTextSelection:ce,getBoundingClientRect:de,findPosition:he,getPointerPosition:pe,isTextNode:fe,emptyEl:me,normalizeContent:ge,appendContent:ve,insertContent:ye,isSingleLeftClick:_e,$:Te,$$:we}),Ee=!1,ke=function(){if(!1!==be.options.autoSetup){var e=Array.prototype.slice.call(document.getElementsByTagName("video")),t=Array.prototype.slice.call(document.getElementsByTagName("audio")),i=Array.prototype.slice.call(document.getElementsByTagName("video-js")),n=e.concat(t,i);if(n&&n.length>0)for(var r=0,a=n.length;r-1&&(r={passive:!0}),e.addEventListener(t,n.dispatcher,r)}else e.attachEvent&&e.attachEvent("on"+t,n.dispatcher)}function He(e,t,i){if(Re.has(e)){var n=Re.get(e);if(n.handlers){if(Array.isArray(t))return Ne(He,e,t,i);var r=function(e,t){n.handlers[t]=[],Me(e,t)};if(void 0!==t){var a=n.handlers[t];if(a)if(i){if(i.guid)for(var s=0;s=t&&(e.apply(void 0,arguments),i=n)}},Qe=function(e,t,i,n){var r;void 0===n&&(n=window);var a=function(){var a=this,s=arguments,o=function(){r=null,o=null,i||e.apply(a,s)};!r&&i&&e.apply(a,s),n.clearTimeout(r),r=n.setTimeout(o,t)};return a.cancel=function(){n.clearTimeout(r),r=null},a},$e=function(){};$e.prototype.allowedEvents_={},$e.prototype.on=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},je(this,e,t),this.addEventListener=i},$e.prototype.addEventListener=$e.prototype.on,$e.prototype.off=function(e,t){He(this,e,t)},$e.prototype.removeEventListener=$e.prototype.off,$e.prototype.one=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},Ve(this,e,t),this.addEventListener=i},$e.prototype.any=function(e,t){var i=this.addEventListener;this.addEventListener=function(){},We(this,e,t),this.addEventListener=i},$e.prototype.trigger=function(e){var t=e.type||e;"string"==typeof e&&(e={type:t}),e=Ue(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),qe(this,e)},$e.prototype.dispatchEvent=$e.prototype.trigger,$e.prototype.queueTrigger=function(e){var t=this;Ge||(Ge=new Map);var i=e.type||e,n=Ge.get(this);n||(n=new Map,Ge.set(this,n));var r=n.get(i);n.delete(i),window.clearTimeout(r);var a=window.setTimeout(function(){0===n.size&&(n=null,Ge.delete(t)),t.trigger(e)},0);n.set(i,a)};var Je=function(e){return"function"==typeof e.name?e.name():"string"==typeof e.name?e.name:e.name_?e.name_:e.constructor&&e.constructor.name?e.constructor.name:typeof e},Ze=function(e){return e instanceof $e||!!e.eventBusEl_&&["on","one","off","trigger"].every(function(t){return"function"==typeof e[t]})},et=function(e){return"string"==typeof e&&/\S/.test(e)||Array.isArray(e)&&!!e.length},tt=function(e,t,i){if(!e||!e.nodeName&&!Ze(e))throw new Error("Invalid target for "+Je(t)+"#"+i+"; must be a DOM node or evented object.")},it=function(e,t,i){if(!et(e))throw new Error("Invalid event type for "+Je(t)+"#"+i+"; must be a non-empty string or array.")},nt=function(e,t,i){if("function"!=typeof e)throw new Error("Invalid listener for "+Je(t)+"#"+i+"; must be a function.")},rt=function(e,t,i){var n,r,a,s=t.length<3||t[0]===e||t[0]===e.eventBusEl_;return s?(n=e.eventBusEl_,t.length>=3&&t.shift(),r=t[0],a=t[1]):(n=t[0],r=t[1],a=t[2]),tt(n,e,i),it(r,e,i),nt(a,e,i),{isTargetingSelf:s,target:n,type:r,listener:a=Ke(e,a)}},at=function(e,t,i,n){tt(e,e,t),e.nodeName?ze[t](e,i,n):e[t](i,n)},st={on:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n=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}},t.isDisposed=function(){return Boolean(this.isDisposed_)},t.player=function(){return this.player_},t.options=function(e){return e?(this.options_=ht(this.options_,e),this.options_):this.options_},t.el=function(){return this.el_},t.createEl=function(e,t,i){return $(e,t,i)},t.localize=function(e,t,i){void 0===i&&(i=e);var n=this.player_.language&&this.player_.language(),r=this.player_.languages&&this.player_.languages(),a=r&&r[n],s=n&&n.split("-")[0],o=r&&r[s],u=i;return a&&a[e]?u=a[e]:o&&o[e]&&(u=o[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(e,i){var n=t[i-1],r=n;return void 0===n&&(r=e),r})),u},t.handleLanguagechange=function(){},t.contentEl=function(){return this.contentEl_||this.el_},t.id=function(){return this.id_},t.name=function(){return this.name_},t.children=function(){return this.children_},t.getChildById=function(e){return this.childIndex_[e]},t.getChild=function(e){if(e)return this.childNameIndex_[e]},t.getDescendant=function(){for(var e=arguments.length,t=new Array(e),i=0;i=0;i--)if(this.children_[i]===e){t=!0,this.children_.splice(i,1);break}if(t){e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[dt(e.name())]=null,this.childNameIndex_[ct(e.name())]=null;var n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}}},t.initChildren=function(){var t=this,i=this.options_.children;if(i){var n,r=this.options_,a=e.getComponent("Tech");(n=Array.isArray(i)?i:Object.keys(i)).concat(Object.keys(this.options_).filter(function(e){return!n.some(function(t){return"string"==typeof t?e===t:e===t.name})})).map(function(e){var n,r;return"string"==typeof e?r=i[n=e]||t.options_[n]||{}:(n=e.name,r=e),{name:n,opts:r}}).filter(function(t){var i=e.getComponent(t.opts.componentClass||dt(t.name));return i&&!a.isTech(i)}).forEach(function(e){var i=e.name,n=e.opts;if(void 0!==r[i]&&(n=r[i]),!1!==n){!0===n&&(n={}),n.playerOptions=t.options_.playerOptions;var a=t.addChild(i,n);a&&(t[i]=a)}})}},t.buildCSSClass=function(){return""},t.ready=function(e,t){if(void 0===t&&(t=!1),e)return this.isReady_?void(t?e.call(this):this.setTimeout(e,1)):(this.readyQueue_=this.readyQueue_||[],void this.readyQueue_.push(e))},t.triggerReady=function(){this.isReady_=!0,this.setTimeout(function(){var e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(e){e.call(this)},this),this.trigger("ready")},1)},t.$=function(e,t){return Te(e,t||this.contentEl())},t.$$=function(e,t){return we(e,t||this.contentEl())},t.hasClass=function(e){return ee(this.el_,e)},t.addClass=function(e){te(this.el_,e)},t.removeClass=function(e){ie(this.el_,e)},t.toggleClass=function(e,t){ne(this.el_,e,t)},t.show=function(){this.removeClass("vjs-hidden")},t.hide=function(){this.addClass("vjs-hidden")},t.lockShowing=function(){this.addClass("vjs-lock-showing")},t.unlockShowing=function(){this.removeClass("vjs-lock-showing")},t.getAttribute=function(e){return se(this.el_,e)},t.setAttribute=function(e,t){oe(this.el_,e,t)},t.removeAttribute=function(e){ue(this.el_,e)},t.width=function(e,t){return this.dimension("width",e,t)},t.height=function(e,t){return this.dimension("height",e,t)},t.dimensions=function(e,t){this.width(e,!0),this.height(t)},t.dimension=function(e,t,i){if(void 0!==t)return null!==t&&t==t||(t=0),-1!==(""+t).indexOf("%")||-1!==(""+t).indexOf("px")?this.el_.style[e]=t:this.el_.style[e]="auto"===t?"":t+"px",void(i||this.trigger("componentresize"));if(!this.el_)return 0;var n=this.el_.style[e],r=n.indexOf("px");return-1!==r?parseInt(n.slice(0,r),10):parseInt(this.el_["offset"+dt(e)],10)},t.currentDimension=function(e){var t=0;if("width"!==e&&"height"!==e)throw new Error("currentDimension only accepts width or height value");if(t=w(this.el_,e),0===(t=parseFloat(t))||isNaN(t)){var i="offset"+dt(e);t=this.el_[i]}return t},t.currentDimensions=function(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}},t.currentWidth=function(){return this.currentDimension("width")},t.currentHeight=function(){return this.currentDimension("height")},t.focus=function(){this.el_.focus()},t.blur=function(){this.el_.blur()},t.handleKeyDown=function(e){this.player_&&(vt.isEventKey(e,"Tab")||e.stopPropagation(),this.player_.handleKeyDown(e))},t.handleKeyPress=function(e){this.handleKeyDown(e)},t.emitTapEvents=function(){var e,t=0,i=null;this.on("touchstart",function(n){1===n.touches.length&&(i={pageX:n.touches[0].pageX,pageY:n.touches[0].pageY},t=window.performance.now(),e=!0)}),this.on("touchmove",function(t){if(t.touches.length>1)e=!1;else if(i){var n=t.touches[0].pageX-i.pageX,r=t.touches[0].pageY-i.pageY;Math.sqrt(n*n+r*r)>10&&(e=!1)}});var n=function(){e=!1};this.on("touchleave",n),this.on("touchcancel",n),this.on("touchend",function(n){i=null,!0===e&&window.performance.now()-t<200&&(n.preventDefault(),this.trigger("tap"))})},t.enableTouchActivity=function(){if(this.player()&&this.player().reportUserActivity){var e,t=Ke(this.player(),this.player().reportUserActivity);this.on("touchstart",function(){t(),this.clearInterval(e),e=this.setInterval(t,250)});var i=function(i){t(),this.clearInterval(e)};this.on("touchmove",t),this.on("touchend",i),this.on("touchcancel",i)}},t.setTimeout=function(e,t){var i,n=this;return e=Ke(this,e),this.clearTimersOnDispose_(),i=window.setTimeout(function(){n.setTimeoutIds_.has(i)&&n.setTimeoutIds_.delete(i),e()},t),this.setTimeoutIds_.add(i),i},t.clearTimeout=function(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),window.clearTimeout(e)),e},t.setInterval=function(e,t){e=Ke(this,e),this.clearTimersOnDispose_();var i=window.setInterval(e,t);return this.setIntervalIds_.add(i),i},t.clearInterval=function(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),window.clearInterval(e)),e},t.requestAnimationFrame=function(e){var t,i=this;return this.supportsRaf_?(this.clearTimersOnDispose_(),e=Ke(this,e),t=window.requestAnimationFrame(function(){i.rafIds_.has(t)&&i.rafIds_.delete(t),e()}),this.rafIds_.add(t),t):this.setTimeout(e,1e3/60)},t.requestNamedAnimationFrame=function(e,t){var i=this;if(!this.namedRafs_.has(e)){this.clearTimersOnDispose_(),t=Ke(this,t);var n=this.requestAnimationFrame(function(){t(),i.namedRafs_.has(e)&&i.namedRafs_.delete(e)});return this.namedRafs_.set(e,n),e}},t.cancelNamedAnimationFrame=function(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))},t.cancelAnimationFrame=function(e){return this.supportsRaf_?(this.rafIds_.has(e)&&(this.rafIds_.delete(e),window.cancelAnimationFrame(e)),e):this.clearTimeout(e)},t.clearTimersOnDispose_=function(){var e=this;this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",function(){[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(function(t){var i=t[0],n=t[1];e[i].forEach(function(t,i){return e[n](i)})}),e.clearingTimersOnDispose_=!1}))},e.registerComponent=function(t,i){if("string"!=typeof t||!t)throw new Error('Illegal component name, "'+t+'"; must be a non-empty string.');var n=e.getComponent("Tech"),r=n&&n.isTech(i),a=e===i||e.prototype.isPrototypeOf(i.prototype);if(r||!a)throw new Error('Illegal component, "'+t+'"; '+(r?"techs must be registered using Tech.registerTech()":"must be a Component subclass")+".");t=dt(t),e.components_||(e.components_={});var s=e.getComponent("Player");if("Player"===t&&s&&s.players){var o=s.players,u=Object.keys(o);if(o&&u.length>0&&u.map(function(e){return o[e]}).every(Boolean))throw new Error("Can not register Player component after player has been created.")}return e.components_[t]=i,e.components_[ct(t)]=i,i},e.getComponent=function(t){if(t&&e.components_)return e.components_[t]},e}();yt.prototype.supportsRaf_="function"==typeof window.requestAnimationFrame&&"function"==typeof window.cancelAnimationFrame,yt.registerComponent("Component",yt);var _t=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},bt=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t};function Tt(e,t,i,n){return function(e,t,i){if("number"!=typeof t||t<0||t>i)throw new Error("Failed to execute '"+e+"' on 'TimeRanges': The index provided ("+t+") is non-numeric or out of bounds (0-"+i+").")}(e,n,i.length-1),i[n][t]}function wt(e){var t;return t=void 0===e||0===e.length?{length:0,start:function(){throw new Error("This TimeRanges object is empty")},end:function(){throw new Error("This TimeRanges object is empty")}}:{length:e.length,start:Tt.bind(null,"start",0,e),end:Tt.bind(null,"end",1,e)},window.Symbol&&window.Symbol.iterator&&(t[window.Symbol.iterator]=function(){return(e||[]).values()}),t}function St(e,t){return Array.isArray(e)?wt(e):void 0===e||void 0===t?wt():wt([[e,t]])}function Et(e,t){var i,n,r=0;if(!t)return 0;e&&e.length||(e=St(0,0));for(var a=0;at&&(n=t),r+=n-i;return r/t}function kt(e){if(e instanceof kt)return e;"number"==typeof e?this.code=e:"string"==typeof e?this.message=e:b(e)&&("number"==typeof e.code&&(this.code=e.code),_(this,e)),this.message||(this.message=kt.defaultMessages[this.code]||"")}kt.prototype.code=0,kt.prototype.message="",kt.prototype.status=null,kt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],kt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."};for(var Ct=0;Ct=0;n--)if(t[n].enabled){Rt(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,i}bt(t,e);var i=t.prototype;return i.addTrack=function(t){var i=this;t.enabled&&Rt(this,t),e.prototype.addTrack.call(this,t),t.addEventListener&&(t.enabledChange_=function(){i.changing_||(i.changing_=!0,Rt(i,t),i.changing_=!1,i.trigger("change"))},t.addEventListener("enabledchange",t.enabledChange_))},i.removeTrack=function(t){e.prototype.removeTrack.call(this,t),t.removeEventListener&&t.enabledChange_&&(t.removeEventListener("enabledchange",t.enabledChange_),t.enabledChange_=null)},t}(Dt),Nt=function(e,t){for(var i=0;i=0;n--)if(t[n].selected){Nt(t,t[n]);break}return(i=e.call(this,t)||this).changing_=!1,Object.defineProperty(_t(i),"selectedIndex",{get:function(){for(var e=0;e=400&&n.statusCode<=599){var a=r;if(t)if($t.TextDecoder){var s=(void 0===(o=n.headers&&n.headers["content-type"])&&(o=""),o.toLowerCase().split(";").reduce(function(e,t){var i=t.split("="),n=i[0],r=i[1];return"charset"===n.trim()?r.trim():e},"utf-8"));try{a=new TextDecoder(s).decode(r)}catch(e){}}else a=String.fromCharCode.apply(null,new Uint8Array(r));e({cause:a})}else e(null,r);var o}};var ei=function(e){var t={};return e?(e.trim().split("\n").forEach(function(e){var i=e.indexOf(":"),n=e.slice(0,i).trim().toLowerCase(),r=e.slice(i+1).trim();void 0===t[n]?t[n]=r:Array.isArray(t[n])?t[n].push(r):t[n]=[t[n],r]}),t):t},ti=ri,ii=ri;function ni(e,t,i){var n=e;return Jt(t)?(i=t,"string"==typeof e&&(n={uri:e})):n=m({},t,{uri:e}),n.callback=i,n}function ri(e,t,i){return ai(t=ni(e,t,i))}function ai(e){if(void 0===e.callback)throw new Error("callback argument missing");var t=!1,i=function(i,n,r){t||(t=!0,e.callback(i,n,r))};function n(e){return clearTimeout(u),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,i(e,m)}function r(){if(!s){var t;clearTimeout(u),t=e.useXDR&&void 0===o.status?200:1223===o.status?204:o.status;var n=m,r=null;return 0!==t?(n={body:function(){var e=void 0;if(e=o.response?o.response:o.responseText||function(e){try{if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;if(""===e.responseType&&!t)return e.responseXML}catch(e){}return null}(o),f)try{e=JSON.parse(e)}catch(e){}return e}(),statusCode:t,method:c,headers:{},url:l,rawRequest:o},o.getAllResponseHeaders&&(n.headers=ei(o.getAllResponseHeaders()))):r=new Error("Internal XMLHttpRequest Error"),i(r,n,n.body)}}var a,s,o=e.xhr||null;o||(o=e.cors||e.useXDR?new ri.XDomainRequest:new ri.XMLHttpRequest);var u,l=o.url=e.uri||e.url,c=o.method=e.method||"GET",d=e.body||e.data,h=o.headers=e.headers||{},p=!!e.sync,f=!1,m={body:void 0,headers:{},statusCode:0,method:c,url:l,rawRequest:o};if("json"in e&&!1!==e.json&&(f=!0,h.accept||h.Accept||(h.Accept="application/json"),"GET"!==c&&"HEAD"!==c&&(h["content-type"]||h["Content-Type"]||(h["Content-Type"]="application/json"),d=JSON.stringify(!0===e.json?d:e.json))),o.onreadystatechange=function(){4===o.readyState&&setTimeout(r,0)},o.onload=r,o.onerror=n,o.onprogress=function(){},o.onabort=function(){s=!0},o.ontimeout=n,o.open(c,l,!p,e.username,e.password),p||(o.withCredentials=!!e.withCredentials),!p&&e.timeout>0&&(u=setTimeout(function(){if(!s){s=!0,o.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",n(e)}},e.timeout)),o.setRequestHeader)for(a in h)h.hasOwnProperty(a)&&o.setRequestHeader(a,h[a]);else if(e.headers&&!function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(o.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(o),o.send(d||null),o}ri.XMLHttpRequest=$t.XMLHttpRequest||function(){},ri.XDomainRequest="withCredentials"in new ri.XMLHttpRequest?ri.XMLHttpRequest:$t.XDomainRequest,function(e,t){for(var i=0;i0&&(window.console&&window.console.groupCollapsed&&window.console.groupCollapsed("Text Track parsing errors for "+t.src),n.forEach(function(e){return d.error(e)}),window.console&&window.console.groupEnd&&window.console.groupEnd()),i.flush()},oi=function(e,t){var i={uri:e},n=Yt(e);n&&(i.cors=n);var r="use-credentials"===t.tech_.crossOrigin();r&&(i.withCredentials=r),ti(i,Ke(this,function(e,i,n){if(e)return d.error(e,i);t.loaded_=!0,"function"!=typeof window.WebVTT?t.tech_&&t.tech_.any(["vttjsloaded","vttjserror"],function(e){if("vttjserror"!==e.type)return si(n,t);d.error("vttjs failed to load, stopping trying to process "+t.src)}):si(n,t)}))},ui=function(e){function t(t){var i;if(void 0===t&&(t={}),!t.tech)throw new Error("A tech was not provided.");var n=ht(t,{kind:Vt[t.kind]||"subtitles",language:t.language||t.srclang||""}),r=Wt[n.mode]||"disabled",a=n.default;"metadata"!==n.kind&&"chapters"!==n.kind||(r="hidden"),(i=e.call(this,n)||this).tech_=n.tech,i.cues_=[],i.activeCues_=[],i.preload_=!1!==i.tech_.preloadTextTracks;var s=new jt(i.cues_),o=new jt(i.activeCues_),u=!1;return i.timeupdateHandler=Ke(_t(i),function(e){void 0===e&&(e={}),this.tech_.isDisposed()||(this.tech_.isReady_?(this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1),"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))):"timeupdate"!==e.type&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))}),i.tech_.one("dispose",function(){i.stopTracking()}),"disabled"!==r&&i.startTracking(),Object.defineProperties(_t(i),{default:{get:function(){return a},set:function(){}},mode:{get:function(){return r},set:function(e){Wt[e]&&r!==e&&(r=e,this.preload_||"disabled"===r||0!==this.cues.length||oi(this.src,this),this.stopTracking(),"disabled"!==r&&this.startTracking(),this.trigger("modechange"))}},cues:{get:function(){return this.loaded_?s:null},set:function(){}},activeCues:{get:function(){if(!this.loaded_)return null;if(0===this.cues.length)return o;for(var e=this.tech_.currentTime(),t=[],i=0,n=this.cues.length;i=e?t.push(r):r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e&&t.push(r)}if(u=!1,t.length!==this.activeCues_.length)u=!0;else for(var a=0;a59?t(i[1],i[2],0,i[4]):t(0,i[1],i[2],i[4]):null}function Si(){this.values=bi(null)}function Ei(e,t,i,n){var r=n?e.split(n):[e];for(var a in r)if("string"==typeof r[a]){var s=r[a].split(i);2===s.length&&t(s[0].trim(),s[1].trim())}}function ki(e,t,i){var n=e;function r(){var t=wi(e);if(null===t)throw new Ti(Ti.Errors.BadTimeStamp,"Malformed timestamp: "+n);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function a(){e=e.replace(/^\s+/,"")}if(a(),t.startTime=r(),a(),"--\x3e"!==e.substr(0,3))throw new Ti(Ti.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): "+n);e=e.substr(3),a(),t.endTime=r(),a(),function(e,t){var n=new Si;Ei(e,function(e,t){switch(e){case"region":for(var r=i.length-1;r>=0;r--)if(i[r].id===t){n.set(e,i[r].region);break}break;case"vertical":n.alt(e,t,["rl","lr"]);break;case"line":var a=t.split(","),s=a[0];n.integer(e,s),n.percent(e,s)&&n.set("snapToLines",!1),n.alt(e,s,["auto"]),2===a.length&&n.alt("lineAlign",a[1],["start","center","end"]);break;case"position":a=t.split(","),n.percent(e,a[0]),2===a.length&&n.alt("positionAlign",a[1],["start","center","end"]);break;case"size":n.percent(e,t);break;case"align":n.alt(e,t,["start","center","end","left","right"])}},/:/,/\s/),t.region=n.get("region",null),t.vertical=n.get("vertical","");try{t.line=n.get("line","auto")}catch(e){}t.lineAlign=n.get("lineAlign","start"),t.snapToLines=n.get("snapToLines",!0),t.size=n.get("size",100);try{t.align=n.get("align","center")}catch(e){t.align=n.get("align","middle")}try{t.position=n.get("position","auto")}catch(e){t.position=n.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},t.align)}t.positionAlign=n.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},t.align)}(e,t)}Ti.prototype=bi(Error.prototype),Ti.prototype.constructor=Ti,Ti.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}},Si.prototype={set:function(e,t){this.get(e)||""===t||(this.values[e]=t)},get:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t},has:function(e){return e in this.values},alt:function(e,t,i){for(var n=0;n=0&&t<=100)&&(this.set(e,t),!0)}};var Ci=_i.createElement&&_i.createElement("textarea"),Ii={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},xi={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)"},Ai={v:"title",lang:"lang"},Pi={rt:"ruby"};function Li(e,t){function i(){if(!t)return null;var e,i=t.match(/^([^<]*)(<[^>]*>?)?/);return e=i[1]?i[1]:i[2],t=t.substr(e.length),e}function n(e,t){return!Pi[t.localName]||Pi[t.localName]===e.localName}function r(t,i){var n=Ii[t];if(!n)return null;var r=e.document.createElement(n),a=Ai[t];return a&&i&&(r[a]=i.trim()),r}for(var a,s,o=e.document.createElement("div"),u=o,l=[];null!==(a=i());)if("<"!==a[0])u.appendChild(e.document.createTextNode((s=a,Ci.innerHTML=s,s=Ci.textContent,Ci.textContent="",s)));else{if("/"===a[1]){l.length&&l[l.length-1]===a.substr(2).replace(">","")&&(l.pop(),u=u.parentNode);continue}var c,d=wi(a.substr(1,a.length-2));if(d){c=e.document.createProcessingInstruction("timestamp",d),u.appendChild(c);continue}var h=a.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!h)continue;if(!(c=r(h[1],h[3])))continue;if(!n(u,c))continue;if(h[2]){var p=h[2].split(".");p.forEach(function(e){var t=/^bg_/.test(e),i=t?e.slice(3):e;if(xi.hasOwnProperty(i)){var n=t?"background-color":"color",r=xi[i];c.style[n]=r}}),c.className=p.join(" ")}l.push(h[1]),u.appendChild(c),u=c}return o}var Di=[[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 Oi(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function Ri(){}function Mi(e,t,i){Ri.call(this),this.cue=t,this.cueDiv=Li(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:function(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function n(e,t){for(var i=t.childNodes.length-1;i>=0;i--)e.push(t.childNodes[i])}function r(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var a=i.match(/^.*(\n|\r)/);return a?(e.length=0,a[0]):i}return"ruby"===t.tagName?r(e):t.childNodes?(n(e,t),r(e)):void 0}for(n(t,e);i=r(t);)for(var a=0;a=0&&e.line<=100))return e.line;if(!e.track||!e.track.textTrackList||!e.track.textTrackList.mediaElement)return-1;for(var t=e.track,i=t.textTrackList,n=0,r=0;rd&&(c=c<0?-1:1,c*=Math.ceil(d/l)*l),s<0&&(c+=""===a.vertical?i.height:i.width,o=o.reverse()),r.move(h,c)}else{var p=r.lineHeight/i.height*100;switch(a.lineAlign){case"center":s-=p/2;break;case"end":s-=p}switch(a.vertical){case"":t.applyStyles({top:t.formatStyle(s,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(s,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(s,"%")})}o=["+y","-x","+x","-y"],r=new Ni(t)}var f=function(e,t){for(var r,a=new Ni(e),s=1,o=0;ou&&(r=new Ni(e),s=u),e=new Ni(a)}return r||a}(r,o);t.move(f.toCSSCompatValues(i))}function Bi(){}Ri.prototype.applyStyles=function(e,t){for(var i in t=t||this.div,e)e.hasOwnProperty(i)&&(t.style[i]=e[i])},Ri.prototype.formatStyle=function(e,t){return 0===e?0:e+t},Mi.prototype=bi(Ri.prototype),Mi.prototype.constructor=Mi,Ni.prototype.move=function(e,t){switch(t=void 0!==t?t:this.lineHeight,e){case"+x":this.left+=t,this.right+=t;break;case"-x":this.left-=t,this.right-=t;break;case"+y":this.top+=t,this.bottom+=t;break;case"-y":this.top-=t,this.bottom-=t}},Ni.prototype.overlaps=function(e){return this.lefte.left&&this.tope.top},Ni.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},Ni.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},Ni.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},Ni.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},Ni.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},Bi.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},Bi.convertCueToDOMTree=function(e,t){return e&&t?Li(e,t):null},Bi.processCues=function(e,t,i){if(!e||!t||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=e.document.createElement("div");if(n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin="1.5%",i.appendChild(n),function(e){for(var t=0;t100)throw new Error("Position must be between 0 and 100.");p=e,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return f},set:function(e){var t=Vi(e);t?(f=t,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return m},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");m=e,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return g},set:function(e){var t=Vi(e);if(!t)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");g=t,this.hasBeenReset=!0}}}),this.displayState=void 0}Wi.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var Gi=Wi,zi={"":!0,up:!0};function Xi(e){return"number"==typeof e&&e>=0&&e<=100}var Ki=function(){var e=100,t=3,i=0,n=100,r=0,a=100,s="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return e},set:function(t){if(!Xi(t))throw new Error("Width must be between 0 and 100.");e=t}},lines:{enumerable:!0,get:function(){return t},set:function(e){if("number"!=typeof e)throw new TypeError("Lines must be set to a number.");t=e}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(e){if(!Xi(e))throw new Error("RegionAnchorX must be between 0 and 100.");n=e}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(e){if(!Xi(e))throw new Error("RegionAnchorY must be between 0 and 100.");i=e}},viewportAnchorY:{enumerable:!0,get:function(){return a},set:function(e){if(!Xi(e))throw new Error("ViewportAnchorY must be between 0 and 100.");a=e}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(e){if(!Xi(e))throw new Error("ViewportAnchorX must be between 0 and 100.");r=e}},scroll:{enumerable:!0,get:function(){return s},set:function(e){var t=function(e){return"string"==typeof e&&!!zi[e.toLowerCase()]&&e.toLowerCase()}(e);!1===t?console.warn("Scroll: an invalid or illegal string was specified."):s=t}}})},Yi=f(function(e){var t=e.exports={WebVTT:Fi,VTTCue:Gi,VTTRegion:Ki};$t.vttjs=t,$t.WebVTT=t.WebVTT;var i=t.VTTCue,n=t.VTTRegion,r=$t.VTTCue,a=$t.VTTRegion;t.shim=function(){$t.VTTCue=i,$t.VTTRegion=n},t.restore=function(){$t.VTTCue=r,$t.VTTRegion=a},$t.VTTCue||t.shim()});Yi.WebVTT,Yi.VTTCue,Yi.VTTRegion;var Qi=function(e){function t(t,i){var n;return void 0===t&&(t={}),void 0===i&&(i=function(){}),t.reportTouchActivity=!1,(n=e.call(this,null,t,i)||this).onDurationChange_=function(e){return n.onDurationChange(e)},n.trackProgress_=function(e){return n.trackProgress(e)},n.trackCurrentTime_=function(e){return n.trackCurrentTime(e)},n.stopTrackingCurrentTime_=function(e){return n.stopTrackingCurrentTime(e)},n.disposeSourceHandler_=function(e){return n.disposeSourceHandler(e)},n.queuedHanders_=new Set,n.hasStarted_=!1,n.on("playing",function(){this.hasStarted_=!0}),n.on("loadstart",function(){this.hasStarted_=!1}),gi.names.forEach(function(e){var i=gi[e];t&&t[i.getterName]&&(n[i.privateName]=t[i.getterName])}),n.featuresProgressEvents||n.manualProgressOn(),n.featuresTimeupdateEvents||n.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(function(e){!1===t["native"+e+"Tracks"]&&(n["featuresNative"+e+"Tracks"]=!1)}),!1===t.nativeCaptions||!1===t.nativeTextTracks?n.featuresNativeTextTracks=!1:!0!==t.nativeCaptions&&!0!==t.nativeTextTracks||(n.featuresNativeTextTracks=!0),n.featuresNativeTextTracks||n.emulateTextTracks(),n.preloadTextTracks=!1!==t.preloadTextTracks,n.autoRemoteTextTracks_=new gi.text.ListClass,n.initTrackListeners(),t.nativeControlsForTouch||n.emitTapEvents(),n.constructor&&(n.name_=n.constructor.name||"Unknown Tech"),n}bt(t,e);var i=t.prototype;return i.triggerSourceset=function(e){var t=this;this.isReady_||this.one("ready",function(){return t.setTimeout(function(){return t.triggerSourceset(e)},1)}),this.trigger({src:e,type:"sourceset"})},i.manualProgressOn=function(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)},i.manualProgressOff=function(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)},i.trackProgress=function(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Ke(this,function(){var e=this.bufferedPercent();this.bufferedPercent_!==e&&this.trigger("progress"),this.bufferedPercent_=e,1===e&&this.stopTrackingProgress()}),500)},i.onDurationChange=function(e){this.duration_=this.duration()},i.buffered=function(){return St(0,0)},i.bufferedPercent=function(){return Et(this.buffered(),this.duration_)},i.stopTrackingProgress=function(){this.clearInterval(this.progressInterval)},i.manualTimeUpdatesOn=function(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)},i.manualTimeUpdatesOff=function(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)},i.trackCurrentTime=function(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)},i.stopTrackingCurrentTime=function(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.dispose=function(){this.clearTracks(fi.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),e.prototype.dispose.call(this)},i.clearTracks=function(e){var t=this;(e=[].concat(e)).forEach(function(e){for(var i=t[e+"Tracks"]()||[],n=i.length;n--;){var r=i[n];"text"===e&&t.removeRemoteTextTrack(r),i.removeTrack(r)}})},i.cleanupAutoTextTracks=function(){for(var e=this.autoRemoteTextTracks_||[],t=e.length;t--;){var i=e[t];this.removeRemoteTextTrack(i)}},i.reset=function(){},i.crossOrigin=function(){},i.setCrossOrigin=function(){},i.error=function(e){return void 0!==e&&(this.error_=new kt(e),this.trigger("error")),this.error_},i.played=function(){return this.hasStarted_?St(0,0):St()},i.play=function(){},i.setScrubbing=function(){},i.scrubbing=function(){},i.setCurrentTime=function(){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},i.initTrackListeners=function(){var e=this;fi.names.forEach(function(t){var i=fi[t],n=function(){e.trigger(t+"trackchange")},r=e[i.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),e.on("dispose",function(){r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)})})},i.addWebVttScript_=function(){var e=this;if(!window.WebVTT)if(document.body.contains(this.el())){if(!this.options_["vtt.js"]&&T(Yi)&&Object.keys(Yi).length>0)return void this.trigger("vttjsloaded");var t=document.createElement("script");t.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",t.onload=function(){e.trigger("vttjsloaded")},t.onerror=function(){e.trigger("vttjserror")},this.on("dispose",function(){t.onload=null,t.onerror=null}),window.WebVTT=!0,this.el().parentNode.appendChild(t)}else this.ready(this.addWebVttScript_)},i.emulateTextTracks=function(){var e=this,t=this.textTracks(),i=this.remoteTextTracks(),n=function(e){return t.addTrack(e.track)},r=function(e){return t.removeTrack(e.track)};i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();var a=function(){return e.trigger("texttrackchange")},s=function(){a();for(var e=0;e=0;r--){var a=e[r];a[t]&&a[t](n,i)}}(e,i,o,s),o}var tn={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},nn={setCurrentTime:1,setMuted:1,setVolume:1},rn={play:1,pause:1};function an(e){return function(t,i){return t===Zi?Zi:i[e]?i[e](t):t}}var sn={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},on=function(e){void 0===e&&(e="");var t=Kt(e);return sn[t.toLowerCase()]||""};function un(e){if(!e.type){var t=on(e.src);t&&(e.type=t)}return e}var ln=function(e){function t(t,i,n){var r,a=ht({createEl:!1},i);if(r=e.call(this,t,a,n)||this,i.playerOptions.sources&&0!==i.playerOptions.sources.length)t.src(i.playerOptions.sources);else for(var s=0,o=i.playerOptions.techOrder;s0;!this.player_.tech(!0)||(N||O)&&t||this.player_.tech(!0).focus(),this.player_.paused()?xt(this.player_.play()):this.player_.pause()}},t}(cn);yt.registerComponent("PosterImage",dn);var hn={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 pn(e,t){var i;if(4===e.length)i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3];else{if(7!==e.length)throw new Error("Invalid color code provided, "+e+"; must be formatted as e.g. #f0e or #f604e2.");i=e.slice(1)}return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+t+")"}function fn(e,t,i){try{e.style[t]=i}catch(e){return}}var mn=function(e){function t(t,i,n){var r;r=e.call(this,t,i,n)||this;var a=function(e){return r.updateDisplay(e)};return t.on("loadstart",function(e){return r.toggleDisplay(e)}),t.on("texttrackchange",a),t.on("loadedmetadata",function(e){return r.preselectTrack(e)}),t.ready(Ke(_t(r),function(){if(t.tech_&&t.tech_.featuresNativeTextTracks)this.hide();else{t.on("fullscreenchange",a),t.on("playerresize",a),window.addEventListener("orientationchange",a),t.on("dispose",function(){return window.removeEventListener("orientationchange",a)});for(var e=this.options_.playerOptions.tracks||[],i=0;i0;return xt(t),void(!this.player_.tech(!0)||(N||O)&&i||this.player_.tech(!0).focus())}var n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(r){var a=function(){return r.focus()};It(t)?t.then(a,function(){}):this.setTimeout(a,1)}else this.player_.tech(!0).focus()},i.handleKeyDown=function(t){this.mouseused_=!1,e.prototype.handleKeyDown.call(this,t)},i.handleMouseDown=function(e){this.mouseused_=!0},t}(vn);yn.prototype.controlText_="Play Video",yt.registerComponent("BigPlayButton",yn);var _n=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).controlText(i&&i.controlText||n.localize("Close")),n}bt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-close-button "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.trigger({type:"close",bubbles:!1})},i.handleKeyDown=function(t){vt.isEventKey(t,"Esc")?(t.preventDefault(),t.stopPropagation(),this.trigger("click")):e.prototype.handleKeyDown.call(this,t)},t}(vn);yt.registerComponent("CloseButton",_n);var bn=function(e){function t(t,i){var n;return void 0===i&&(i={}),n=e.call(this,t,i)||this,i.replay=void 0===i.replay||i.replay,n.on(t,"play",function(e){return n.handlePlay(e)}),n.on(t,"pause",function(e){return n.handlePause(e)}),i.replay&&n.on(t,"ended",function(e){return n.handleEnded(e)}),n}bt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-play-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){this.player_.paused()?xt(this.player_.play()):this.player_.pause()},i.handleSeeked=function(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)},i.handlePlay=function(e){this.removeClass("vjs-ended"),this.removeClass("vjs-paused"),this.addClass("vjs-playing"),this.controlText("Pause")},i.handlePause=function(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.controlText("Play")},i.handleEnded=function(e){var t=this;this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.controlText("Replay"),this.one(this.player_,"seeked",function(e){return t.handleSeeked(e)})},t}(vn);bn.prototype.controlText_="Play",yt.registerComponent("PlayToggle",bn);var Tn=function(e,t){e=e<0?0:e;var i=Math.floor(e%60),n=Math.floor(e/60%60),r=Math.floor(e/3600),a=Math.floor(t/60%60),s=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(r=n=i="-"),(r=r>0||s>0?r+":":"")+(n=((r||a>=10)&&n<10?"0"+n:n)+":")+(i<10?"0"+i:i)},wn=Tn;function Sn(e,t){return void 0===t&&(t=e),wn(e,t)}var En=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["timeupdate","ended"],function(e){return n.updateContent(e)}),n.updateTextNode_(),n}bt(t,e);var i=t.prototype;return i.createEl=function(){var t=this.buildCSSClass(),i=e.prototype.createEl.call(this,"div",{className:t+" vjs-time-control vjs-control"}),n=$("span",{className:"vjs-control-text",textContent:this.localize(this.labelText_)+" "},{role:"presentation"});return i.appendChild(n),this.contentEl_=$("span",{className:t+"-display"},{"aria-live":"off",role:"presentation"}),i.appendChild(this.contentEl_),i},i.dispose=function(){this.contentEl_=null,this.textNode_=null,e.prototype.dispose.call(this)},i.updateTextNode_=function(e){var t=this;void 0===e&&(e=0),e=Sn(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",function(){if(t.contentEl_){var e=t.textNode_;e&&t.contentEl_.firstChild!==e&&(e=null,d.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),t.textNode_=document.createTextNode(t.formattedTime_),t.textNode_&&(e?t.contentEl_.replaceChild(t.textNode_,e):t.contentEl_.appendChild(t.textNode_))}}))},i.updateContent=function(e){},t}(yt);En.prototype.labelText_="Time",En.prototype.controlText_="Time",yt.registerComponent("TimeDisplay",En);var kn=function(e){function t(){return e.apply(this,arguments)||this}bt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-current-time"},i.updateContent=function(e){var t;t=this.player_.ended()?this.player_.duration():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)},t}(En);kn.prototype.labelText_="Current Time",kn.prototype.controlText_="Current Time",yt.registerComponent("CurrentTimeDisplay",kn);var Cn=function(e){function t(t,i){var n,r=function(e){return n.updateContent(e)};return(n=e.call(this,t,i)||this).on(t,"durationchange",r),n.on(t,"loadstart",r),n.on(t,"loadedmetadata",r),n}bt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-duration"},i.updateContent=function(e){var t=this.player_.duration();this.updateTextNode_(t)},t}(En);Cn.prototype.labelText_="Duration",Cn.prototype.controlText_="Duration",yt.registerComponent("DurationDisplay",Cn);var In=function(e){function t(){return e.apply(this,arguments)||this}return bt(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),i=e.prototype.createEl.call(this,"div"),n=e.prototype.createEl.call(this,"span",{textContent:"/"});return i.appendChild(n),t.appendChild(i),t},t}(yt);yt.registerComponent("TimeDivider",In);var xn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"durationchange",function(e){return n.updateContent(e)}),n}bt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-remaining-time"},i.createEl=function(){var t=e.prototype.createEl.call(this);return!1!==this.options_.displayNegative&&t.insertBefore($("span",{},{"aria-hidden":!0},"-"),this.contentEl_),t},i.updateContent=function(e){var t;"number"==typeof this.player_.duration()&&(t=this.player_.ended()?0:this.player_.remainingTimeDisplay?this.player_.remainingTimeDisplay():this.player_.remainingTime(),this.updateTextNode_(t))},t}(En);xn.prototype.labelText_="Remaining Time",xn.prototype.controlText_="Remaining Time",yt.registerComponent("RemainingTimeDisplay",xn);var An=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateShowing(),n.on(n.player(),"durationchange",function(e){return n.updateShowing(e)}),n}bt(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-live-control vjs-control"});return this.contentEl_=$("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild($("span",{className:"vjs-control-text",textContent:this.localize("Stream Type")+" "})),this.contentEl_.appendChild(document.createTextNode(this.localize("LIVE"))),t.appendChild(this.contentEl_),t},i.dispose=function(){this.contentEl_=null,e.prototype.dispose.call(this)},i.updateShowing=function(e){this.player().duration()===1/0?this.show():this.hide()},t}(yt);yt.registerComponent("LiveDisplay",An);var Pn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).updateLiveEdgeStatus(),n.player_.liveTracker&&(n.updateLiveEdgeStatusHandler_=function(e){return n.updateLiveEdgeStatus(e)},n.on(n.player_.liveTracker,"liveedgechange",n.updateLiveEdgeStatusHandler_)),n}bt(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"button",{className:"vjs-seek-to-live-control vjs-control"});return this.textEl_=$("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),t.appendChild(this.textEl_),t},i.updateLiveEdgeStatus=function(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))},i.handleClick=function(){this.player_.liveTracker.seekToLiveEdge()},i.dispose=function(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,e.prototype.dispose.call(this)},t}(vn);Pn.prototype.controlText_="Seek to live, currently playing live",yt.registerComponent("SeekToLive",Pn);var Ln=function(e,t,i){return e=Number(e),Math.min(i,Math.max(t,isNaN(e)?t:e))},Dn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseDown_=function(e){return n.handleMouseDown(e)},n.handleMouseUp_=function(e){return n.handleMouseUp(e)},n.handleKeyDown_=function(e){return n.handleKeyDown(e)},n.handleClick_=function(e){return n.handleClick(e)},n.handleMouseMove_=function(e){return n.handleMouseMove(e)},n.update_=function(e){return n.update(e)},n.bar=n.getChild(n.options_.barName),n.vertical(!!n.options_.vertical),n.enable(),n}bt(t,e);var i=t.prototype;return i.enabled=function(){return this.enabled_},i.enable=function(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)},i.disable=function(){if(this.enabled()){var 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}},i.createEl=function(t,i,n){return void 0===i&&(i={}),void 0===n&&(n={}),i.className=i.className+" vjs-slider",i=_({tabIndex:0},i),n=_({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100,tabIndex:0},n),e.prototype.createEl.call(this,t,i,n)},i.handleMouseDown=function(e){var t=this.bar.el_.ownerDocument;"mousedown"===e.type&&e.preventDefault(),"touchstart"!==e.type||R||e.preventDefault(),le(),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)},i.handleMouseMove=function(e){},i.handleMouseUp=function(){var e=this.bar.el_.ownerDocument;ce(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.update()},i.update=function(){var e=this;if(this.el_&&this.bar){var t=this.getProgress();return t===this.progress_?t:(this.progress_=t,this.requestNamedAnimationFrame("Slider#update",function(){var i=e.vertical()?"height":"width";e.bar.el().style[i]=(100*t).toFixed(2)+"%"}),t)}},i.getProgress=function(){return Number(Ln(this.getPercent(),0,1).toFixed(4))},i.calculateDistance=function(e){var t=pe(this.el_,e);return this.vertical()?t.y:t.x},i.handleKeyDown=function(t){vt.isEventKey(t,"Left")||vt.isEventKey(t,"Down")?(t.preventDefault(),t.stopPropagation(),this.stepBack()):vt.isEventKey(t,"Right")||vt.isEventKey(t,"Up")?(t.preventDefault(),t.stopPropagation(),this.stepForward()):e.prototype.handleKeyDown.call(this,t)},i.handleClick=function(e){e.stopPropagation(),e.preventDefault()},i.vertical=function(e){if(void 0===e)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")},t}(yt);yt.registerComponent("Slider",Dn);var On=function(e,t){return Ln(e/t*100,0,100).toFixed(2)+"%"},Rn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).partEls_=[],n.on(t,"progress",function(e){return n.update(e)}),n}bt(t,e);var i=t.prototype;return i.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-load-progress"}),i=$("span",{className:"vjs-control-text"}),n=$("span",{textContent:this.localize("Loaded")}),r=document.createTextNode(": ");return this.percentageEl_=$("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),t.appendChild(i),i.appendChild(n),i.appendChild(r),i.appendChild(this.percentageEl_),t},i.dispose=function(){this.partEls_=null,this.percentageEl_=null,e.prototype.dispose.call(this)},i.update=function(e){var t=this;this.requestNamedAnimationFrame("LoadProgressBar#update",function(){var e=t.player_.liveTracker,i=t.player_.buffered(),n=e&&e.isLive()?e.seekableEnd():t.player_.duration(),r=t.player_.bufferedEnd(),a=t.partEls_,s=On(r,n);t.percent_!==s&&(t.el_.style.width=s,J(t.percentageEl_,s),t.percent_=s);for(var o=0;oi.length;d--)t.el_.removeChild(a[d-1]);a.length=i.length})},t}(yt);yt.registerComponent("LoadProgressBar",Rn);var Mn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=Ye(Ke(_t(n),n.update),Xe),n}bt(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i){var n=he(this.el_),r=de(this.player_.el()),a=e.width*t;if(r&&n){var s=e.left-r.left+a,o=e.width-a+(r.right-e.right),u=n.width/2;sn.width&&(u=n.width),u=Math.round(u),this.el_.style.right="-"+u+"px",this.write(i)}},i.write=function(e){J(this.el_,e)},i.updateTime=function(e,t,i,n){var r=this;this.requestNamedAnimationFrame("TimeTooltip#updateTime",function(){var a,s=r.player_.duration();if(r.player_.liveTracker&&r.player_.liveTracker.isLive()){var o=r.player_.liveTracker.liveWindow(),u=o-t*o;a=(u<1?"":"-")+Sn(u,o)}else a=Sn(i,s);r.update(e,t,a),n&&n()})},t}(yt);yt.registerComponent("TimeTooltip",Mn);var Nn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=Ye(Ke(_t(n),n.update),Xe),n}bt(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})},i.update=function(e,t){var i=this.getChild("timeTooltip");if(i){var n=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();i.updateTime(e,t,n)}},t}(yt);Nn.prototype.options_={children:[]},q||A||Nn.prototype.options_.children.push("timeTooltip"),yt.registerComponent("PlayProgressBar",Nn);var Un=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=Ye(Ke(_t(n),n.update),Xe),n}bt(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t){var i=this,n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,function(){i.el_.style.left=e.width*t+"px"})},t}(yt);Un.prototype.options_={children:["timeTooltip"]},yt.registerComponent("MouseTimeDisplay",Un);var Bn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).setEventHandlers_(),n}bt(t,e);var i=t.prototype;return i.setEventHandlers_=function(){var e=this;this.update_=Ke(this,this.update),this.update=Ye(this.update_,Xe),this.on(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=function(t){return e.enableInterval_(t)},this.disableIntervalHandler_=function(t){return e.disableInterval_(t)},this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in document&&"visibilityState"in document&&this.on(document,"visibilitychange",this.toggleVisibility_)},i.toggleVisibility_=function(e){"hidden"===document.visibilityState?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(this.player_.ended()||this.player_.paused()||this.enableInterval_(),this.update())},i.enableInterval_=function(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Xe))},i.disableInterval_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&"ended"!==e.type||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})},i.update=function(t){var i=this;if("hidden"!==document.visibilityState&&!this.player_.scrubbing()){var n=e.prototype.update.call(this);return this.requestNamedAnimationFrame("SeekBar#update",function(){var e=i.player_.ended()?i.player_.duration():i.getCurrentTime_(),t=i.player_.liveTracker,r=i.player_.duration();t&&t.isLive()&&(r=i.player_.liveTracker.liveCurrentTime()),i.percent_!==n&&(i.el_.setAttribute("aria-valuenow",(100*n).toFixed(2)),i.percent_=n),i.currentTime_===e&&i.duration_===r||(i.el_.setAttribute("aria-valuetext",i.localize("progress bar timing: currentTime={1} duration={2}",[Sn(e,r),Sn(r,r)],"{1} of {2}")),i.currentTime_=e,i.duration_=r),i.bar&&i.bar.update(de(i.el()),i.getProgress())}),n}},i.userSeek_=function(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)},i.getCurrentTime_=function(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()},i.getPercent=function(){var e,t=this.getCurrentTime_(),i=this.player_.liveTracker;return i&&i.isLive()?(e=(t-i.seekableStart())/i.liveWindow(),i.atLiveEdge()&&(e=1)):e=t/this.player_.duration(),e},i.handleMouseDown=function(t){_e(t)&&(t.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.player_.pause(),e.prototype.handleMouseDown.call(this,t))},i.handleMouseMove=function(e,t){if(void 0===t&&(t=!1),_e(e)){var i;t||this.player_.scrubbing()||this.player_.scrubbing(!0);var n=this.calculateDistance(e),r=this.player_.liveTracker;if(r&&r.isLive()){if(n>=.99)return void r.seekToLiveEdge();var a=r.seekableStart(),s=r.liveCurrentTime();if((i=a+n*r.liveWindow())>=s&&(i=s),i<=a&&(i=a+.1),i===1/0)return}else(i=n*this.player_.duration())===this.player_.duration()&&(i-=.1);this.userSeek_(i)}},i.enable=function(){e.prototype.enable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.show()},i.disable=function(){e.prototype.disable.call(this);var t=this.getChild("mouseTimeDisplay");t&&t.hide()},i.handleMouseUp=function(t){e.prototype.handleMouseUp.call(this,t),t&&t.stopPropagation(),this.player_.scrubbing(!1),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?xt(this.player_.play()):this.update_()},i.stepForward=function(){this.userSeek_(this.player_.currentTime()+5)},i.stepBack=function(){this.userSeek_(this.player_.currentTime()-5)},i.handleAction=function(e){this.player_.paused()?this.player_.play():this.player_.pause()},i.handleKeyDown=function(t){var i=this.player_.liveTracker;if(vt.isEventKey(t,"Space")||vt.isEventKey(t,"Enter"))t.preventDefault(),t.stopPropagation(),this.handleAction(t);else if(vt.isEventKey(t,"Home"))t.preventDefault(),t.stopPropagation(),this.userSeek_(0);else if(vt.isEventKey(t,"End"))t.preventDefault(),t.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(vt(t))){t.preventDefault(),t.stopPropagation();var n=10*(vt.codes[vt(t)]-vt.codes[0])/100;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else vt.isEventKey(t,"PgDn")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()-60)):vt.isEventKey(t,"PgUp")?(t.preventDefault(),t.stopPropagation(),this.userSeek_(this.player_.currentTime()+60)):e.prototype.handleKeyDown.call(this,t)},i.dispose=function(){this.disableInterval_(),this.off(this.player_,["ended","durationchange","timeupdate"],this.update),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in document&&"visibilityState"in document&&this.off(document,"visibilitychange",this.toggleVisibility_),e.prototype.dispose.call(this)},t}(Dn);Bn.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar"},q||A||Bn.prototype.options_.children.splice(1,0,"mouseTimeDisplay"),yt.registerComponent("SeekBar",Bn);var Fn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).handleMouseMove=Ye(Ke(_t(n),n.handleMouseMove),Xe),n.throttledHandleMouseSeek=Ye(Ke(_t(n),n.handleMouseSeek),Xe),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.handleMouseDownHandler_=function(e){return n.handleMouseDown(e)},n.enable(),n}bt(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-progress-control vjs-control"})},i.handleMouseMove=function(e){var t=this.getChild("seekBar");if(t){var i=t.getChild("playProgressBar"),n=t.getChild("mouseTimeDisplay");if(i||n){var r=t.el(),a=he(r),s=pe(r,e).x;s=Ln(s,0,1),n&&n.update(a,s),i&&i.update(a,t.getProgress())}}},i.handleMouseSeek=function(e){var t=this.getChild("seekBar");t&&t.handleMouseMove(e)},i.enabled=function(){return this.enabled_},i.disable=function(){if(this.children().forEach(function(e){return 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())){var e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&xt(this.player_.play())}},i.enable=function(){this.children().forEach(function(e){return 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)},i.removeListenersAddedOnMousedownAndTouchstart=function(){var 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_)},i.handleMouseDown=function(e){var t=this.el_.ownerDocument,i=this.getChild("seekBar");i&&i.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)},i.handleMouseUp=function(e){var t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()},t}(yt);Fn.prototype.options_={children:["seekBar"]},yt.registerComponent("ProgressControl",Fn);var jn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,["enterpictureinpicture","leavepictureinpicture"],function(e){return n.handlePictureInPictureChange(e)}),n.on(t,["disablepictureinpicturechanged","loadedmetadata"],function(e){return n.handlePictureInPictureEnabledChange(e)}),n.on(t,["loadedmetadata","audioonlymodechange","audiopostermodechange"],function(){"audio"===t.currentType().substring(0,5)||t.audioPosterMode()||t.audioOnlyMode()?(t.isInPictureInPicture()&&t.exitPictureInPicture(),n.hide()):n.show()}),n.disable(),n}bt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-picture-in-picture-control "+e.prototype.buildCSSClass.call(this)},i.handlePictureInPictureEnabledChange=function(){document.pictureInPictureEnabled&&!1===this.player_.disablePictureInPicture()?this.enable():this.disable()},i.handlePictureInPictureChange=function(e){this.player_.isInPictureInPicture()?this.controlText("Exit Picture-in-Picture"):this.controlText("Picture-in-Picture"),this.handlePictureInPictureEnabledChange()},i.handleClick=function(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()},t}(vn);jn.prototype.controlText_="Picture-in-Picture",yt.registerComponent("PictureInPictureToggle",jn);var Hn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"fullscreenchange",function(e){return n.handleFullscreenChange(e)}),!1===document[t.fsApi_.fullscreenEnabled]&&n.disable(),n}bt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-fullscreen-control "+e.prototype.buildCSSClass.call(this)},i.handleFullscreenChange=function(e){this.player_.isFullscreen()?this.controlText("Non-Fullscreen"):this.controlText("Fullscreen")},i.handleClick=function(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()},t}(vn);Hn.prototype.controlText_="Fullscreen",yt.registerComponent("FullscreenToggle",Hn);var qn=function(e,t){t.tech_&&!t.tech_.featuresVolumeControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresVolumeControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},Vn=function(e){function t(){return e.apply(this,arguments)||this}return bt(t,e),t.prototype.createEl=function(){var t=e.prototype.createEl.call(this,"div",{className:"vjs-volume-level"});return t.appendChild(e.prototype.createEl.call(this,"span",{className:"vjs-control-text"})),t},t}(yt);yt.registerComponent("VolumeLevel",Vn);var Wn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=Ye(Ke(_t(n),n.update),Xe),n}bt(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})},i.update=function(e,t,i,n){if(!i){var r=de(this.el_),a=de(this.player_.el()),s=e.width*t;if(!a||!r)return;var o=e.left-a.left+s,u=e.width-s+(a.right-e.right),l=r.width/2;or.width&&(l=r.width),this.el_.style.right="-"+l+"px"}this.write(n+"%")},i.write=function(e){J(this.el_,e)},i.updateVolume=function(e,t,i,n,r){var a=this;this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",function(){a.update(e,t,i,n.toFixed(0)),r&&r()})},t}(yt);yt.registerComponent("VolumeLevelTooltip",Wn);var Gn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).update=Ye(Ke(_t(n),n.update),Xe),n}bt(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-mouse-display"})},i.update=function(e,t,i){var n=this,r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,i,r,function(){i?n.el_.style.bottom=e.height*t+"px":n.el_.style.left=e.width*t+"px"})},t}(yt);Gn.prototype.options_={children:["volumeLevelTooltip"]},yt.registerComponent("MouseVolumeLevelDisplay",Gn);var zn=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on("slideractive",function(e){return n.updateLastVolume_(e)}),n.on(t,"volumechange",function(e){return n.updateARIAAttributes(e)}),t.ready(function(){return n.updateARIAAttributes()}),n}bt(t,e);var i=t.prototype;return i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})},i.handleMouseDown=function(t){_e(t)&&e.prototype.handleMouseDown.call(this,t)},i.handleMouseMove=function(e){var t=this.getChild("mouseVolumeLevelDisplay");if(t){var i=this.el(),n=de(i),r=this.vertical(),a=pe(i,e);a=r?a.y:a.x,a=Ln(a,0,1),t.update(n,a,r)}_e(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))},i.checkMuted=function(){this.player_.muted()&&this.player_.muted(!1)},i.getPercent=function(){return this.player_.muted()?0:this.player_.volume()},i.stepForward=function(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)},i.stepBack=function(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)},i.updateARIAAttributes=function(e){var t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")},i.volumeAsPercentage_=function(){return Math.round(100*this.player_.volume())},i.updateLastVolume_=function(){var e=this,t=this.player_.volume();this.one("sliderinactive",function(){0===e.player_.volume()&&e.player_.lastVolume_(t)})},t}(Dn);zn.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},q||A||zn.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),zn.prototype.playerEvent="volumechange",yt.registerComponent("VolumeBar",zn);var Xn=function(e){function t(t,i){var n;return void 0===i&&(i={}),i.vertical=i.vertical||!1,(void 0===i.volumeBar||T(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),n=e.call(this,t,i)||this,qn(_t(n),t),n.throttledHandleMouseMove=Ye(Ke(_t(n),n.handleMouseMove),Xe),n.handleMouseUpHandler_=function(e){return n.handleMouseUp(e)},n.on("mousedown",function(e){return n.handleMouseDown(e)}),n.on("touchstart",function(e){return n.handleMouseDown(e)}),n.on("mousemove",function(e){return n.handleMouseMove(e)}),n.on(n.volumeBar,["focus","slideractive"],function(){n.volumeBar.addClass("vjs-slider-active"),n.addClass("vjs-slider-active"),n.trigger("slideractive")}),n.on(n.volumeBar,["blur","sliderinactive"],function(){n.volumeBar.removeClass("vjs-slider-active"),n.removeClass("vjs-slider-active"),n.trigger("sliderinactive")}),n}bt(t,e);var i=t.prototype;return i.createEl=function(){var t="vjs-volume-horizontal";return this.options_.vertical&&(t="vjs-volume-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-control vjs-control "+t})},i.handleMouseDown=function(e){var 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_)},i.handleMouseUp=function(e){var 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_)},i.handleMouseMove=function(e){this.volumeBar.handleMouseMove(e)},t}(yt);Xn.prototype.options_={children:["volumeBar"]},yt.registerComponent("VolumeControl",Xn);var Kn=function(e,t){t.tech_&&!t.tech_.featuresMuteControl&&e.addClass("vjs-hidden"),e.on(t,"loadstart",function(){t.tech_.featuresMuteControl?e.removeClass("vjs-hidden"):e.addClass("vjs-hidden")})},Yn=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,Kn(_t(n),t),n.on(t,["loadstart","volumechange"],function(e){return n.update(e)}),n}bt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-mute-control "+e.prototype.buildCSSClass.call(this)},i.handleClick=function(e){var t=this.player_.volume(),i=this.player_.lastVolume_();if(0===t){var n=i<.1?.1:i;this.player_.volume(n),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())},i.update=function(e){this.updateIcon_(),this.updateControlText_()},i.updateIcon_=function(){var e=this.player_.volume(),t=3;q&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),0===e||this.player_.muted()?t=0:e<.33?t=1:e<.67&&(t=2);for(var i=0;i<4;i++)ie(this.el_,"vjs-vol-"+i);te(this.el_,"vjs-vol-"+t)},i.updateControlText_=function(){var e=this.player_.muted()||0===this.player_.volume()?"Unmute":"Mute";this.controlText()!==e&&this.controlText(e)},t}(vn);Yn.prototype.controlText_="Mute",yt.registerComponent("MuteToggle",Yn);var Qn=function(e){function t(t,i){var n;return void 0===i&&(i={}),void 0!==i.inline?i.inline=i.inline:i.inline=!0,(void 0===i.volumeControl||T(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),(n=e.call(this,t,i)||this).handleKeyPressHandler_=function(e){return n.handleKeyPress(e)},n.on(t,["loadstart"],function(e){return n.volumePanelState_(e)}),n.on(n.muteToggle,"keyup",function(e){return n.handleKeyPress(e)}),n.on(n.volumeControl,"keyup",function(e){return n.handleVolumeControlKeyUp(e)}),n.on("keydown",function(e){return n.handleKeyPress(e)}),n.on("mouseover",function(e){return n.handleMouseOver(e)}),n.on("mouseout",function(e){return n.handleMouseOut(e)}),n.on(n.volumeControl,["slideractive"],n.sliderActive_),n.on(n.volumeControl,["sliderinactive"],n.sliderInactive_),n}bt(t,e);var i=t.prototype;return i.sliderActive_=function(){this.addClass("vjs-slider-active")},i.sliderInactive_=function(){this.removeClass("vjs-slider-active")},i.volumePanelState_=function(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")},i.createEl=function(){var t="vjs-volume-panel-horizontal";return this.options_.inline||(t="vjs-volume-panel-vertical"),e.prototype.createEl.call(this,"div",{className:"vjs-volume-panel vjs-control "+t})},i.dispose=function(){this.handleMouseOut(),e.prototype.dispose.call(this)},i.handleVolumeControlKeyUp=function(e){vt.isEventKey(e,"Esc")&&this.muteToggle.focus()},i.handleMouseOver=function(e){this.addClass("vjs-hover"),je(document,"keyup",this.handleKeyPressHandler_)},i.handleMouseOut=function(e){this.removeClass("vjs-hover"),He(document,"keyup",this.handleKeyPressHandler_)},i.handleKeyPress=function(e){vt.isEventKey(e,"Esc")&&this.handleMouseOut()},t}(yt);Qn.prototype.options_={children:["muteToggle","volumeControl"]},yt.registerComponent("VolumePanel",Qn);var $n=function(e){function t(t,i){var n;return n=e.call(this,t,i)||this,i&&(n.menuButton_=i.menuButton),n.focusedChild_=-1,n.on("keydown",function(e){return n.handleKeyDown(e)}),n.boundHandleBlur_=function(e){return n.handleBlur(e)},n.boundHandleTapClick_=function(e){return n.handleTapClick(e)},n}bt(t,e);var i=t.prototype;return i.addEventListenerForItem=function(e){e instanceof yt&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))},i.removeEventListenerForItem=function(e){e instanceof yt&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))},i.removeChild=function(t){"string"==typeof t&&(t=this.getChild(t)),this.removeEventListenerForItem(t),e.prototype.removeChild.call(this,t)},i.addItem=function(e){var t=this.addChild(e);t&&this.addEventListenerForItem(t)},i.createEl=function(){var t=this.options_.contentElType||"ul";this.contentEl_=$(t,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");var i=e.prototype.createEl.call(this,"div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),je(i,"click",function(e){e.preventDefault(),e.stopImmediatePropagation()}),i},i.dispose=function(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,e.prototype.dispose.call(this)},i.handleBlur=function(e){var t=e.relatedTarget||document.activeElement;if(!this.children().some(function(e){return e.el()===t})){var i=this.menuButton_;i&&i.buttonPressed_&&t!==i.el().firstChild&&i.unpressButton()}},i.handleTapClick=function(e){if(this.menuButton_){this.menuButton_.unpressButton();var t=this.children();if(!Array.isArray(t))return;var i=t.filter(function(t){return t.el()===e.target})[0];if(!i)return;"CaptionSettingsMenuItem"!==i.name()&&this.menuButton_.focus()}},i.handleKeyDown=function(e){vt.isEventKey(e,"Left")||vt.isEventKey(e,"Down")?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(vt.isEventKey(e,"Right")||vt.isEventKey(e,"Up"))&&(e.preventDefault(),e.stopPropagation(),this.stepBack())},i.stepForward=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_+1),this.focus(e)},i.stepBack=function(){var e=0;void 0!==this.focusedChild_&&(e=this.focusedChild_-1),this.focus(e)},i.focus=function(e){void 0===e&&(e=0);var 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())},t}(yt);yt.registerComponent("Menu",$n);var Jn=function(e){function t(t,i){var n;void 0===i&&(i={}),(n=e.call(this,t,i)||this).menuButton_=new vn(t,i),n.menuButton_.controlText(n.controlText_),n.menuButton_.el_.setAttribute("aria-haspopup","true");var r=vn.prototype.buildCSSClass();n.menuButton_.el_.className=n.buildCSSClass()+" "+r,n.menuButton_.removeClass("vjs-control"),n.addChild(n.menuButton_),n.update(),n.enabled_=!0;var a=function(e){return n.handleClick(e)};return n.handleMenuKeyUp_=function(e){return n.handleMenuKeyUp(e)},n.on(n.menuButton_,"tap",a),n.on(n.menuButton_,"click",a),n.on(n.menuButton_,"keydown",function(e){return n.handleKeyDown(e)}),n.on(n.menuButton_,"mouseenter",function(){n.addClass("vjs-hover"),n.menu.show(),je(document,"keyup",n.handleMenuKeyUp_)}),n.on("mouseleave",function(e){return n.handleMouseLeave(e)}),n.on("keydown",function(e){return n.handleSubmenuKeyDown(e)}),n}bt(t,e);var i=t.prototype;return i.update=function(){var 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"))},i.createMenu=function(){var e=new $n(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){var t=$("li",{className:"vjs-menu-title",textContent:dt(this.options_.title),tabIndex:-1}),i=new yt(this.player_,{el:t});e.addItem(i)}if(this.items=this.createItems(),this.items)for(var n=0;n-1&&"showing"===a.mode){i=!1;break}}i!==this.isSelected_&&this.selected(i)},i.handleSelectedLanguageChange=function(e){for(var t=this.player().textTracks(),i=!0,n=0,r=t.length;n-1&&"showing"===a.mode){i=!1;break}}i&&(this.player_.cache_.selectedLanguage={enabled:!1})},t}(ir);yt.registerComponent("OffTextTrackMenuItem",nr);var rr=function(e){function t(t,i){return void 0===i&&(i={}),i.tracks=t.textTracks(),e.call(this,t,i)||this}return bt(t,e),t.prototype.createItems=function(e,t){var i;void 0===e&&(e=[]),void 0===t&&(t=ir),this.label_&&(i=this.label_+" off"),e.push(new nr(this.player_,{kinds:this.kinds_,kind:this.kind_,label:i})),this.hideThreshold_+=1;var n=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(var r=0;r-1){var s=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});s.addClass("vjs-"+a.kind+"-menu-item"),e.push(s)}}return e},t}(Zn);yt.registerComponent("TextTrackButton",rr);var ar=function(e){function t(t,i){var n,r=i.track,a=i.cue,s=t.currentTime();return i.selectable=!0,i.multiSelectable=!1,i.label=a.text,i.selected=a.startTime<=s&&s=0;t--){var i=e[t];if(i.kind===this.kind_)return i}},i.getMenuCaption=function(){return this.track_&&this.track_.label?this.track_.label:this.localize(dt(this.kind_))},i.createMenu=function(){return this.options_.title=this.getMenuCaption(),e.prototype.createMenu.call(this)},i.createItems=function(){var e=[];if(!this.track_)return e;var t=this.track_.cues;if(!t)return e;for(var i=0,n=t.length;i-1&&(n.label_="captions"),n.menuButton_.controlText(dt(n.label_)),n}bt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildCSSClass.call(this)},i.buildWrapperCSSClass=function(){return"vjs-subs-caps-button "+e.prototype.buildWrapperCSSClass.call(this)},i.createItems=function(){var t=[];return this.player().tech_&&this.player().tech_.featuresNativeTextTracks||!this.player().getChild("textTrackSettings")||(t.push(new lr(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e.prototype.createItems.call(this,t,dr)},t}(rr);hr.prototype.kinds_=["captions","subtitles"],hr.prototype.controlText_="Subtitles",yt.registerComponent("SubsCapsButton",hr);var pr=function(e){function t(t,i){var n,r=i.track,a=t.audioTracks();i.label=r.label||r.language||"Unknown",i.selected=r.enabled,(n=e.call(this,t,i)||this).track=r,n.addClass("vjs-"+r.kind+"-menu-item");var s=function(){for(var e=arguments.length,t=new Array(e),i=0;i=0;i--)t.push(new mr(this.player(),{rate:e[i]+"x"}));return t},i.updateARIAAttributes=function(){this.el().setAttribute("aria-valuenow",this.player().playbackRate())},i.handleClick=function(e){var t=this.player().playbackRate(),i=this.playbackRates(),n=(i.indexOf(t)+1)%i.length;this.player().playbackRate(i[n])},i.handlePlaybackRateschange=function(e){this.update()},i.playbackRates=function(){var e=this.player();return e.playbackRates&&e.playbackRates()||[]},i.playbackRateSupported=function(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0},i.updateVisibility=function(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")},i.updateLabel=function(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")},t}(Jn);gr.prototype.controlText_="Playback Rate",yt.registerComponent("PlaybackRateMenuButton",gr);var vr=function(e){function t(){return e.apply(this,arguments)||this}bt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(t,i,n){return void 0===t&&(t="div"),void 0===i&&(i={}),void 0===n&&(n={}),i.className||(i.className=this.buildCSSClass()),e.prototype.createEl.call(this,t,i,n)},t}(yt);yt.registerComponent("Spacer",vr);var yr=function(e){function t(){return e.apply(this,arguments)||this}bt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-custom-control-spacer "+e.prototype.buildCSSClass.call(this)},i.createEl=function(){return e.prototype.createEl.call(this,"div",{className:this.buildCSSClass(),textContent:" "})},t}(vr);yt.registerComponent("CustomControlSpacer",yr);var _r=function(e){function t(){return e.apply(this,arguments)||this}return bt(t,e),t.prototype.createEl=function(){return e.prototype.createEl.call(this,"div",{className:"vjs-control-bar",dir:"ltr"})},t}(yt);_r.prototype.options_={children:["playToggle","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","fullscreenToggle"]},"exitPictureInPicture"in document&&_r.prototype.options_.children.splice(_r.prototype.options_.children.length-1,0,"pictureInPictureToggle"),yt.registerComponent("ControlBar",_r);var br=function(e){function t(t,i){var n;return(n=e.call(this,t,i)||this).on(t,"error",function(e){return n.open(e)}),n}bt(t,e);var i=t.prototype;return i.buildCSSClass=function(){return"vjs-error-display "+e.prototype.buildCSSClass.call(this)},i.content=function(){var e=this.player().error();return e?this.localize(e.message):""},t}(Lt);br.prototype.options_=m({},Lt.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),yt.registerComponent("ErrorDisplay",br);var Tr=["#000","Black"],wr=["#00F","Blue"],Sr=["#0FF","Cyan"],Er=["#0F0","Green"],kr=["#F0F","Magenta"],Cr=["#F00","Red"],Ir=["#FFF","White"],xr=["#FF0","Yellow"],Ar=["1","Opaque"],Pr=["0.5","Semi-Transparent"],Lr=["0","Transparent"],Dr={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Tr,Ir,Cr,Er,wr,xr,kr,Sr]},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Transparency",options:[Ar,Pr,Lr]},color:{selector:".vjs-fg-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Ir,Tr,Cr,Er,wr,xr,kr,Sr]},edgeStyle:{selector:".vjs-edge-style > select",id:"%s",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Dropshadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"captions-font-family-%s",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"captions-font-size-%s",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:function(e){return"1.00"===e?null:Number(e)}},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Transparency",options:[Ar,Pr]},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Transparency",options:[Lr,Pr,Ar]}};function Or(e,t){if(t&&(e=t(e)),e&&"none"!==e)return e}Dr.windowColor.options=Dr.backgroundColor.options;var Rr=function(e){function t(t,i){var n;return i.temporary=!1,(n=e.call(this,t,i)||this).updateDisplay=n.updateDisplay.bind(_t(n)),n.fill(),n.hasBeenOpened_=n.hasBeenFilled_=!0,n.endDialog=$("p",{className:"vjs-control-text",textContent:n.localize("End of dialog window.")}),n.el().appendChild(n.endDialog),n.setDefaults(),void 0===i.persistTextTrackSettings&&(n.options_.persistTextTrackSettings=n.options_.playerOptions.persistTextTrackSettings),n.on(n.$(".vjs-done-button"),"click",function(){n.saveSettings(),n.close()}),n.on(n.$(".vjs-default-button"),"click",function(){n.setDefaults(),n.updateDisplay()}),y(Dr,function(e){n.on(n.$(e.selector),"change",n.updateDisplay)}),n.options_.persistTextTrackSettings&&n.restoreSettings(),n}bt(t,e);var i=t.prototype;return i.dispose=function(){this.endDialog=null,e.prototype.dispose.call(this)},i.createElSelect_=function(e,t,i){var n=this;void 0===t&&(t=""),void 0===i&&(i="label");var r=Dr[e],a=r.id.replace("%s",this.id_),s=[t,a].join(" ").trim();return["<"+i+' id="'+a+'" class="'+("label"===i?"vjs-label":"")+'">',this.localize(r.label),"",'").join("")},i.createElFgColor_=function(){var e="captions-text-legend-"+this.id_;return['
','',this.localize("Text"),"",this.createElSelect_("color",e),'',this.createElSelect_("textOpacity",e),"","
"].join("")},i.createElBgColor_=function(){var e="captions-background-"+this.id_;return['
','',this.localize("Background"),"",this.createElSelect_("backgroundColor",e),'',this.createElSelect_("backgroundOpacity",e),"","
"].join("")},i.createElWinColor_=function(){var e="captions-window-"+this.id_;return['
','',this.localize("Window"),"",this.createElSelect_("windowColor",e),'',this.createElSelect_("windowOpacity",e),"","
"].join("")},i.createElColors_=function(){return $("div",{className:"vjs-track-settings-colors",innerHTML:[this.createElFgColor_(),this.createElBgColor_(),this.createElWinColor_()].join("")})},i.createElFont_=function(){return $("div",{className:"vjs-track-settings-font",innerHTML:['
',this.createElSelect_("fontPercent","","legend"),"
",'
',this.createElSelect_("edgeStyle","","legend"),"
",'
',this.createElSelect_("fontFamily","","legend"),"
"].join("")})},i.createElControls_=function(){var e=this.localize("restore all settings to the default values");return $("div",{className:"vjs-track-settings-controls",innerHTML:['",'"].join("")})},i.content=function(){return[this.createElColors_(),this.createElFont_(),this.createElControls_()]},i.label=function(){return this.localize("Caption Settings Dialog")},i.description=function(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")},i.buildCSSClass=function(){return e.prototype.buildCSSClass.call(this)+" vjs-text-track-settings"},i.getValues=function(){var e,t,i,n=this;return t=function(e,t,i){var r,a,s=(r=n.$(t.selector),a=t.parser,Or(r.options[r.options.selectedIndex].value,a));return void 0!==s&&(e[i]=s),e},void 0===(i={})&&(i=0),v(e=Dr).reduce(function(i,n){return t(i,e[n],n)},i)},i.setValues=function(e){var t=this;y(Dr,function(i,n){!function(e,t,i){if(t)for(var n=0;nthis.options_.liveTolerance;this.timeupdateSeen_&&n!==1/0||(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}},i.handleDurationchange=function(){this.toggleTracking()},i.toggleTracking=function(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())},i.startTracking=function(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Xe),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_)))},i.handleFirstTimeupdate=function(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)},i.handleSeeked=function(){var e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()},i.handlePlay=function(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)},i.reset_=function(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)},i.nextSeekedFromUser=function(){this.nextSeekedFromUser_=!0},i.stopTracking=function(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))},i.seekableEnd=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.end(i));return t.length?t.sort()[t.length-1]:1/0},i.seekableStart=function(){for(var e=this.player_.seekable(),t=[],i=e?e.length:0;i--;)t.push(e.start(i));return t.length?t.sort()[0]:0},i.liveWindow=function(){var e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()},i.isLive=function(){return this.isTracking()},i.atLiveEdge=function(){return!this.behindLiveEdge()},i.liveCurrentTime=function(){return this.pastSeekEnd()+this.seekableEnd()},i.pastSeekEnd=function(){var e=this.seekableEnd();return-1!==this.lastSeekEnd_&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_},i.behindLiveEdge=function(){return this.behindLiveEdge_},i.isTracking=function(){return"number"==typeof this.trackingInterval_},i.seekToLiveEdge=function(){this.seekedBehindLive_=!1,this.atLiveEdge()||(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))},i.dispose=function(){this.off(document,"visibilitychange",this.handleVisibilityChange_),this.stopTracking(),e.prototype.dispose.call(this)},t}(yt);yt.registerComponent("LiveTracker",Ur);var Br,Fr=function(e){var t=e.el();if(t.hasAttribute("src"))return e.triggerSourceset(t.src),!0;var i=e.$$("source"),n=[],r="";if(!i.length)return!1;for(var a=0;a=2&&r.push("loadeddata"),e.readyState>=3&&r.push("canplay"),e.readyState>=4&&r.push("canplaythrough"),this.ready(function(){r.forEach(function(e){this.trigger(e)},this)})}},i.setScrubbing=function(e){this.isScrubbing_=e},i.scrubbing=function(){return this.isScrubbing_},i.setCurrentTime=function(e){try{this.isScrubbing_&&this.el_.fastSeek&&V?this.el_.fastSeek(e):this.el_.currentTime=e}catch(e){d(e,"Video is not ready. (Video.js)")}},i.duration=function(){var e=this;return this.el_.duration===1/0&&A&&R&&0===this.el_.currentTime?(this.on("timeupdate",function t(){e.el_.currentTime>0&&(e.el_.duration===1/0&&e.trigger("durationchange"),e.off("timeupdate",t))}),NaN):this.el_.duration||NaN},i.width=function(){return this.el_.offsetWidth},i.height=function(){return this.el_.offsetHeight},i.proxyWebkitFullscreen_=function(){var e=this;if("webkitDisplayingFullscreen"in this.el_){var t=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},i=function(){"webkitPresentationMode"in this.el_&&"picture-in-picture"!==this.el_.webkitPresentationMode&&(this.one("webkitendfullscreen",t),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",function(){e.off("webkitbeginfullscreen",i),e.off("webkitendfullscreen",t)})}},i.supportsFullScreen=function(){if("function"==typeof this.el_.webkitEnterFullScreen){var e=window.navigator&&window.navigator.userAgent||"";if(/Android/.test(e)||!/Chrome|Mac OS X 10.5/.test(e))return!0}return!1},i.enterFullScreen=function(){var e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)xt(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},0);else try{e.webkitEnterFullScreen()}catch(e){this.trigger("fullscreenerror",e)}},i.exitFullScreen=function(){this.el_.webkitDisplayingFullscreen?this.el_.webkitExitFullScreen():this.trigger("fullscreenerror",new Error("The video is not fullscreen"))},i.requestPictureInPicture=function(){return this.el_.requestPictureInPicture()},i.requestVideoFrameCallback=function(t){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(t):e.prototype.requestVideoFrameCallback.call(this,t)},i.cancelVideoFrameCallback=function(t){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(t):e.prototype.cancelVideoFrameCallback.call(this,t)},i.src=function(e){if(void 0===e)return this.el_.src;this.setSrc(e)},i.reset=function(){t.resetMediaElement(this.el_)},i.currentSrc=function(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc},i.setControls=function(e){this.el_.controls=!!e},i.addTextTrack=function(t,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(t,i,n):e.prototype.addTextTrack.call(this,t,i,n)},i.createRemoteTextTrack=function(t){if(!this.featuresNativeTextTracks)return e.prototype.createRemoteTextTrack.call(this,t);var i=document.createElement("track");return t.kind&&(i.kind=t.kind),t.label&&(i.label=t.label),(t.language||t.srclang)&&(i.srclang=t.language||t.srclang),t.default&&(i.default=t.default),t.id&&(i.id=t.id),t.src&&(i.src=t.src),i},i.addRemoteTextTrack=function(t,i){var n=e.prototype.addRemoteTextTrack.call(this,t,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n},i.removeRemoteTextTrack=function(t){if(e.prototype.removeRemoteTextTrack.call(this,t),this.featuresNativeTextTracks)for(var i=this.$$("track"),n=i.length;n--;)t!==i[n]&&t!==i[n].track||this.el().removeChild(i[n])},i.getVideoPlaybackQuality=function(){if("function"==typeof this.el().getVideoPlaybackQuality)return this.el().getVideoPlaybackQuality();var e={};return void 0!==this.el().webkitDroppedFrameCount&&void 0!==this.el().webkitDecodedFrameCount&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),window.performance&&"function"==typeof window.performance.now?e.creationTime=window.performance.now():window.performance&&window.performance.timing&&"number"==typeof window.performance.timing.navigationStart&&(e.creationTime=window.Date.now()-window.performance.timing.navigationStart),e},t}(Qi);Wr(Gr,"TEST_VID",function(){if(X()){var e=document.createElement("video"),t=document.createElement("track");return t.kind="captions",t.srclang="en",t.label="English",e.appendChild(t),e}}),Gr.isSupported=function(){try{Gr.TEST_VID.volume=.5}catch(e){return!1}return!(!Gr.TEST_VID||!Gr.TEST_VID.canPlayType)},Gr.canPlayType=function(e){return Gr.TEST_VID.canPlayType(e)},Gr.canPlaySource=function(e,t){return Gr.canPlayType(e.type)},Gr.canControlVolume=function(){try{var e=Gr.TEST_VID.volume;Gr.TEST_VID.volume=e/2+.1;var t=e!==Gr.TEST_VID.volume;return t&&q?(window.setTimeout(function(){Gr&&Gr.prototype&&(Gr.prototype.featuresVolumeControl=e!==Gr.TEST_VID.volume)}),!1):t}catch(e){return!1}},Gr.canMuteVolume=function(){try{var e=Gr.TEST_VID.muted;return Gr.TEST_VID.muted=!e,Gr.TEST_VID.muted?oe(Gr.TEST_VID,"muted","muted"):ue(Gr.TEST_VID,"muted"),e!==Gr.TEST_VID.muted}catch(e){return!1}},Gr.canControlPlaybackRate=function(){if(A&&R&&M<58)return!1;try{var e=Gr.TEST_VID.playbackRate;return Gr.TEST_VID.playbackRate=e/2+.1,e!==Gr.TEST_VID.playbackRate}catch(e){return!1}},Gr.canOverrideAttributes=function(){try{var e=function(){};Object.defineProperty(document.createElement("video"),"src",{get:e,set:e}),Object.defineProperty(document.createElement("audio"),"src",{get:e,set:e}),Object.defineProperty(document.createElement("video"),"innerHTML",{get:e,set:e}),Object.defineProperty(document.createElement("audio"),"innerHTML",{get:e,set:e})}catch(e){return!1}return!0},Gr.supportsNativeTextTracks=function(){return V||q&&R},Gr.supportsNativeVideoTracks=function(){return!(!Gr.TEST_VID||!Gr.TEST_VID.videoTracks)},Gr.supportsNativeAudioTracks=function(){return!(!Gr.TEST_VID||!Gr.TEST_VID.audioTracks)},Gr.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function(e){var t=e[0],i=e[1];Wr(Gr.prototype,t,function(){return Gr[i]()},!0)}),Gr.prototype.featuresVolumeControl=Gr.canControlVolume(),Gr.prototype.movingMediaElementInDOM=!q,Gr.prototype.featuresFullscreenResize=!0,Gr.prototype.featuresProgressEvents=!0,Gr.prototype.featuresTimeupdateEvents=!0,Gr.prototype.featuresVideoFrameCallback=!(!Gr.TEST_VID||!Gr.TEST_VID.requestVideoFrameCallback),Gr.patchCanPlayType=function(){P>=4&&!D&&!R&&(Br=Gr.TEST_VID&&Gr.TEST_VID.constructor.prototype.canPlayType,Gr.TEST_VID.constructor.prototype.canPlayType=function(e){return e&&/^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e)?"maybe":Br.call(this,e)})},Gr.unpatchCanPlayType=function(){var e=Gr.TEST_VID.constructor.prototype.canPlayType;return Br&&(Gr.TEST_VID.constructor.prototype.canPlayType=Br),e},Gr.patchCanPlayType(),Gr.disposeMediaElement=function(e){if(e){for(e.parentNode&&e.parentNode.removeChild(e);e.hasChildNodes();)e.removeChild(e.firstChild);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},Gr.resetMediaElement=function(e){if(e){for(var t=e.querySelectorAll("source"),i=t.length;i--;)e.removeChild(t[i]);e.removeAttribute("src"),"function"==typeof e.load&&function(){try{e.load()}catch(e){}}()}},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(e){Gr.prototype[e]=function(){return this.el_[e]||this.el_.hasAttribute(e)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(e){Gr.prototype["set"+dt(e)]=function(t){this.el_[e]=t,t?this.el_.setAttribute(e,e):this.el_.removeAttribute(e)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(e){Gr.prototype[e]=function(){return this.el_[e]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(e){Gr.prototype["set"+dt(e)]=function(t){this.el_[e]=t}}),["pause","load","play"].forEach(function(e){Gr.prototype[e]=function(){return this.el_[e]()}}),Qi.withSourceHandlers(Gr),Gr.nativeSourceHandler={},Gr.nativeSourceHandler.canPlayType=function(e){try{return Gr.TEST_VID.canPlayType(e)}catch(e){return""}},Gr.nativeSourceHandler.canHandleSource=function(e,t){if(e.type)return Gr.nativeSourceHandler.canPlayType(e.type);if(e.src){var i=Kt(e.src);return Gr.nativeSourceHandler.canPlayType("video/"+i)}return""},Gr.nativeSourceHandler.handleSource=function(e,t,i){t.setSrc(e.src)},Gr.nativeSourceHandler.dispose=function(){},Gr.registerSourceHandler(Gr.nativeSourceHandler),Qi.registerTech("Html5",Gr);var zr=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Xr={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Kr=["tiny","xsmall","small","medium","large","xlarge","huge"],Yr={};Kr.forEach(function(e){var t="x"===e.charAt(0)?"x-"+e.substring(1):e;Yr[e]="vjs-layout-"+t});var Qr={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0},$r=function(e){function i(n,r,s){var o;if(n.id=n.id||r.id||"vjs_video_"+De(),(r=_(i.getTagSettings(n),r)).initChildren=!1,r.createEl=!1,r.evented=!1,r.reportTouchActivity=!1,!r.language)if("function"==typeof n.closest){var u=n.closest("[lang]");u&&u.getAttribute&&(r.language=u.getAttribute("lang"))}else for(var l=n;l&&1===l.nodeType;){if(ae(l).hasOwnProperty("lang")){r.language=l.getAttribute("lang");break}l=l.parentNode}if((o=e.call(this,null,r,s)||this).boundDocumentFullscreenChange_=function(e){return o.documentFullscreenChange_(e)},o.boundFullWindowOnEscKey_=function(e){return o.fullWindowOnEscKey(e)},o.boundUpdateStyleEl_=function(e){return o.updateStyleEl_(e)},o.boundApplyInitTime_=function(e){return o.applyInitTime_(e)},o.boundUpdateCurrentBreakpoint_=function(e){return o.updateCurrentBreakpoint_(e)},o.boundHandleTechClick_=function(e){return o.handleTechClick_(e)},o.boundHandleTechDoubleClick_=function(e){return o.handleTechDoubleClick_(e)},o.boundHandleTechTouchStart_=function(e){return o.handleTechTouchStart_(e)},o.boundHandleTechTouchMove_=function(e){return o.handleTechTouchMove_(e)},o.boundHandleTechTouchEnd_=function(e){return o.handleTechTouchEnd_(e)},o.boundHandleTechTap_=function(e){return o.handleTechTap_(e)},o.isFullscreen_=!1,o.log=h(o.id_),o.fsApi_=a,o.isPosterFromTech_=!1,o.queuedCallbacks_=[],o.isReady_=!1,o.hasStarted_=!1,o.userActive_=!1,o.debugEnabled_=!1,o.audioOnlyMode_=!1,o.audioPosterMode_=!1,o.audioOnlyCache_={playerHeight:null,hiddenChildren:[]},!o.options_||!o.options_.techOrder||!o.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(o.tag=n,o.tagAttributes=n&&ae(n),o.language(o.options_.language),r.languages){var c={};Object.getOwnPropertyNames(r.languages).forEach(function(e){c[e.toLowerCase()]=r.languages[e]}),o.languages_=c}else o.languages_=i.prototype.options_.languages;o.resetCache_(),o.poster_=r.poster||"",o.controls_=!!r.controls,n.controls=!1,n.removeAttribute("controls"),o.changingSrc_=!1,o.playCallbacks_=[],o.playTerminatedQueue_=[],n.hasAttribute("autoplay")?o.autoplay(!0):o.autoplay(o.options_.autoplay),r.plugins&&Object.keys(r.plugins).forEach(function(e){if("function"!=typeof o[e])throw new Error('plugin "'+e+'" does not exist')}),o.scrubbing_=!1,o.el_=o.createEl(),ot(_t(o),{eventBusKey:"el_"}),o.fsApi_.requestFullscreen&&(je(document,o.fsApi_.fullscreenchange,o.boundDocumentFullscreenChange_),o.on(o.fsApi_.fullscreenchange,o.boundDocumentFullscreenChange_)),o.fluid_&&o.on(["playerreset","resize"],o.boundUpdateStyleEl_);var d=ht(o.options_);r.plugins&&Object.keys(r.plugins).forEach(function(e){o[e](r.plugins[e])}),r.debug&&o.debug(!0),o.options_.playerOptions=d,o.middleware_=[],o.playbackRates(r.playbackRates),o.initChildren(),o.isAudio("audio"===n.nodeName.toLowerCase()),o.controls()?o.addClass("vjs-controls-enabled"):o.addClass("vjs-controls-disabled"),o.el_.setAttribute("role","region"),o.isAudio()?o.el_.setAttribute("aria-label",o.localize("Audio Player")):o.el_.setAttribute("aria-label",o.localize("Video Player")),o.isAudio()&&o.addClass("vjs-audio"),o.flexNotSupported_()&&o.addClass("vjs-no-flex"),F&&o.addClass("vjs-touch-enabled"),q||o.addClass("vjs-workinghover"),i.players[o.id_]=_t(o);var p=t.split(".")[0];return o.addClass("vjs-v"+p),o.userActive(!0),o.reportUserActivity(),o.one("play",function(e){return o.listenForUserActivity_(e)}),o.on("stageclick",function(e){return o.handleStageClick_(e)}),o.on("keydown",function(e){return o.handleKeyDown(e)}),o.on("languagechange",function(e){return o.handleLanguagechange(e)}),o.breakpoints(o.options_.breakpoints),o.responsive(o.options_.responsive),o.on("ready",function(){o.audioPosterMode(o.options_.audioPosterMode),o.audioOnlyMode(o.options_.audioOnlyMode)}),o}bt(i,e);var r=i.prototype;return r.dispose=function(){var t=this;this.trigger("dispose"),this.off("dispose"),He(document,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),He(document,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),i.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),Ji[this.id()]=null,gi.names.forEach(function(e){var i=gi[e],n=t[i.getterName]();n&&n.off&&n.off()}),e.prototype.dispose.call(this,{restoreEl:this.options_.restoreEl})},r.createEl=function(){var t,i=this.tag,n=this.playerElIngest_=i.parentNode&&i.parentNode.hasAttribute&&i.parentNode.hasAttribute("data-vjs-player"),r="video-js"===this.tag.tagName.toLowerCase();n?t=this.el_=i.parentNode:r||(t=this.el_=e.prototype.createEl.call(this,"div"));var a=ae(i);if(r){for(t=this.el_=i,i=this.tag=document.createElement("video");t.children.length;)i.appendChild(t.firstChild);ee(t,"video-js")||te(t,"video-js"),t.appendChild(i),n=this.playerElIngest_=t,Object.keys(t).forEach(function(e){try{i[e]=t[e]}catch(e){}})}if(i.setAttribute("tabindex","-1"),a.tabindex="-1",(N||R&&B)&&(i.setAttribute("role","application"),a.role="application"),i.removeAttribute("width"),i.removeAttribute("height"),"width"in a&&delete a.width,"height"in a&&delete a.height,Object.getOwnPropertyNames(a).forEach(function(e){r&&"class"===e||t.setAttribute(e,a[e]),r&&i.setAttribute(e,a[e])}),i.playerId=i.id,i.id+="_html5_api",i.className="vjs-tech",i.player=t.player=this,this.addClass("vjs-paused"),!0!==window.VIDEOJS_NO_DYNAMIC_STYLE){this.styleEl_=Ae("vjs-styles-dimensions");var s=Te(".vjs-styles-defaults"),o=Te("head");o.insertBefore(this.styleEl_,s?s.nextSibling:o.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);for(var u=i.getElementsByTagName("a"),l=0;l0?this.videoWidth()+":"+this.videoHeight():"16:9").split(":"),r=n[1]/n[0];e=void 0!==this.width_?this.width_:void 0!==this.height_?this.height_/r:this.videoWidth()||300,t=void 0!==this.height_?this.height_:e*r,i=/^[^a-zA-Z]/.test(this.id())?"dimensions-"+this.id():this.id()+"-dimensions",this.addClass(i),Pe(this.styleEl_,"\n ."+i+" {\n width: "+e+"px;\n height: "+t+"px;\n }\n\n ."+i+".vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: "+100*r+"%;\n }\n ")}else{var a="number"==typeof this.width_?this.width_:this.options_.width,s="number"==typeof this.height_?this.height_:this.options_.height,o=this.tech_&&this.tech_.el();o&&(a>=0&&(o.width=a),s>=0&&(o.height=s))}},r.loadTech_=function(e,t){var i=this;this.tech_&&this.unloadTech_();var n=dt(e),r=e.charAt(0).toLowerCase()+e.slice(1);"Html5"!==n&&this.tag&&(Qi.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;var a=this.autoplay();("string"==typeof this.autoplay()||!0===this.autoplay()&&this.options_.normalizeAutoplay)&&(a=!1);var s={source:t,autoplay:a,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,Promise:this.options_.Promise};gi.names.forEach(function(e){var t=gi[e];s[t.getterName]=i[t.privateName]}),_(s,this.options_[n]),_(s,this.options_[r]),_(s,this.options_[e.toLowerCase()]),this.tag&&(s.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(s.startTime=this.cache_.currentTime);var o,u,l=Qi.getTech(e);if(!l)throw new Error("No Tech named '"+n+"' exists! '"+n+"' should be registered using videojs.registerTech()'");this.tech_=new l(s),this.tech_.ready(Ke(this,this.handleTechReady_),!0),o=this.textTracksJson_||[],u=this.tech_,o.forEach(function(e){var t=u.addRemoteTextTrack(e).track;!e.src&&e.cues&&e.cues.forEach(function(e){return t.addCue(e)})}),u.textTracks(),zr.forEach(function(e){i.on(i.tech_,e,function(t){return i["handleTech"+dt(e)+"_"](t)})}),Object.keys(Xr).forEach(function(e){i.on(i.tech_,e,function(t){0===i.tech_.playbackRate()&&i.tech_.seeking()?i.queuedCallbacks_.push({callback:i["handleTech"+Xr[e]+"_"].bind(i),event:t}):i["handleTech"+Xr[e]+"_"](t)})}),this.on(this.tech_,"loadstart",function(e){return i.handleTechLoadStart_(e)}),this.on(this.tech_,"sourceset",function(e){return i.handleTechSourceset_(e)}),this.on(this.tech_,"waiting",function(e){return i.handleTechWaiting_(e)}),this.on(this.tech_,"ended",function(e){return i.handleTechEnded_(e)}),this.on(this.tech_,"seeking",function(e){return i.handleTechSeeking_(e)}),this.on(this.tech_,"play",function(e){return i.handleTechPlay_(e)}),this.on(this.tech_,"firstplay",function(e){return i.handleTechFirstPlay_(e)}),this.on(this.tech_,"pause",function(e){return i.handleTechPause_(e)}),this.on(this.tech_,"durationchange",function(e){return i.handleTechDurationChange_(e)}),this.on(this.tech_,"fullscreenchange",function(e,t){return i.handleTechFullscreenChange_(e,t)}),this.on(this.tech_,"fullscreenerror",function(e,t){return i.handleTechFullscreenError_(e,t)}),this.on(this.tech_,"enterpictureinpicture",function(e){return i.handleTechEnterPictureInPicture_(e)}),this.on(this.tech_,"leavepictureinpicture",function(e){return i.handleTechLeavePictureInPicture_(e)}),this.on(this.tech_,"error",function(e){return i.handleTechError_(e)}),this.on(this.tech_,"posterchange",function(e){return i.handleTechPosterChange_(e)}),this.on(this.tech_,"textdata",function(e){return i.handleTechTextData_(e)}),this.on(this.tech_,"ratechange",function(e){return i.handleTechRateChange_(e)}),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode===this.el()||"Html5"===n&&this.tag||Z(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)},r.unloadTech_=function(){var e,t,i,n=this;gi.names.forEach(function(e){var t=gi[e];n[t.privateName]=n[t.getterName]()}),this.textTracksJson_=(e=this.tech_,t=e.$$("track"),i=Array.prototype.map.call(t,function(e){return e.track}),Array.prototype.map.call(t,function(e){var t=At(e.track);return e.src&&(t.src=e.src),t}).concat(Array.prototype.filter.call(e.textTracks(),function(e){return-1===i.indexOf(e)}).map(At))),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1},r.tech=function(e){return void 0===e&&d.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),this.tech_},r.addTechControlsListeners_=function(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)},r.removeTechControlsListeners_=function(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)},r.handleTechReady_=function(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()},r.handleTechLoadStart_=function(){this.removeClass("vjs-ended"),this.removeClass("vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):(this.trigger("loadstart"),this.trigger("firstplay")),this.manualAutoplay_(!0===this.autoplay()&&this.options_.normalizeAutoplay?"play":this.autoplay())},r.manualAutoplay_=function(e){var t=this;if(this.tech_&&"string"==typeof e){var i,n=function(){var e=t.muted();t.muted(!0);var i=function(){t.muted(e)};t.playTerminatedQueue_.push(i);var n=t.play();if(It(n))return n.catch(function(e){throw i(),new Error("Rejection at manualAutoplay. Restoring muted value. "+(e||""))})};if("any"!==e||this.muted()?i="muted"!==e||this.muted()?this.play():n():It(i=this.play())&&(i=i.catch(n)),It(i))return i.then(function(){t.trigger({type:"autoplay-success",autoplay:e})}).catch(function(){t.trigger({type:"autoplay-failure",autoplay:e})})}},r.updateSourceCaches_=function(e){void 0===e&&(e="");var t=e,i="";"string"!=typeof t&&(t=e.src,i=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!i&&(i=function(e,t){if(!t)return"";if(e.cache_.source.src===t&&e.cache_.source.type)return e.cache_.source.type;var i=e.cache_.sources.filter(function(e){return e.src===t});if(i.length)return i[0].type;for(var n=e.$$("source"),r=0;r0&&0===this.cache_.lastPlaybackRate&&(this.queuedCallbacks_.forEach(function(e){return e.callback(e.event)}),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")},r.handleTechWaiting_=function(){var e=this;this.addClass("vjs-waiting"),this.trigger("waiting");var t=this.currentTime();this.on("timeupdate",function i(){t!==e.currentTime()&&(e.removeClass("vjs-waiting"),e.off("timeupdate",i))})},r.handleTechCanPlay_=function(){this.removeClass("vjs-waiting"),this.trigger("canplay")},r.handleTechCanPlayThrough_=function(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")},r.handleTechPlaying_=function(){this.removeClass("vjs-waiting"),this.trigger("playing")},r.handleTechSeeking_=function(){this.addClass("vjs-seeking"),this.trigger("seeking")},r.handleTechSeeked_=function(){this.removeClass("vjs-seeking"),this.removeClass("vjs-ended"),this.trigger("seeked")},r.handleTechFirstPlay_=function(){this.options_.starttime&&(d.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),this.currentTime(this.options_.starttime)),this.addClass("vjs-has-started"),this.trigger("firstplay")},r.handleTechPause_=function(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")},r.handleTechEnded_=function(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")},r.handleTechDurationChange_=function(){this.duration(this.techGet_("duration"))},r.handleTechClick_=function(e){this.controls_&&(void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.click&&!1===this.options_.userActions.click||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.click?this.options_.userActions.click.call(this,e):this.paused()?xt(this.play()):this.pause()))},r.handleTechDoubleClick_=function(e){this.controls_&&(Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),function(t){return t.contains(e.target)})||void 0!==this.options_&&void 0!==this.options_.userActions&&void 0!==this.options_.userActions.doubleClick&&!1===this.options_.userActions.doubleClick||(void 0!==this.options_&&void 0!==this.options_.userActions&&"function"==typeof this.options_.userActions.doubleClick?this.options_.userActions.doubleClick.call(this,e):this.isFullscreen()?this.exitFullscreen():this.requestFullscreen()))},r.handleTechTap_=function(){this.userActive(!this.userActive())},r.handleTechTouchStart_=function(){this.userWasActive=this.userActive()},r.handleTechTouchMove_=function(){this.userWasActive&&this.reportUserActivity()},r.handleTechTouchEnd_=function(e){e.cancelable&&e.preventDefault()},r.handleStageClick_=function(){this.reportUserActivity()},r.toggleFullscreenClass_=function(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")},r.documentFullscreenChange_=function(e){var t=e.target.player;if(!t||t===this){var i=this.el(),n=document[this.fsApi_.fullscreenElement]===i;!n&&i.matches?n=i.matches(":"+this.fsApi_.fullscreen):!n&&i.msMatchesSelector&&(n=i.msMatchesSelector(":"+this.fsApi_.fullscreen)),this.isFullscreen(n)}},r.handleTechFullscreenChange_=function(e,t){var i=this;t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",function(){i.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))},r.handleTechFullscreenError_=function(e,t){this.trigger("fullscreenerror",t)},r.togglePictureInPictureClass_=function(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")},r.handleTechEnterPictureInPicture_=function(e){this.isInPictureInPicture(!0)},r.handleTechLeavePictureInPicture_=function(e){this.isInPictureInPicture(!1)},r.handleTechError_=function(){var e=this.tech_.error();this.error(e)},r.handleTechTextData_=function(){var e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)},r.getCache=function(){return this.cache_},r.resetCache_=function(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}},r.techCall_=function(e,t){this.ready(function(){if(e in nn)return function(e,t,i,n){return t[i](e.reduce(an(i),n))}(this.middleware_,this.tech_,e,t);if(e in rn)return en(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(e){throw d(e),e}},!0)},r.techGet_=function(e){if(this.tech_&&this.tech_.isReady_){if(e in tn)return function(e,t,i){return e.reduceRight(an(i),t[i]())}(this.middleware_,this.tech_,e);if(e in rn)return en(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){if(void 0===this.tech_[e])throw d("Video.js: "+e+" method not defined for "+this.techName_+" playback technology.",t),t;if("TypeError"===t.name)throw d("Video.js: "+e+" unavailable on "+this.techName_+" playback technology element.",t),this.tech_.isReady_=!1,t;throw d(t),t}}},r.play=function(){var e=this,t=this.options_.Promise||window.Promise;return t?new t(function(t){e.play_(t)}):this.play_()},r.play_=function(e){var t=this;void 0===e&&(e=xt),this.playCallbacks_.push(e);var i=Boolean(!this.changingSrc_&&(this.src()||this.currentSrc()));if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!i)return this.waitToPlay_=function(e){t.play_()},this.one(["ready","loadstart"],this.waitToPlay_),void(i||!V&&!q||this.load());var n=this.techGet_("play");null===n?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(n)},r.runPlayTerminatedQueue_=function(){var e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(e){e()})},r.runPlayCallbacks_=function(e){var t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(t){t(e)})},r.pause=function(){this.techCall_("pause")},r.paused=function(){return!1!==this.techGet_("paused")},r.played=function(){return this.techGet_("played")||St(0,0)},r.scrubbing=function(e){if(void 0===e)return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")},r.currentTime=function(e){return void 0!==e?(e<0&&(e=0),this.isReady_&&!this.changingSrc_&&this.tech_&&this.tech_.isReady_?(this.techCall_("setCurrentTime",e),void(this.cache_.initTime=0)):(this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),void this.one("canplay",this.boundApplyInitTime_))):(this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime)},r.applyInitTime_=function(){this.currentTime(this.cache_.initTime)},r.duration=function(e){if(void 0===e)return void 0!==this.cache_.duration?this.cache_.duration:NaN;(e=parseFloat(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"))},r.remainingTime=function(){return this.duration()-this.currentTime()},r.remainingTimeDisplay=function(){return Math.floor(this.duration())-Math.floor(this.currentTime())},r.buffered=function(){var e=this.techGet_("buffered");return e&&e.length||(e=St(0,0)),e},r.bufferedPercent=function(){return Et(this.buffered(),this.duration())},r.bufferedEnd=function(){var e=this.buffered(),t=this.duration(),i=e.end(e.length-1);return i>t&&(i=t),i},r.volume=function(e){var t;return void 0!==e?(t=Math.max(0,Math.min(1,parseFloat(e))),this.cache_.volume=t,this.techCall_("setVolume",t),void(t>0&&this.lastVolume_(t))):(t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t)},r.muted=function(e){if(void 0===e)return this.techGet_("muted")||!1;this.techCall_("setMuted",e)},r.defaultMuted=function(e){return void 0!==e?this.techCall_("setDefaultMuted",e):this.techGet_("defaultMuted")||!1},r.lastVolume_=function(e){if(void 0===e||0===e)return this.cache_.lastVolume;this.cache_.lastVolume=e},r.supportsFullScreen=function(){return this.techGet_("supportsFullScreen")||!1},r.isFullscreen=function(e){if(void 0!==e){var t=this.isFullscreen_;return this.isFullscreen_=Boolean(e),this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),void this.toggleFullscreenClass_()}return this.isFullscreen_},r.requestFullscreen=function(e){var t=this.options_.Promise||window.Promise;if(t){var i=this;return new t(function(t,n){function r(){i.off("fullscreenerror",s),i.off("fullscreenchange",a)}function a(){r(),t()}function s(e,t){r(),n(t)}i.one("fullscreenchange",a),i.one("fullscreenerror",s);var o=i.requestFullscreenHelper_(e);o&&(o.then(r,r),o.then(t,n))})}return this.requestFullscreenHelper_()},r.requestFullscreenHelper_=function(e){var t,i=this;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},void 0!==e&&(t=e)),this.fsApi_.requestFullscreen){var n=this.el_[this.fsApi_.requestFullscreen](t);return n&&n.then(function(){return i.isFullscreen(!0)},function(){return i.isFullscreen(!1)}),n}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()},r.exitFullscreen=function(){var e=this.options_.Promise||window.Promise;if(e){var t=this;return new e(function(e,i){function n(){t.off("fullscreenerror",a),t.off("fullscreenchange",r)}function r(){n(),e()}function a(e,t){n(),i(t)}t.one("fullscreenchange",r),t.one("fullscreenerror",a);var s=t.exitFullscreenHelper_();s&&(s.then(n,n),s.then(e,i))})}return this.exitFullscreenHelper_()},r.exitFullscreenHelper_=function(){var e=this;if(this.fsApi_.requestFullscreen){var t=document[this.fsApi_.exitFullscreen]();return t&&xt(t.then(function(){return e.isFullscreen(!1)})),t}this.tech_.supportsFullScreen()&&1==!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()},r.enterFullWindow=function(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=document.documentElement.style.overflow,je(document,"keydown",this.boundFullWindowOnEscKey_),document.documentElement.style.overflow="hidden",te(document.body,"vjs-full-window"),this.trigger("enterFullWindow")},r.fullWindowOnEscKey=function(e){vt.isEventKey(e,"Esc")&&!0===this.isFullscreen()&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())},r.exitFullWindow=function(){this.isFullscreen(!1),this.isFullWindow=!1,He(document,"keydown",this.boundFullWindowOnEscKey_),document.documentElement.style.overflow=this.docOrigOverflow,ie(document.body,"vjs-full-window"),this.trigger("exitFullWindow")},r.disablePictureInPicture=function(e){if(void 0===e)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")},r.isInPictureInPicture=function(e){return void 0!==e?(this.isInPictureInPicture_=!!e,void this.togglePictureInPictureClass_()):!!this.isInPictureInPicture_},r.requestPictureInPicture=function(){if("pictureInPictureEnabled"in document&&!1===this.disablePictureInPicture())return this.techGet_("requestPictureInPicture")},r.exitPictureInPicture=function(){if("pictureInPictureEnabled"in document)return document.exitPictureInPicture()},r.handleKeyDown=function(e){var t,i,n=this.options_.userActions;n&&n.hotkeys&&(t=this.el_.ownerDocument.activeElement,i=t.tagName.toLowerCase(),t.isContentEditable||("input"===i?-1===["button","checkbox","hidden","radio","reset","submit"].indexOf(t.type):-1!==["textarea"].indexOf(i))||("function"==typeof n.hotkeys?n.hotkeys.call(this,e):this.handleHotkeys(e)))},r.handleHotkeys=function(e){var t=this.options_.userActions?this.options_.userActions.hotkeys:{},i=t.fullscreenKey,n=void 0===i?function(e){return vt.isEventKey(e,"f")}:i,r=t.muteKey,a=void 0===r?function(e){return vt.isEventKey(e,"m")}:r,s=t.playPauseKey,o=void 0===s?function(e){return vt.isEventKey(e,"k")||vt.isEventKey(e,"Space")}:s;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();var u=yt.getComponent("FullscreenToggle");!1!==document[this.fsApi_.fullscreenEnabled]&&u.prototype.handleClick.call(this,e)}else a.call(this,e)?(e.preventDefault(),e.stopPropagation(),yt.getComponent("MuteToggle").prototype.handleClick.call(this,e)):o.call(this,e)&&(e.preventDefault(),e.stopPropagation(),yt.getComponent("PlayToggle").prototype.handleClick.call(this,e))},r.canPlayType=function(e){for(var t,i=0,n=this.options_.techOrder;i1?i.handleSrc_(s.slice(1)):(i.changingSrc_=!1,i.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),void i.triggerReady());r=n,a=i.tech_,r.forEach(function(e){return e.setTech&&e.setTech(a)})},n.setTimeout(function(){return function e(t,i,n,r,a,s){void 0===t&&(t={}),void 0===i&&(i=[]),void 0===a&&(a=[]),void 0===s&&(s=!1);var o=i,u=o[0],l=o.slice(1);if("string"==typeof u)e(t,$i[u],n,r,a,s);else if(u){var c=function(e,t){var i=Ji[e.id()],n=null;if(null==i)return n=t(e),Ji[e.id()]=[[t,n]],n;for(var r=0;r1){var o=function(){i.error(null),i.handleSrc_(s.slice(1),!0)},u=function(){i.off("error",o)};this.one("error",o),this.one("playing",u),this.resetRetryOnError_=function(){i.off("error",o),i.off("playing",u)}}}else this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0)},r.src=function(e){return this.handleSrc_(e,!1)},r.src_=function(e){var t,i,n=this,r=this.selectSource([e]);return!r||(t=r.tech,i=this.techName_,dt(t)!==dt(i)?(this.changingSrc_=!0,this.loadTech_(r.tech,r.source),this.tech_.ready(function(){n.changingSrc_=!1}),!1):(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1))},r.load=function(){this.techCall_("load")},r.reset=function(){var e=this,t=this.options_.Promise||window.Promise;this.paused()||!t?this.doReset_():xt(this.play().then(function(){return e.doReset_()}))},r.doReset_=function(){this.tech_&&this.tech_.clearTracks("text"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),Ze(this)&&this.trigger("playerreset")},r.resetControlBarUI_=function(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()},r.resetProgressBar_=function(){this.currentTime(0);var e=this.controlBar||{},t=e.durationDisplay,i=e.remainingTimeDisplay;t&&t.updateContent(),i&&i.updateContent()},r.resetPlaybackRate_=function(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()},r.resetVolumeBar_=function(){this.volume(1),this.trigger("volumechange")},r.currentSources=function(){var e=this.currentSource(),t=[];return 0!==Object.keys(e).length&&t.push(e),this.cache_.sources||t},r.currentSource=function(){return this.cache_.source||{}},r.currentSrc=function(){return this.currentSource()&&this.currentSource().src||""},r.currentType=function(){return this.currentSource()&&this.currentSource().type||""},r.preload=function(e){return void 0!==e?(this.techCall_("setPreload",e),void(this.options_.preload=e)):this.techGet_("preload")},r.autoplay=function(e){if(void 0===e)return this.options_.autoplay||!1;var t;"string"==typeof e&&/(any|play|muted)/.test(e)||!0===e&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_("string"==typeof e?e:"play"),t=!1):this.options_.autoplay=!!e,t=void 0===t?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)},r.playsinline=function(e){return void 0!==e?(this.techCall_("setPlaysinline",e),this.options_.playsinline=e,this):this.techGet_("playsinline")},r.loop=function(e){return void 0!==e?(this.techCall_("setLoop",e),void(this.options_.loop=e)):this.techGet_("loop")},r.poster=function(e){if(void 0===e)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))},r.handleTechPosterChange_=function(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){var e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}},r.controls=function(e){if(void 0===e)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_()))},r.usingNativeControls=function(e){if(void 0===e)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")))},r.error=function(e){var t=this;if(void 0===e)return this.error_||null;if(n("beforeerror").forEach(function(i){var n=i(t,e);b(n)&&!Array.isArray(n)||"string"==typeof n||"number"==typeof n||null===n?e=n:t.log.error("please return a value that MediaError expects in beforeerror hooks")}),this.options_.suppressNotSupportedError&&e&&4===e.code){var i=function(){this.error(e)};return this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],i),void this.one("loadstart",function(){this.off(["click","touchstart"],i)})}if(null===e)return this.error_=e,this.removeClass("vjs-error"),void(this.errorDisplay&&this.errorDisplay.close());this.error_=new kt(e),this.addClass("vjs-error"),d.error("(CODE:"+this.error_.code+" "+kt.errorTypes[this.error_.code]+")",this.error_.message,this.error_),this.trigger("error"),n("error").forEach(function(e){return e(t,t.error_)})},r.reportUserActivity=function(e){this.userActivity_=!0},r.userActive=function(e){if(void 0===e)return this.userActive_;if((e=!!e)!==this.userActive_){if(this.userActive_=e,this.userActive_)return this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),void this.trigger("useractive");this.tech_&&this.tech_.one("mousemove",function(e){e.stopPropagation(),e.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}},r.listenForUserActivity_=function(){var e,t,i,n=Ke(this,this.reportUserActivity),r=function(t){n(),this.clearInterval(e)};this.on("mousedown",function(){n(),this.clearInterval(e),e=this.setInterval(n,250)}),this.on("mousemove",function(e){e.screenX===t&&e.screenY===i||(t=e.screenX,i=e.screenY,n())}),this.on("mouseup",r),this.on("mouseleave",r);var a,s=this.getChild("controlBar");!s||q||A||(s.on("mouseenter",function(e){0!==this.player().options_.inactivityTimeout&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),s.on("mouseleave",function(e){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",n),this.on("keyup",n),this.setInterval(function(){if(this.userActivity_){this.userActivity_=!1,this.userActive(!0),this.clearTimeout(a);var e=this.options_.inactivityTimeout;e<=0||(a=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},e))}},250)},r.playbackRate=function(e){if(void 0===e)return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1;this.techCall_("setPlaybackRate",e)},r.defaultPlaybackRate=function(e){return void 0!==e?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1},r.isAudio=function(e){if(void 0===e)return!!this.isAudio_;this.isAudio_=!!e},r.enableAudioOnlyUI_=function(){var e=this;this.addClass("vjs-audio-only-mode");var t=this.children(),i=this.getChild("ControlBar"),n=i&&i.currentHeight();t.forEach(function(t){t!==i&&t.el_&&!t.hasClass("vjs-hidden")&&(t.hide(),e.audioOnlyCache_.hiddenChildren.push(t))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.height(n),this.trigger("audioonlymodechange")},r.disableAudioOnlyUI_=function(){this.removeClass("vjs-audio-only-mode"),this.audioOnlyCache_.hiddenChildren.forEach(function(e){return e.show()}),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")},r.audioOnlyMode=function(e){var t=this;if("boolean"!=typeof e||e===this.audioOnlyMode_)return this.audioOnlyMode_;this.audioOnlyMode_=e;var i=this.options_.Promise||window.Promise;if(i){if(e){var n=[];return this.isInPictureInPicture()&&n.push(this.exitPictureInPicture()),this.isFullscreen()&&n.push(this.exitFullscreen()),this.audioPosterMode()&&n.push(this.audioPosterMode(!1)),i.all(n).then(function(){return t.enableAudioOnlyUI_()})}return i.resolve().then(function(){return t.disableAudioOnlyUI_()})}e?(this.isInPictureInPicture()&&this.exitPictureInPicture(),this.isFullscreen()&&this.exitFullscreen(),this.enableAudioOnlyUI_()):this.disableAudioOnlyUI_()},r.enablePosterModeUI_=function(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.disablePosterModeUI_=function(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")},r.audioPosterMode=function(e){var t=this;if("boolean"!=typeof e||e===this.audioPosterMode_)return this.audioPosterMode_;this.audioPosterMode_=e;var i=this.options_.Promise||window.Promise;return i?e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(function(){t.enablePosterModeUI_()}):i.resolve().then(function(){t.enablePosterModeUI_()}):i.resolve().then(function(){t.disablePosterModeUI_()}):e?(this.audioOnlyMode()&&this.audioOnlyMode(!1),void this.enablePosterModeUI_()):void this.disablePosterModeUI_()},r.addTextTrack=function(e,t,i){if(this.tech_)return this.tech_.addTextTrack(e,t,i)},r.addRemoteTextTrack=function(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)},r.removeRemoteTextTrack=function(e){void 0===e&&(e={});var t=e.track;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)},r.getVideoPlaybackQuality=function(){return this.techGet_("getVideoPlaybackQuality")},r.videoWidth=function(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0},r.videoHeight=function(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0},r.language=function(e){if(void 0===e)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Ze(this)&&this.trigger("languagechange"))},r.languages=function(){return ht(i.prototype.options_.languages,this.languages_)},r.toJSON=function(){var e=ht(this.options_),t=e.tracks;e.tracks=[];for(var i=0;i-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n-1;t=this.buffer.indexOf("\n"))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)},t}(fa),va=String.fromCharCode(9),ya=function(e){var t=/([0-9.]*)?@?([0-9.]*)?/.exec(e||""),i={};return t[1]&&(i.length=parseInt(t[1],10)),t[2]&&(i.offset=parseInt(t[2],10)),i},_a=function(e){for(var t,i=e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')),n={},r=i.length;r--;)""!==i[r]&&((t=/([^=]*)=(.*)/.exec(i[r]).slice(1))[0]=t[0].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^\s+|\s+$/g,""),t[1]=t[1].replace(/^['"](.*)['"]$/g,"$1"),n[t[0]]=t[1]);return n},ba=function(e){function t(){var t;return(t=e.call(this)||this).customParsers=[],t.tagMappers=[],t}bt(t,e);var i=t.prototype;return i.push=function(e){var t,i,n=this;0!==(e=e.trim()).length&&("#"===e[0]?this.tagMappers.reduce(function(t,i){var n=i(e);return n===e?t:t.concat([n])},[e]).forEach(function(e){for(var r=0;r0&&(s.duration=e.duration),0===e.duration&&(s.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=a},key:function(){if(e.attributes)if("NONE"!==e.attributes.METHOD)if(e.attributes.URI){if("com.apple.streamingkeydelivery"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:e.attributes});if("com.microsoft.playready"===e.attributes.KEYFORMAT)return this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.microsoft.playready"]={uri:e.attributes.URI});if("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"===e.attributes.KEYFORMAT)return-1===["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(e.attributes.METHOD)?void this.trigger("warn",{message:"invalid key method provided for Widevine"}):("SAMPLE-AES-CENC"===e.attributes.METHOD&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),"data:text/plain;base64,"!==e.attributes.URI.substring(0,23)?void this.trigger("warn",{message:"invalid key URI provided for Widevine"}):e.attributes.KEYID&&"0x"===e.attributes.KEYID.substring(0,2)?(this.manifest.contentProtection=this.manifest.contentProtection||{},void(this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:e.attributes.KEYFORMAT,keyId:e.attributes.KEYID.substring(2)},pssh:function(e){for(var t=ma(e),i=new Uint8Array(t.length),n=0;n=t.length&&u.call(t,function(t,i){return t===(o[i]?o[i]&e[a+i]:e[a+i])})},qa=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=window.location&&window.location.href||"");var i="function"==typeof window.URL,n=/^\/\//.test(e),r=!window.location&&!/\/\//i.test(e);if(i?e=new window.URL(e,window.location||"http://example.com"):/\/\//i.test(e)||(e=pa.buildAbsoluteURL(window.location&&window.location.href||"",e)),i){var a=new URL(t,e);return r?a.href.slice("http://example.com".length):n?a.href.slice(a.protocol.length):a.href}return pa.buildAbsoluteURL(e,t)};function Va(e,t){return void 0===t&&(t=Object),t&&"function"==typeof t.freeze?t.freeze(e):e}var Wa=Va({HTML:"text/html",isHTML:function(e){return e===Wa.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),Ga=Va({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(e){return e===Ga.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"}),za={freeze:Va,MIME_TYPE:Wa,NAMESPACE:Ga},Xa=za.NAMESPACE;function Ka(e){return""!==e}function Ya(e,t){return e.hasOwnProperty(t)||(e[t]=!0),e}function Qa(e){if(!e)return[];var t=function(e){return e?e.split(/[\t\n\f\r ]+/).filter(Ka):[]}(e);return Object.keys(t.reduce(Ya,{}))}function $a(e,t){for(var i in e)t[i]=e[i]}function Ja(e,t){var i=e.prototype;if(!(i instanceof t)){var n=function(){};n.prototype=t.prototype,$a(i,n=new n),e.prototype=i=n}i.constructor!=e&&("function"!=typeof e&&console.error("unknown Class:"+e),i.constructor=e)}var Za={},es=Za.ELEMENT_NODE=1,ts=Za.ATTRIBUTE_NODE=2,is=Za.TEXT_NODE=3,ns=Za.CDATA_SECTION_NODE=4,rs=Za.ENTITY_REFERENCE_NODE=5,as=Za.ENTITY_NODE=6,ss=Za.PROCESSING_INSTRUCTION_NODE=7,os=Za.COMMENT_NODE=8,us=Za.DOCUMENT_NODE=9,ls=Za.DOCUMENT_TYPE_NODE=10,cs=Za.DOCUMENT_FRAGMENT_NODE=11,ds=Za.NOTATION_NODE=12,hs={},ps={};hs.INDEX_SIZE_ERR=(ps[1]="Index size error",1),hs.DOMSTRING_SIZE_ERR=(ps[2]="DOMString size error",2);var fs=hs.HIERARCHY_REQUEST_ERR=(ps[3]="Hierarchy request error",3);hs.WRONG_DOCUMENT_ERR=(ps[4]="Wrong document",4),hs.INVALID_CHARACTER_ERR=(ps[5]="Invalid character",5),hs.NO_DATA_ALLOWED_ERR=(ps[6]="No data allowed",6),hs.NO_MODIFICATION_ALLOWED_ERR=(ps[7]="No modification allowed",7);var ms=hs.NOT_FOUND_ERR=(ps[8]="Not found",8);hs.NOT_SUPPORTED_ERR=(ps[9]="Not supported",9);var gs=hs.INUSE_ATTRIBUTE_ERR=(ps[10]="Attribute in use",10);function vs(e,t){if(t instanceof Error)var i=t;else i=this,Error.call(this,ps[e]),this.message=ps[e],Error.captureStackTrace&&Error.captureStackTrace(this,vs);return i.code=e,t&&(this.message=this.message+": "+t),i}function ys(){}function _s(e,t){this._node=e,this._refresh=t,bs(this)}function bs(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var i=e._refresh(e._node);$s(e,"length",i.length),$a(i,e),e._inc=t}}function Ts(){}function ws(e,t){for(var i=e.length;i--;)if(e[i]===t)return i}function Ss(e,t,i,n){if(n?t[ws(t,n)]=i:t[t.length++]=i,e){i.ownerElement=e;var r=e.ownerDocument;r&&(n&&Ps(r,e,n),function(e,t,i){e&&e._inc++,i.namespaceURI===Xa.XMLNS&&(t._nsMap[i.prefix?i.localName:""]=i.value)}(r,e,i))}}function Es(e,t,i){var n=ws(t,i);if(!(n>=0))throw vs(ms,new Error(e.tagName+"@"+i));for(var r=t.length-1;n"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function xs(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(xs(e,t))return!0}while(e=e.nextSibling)}function As(){}function Ps(e,t,i,n){e&&e._inc++,i.namespaceURI===Xa.XMLNS&&delete t._nsMap[i.prefix?i.localName:""]}function Ls(e,t,i){if(e&&e._inc){e._inc++;var n=t.childNodes;if(i)n[n.length++]=i;else{for(var r=t.firstChild,a=0;r;)n[a++]=r,r=r.nextSibling;n.length=a}}}function Ds(e,t){var i=t.previousSibling,n=t.nextSibling;return i?i.nextSibling=n:e.firstChild=n,n?n.previousSibling=i:e.lastChild=i,Ls(e.ownerDocument,e),t}function Os(e,t,i){var n=t.parentNode;if(n&&n.removeChild(t),t.nodeType===cs){var r=t.firstChild;if(null==r)return t;var a=t.lastChild}else r=a=t;var s=i?i.previousSibling:e.lastChild;r.previousSibling=s,a.nextSibling=i,s?s.nextSibling=r:e.firstChild=r,null==i?e.lastChild=a:i.previousSibling=a;do{r.parentNode=e}while(r!==a&&(r=r.nextSibling));return Ls(e.ownerDocument||e,e),t.nodeType==cs&&(t.firstChild=t.lastChild=null),t}function Rs(){this._nsMap={}}function Ms(){}function Ns(){}function Us(){}function Bs(){}function Fs(){}function js(){}function Hs(){}function qs(){}function Vs(){}function Ws(){}function Gs(){}function zs(){}function Xs(e,t){var i=[],n=9==this.nodeType&&this.documentElement||this,r=n.prefix,a=n.namespaceURI;if(a&&null==r&&null==(r=n.lookupPrefix(a)))var s=[{namespace:a,prefix:null}];return Qs(this,i,e,t,s),i.join("")}function Ks(e,t,i){var n=e.prefix||"",r=e.namespaceURI;if(!r)return!1;if("xml"===n&&r===Xa.XML||r===Xa.XMLNS)return!1;for(var a=i.length;a--;){var s=i[a];if(s.prefix===n)return s.namespace!==r}return!0}function Ys(e,t,i){e.push(" ",t,'="',i.replace(/[<&"]/g,Is),'"')}function Qs(e,t,i,n,r){if(r||(r=[]),n){if(!(e=n(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case es:var a=e.attributes,s=a.length,o=e.firstChild,u=e.tagName,l=u;if(!(i=Xa.isHTML(e.namespaceURI)||i)&&!e.prefix&&e.namespaceURI){for(var c,d=0;d=0;h--)if(""===(p=r[h]).prefix&&p.namespace===e.namespaceURI){c=p.namespace;break}if(c!==e.namespaceURI)for(h=r.length-1;h>=0;h--){var p;if((p=r[h]).namespace===e.namespaceURI){p.prefix&&(l=p.prefix+":"+u);break}}}t.push("<",l);for(var f=0;f"),i&&/^script$/i.test(u))for(;o;)o.data?t.push(o.data):Qs(o,t,i,n,r.slice()),o=o.nextSibling;else for(;o;)Qs(o,t,i,n,r.slice()),o=o.nextSibling;t.push("")}else t.push("/>");return;case us:case cs:for(o=e.firstChild;o;)Qs(o,t,i,n,r.slice()),o=o.nextSibling;return;case ts:return Ys(t,e.name,e.value);case is:return t.push(e.data.replace(/[<&]/g,Is).replace(/]]>/g,"]]>"));case ns:return t.push("");case os:return t.push("\x3c!--",e.data,"--\x3e");case ls:var y=e.publicId,_=e.systemId;if(t.push("");else if(_&&"."!=_)t.push(" SYSTEM ",_,">");else{var b=e.internalSubset;b&&t.push(" [",b,"]"),t.push(">")}return;case ss:return t.push("");case rs:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function $s(e,t,i){e[t]=i}hs.INVALID_STATE_ERR=(ps[11]="Invalid state",11),hs.SYNTAX_ERR=(ps[12]="Syntax error",12),hs.INVALID_MODIFICATION_ERR=(ps[13]="Invalid modification",13),hs.NAMESPACE_ERR=(ps[14]="Invalid namespace",14),hs.INVALID_ACCESS_ERR=(ps[15]="Invalid access",15),vs.prototype=Error.prototype,$a(hs,vs),ys.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var i=[],n=0;n0},lookupPrefix:function(e){for(var t=this;t;){var i=t._nsMap;if(i)for(var n in i)if(i[n]==e)return n;t=t.nodeType==ts?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var i=t._nsMap;if(i&&e in i)return i[e];t=t.nodeType==ts?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},$a(Za,Cs),$a(Za,Cs.prototype),As.prototype={nodeName:"#document",nodeType:us,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==cs){for(var i=e.firstChild;i;){var n=i.nextSibling;this.insertBefore(i,t),i=n}return e}return null==this.documentElement&&e.nodeType==es&&(this.documentElement=e),Os(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),Ds(this,e)},importNode:function(e,t){return function e(t,i,n){var r;switch(i.nodeType){case es:(r=i.cloneNode(!1)).ownerDocument=t;case cs:break;case ts:n=!0}if(r||(r=i.cloneNode(!1)),r.ownerDocument=t,r.parentNode=null,n)for(var a=i.firstChild;a;)r.appendChild(e(t,a,n)),a=a.nextSibling;return r}(this,e,t)},getElementById:function(e){var t=null;return xs(this.documentElement,function(i){if(i.nodeType==es&&i.getAttribute("id")==e)return t=i,!0}),t},getElementsByClassName:function(e){var t=Qa(e);return new _s(this,function(i){var n=[];return t.length>0&&xs(i.documentElement,function(r){if(r!==i&&r.nodeType===es){var a=r.getAttribute("class");if(a){var s=e===a;if(!s){var o=Qa(a);s=t.every((u=o,function(e){return u&&-1!==u.indexOf(e)}))}s&&n.push(r)}}var u}),n})},createElement:function(e){var t=new Rs;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.localName=e,t.childNodes=new ys,(t.attributes=new Ts)._ownerElement=t,t},createDocumentFragment:function(){var e=new Ws;return e.ownerDocument=this,e.childNodes=new ys,e},createTextNode:function(e){var t=new Us;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new Bs;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new Fs;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var i=new Gs;return i.ownerDocument=this,i.tagName=i.target=e,i.nodeValue=i.data=t,i},createAttribute:function(e){var t=new Ms;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new Vs;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var i=new Rs,n=t.split(":"),r=i.attributes=new Ts;return i.childNodes=new ys,i.ownerDocument=this,i.nodeName=t,i.tagName=t,i.namespaceURI=e,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,r._ownerElement=i,i},createAttributeNS:function(e,t){var i=new Ms,n=t.split(":");return i.ownerDocument=this,i.nodeName=t,i.name=t,i.namespaceURI=e,i.specified=!0,2==n.length?(i.prefix=n[0],i.localName=n[1]):i.localName=t,i}},Ja(As,Cs),Rs.prototype={nodeType:es,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var i=this.ownerDocument.createAttribute(e);i.value=i.nodeValue=""+t,this.setAttributeNode(i)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===cs?this.insertBefore(e,null):function(e,t){var i=t.parentNode;if(i){var n=e.lastChild;i.removeChild(t),n=e.lastChild}return n=e.lastChild,t.parentNode=e,t.previousSibling=n,t.nextSibling=null,n?n.nextSibling=t:e.firstChild=t,e.lastChild=t,Ls(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);i&&this.removeAttributeNode(i)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var i=this.getAttributeNodeNS(e,t);return i&&i.value||""},setAttributeNS:function(e,t,i){var n=this.ownerDocument.createAttributeNS(e,t);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new _s(this,function(t){var i=[];return xs(t,function(n){n===t||n.nodeType!=es||"*"!==e&&n.tagName!=e||i.push(n)}),i})},getElementsByTagNameNS:function(e,t){return new _s(this,function(i){var n=[];return xs(i,function(r){r===i||r.nodeType!==es||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||n.push(r)}),n})}},As.prototype.getElementsByTagName=Rs.prototype.getElementsByTagName,As.prototype.getElementsByTagNameNS=Rs.prototype.getElementsByTagNameNS,Ja(Rs,Cs),Ms.prototype.nodeType=ts,Ja(Ms,Cs),Ns.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(ps[fs])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,i){i=this.data.substring(0,e)+i+this.data.substring(e+t),this.nodeValue=this.data=i,this.length=i.length}},Ja(Ns,Cs),Us.prototype={nodeName:"#text",nodeType:is,splitText:function(e){var t=this.data,i=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},Ja(Us,Ns),Bs.prototype={nodeName:"#comment",nodeType:os},Ja(Bs,Ns),Fs.prototype={nodeName:"#cdata-section",nodeType:ns},Ja(Fs,Ns),js.prototype.nodeType=ls,Ja(js,Cs),Hs.prototype.nodeType=ds,Ja(Hs,Cs),qs.prototype.nodeType=as,Ja(qs,Cs),Vs.prototype.nodeType=rs,Ja(Vs,Cs),Ws.prototype.nodeName="#document-fragment",Ws.prototype.nodeType=cs,Ja(Ws,Cs),Gs.prototype.nodeType=ss,Ja(Gs,Cs),zs.prototype.serializeToString=function(e,t,i){return Xs.call(e,t,i)},Cs.prototype.toString=Xs;try{Object.defineProperty&&(Object.defineProperty(_s.prototype,"length",{get:function(){return bs(this),this.$$length}}),Object.defineProperty(Cs.prototype,"textContent",{get:function(){return function e(t){switch(t.nodeType){case es:case cs:var i=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&i.push(e(t)),t=t.nextSibling;return i.join("");default:return t.nodeValue}}(this)},set:function(e){switch(this.nodeType){case es:case cs:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),$s=function(e,t,i){e["$$"+t]=i})}catch(e){}var Js=ks,Zs=f(function(e,t){var i=za.freeze;t.XML_ENTITIES=i({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),t.HTML_ENTITIES=i({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"A",Aacute:"Á",Acirc:"Â",Atilde:"A",Auml:"Ä",Aring:"A",AElig:"A",Ccedil:"Ç",Egrave:"E",Eacute:"É",Ecirc:"E",Euml:"Ë",Igrave:"I",Iacute:"Í",Icirc:"Î",Iuml:"I",ETH:"?",Ntilde:"N",Ograve:"O",Oacute:"Ó",Ocirc:"Ô",Otilde:"O",Ouml:"Ö",Oslash:"O",Ugrave:"U",Uacute:"Ú",Ucirc:"U",Uuml:"Ü",Yacute:"Ý",THORN:"?",szlig:"ß",agrave:"a",aacute:"á",acirc:"â",atilde:"a",auml:"ä",aring:"a",aelig:"a",ccedil:"ç",egrave:"e",eacute:"é",ecirc:"e",euml:"ë",igrave:"i",iacute:"í",icirc:"î",iuml:"i",eth:"?",ntilde:"n",ograve:"o",oacute:"ó",ocirc:"ô",otilde:"o",ouml:"ö",oslash:"o",ugrave:"u",uacute:"ú",ucirc:"u",uuml:"ü",yacute:"ý",thorn:"?",yuml:"y",nbsp:" ",iexcl:"!",cent:"c",pound:"L",curren:"¤",yen:"Y",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"a",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"—",deg:"°",plusmn:"±",sup2:"2",sup3:"3",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"1",ordm:"o",raquo:"»",frac14:"1",frac12:"1",frac34:"3",iquest:"?",times:"×",divide:"÷",forall:"?",part:"?",exist:"?",empty:"Ř",nabla:"?",isin:"?",notin:"?",ni:"?",prod:"?",sum:"?",minus:"-",lowast:"*",radic:"?",prop:"?",infin:"?",ang:"?",and:"?",or:"?",cap:"?",cup:"?",int:"?",there4:"?",sim:"~",cong:"?",asymp:"?",ne:"?",equiv:"?",le:"?",ge:"?",sub:"?",sup:"?",nsub:"?",sube:"?",supe:"?",oplus:"?",otimes:"?",perp:"?",sdot:"·",Alpha:"?",Beta:"?",Gamma:"?",Delta:"?",Epsilon:"?",Zeta:"?",Eta:"?",Theta:"?",Iota:"?",Kappa:"?",Lambda:"?",Mu:"?",Nu:"?",Xi:"?",Omicron:"?",Pi:"?",Rho:"?",Sigma:"?",Tau:"?",Upsilon:"?",Phi:"?",Chi:"?",Psi:"?",Omega:"?",alpha:"?",beta:"ß",gamma:"?",delta:"?",epsilon:"?",zeta:"?",eta:"?",theta:"?",iota:"?",kappa:"?",lambda:"?",mu:"µ",nu:"?",xi:"?",omicron:"?",pi:"?",rho:"?",sigmaf:"?",sigma:"?",tau:"?",upsilon:"?",phi:"?",chi:"?",psi:"?",omega:"?",thetasym:"?",upsih:"?",piv:"?",OElig:"O",oelig:"o",Scaron:"Š",scaron:"š",Yuml:"Y",fnof:"f",circ:"^",tilde:"~",ensp:" ",emsp:" ",thinsp:" ",zwnj:"?",zwj:"?",lrm:"?",rlm:"?",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"'",Prime:"”",lsaquo:"‹",rsaquo:"›",oline:"?",euro:"€",trade:"™",larr:"‹",uarr:"^",rarr:"›",darr:"ˇ",harr:"-",crarr:"?",lceil:"?",rceil:"?",lfloor:"?",rfloor:"?",loz:"?",spades:"¦",clubs:"¦",hearts:"¦",diams:"¦"}),t.entityMap=t.HTML_ENTITIES});Zs.XML_ENTITIES,Zs.HTML_ENTITIES,Zs.entityMap;var eo=za.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]/,io=new RegExp("[\\-\\.0-9"+to.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),no=new RegExp("^"+to.source+io.source+"*(?::"+to.source+io.source+"*)?$"),ro=0,ao=1,so=2,oo=3,uo=4,lo=5,co=6,ho=7;function po(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,po)}function fo(){}function mo(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function go(e,t,i,n,r,a){function s(e,t,n){i.attributeNames.hasOwnProperty(e)&&a.fatalError("Attribute "+e+" redefined"),i.addValue(e,t,n)}for(var o,u=++t,l=ro;;){var c=e.charAt(u);switch(c){case"=":if(l===ao)o=e.slice(t,u),l=oo;else{if(l!==so)throw new Error("attribute equal must after attrName");l=oo}break;case"'":case'"':if(l===oo||l===ao){if(l===ao&&(a.warning('attribute value must after "="'),o=e.slice(t,u)),t=u+1,!((u=e.indexOf(c,t))>0))throw new Error("attribute value no end '"+c+"' match");s(o,d=e.slice(t,u).replace(/&#?\w+;/g,r),t-1),l=lo}else{if(l!=uo)throw new Error('attribute value must after "="');s(o,d=e.slice(t,u).replace(/&#?\w+;/g,r),t),a.warning('attribute "'+o+'" missed start quot('+c+")!!"),t=u+1,l=lo}break;case"/":switch(l){case ro:i.setTagName(e.slice(t,u));case lo:case co:case ho:l=ho,i.closed=!0;case uo:case ao:case so:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return a.error("unexpected end of input"),l==ro&&i.setTagName(e.slice(t,u)),u;case">":switch(l){case ro:i.setTagName(e.slice(t,u));case lo:case co:case ho:break;case uo:case ao:"/"===(d=e.slice(t,u)).slice(-1)&&(i.closed=!0,d=d.slice(0,-1));case so:l===so&&(d=o),l==uo?(a.warning('attribute "'+d+'" missed quot(")!'),s(o,d.replace(/&#?\w+;/g,r),t)):(eo.isHTML(n[""])&&d.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),s(d,d,t));break;case oo:throw new Error("attribute value missed!!")}return u;case"?":c=" ";default:if(c<=" ")switch(l){case ro:i.setTagName(e.slice(t,u)),l=co;break;case ao:o=e.slice(t,u),l=so;break;case uo:var d=e.slice(t,u).replace(/&#?\w+;/g,r);a.warning('attribute "'+d+'" missed quot(")!!'),s(o,d,t);case lo:l=co}else switch(l){case so:i.tagName,eo.isHTML(n[""])&&o.match(/^(?:disabled|checked|selected)$/i)||a.warning('attribute "'+o+'" missed value!! "'+o+'" instead2!!'),s(o,o,t),t=u,l=ao;break;case lo:a.warning('attribute space is required"'+o+'"!!');case co:l=ao,t=u;break;case oo:l=uo,t=u;break;case ho:throw new Error("elements closed character '/' and '>' must be connected to")}}u++}}function vo(e,t,i){for(var n=e.tagName,r=null,a=e.length;a--;){var s=e[a],o=s.qName,u=s.value;if((h=o.indexOf(":"))>0)var l=s.prefix=o.slice(0,h),c=o.slice(h+1),d="xmlns"===l&&c;else c=o,l=null,d="xmlns"===o&&"";s.localName=c,!1!==d&&(null==r&&(r={},bo(i,i={})),i[d]=r[d]=u,s.uri=eo.XMLNS,t.startPrefixMapping(d,u))}for(a=e.length;a--;)(l=(s=e[a]).prefix)&&("xml"===l&&(s.uri=eo.XML),"xmlns"!==l&&(s.uri=i[l||""]));var h;(h=n.indexOf(":"))>0?(l=e.prefix=n.slice(0,h),c=e.localName=n.slice(h+1)):(l=null,c=e.localName=n);var p=e.uri=i[l||""];if(t.startElement(p,c,n,e),!e.closed)return e.currentNSMap=i,e.localNSMap=r,!0;if(t.endElement(p,c,n),r)for(l in r)t.endPrefixMapping(l)}function yo(e,t,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var a=e.indexOf("",t),s=e.substring(t+1,a);if(/[&<]/.test(s))return/^script$/i.test(i)?(r.characters(s,0,s.length),a):(s=s.replace(/&#?\w+;/g,n),r.characters(s,0,s.length),a)}return t+1}function _o(e,t,i,n){var r=n[i];return null==r&&((r=e.lastIndexOf(""))t?(i.comment(e,t+4,r-t-4),r+3):(n.error("Unclosed comment"),-1):-1;default:if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return i.startCDATA(),i.characters(e,t+9,r-t-9),i.endCDATA(),r+3}var a=function(e,t){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=t,r.exec(e);i=r.exec(e);)if(n.push(i),i[1])return n}(e,t),s=a.length;if(s>1&&/!doctype/i.test(a[0][0])){var o=a[1][0],u=!1,l=!1;s>3&&(/^public$/i.test(a[2][0])?(u=a[3][0],l=s>4&&a[4][0]):/^system$/i.test(a[2][0])&&(l=a[3][0]));var c=a[s-1];return i.startDTD(o,u,l),i.endDTD(),c.index+c[0].length}}return-1}function wo(e,t,i){var n=e.indexOf("?>",t);if(n){var r=e.substring(t,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,i.processingInstruction(r[1],r[2]),n+2):-1}return-1}function So(){this.attributeNames={}}po.prototype=new Error,po.prototype.name=po.name,fo.prototype={parse:function(e,t,i){var n=this.domBuilder;n.startDocument(),bo(t,t={}),function(e,t,i,n,r){function a(e){var t=e.slice(1,-1);return t in i?i[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10),i=56320+(1023&e);return String.fromCharCode(t,i)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(r.error("entity not found:"+e),e)}function s(t){if(t>f){var i=e.substring(f,t).replace(/&#?\w+;/g,a);d&&o(f),n.characters(i,0,t-f),f=t}}function o(t,i){for(;t>=l&&(i=c.exec(e));)u=i.index,l=u+i[0].length,d.lineNumber++;d.columnNumber=t-u+1}for(var u=0,l=0,c=/.*(?:\r\n?|\n)|.*$/g,d=n.locator,h=[{currentNSMap:t}],p={},f=0;;){try{var m=e.indexOf("<",f);if(m<0){if(!e.substr(f).match(/^\s*$/)){var g=n.doc,v=g.createTextNode(e.substr(f));g.appendChild(v),n.currentElement=v}return}switch(m>f&&s(m),e.charAt(m+1)){case"/":var y=e.indexOf(">",m+3),_=e.substring(m+2,y).replace(/[ \t\n\r]+$/g,""),b=h.pop();y<0?(_=e.substring(m+2).replace(/[\s<].*/,""),r.error("end tag name: "+_+" is not complete:"+b.tagName),y=m+1+_.length):_.match(/\sf?f=y:s(Math.max(m,f)+1)}}(e,t,i,n,this.errorHandler),n.endDocument()}},So.prototype={setTagName:function(e){if(!no.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,i){if(!no.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:i}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}};var Eo=Js,ko=za.NAMESPACE,Co=po,Io=fo;function xo(e){this.options=e||{locator:{}}}function Ao(){this.cdata=!1}function Po(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function Lo(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function Do(e,t,i){return"string"==typeof e?e.substr(t,i):e.length>=t+i||t?new java.lang.String(e,t,i)+"":e}function Oo(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}xo.prototype.parseFromString=function(e,t){var i=this.options,n=new Io,r=i.domBuilder||new Ao,a=i.errorHandler,s=i.locator,o=i.xmlns||{},u=/\/x?html?$/.test(t),l=u?Zs.HTML_ENTITIES:Zs.XML_ENTITIES;return s&&r.setDocumentLocator(s),n.errorHandler=function(e,t,i){if(!e){if(t instanceof Ao)return t;e=t}var n={},r=e instanceof Function;function a(t){var a=e[t];!a&&r&&(a=2==e.length?function(i){e(t,i)}:e),n[t]=a&&function(e){a("[xmldom "+t+"]\t"+e+Lo(i))}||function(){}}return i=i||{},a("warning"),a("error"),a("fatalError"),n}(a,r,s),n.domBuilder=i.domBuilder||r,u&&(o[""]=ko.HTML),o.xml=o.xml||ko.XML,e&&"string"==typeof e?n.parse(e,o,l):n.errorHandler.error("invalid doc source"),r.doc},Ao.prototype={startDocument:function(){this.doc=(new Eo).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,i,n){var r=this.doc,a=r.createElementNS(e,i||t),s=n.length;Oo(this,a),this.currentElement=a,this.locator&&Po(this.locator,a);for(var o=0;ot.timeline?1:-1});var t,i},Yo=function(e){var t,i,n=[];return t=e,i=function(e,t,i,r){n=n.concat(e.playlists||[])},Xo.forEach(function(e){for(var n in t.mediaGroups[e])for(var r in t.mediaGroups[e][n]){var a=t.mediaGroups[e][n][r];i(a)}}),n},Qo=function(e){var t=e.playlist,i=e.mediaSequence;t.mediaSequence=i,t.segments.forEach(function(e,i){e.number=t.mediaSequence+i})},$o=function(e){return e&&e.uri+"-"+(i="bigint"==typeof(t=e.byterange).offset||"bigint"==typeof t.length?window.BigInt(t.offset)+window.BigInt(t.length)-window.BigInt(1):t.offset+t.length-1,t.offset+"-"+i);var t,i},Jo=function(e){return Uo(e.reduce(function(e,t){var i,n=t.attributes.id+(t.attributes.lang||"");e[n]?(t.segments&&(t.segments[0]&&(t.segments[0].discontinuity=!0),(i=e[n].segments).push.apply(i,t.segments)),t.attributes.contentProtection&&(e[n].attributes.contentProtection=t.attributes.contentProtection)):(e[n]=t,e[n].attributes.timelineStarts=[]);return e[n].attributes.timelineStarts.push({start:t.attributes.periodStart,timeline:t.attributes.periodStart}),e},{})).map(function(e){var t;return e.discontinuityStarts=(t=e.segments||[],"discontinuity",t.reduce(function(e,t,i){return t.discontinuity&&e.push(i),e},[])),e})},Zo=function(e,t){var i=$o(e.sidx),n=i&&t[i]&&t[i].sidx;return n&&zo(e,n,e.sidx.resolvedUri),e},eu=function(e){var t,i=e.attributes,n=e.segments,r=e.sidx,a=e.discontinuityStarts,s={attributes:(t={NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth},t["PROGRAM-ID"]=1,t),uri:"",endList:"static"===i.type,timeline:i.periodStart,resolvedUri:"",targetDuration:i.duration,discontinuityStarts:a,timelineStarts:i.timelineStarts,segments:n};return i.contentProtection&&(s.contentProtection=i.contentProtection),r&&(s.sidx=r),s},tu=function(e){var t=e.attributes;return"video/mp4"===t.mimeType||"video/webm"===t.mimeType||"video"===t.contentType},iu=function(e){var t=e.attributes;return"audio/mp4"===t.mimeType||"audio/webm"===t.mimeType||"audio"===t.contentType},nu=function(e){var t=e.attributes;return"text/vtt"===t.mimeType||"text"===t.contentType},ru=function(e){return e?Object.keys(e).reduce(function(t,i){var n=e[i];return t.concat(n.playlists)},[]):[]},au=function(e){var t,i=e.dashPlaylists,n=e.locations,r=e.sidxMapping,a=void 0===r?{}:r,s=e.previousManifest;if(!i.length)return{};var o=i[0].attributes,u=o.sourceDuration,l=o.type,c=o.suggestedPresentationDelay,d=o.minimumUpdatePeriod,h=Jo(i.filter(tu)).map(eu),p=Jo(i.filter(iu)),f=Jo(i.filter(nu)),m=i.map(function(e){return e.attributes.captionServices}).filter(Boolean),g={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:(t={AUDIO:{},VIDEO:{}},t["CLOSED-CAPTIONS"]={},t.SUBTITLES={},t),uri:"",duration:u,playlists:function(e,t){if(void 0===t&&(t={}),!Object.keys(t).length)return e;for(var i in e)e[i]=Zo(e[i],t);return e}(h,a)};d>=0&&(g.minimumUpdatePeriod=1e3*d),n&&(g.locations=n),"dynamic"===l&&(g.suggestedPresentationDelay=c);var v,y,_,b,T,w,S,E=0===g.playlists.length,k=p.length?function(e,t,i){var n;void 0===t&&(t={}),void 0===i&&(i=!1);var r=p.reduce(function(e,r){var a=r.attributes.role&&r.attributes.role.value||"",s=r.attributes.lang||"",o=r.attributes.label||"main";if(s&&!r.attributes.label){var u=a?" ("+a+")":"";o=""+r.attributes.lang+u}e[o]||(e[o]={language:s,autoselect:!0,default:"main"===a,playlists:[],uri:""});var l=Zo(function(e,t){var i,n=e.attributes,r=e.segments,a=e.sidx,s=e.mediaSequence,o=e.discontinuitySequence,u=e.discontinuityStarts,l={attributes:(i={NAME:n.id,BANDWIDTH:n.bandwidth,CODECS:n.codecs},i["PROGRAM-ID"]=1,i),uri:"",endList:"static"===n.type,timeline:n.periodStart,resolvedUri:"",targetDuration:n.duration,discontinuitySequence:o,discontinuityStarts:u,timelineStarts:n.timelineStarts,mediaSequence:s,segments:r};return n.contentProtection&&(l.contentProtection=n.contentProtection),a&&(l.sidx=a),t&&(l.attributes.AUDIO="audio",l.attributes.SUBTITLES="subs"),l}(r,i),t);return e[o].playlists.push(l),void 0===n&&"main"===a&&((n=r).default=!0),e},{});return n||(r[Object.keys(r)[0]].default=!0),r}(0,a,E):null,C=f.length?function(e,t){return void 0===t&&(t={}),f.reduce(function(e,i){var n=i.attributes.lang||"text";return e[n]||(e[n]={language:n,default:!1,autoselect:!1,playlists:[],uri:""}),e[n].playlists.push(Zo(function(e){var t,i=e.attributes,n=e.segments,r=e.mediaSequence,a=e.discontinuityStarts,s=e.discontinuitySequence;void 0===n&&(n=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);var o=((t={NAME:i.id,BANDWIDTH:i.bandwidth})["PROGRAM-ID"]=1,t);return i.codecs&&(o.CODECS=i.codecs),{attributes:o,uri:"",endList:"static"===i.type,timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:a,discontinuitySequence:s,mediaSequence:r,segments:n}}(i),t)),e},{})}(0,a):null,I=h.concat(ru(k),ru(C)),x=I.map(function(e){return e.timelineStarts});return g.timelineStarts=Ko(x),v=I,y=g.timelineStarts,v.forEach(function(e){e.mediaSequence=0,e.discontinuitySequence=jo(y,function(t){return t.timeline===e.timeline}),e.segments&&e.segments.forEach(function(e,t){e.number=t})}),k&&(g.mediaGroups.AUDIO.audio=k),C&&(g.mediaGroups.SUBTITLES.subs=C),m.length&&(g.mediaGroups["CLOSED-CAPTIONS"].cc=m.reduce(function(e,t){return t?(t.forEach(function(t){var i=t.channel,n=t.language;e[n]={autoselect:!1,default:!1,instreamId:i,language:n},t.hasOwnProperty("aspectRatio")&&(e[n].aspectRatio=t.aspectRatio),t.hasOwnProperty("easyReader")&&(e[n].easyReader=t.easyReader),t.hasOwnProperty("3D")&&(e[n]["3D"]=t["3D"])}),e):e},{})),s?(b=(_={oldManifest:s,newManifest:g}).oldManifest,T=_.newManifest,w=b.playlists.concat(Yo(b)),S=T.playlists.concat(Yo(T)),T.timelineStarts=Ko([b.timelineStarts,T.timelineStarts]),function(e){var t=e.oldPlaylists,i=e.timelineStarts;e.newPlaylists.forEach(function(e){e.discontinuitySequence=jo(i,function(t){return t.timeline===e.timeline});var n=function(e,t){for(var i=0;in.timeline||n.segments.length&&e.timeline>n.segments[n.segments.length-1].timeline)&&e.discontinuitySequence--);n.segments[a].discontinuity&&!r.discontinuity&&(r.discontinuity=!0,e.discontinuityStarts.unshift(0),e.discontinuitySequence--),Qo({playlist:e,mediaSequence:n.segments[a].number})}})}({oldPlaylists:w,newPlaylists:S,timelineStarts:T.timelineStarts}),T):g},su=function(e,t,i){var n=e.NOW,r=e.clientOffset,a=e.availabilityStartTime,s=e.timescale,o=void 0===s?1:s,u=e.periodStart,l=void 0===u?0:u,c=e.minimumUpdatePeriod,d=(n+r)/1e3+(void 0===c?0:c)-(a+l);return Math.ceil((d*o-t)/i)},ou=function(e,t){for(var i=e.type,n=e.minimumUpdatePeriod,r=void 0===n?0:n,a=e.media,s=void 0===a?"":a,o=e.sourceDuration,u=e.timescale,l=void 0===u?1:u,c=e.startNumber,d=void 0===c?1:c,h=e.periodStart,p=[],f=-1,m=0;mf&&(f=_);var b=void 0;if(y<0){var T=m+1;b=T===t.length?"dynamic"===i&&r>0&&s.indexOf("$Number$")>0?su(e,f,v):(o*l-f)/v:(t[T].t-f)/v}else b=y+1;for(var w=d+p.length+b,S=d+p.length;S=r?a:""+new Array(r-a.length+1).join("0")+a)}}(t))},cu=function(e,t){var i={RepresentationID:e.id,Bandwidth:e.bandwidth||0},n=e.initialization,r=void 0===n?{sourceURL:"",range:""}:n,a=Ho({baseUrl:e.baseUrl,source:lu(r.sourceURL,i),range:r.range});return function(e,t){return e.duration||t?e.duration?Wo(e):ou(e,t):[{number:e.startNumber||1,duration:e.sourceDuration,time:0,timeline:e.periodStart}]}(e,t).map(function(t){i.Number=t.number,i.Time=t.time;var n=lu(e.media||"",i),r=e.timescale||1,s=e.presentationTimeOffset||0,o=e.periodStart+(t.time-s)/r;return{uri:n,timeline:t.timeline,duration:t.duration,resolvedUri:qa(e.baseUrl||"",n),map:a,number:t.number,presentationTime:o}})},du=function(e,t){var i=e.duration,n=e.segmentUrls,r=void 0===n?[]:n,a=e.periodStart;if(!i&&!t||i&&t)throw new Error("SEGMENT_TIME_UNSPECIFIED");var s,o=r.map(function(t){return function(e,t){var i=e.baseUrl,n=e.initialization,r=void 0===n?{}:n,a=Ho({baseUrl:i,source:r.sourceURL,range:r.range}),s=Ho({baseUrl:i,source:t.media,range:t.mediaRange});return s.map=a,s}(e,t)});return i&&(s=Wo(e)),t&&(s=ou(e,t)),s.map(function(t,i){if(o[i]){var n=o[i],r=e.timescale||1,s=e.presentationTimeOffset||0;return n.timeline=t.timeline,n.duration=t.duration,n.number=t.number,n.presentationTime=a+(t.time-s)/r,n}}).filter(function(e){return e})},hu=function(e){var t,i,n=e.attributes,r=e.segmentInfo;r.template?(i=cu,t=No(n,r.template)):r.base?(i=Go,t=No(n,r.base)):r.list&&(i=du,t=No(n,r.list));var a={attributes:n};if(!i)return a;var s=i(t,r.segmentTimeline);if(t.duration){var o=t,u=o.duration,l=o.timescale,c=void 0===l?1:l;t.duration=u/c}else s.length?t.duration=s.reduce(function(e,t){return Math.max(e,Math.ceil(t.duration))},0):t.duration=0;return a.attributes=t,a.segments=s,r.base&&t.indexRange&&(a.sidx=s[0],a.segments=[]),a},pu=function(e,t){return Fo(e.childNodes).filter(function(e){return e.tagName===t})},fu=function(e){return e.textContent.trim()},mu=function(e){var t=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e);if(!t)return 0;var i=t.slice(1),n=i[0],r=i[1],a=i[2],s=i[3],o=i[4],u=i[5];return 31536e3*parseFloat(n||0)+2592e3*parseFloat(r||0)+86400*parseFloat(a||0)+3600*parseFloat(s||0)+60*parseFloat(o||0)+parseFloat(u||0)},gu={mediaPresentationDuration:function(e){return mu(e)},availabilityStartTime:function(e){return/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t=e)&&(t+="Z"),Date.parse(t)/1e3;var t},minimumUpdatePeriod:function(e){return mu(e)},suggestedPresentationDelay:function(e){return mu(e)},type:function(e){return e},timeShiftBufferDepth:function(e){return mu(e)},start:function(e){return mu(e)},width:function(e){return parseInt(e,10)},height:function(e){return parseInt(e,10)},bandwidth:function(e){return parseInt(e,10)},startNumber:function(e){return parseInt(e,10)},timescale:function(e){return parseInt(e,10)},presentationTimeOffset:function(e){return parseInt(e,10)},duration:function(e){var t=parseInt(e,10);return isNaN(t)?mu(e):t},d:function(e){return parseInt(e,10)},t:function(e){return parseInt(e,10)},r:function(e){return parseInt(e,10)},DEFAULT:function(e){return e}},vu=function(e){return e&&e.attributes?Fo(e.attributes).reduce(function(e,t){var i=gu[t.name]||gu.DEFAULT;return e[t.name]=i(t.value),e},{}):{}},yu={"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"},_u=function(e,t){return t.length?Bo(e.map(function(e){return t.map(function(t){return qa(e,fu(t))})})):e},bu=function(e){var t=pu(e,"SegmentTemplate")[0],i=pu(e,"SegmentList")[0],n=i&&pu(i,"SegmentURL").map(function(e){return No({tag:"SegmentURL"},vu(e))}),r=pu(e,"SegmentBase")[0],a=i||t,s=a&&pu(a,"SegmentTimeline")[0],o=i||r||t,u=o&&pu(o,"Initialization")[0],l=t&&vu(t);l&&u?l.initialization=u&&vu(u):l&&l.initialization&&(l.initialization={sourceURL:l.initialization});var c={template:l,segmentTimeline:s&&pu(s,"S").map(function(e){return vu(e)}),list:i&&No(vu(i),{segmentUrls:n,initialization:vu(u)}),base:r&&No(vu(r),{initialization:vu(u)})};return Object.keys(c).forEach(function(e){c[e]||delete c[e]}),c},Tu=function(e){return e.reduce(function(e,t){var i=vu(t);i.schemeIdUri&&(i.schemeIdUri=i.schemeIdUri.toLowerCase());var n=yu[i.schemeIdUri];if(n){e[n]={attributes:i};var r=pu(t,"cenc:pssh")[0];if(r){var a=fu(r);e[n].pssh=a&&function(e){for(var t=(r=a,window.atob?window.atob(r):Buffer.from(r,"base64").toString("binary")),i=new Uint8Array(t.length),n=0;n0)throw new Error("DASH_INVALID_XML");return i},Eu=Math.pow(2,32),ku=function(e){var t,i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.getBigUint64?(t=i.getBigUint64(0))>4?n+20:n+10}(t,i),e(t,i))},xu=function(e){return"string"==typeof e?ja(e):e},Au={EBML:Ua([26,69,223,163]),DocType:Ua([66,130]),Segment:Ua([24,83,128,103]),SegmentInfo:Ua([21,73,169,102]),Tracks:Ua([22,84,174,107]),Track:Ua([174]),TrackNumber:Ua([215]),DefaultDuration:Ua([35,227,131]),TrackEntry:Ua([174]),TrackType:Ua([131]),FlagDefault:Ua([136]),CodecID:Ua([134]),CodecPrivate:Ua([99,162]),VideoTrack:Ua([224]),AudioTrack:Ua([225]),Cluster:Ua([31,67,182,117]),Timestamp:Ua([231]),TimestampScale:Ua([42,215,177]),BlockGroup:Ua([160]),BlockDuration:Ua([155]),Block:Ua([161]),SimpleBlock:Ua([163])},Pu=[128,64,32,16,8,4,2,1],Lu=function(e,t,i,n){void 0===i&&(i=!0),void 0===n&&(n=!1);var r=function(e){for(var t=1,i=0;il&&(u-=l,u-=l,u-=Ba(2))}return Number(u)}(a,{signed:n}),bytes:a}},Du=function e(t){return"string"==typeof t?t.match(/.{1,2}/g).map(function(t){return e(t)}):"number"==typeof t?function(e,t){var i=(void 0===t?{}:t).le,n=void 0!==i&&i;("bigint"!=typeof e&&"number"!=typeof e||"number"==typeof e&&e!=e)&&(e=0);for(var r,a=(r=e=Ba(e),Math.ceil(function(e){return e.toString(2).length}(r)/8)),s=new Uint8Array(new ArrayBuffer(a)),o=0;o=i.length)return i.length;var r=Lu(i,n,!1);if(Ha(t.bytes,r.bytes))return n;var a=Lu(i,n+r.length);return e(t,i,n+a.length+a.value+r.length)},Ru=function e(t,i){i=function(e){return Array.isArray(e)?e.map(function(e){return Du(e)}):[Du(e)]}(i),t=Ua(t);var n=[];if(!i.length)return n;for(var r=0;rt.length?t.length:o+s.value,l=t.subarray(o,u);Ha(i[0],a.bytes)&&(1===i.length?n.push(l):n=n.concat(e(l,i.slice(1)))),r+=a.length+s.length+l.length}return n},Mu=Ua([0,0,0,1]),Nu=Ua([0,0,1]),Uu=Ua([0,0,3]),Bu=function(e){for(var t=[],i=1;i>1&63),-1!==i.indexOf(u)&&(r=a+o),a+=o+("h264"===t?1:2)}else a++}return e.subarray(0,0)},ju={webm:Ua([119,101,98,109]),matroska:Ua([109,97,116,114,111,115,107,97]),flac:Ua([102,76,97,67]),ogg:Ua([79,103,103,83]),ac3:Ua([11,119]),riff:Ua([82,73,70,70]),avi:Ua([65,86,73]),wav:Ua([87,65,86,69]),"3gp":Ua([102,116,121,112,51,103]),mp4:Ua([102,116,121,112]),fmp4:Ua([115,116,121,112]),mov:Ua([102,116,121,112,113,116]),moov:Ua([109,111,111,118]),moof:Ua([109,111,111,102])},Hu={aac:function(e){var t=Iu(e);return Ha(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=Iu(e);return Ha(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=Ru(e,[Au.EBML,Au.DocType])[0];return Ha(t,ju.webm)},mkv:function(e){var t=Ru(e,[Au.EBML,Au.DocType])[0];return Ha(t,ju.matroska)},mp4:function(e){return!Hu["3gp"](e)&&!Hu.mov(e)&&(!(!Ha(e,ju.mp4,{offset:4})&&!Ha(e,ju.fmp4,{offset:4}))||!(!Ha(e,ju.moof,{offset:4})&&!Ha(e,ju.moov,{offset:4}))||void 0)},mov:function(e){return Ha(e,ju.mov,{offset:4})},"3gp":function(e){return Ha(e,ju["3gp"],{offset:4})},ac3:function(e){var t=Iu(e);return Ha(e,ju.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return 71===e[0];for(var t=0;t+188"):function(){}},Yu=function(e,t){var i,n=[];if(e&&e.length)for(i=0;i=t})},$u=function(e,t){return Yu(e,function(e){return e-1/30>=t})},Ju=function(e){var t=[];if(!e||!e.length)return"";for(var i=0;i "+e.end(i));return t.join(", ")},Zu=function(e){for(var t=[],i=0;ia||(i+=t>r&&t<=a?a-t:a-r)}return i},il=ca.createTimeRange,nl=function(e,t){if(!t.preload)return t.duration;var i=0;return(t.parts||[]).forEach(function(e){i+=e.duration}),(t.preloadHints||[]).forEach(function(t){"PART"===t.type&&(i+=e.partTargetDuration)}),i},rl=function(e){return(e.segments||[]).reduce(function(e,t,i){return t.parts?t.parts.forEach(function(n,r){e.push({duration:n.duration,segmentIndex:i,partIndex:r,part:n,segment:t})}):e.push({duration:t.duration,segmentIndex:i,partIndex:null,segment:t,part:null}),e},[])},al=function(e){var t=e.segments&&e.segments.length&&e.segments[e.segments.length-1];return t&&t.parts||[]},sl=function(e){var t=e.preloadSegment;if(t){var i=t.parts;return(t.preloadHints||[]).reduce(function(e,t){return e+("PART"===t.type?1:0)},0)+(i&&i.length?i.length:0)}},ol=function(e,t){if(t.endList)return 0;if(e&&e.suggestedPresentationDelay)return e.suggestedPresentationDelay;var i=al(t).length>0;return i&&t.serverControl&&t.serverControl.partHoldBack?t.serverControl.partHoldBack:i&&t.partTargetDuration?3*t.partTargetDuration:t.serverControl&&t.serverControl.holdBack?t.serverControl.holdBack:t.targetDuration?3*t.targetDuration:0},ul=function(e,t,i){if(void 0===t&&(t=e.mediaSequence+e.segments.length),tr){var s=[r,n];n=s[0],r=s[1]}if(n<0){for(var o=n;oDate.now()},pl=function(e){return e.excludeUntil&&e.excludeUntil===1/0},fl=function(e){var t=hl(e);return!e.disabled&&!t},ml=function(e,t){return t.attributes&&t.attributes[e]},gl=function(e,t){if(1===e.playlists.length)return!0;var i=t.attributes.BANDWIDTH||Number.MAX_VALUE;return 0===e.playlists.filter(function(e){return!!fl(e)&&(e.attributes.BANDWIDTH||0)0)for(var h=l-1;h>=0;h--){var p=u[h];if(o+=p.duration,s){if(o<0)continue}else if(o+1/30<=0)continue;return{partIndex:p.partIndex,segmentIndex:p.segmentIndex,startTime:a-cl({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:h})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i}}if(l<0){for(var f=l;f<0;f++)if((o-=t.targetDuration)<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:i};l=0}for(var m=l;m0)continue}else if(o-1/30>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:a+cl({defaultDuration:t.targetDuration,durationList:u,startIndex:l,endIndex:m})}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:i}},isEnabled:fl,isDisabled:function(e){return e.disabled},isBlacklisted:hl,isIncompatible:pl,playlistEnd:dl,isAes:function(e){for(var t=0;t-1&&s!==a.length-1&&(i._HLS_part=s),(s>-1||a.length)&&r--}i._HLS_msn=r}if(t.serverControl&&t.serverControl.canSkipUntil&&(i._HLS_skip=t.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){var o=new window.URL(e);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(e){i.hasOwnProperty(e)&&o.searchParams.set(e,i[e])}),e=o.toString()}return e}(i,t)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:i,withCredentials:this.withCredentials},function(t,i){if(e.request)return t?e.playlistRequestError(e.request,e.media(),"HAVE_METADATA"):void e.haveMetadata({playlistString:e.request.responseText,url:e.media().uri,id:e.media().id})})}},i.playlistRequestError=function(e,t,i){var n=t.uri,r=t.id;this.request=null,i&&(this.state=i),this.error={playlist:this.master.playlists[r],status:e.status,message:"HLS playlist request error at URL: "+n+".",responseText:e.responseText,code:e.status>=500?4:2},this.trigger("error")},i.parseManifest_=function(e){var t=this,i=e.url;return function(e){var t=e.onwarn,i=e.oninfo,n=e.manifestString,r=e.customTagParsers,a=void 0===r?[]:r,s=e.customTagMappers,o=void 0===s?[]:s,u=e.experimentalLLHLS,l=new Sa;t&&l.on("warn",t),i&&l.on("info",i),a.forEach(function(e){return l.addParser(e)}),o.forEach(function(e){return l.addTagMapper(e)}),l.push(n),l.end();var c=l.manifest;if(u||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(e){c.hasOwnProperty(e)&&delete c[e]}),c.segments&&c.segments.forEach(function(e){["parts","preloadHints"].forEach(function(t){e.hasOwnProperty(t)&&delete e[t]})})),!c.targetDuration){var d=10;c.segments&&c.segments.length&&(d=c.segments.reduce(function(e,t){return Math.max(e,t.duration)},0)),t&&t("manifest has no targetDuration defaulting to "+d),c.targetDuration=d}var h=al(c);if(h.length&&!c.partTargetDuration){var p=h.reduce(function(e,t){return Math.max(e,t.duration)},0);t&&(t("manifest has no partTargetDuration defaulting to "+p),Tl.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.")),c.partTargetDuration=p}return c}({onwarn:function(e){var n=e.message;return t.logger_("m3u8-parser warn for "+i+": "+n)},oninfo:function(e){var n=e.message;return t.logger_("m3u8-parser info for "+i+": "+n)},manifestString:e.manifestString,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,experimentalLLHLS:this.experimentalLLHLS})},i.haveMetadata=function(e){var t=e.playlistString,i=e.playlistObject,n=e.url,r=e.id;this.request=null,this.state="HAVE_METADATA";var a=i||this.parseManifest_({url:n,manifestString:t});a.lastRequest=Date.now(),El({playlist:a,uri:n,id:r});var s=Dl(this.master,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,s?(this.master=s,this.media_=this.master.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Ol(this.media(),!!s)),this.trigger("loadedplaylist")},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),window.clearTimeout(this.mediaUpdateTimeout),window.clearTimeout(this.finalRenditionTimeout),this.off()},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e,t){var i=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);if("string"==typeof e){if(!this.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.master.playlists[e]}if(window.clearTimeout(this.finalRenditionTimeout),t){var n=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=window.setTimeout(this.media.bind(this,e,!1),n)}else{var r=this.state,a=!this.media_||e.id!==this.media_.id,s=this.master.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length)return this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,void(a&&(this.trigger("mediachanging"),"HAVE_MASTER"===r?this.trigger("loadedmetadata"):this.trigger("mediachange")));if(this.updateMediaUpdateTimeout_(Ol(e,!0)),a){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},function(t,n){if(i.request){if(e.lastRequest=Date.now(),e.resolvedUri=Xu(i.handleManifestRedirects,e.resolvedUri,n),t)return i.playlistRequestError(i.request,e,r);i.haveMetadata({playlistString:n.responseText,url:e.uri,id:e.id}),"HAVE_MASTER"===r?i.trigger("loadedmetadata"):i.trigger("mediachange")}})}}},i.pause=function(){this.mediaUpdateTimeout&&(window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),"HAVE_NOTHING"===this.state&&(this.started=!1),"SWITCHING_MEDIA"===this.state?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MASTER":"HAVE_CURRENT_METADATA"===this.state&&(this.state="HAVE_METADATA")},i.load=function(e){var t=this;this.mediaUpdateTimeout&&(window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);var i=this.media();if(e){var n=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=window.setTimeout(function(){t.mediaUpdateTimeout=null,t.load()},n)}else this.started?i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist"):this.start()},i.updateMediaUpdateTimeout_=function(e){var t=this;this.mediaUpdateTimeout&&(window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.media()&&!this.media().endList&&(this.mediaUpdateTimeout=window.setTimeout(function(){t.mediaUpdateTimeout=null,t.trigger("mediaupdatetimeout"),t.updateMediaUpdateTimeout_(e)},e))},i.start=function(){var e=this;if(this.started=!0,"object"==typeof this.src)return this.src.uri||(this.src.uri=window.location.href),this.src.resolvedUri=this.src.uri,void setTimeout(function(){e.setupInitialPlaylist(e.src)},0);this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials},function(t,i){if(e.request){if(e.request=null,t)return e.error={status:i.status,message:"HLS playlist request error at URL: "+e.src+".",responseText:i.responseText,code:2},"HAVE_NOTHING"===e.state&&(e.started=!1),e.trigger("error");e.src=Xu(e.handleManifestRedirects,e.src,i);var n=e.parseManifest_({manifestString:i.responseText,url:e.src});e.setupInitialPlaylist(n)}})},i.srcUri=function(){return"string"==typeof this.src?this.src:this.src.uri},i.setupInitialPlaylist=function(e){if(this.state="HAVE_MASTER",e.playlists)return this.master=e,kl(this.master,this.srcUri()),e.playlists.forEach(function(e){e.segments=Pl(e),e.segments.forEach(function(t){Al(t,e.resolvedUri)})}),this.trigger("loadedplaylist"),void(this.request||this.media(this.master.playlists[0]));var t=this.srcUri()||window.location.href;this.master=function(e,t){var i=wl(0,t),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:window.location.href,resolvedUri:window.location.href,playlists:[{uri:t,id:i,resolvedUri:t,attributes:{}}]};return n.playlists[i]=n.playlists[0],n.playlists[t]=n.playlists[0],n}(0,t),this.haveMetadata({playlistObject:e,url:t,id:this.master.playlists[0].id}),this.trigger("loadedmetadata")},t}(Il),Ml=ca.xhr,Nl=ca.mergeOptions,Ul=function(e,t,i,n){var r="arraybuffer"===e.responseType?e.response:e.responseText;!t&&r&&(e.responseTime=Date.now(),e.roundTripTime=e.responseTime-e.requestTime,e.bytesReceived=r.byteLength||r.length,e.bandwidth||(e.bandwidth=Math.floor(e.bytesReceived/e.roundTripTime*8*1e3))),i.headers&&(e.responseHeaders=i.headers),t&&"ETIMEDOUT"===t.code&&(e.timedout=!0),t||e.aborted||200===i.statusCode||206===i.statusCode||0===i.statusCode||(t=new Error("XHR Failed with a response of: "+(e&&(r||e.responseText)))),n(t,e)},Bl=function(){var e=function e(t,i){t=Nl({timeout:45e3},t);var n=e.beforeRequest||ca.Vhs.xhr.beforeRequest;if(n&&"function"==typeof n){var r=n(t);r&&(t=r)}var a=(!0===ca.Vhs.xhr.original?Ml:ca.Vhs.xhr)(t,function(e,t){return Ul(a,e,t,i)}),s=a.abort;return a.abort=function(){return a.aborted=!0,s.apply(a,arguments)},a.uri=t.uri,a.requestTime=Date.now(),a};return e.original=!0,e},Fl=function(e){var t,i={};return e.byterange&&(i.Range="bytes="+(t=e.byterange).offset+"-"+("bigint"==typeof t.offset||"bigint"==typeof t.length?window.BigInt(t.offset)+window.BigInt(t.length)-window.BigInt(1):t.offset+t.length-1)),i},jl=function(e,t){return e.start(t)+"-"+e.end(t)},Hl=function(e,t){var i=e.toString(16);return"00".substring(0,2-i.length)+i+(t%2?" ":"")},ql=function(e){return e>=32&&e<126?String.fromCharCode(e):"."},Vl=function(e){var t={};return Object.keys(e).forEach(function(i){var n=e[i];Na(n)?t[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:t[i]=n}),t},Wl=function(e){var t=e.byterange||{length:1/0,offset:0};return[t.length,t.offset,e.resolvedUri].join(",")},Gl=function(e){return e.resolvedUri},zl=function(e){for(var t=Array.prototype.slice.call(e),i="",n=0;n0;n+=12,r--)i.references.push({referenceType:(128&e[n])>>>7,referencedSize:2147483647&t.getUint32(n),subsegmentDuration:t.getUint32(n+4),startsWithSap:!!(128&e[n+8]),sapType:(112&e[n+8])>>>4,sapDeltaTime:268435455&t.getUint32(n+8)});return i}(Ua(s.response).subarray(8))}catch(e){return void n.requestErrored_(e,s,t)}return u[r]={sidxInfo:e.sidx,sidx:o},zo(e,o,e.sidx.resolvedUri),i(!0)}};this.request=function(e,t,i){var n,r=[],a=!1,s=function(e,t,n,r){return t.abort(),a=!0,i(e,t,n,r)},o=function(e,t){if(!a){if(e)return s(e,t,"",r);var i=t.responseText.substring(r&&r.byteLength||0,t.responseText.length);if(r=function(){for(var e=arguments.length,t=new Array(e),i=0;i=c+l)return s(t,{response:o.subarray(l,l+c),status:i.status,uri:i.uri});n.request=n.vhs_.xhr({uri:a,responseType:"arraybuffer",headers:Fl({byterange:e.sidx.byterange})},s)})}else this.mediaRequest_=window.setTimeout(function(){return i(!1)},0)},i.dispose=function(){this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},window.clearTimeout(this.minimumUpdatePeriodTimeout_),window.clearTimeout(this.mediaRequest_),window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.off()},i.hasPendingRequest=function(){return this.request||this.mediaRequest_},i.stopRequest=function(){if(this.request){var e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}},i.media=function(e){var t=this;if(!e)return this.media_;if("HAVE_NOTHING"===this.state)throw new Error("Cannot switch media playlist from "+this.state);var i=this.state;if("string"==typeof e){if(!this.masterPlaylistLoader_.master.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.masterPlaylistLoader_.master.playlists[e]}var n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList)return this.state="HAVE_METADATA",this.media_=e,void(n&&(this.trigger("mediachanging"),this.trigger("mediachange")));n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,i,function(n){t.haveMetadata({startingState:i,playlist:e})}))},i.haveMetadata=function(e){var t=e.startingState,i=e.playlist;this.state="HAVE_METADATA",this.loadedPlaylists_[i.id]=i,this.mediaRequest_=null,this.refreshMedia_(i.id),"HAVE_MASTER"===t?this.trigger("loadedmetadata"):this.trigger("mediachange")},i.pause=function(){this.masterPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.masterPlaylistLoader_.createMupOnMedia_),this.masterPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMaster_&&(window.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_),this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_=null),"HAVE_NOTHING"===this.state&&(this.started=!1)},i.load=function(e){var t=this;window.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;var i=this.media();if(e){var n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=window.setTimeout(function(){return t.load()},n)}else this.started?i&&!i.endList?(this.isMaster_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist"):this.start()},i.start=function(){var e=this;this.started=!0,this.isMaster_?this.requestMaster_(function(t,i){e.haveMaster_(),e.hasPendingRequest()||e.media_||e.media(e.masterPlaylistLoader_.master.playlists[0])}):this.mediaRequest_=window.setTimeout(function(){return e.haveMaster_()},0)},i.requestMaster_=function(e){var t=this;this.request=this.vhs_.xhr({uri:this.masterPlaylistLoader_.srcUrl,withCredentials:this.withCredentials},function(i,n){if(!t.requestErrored_(i,n)){var r=n.responseText!==t.masterPlaylistLoader_.masterXml_;return t.masterPlaylistLoader_.masterXml_=n.responseText,n.responseHeaders&&n.responseHeaders.date?t.masterLoaded_=Date.parse(n.responseHeaders.date):t.masterLoaded_=Date.now(),t.masterPlaylistLoader_.srcUrl=Xu(t.handleManifestRedirects,t.masterPlaylistLoader_.srcUrl,n),r?(t.handleMaster_(),void t.syncClientServerClock_(function(){return e(n,r)})):e(n,r)}"HAVE_NOTHING"===t.state&&(t.started=!1)})},i.syncClientServerClock_=function(e){var t,i=this,n=(t=this.masterPlaylistLoader_.masterXml_,function(e){var t=pu(e,"UTCTiming")[0];if(!t)return null;var i=vu(t);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error("UNSUPPORTED_UTC_TIMING_SCHEME")}return i}(Su(t)));return null===n?(this.masterPlaylistLoader_.clientOffset_=this.masterLoaded_-Date.now(),e()):"DIRECT"===n.method?(this.masterPlaylistLoader_.clientOffset_=n.value-Date.now(),e()):void(this.request=this.vhs_.xhr({uri:zu(this.masterPlaylistLoader_.srcUrl,n.value),method:n.method,withCredentials:this.withCredentials},function(t,r){if(i.request){if(t)return i.masterPlaylistLoader_.clientOffset_=i.masterLoaded_-Date.now(),e();var a;a="HEAD"===n.method?r.responseHeaders&&r.responseHeaders.date?Date.parse(r.responseHeaders.date):i.masterLoaded_:Date.parse(r.responseText),i.masterPlaylistLoader_.clientOffset_=a-Date.now(),e()}}))},i.haveMaster_=function(){this.state="HAVE_MASTER",this.isMaster_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)},i.handleMaster_=function(){this.mediaRequest_=null;var e,t,i,n=this.masterPlaylistLoader_.master,r=(i=function(e,t){void 0===t&&(t={});var i=wu(Su(e),t),n=i.representationInfo.map(hu);return au({dashPlaylists:n,locations:i.locations,sidxMapping:t.sidxMapping,previousManifest:t.previousManifest})}((e={masterXml:this.masterPlaylistLoader_.masterXml_,srcUrl:this.masterPlaylistLoader_.srcUrl,clientOffset:this.masterPlaylistLoader_.clientOffset_,sidxMapping:this.masterPlaylistLoader_.sidxMapping_,previousManifest:n}).masterXml,{manifestUri:t=e.srcUrl,clientOffset:e.clientOffset,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest}),kl(i,t),i);n&&(r=function(e,t,i){for(var n=!0,r=Ql(e,{duration:t.duration,minimumUpdatePeriod:t.minimumUpdatePeriod,timelineStarts:t.timelineStarts}),a=0;a-1)},this.trigger=function(t){var i,n,r,a;if(i=e[t])if(2===arguments.length)for(r=i.length,n=0;n>>1,e.samplingfrequencyindex<<7|e.channelcount<<3,6,1,2]))},m=function(e){return t(w.hdlr,x[e])},f=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,e.duration>>>24&255,e.duration>>>16&255,e.duration>>>8&255,255&e.duration,85,196,0,0]);return e.samplerate&&(i[12]=e.samplerate>>>24&255,i[13]=e.samplerate>>>16&255,i[14]=e.samplerate>>>8&255,i[15]=255&e.samplerate),t(w.mdhd,i)},p=function(e){return t(w.mdia,f(e),m(e.type),s(e))},a=function(e){return t(w.mfhd,new Uint8Array([0,0,0,0,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e]))},s=function(e){return t(w.minf,"video"===e.type?t(w.vmhd,A):t(w.smhd,P),i(),v(e))},o=function(e,i){for(var n=[],r=i.length;r--;)n[r]=_(i[r]);return t.apply(null,[w.moof,a(e)].concat(n))},u=function(e){for(var i=e.length,n=[];i--;)n[i]=d(e[i]);return t.apply(null,[w.moov,c(4294967295)].concat(n).concat(l(e)))},l=function(e){for(var i=e.length,n=[];i--;)n[i]=b(e[i]);return t.apply(null,[w.mvex].concat(n))},c=function(e){var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(4278190080&e)>>24,(16711680&e)>>16,(65280&e)>>8,255&e,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 t(w.mvhd,i)},g=function(e){var i,n,r=e.samples||[],a=new Uint8Array(4+r.length);for(n=0;n>>8),s.push(255&r[i].byteLength),s=s.concat(Array.prototype.slice.call(r[i]));for(i=0;i>>8),o.push(255&a[i].byteLength),o=o.concat(Array.prototype.slice.call(a[i]));if(n=[w.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(65280&e.width)>>8,255&e.width,(65280&e.height)>>8,255&e.height,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),t(w.avcC,new Uint8Array([1,e.profileIdc,e.profileCompatibility,e.levelIdc,255].concat([r.length],s,[a.length],o))),t(w.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],e.sarRatio){var u=e.sarRatio[0],l=e.sarRatio[1];n.push(t(w.pasp,new Uint8Array([(4278190080&u)>>24,(16711680&u)>>16,(65280&u)>>8,255&u,(4278190080&l)>>24,(16711680&l)>>16,(65280&l)>>8,255&l])))}return t.apply(null,n)},U=function(e){return t(w.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(65280&e.channelcount)>>8,255&e.channelcount,(65280&e.samplesize)>>8,255&e.samplesize,0,0,0,0,(65280&e.samplerate)>>8,255&e.samplerate,0,0]),n(e))},h=function(e){var i=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,0,(4278190080&e.duration)>>24,(16711680&e.duration)>>16,(65280&e.duration)>>8,255&e.duration,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(65280&e.width)>>8,255&e.width,0,0,(65280&e.height)>>8,255&e.height,0,0]);return t(w.tkhd,i)},_=function(e){var i,n,r,a,s,o;return i=t(w.tfhd,new Uint8Array([0,0,0,58,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),s=Math.floor(e.baseMediaDecodeTime/W),o=Math.floor(e.baseMediaDecodeTime%W),n=t(w.tfdt,new Uint8Array([1,0,0,0,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o>>>24&255,o>>>16&255,o>>>8&255,255&o])),"audio"===e.type?(r=T(e,92),t(w.traf,i,n,r)):(a=g(e),r=T(e,a.length+92),t(w.traf,i,n,r,a))},d=function(e){return e.duration=e.duration||4294967295,t(w.trak,h(e),p(e))},b=function(e){var i=new Uint8Array([0,0,0,0,(4278190080&e.id)>>24,(16711680&e.id)>>16,(65280&e.id)>>8,255&e.id,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return"video"!==e.type&&(i[i.length-1]=0),t(w.trex,i)},j=function(e,t){var i=0,n=0,r=0,a=0;return e.length&&(void 0!==e[0].duration&&(i=1),void 0!==e[0].size&&(n=2),void 0!==e[0].flags&&(r=4),void 0!==e[0].compositionTimeOffset&&(a=8)),[0,0,i|n|r|a,1,(4278190080&e.length)>>>24,(16711680&e.length)>>>16,(65280&e.length)>>>8,255&e.length,(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},F=function(e,i){var n,r,a,s,o,u;for(i+=20+16*(s=e.samples||[]).length,a=j(s,i),(r=new Uint8Array(a.length+16*s.length)).set(a),n=a.length,u=0;u>>24,r[n++]=(16711680&o.duration)>>>16,r[n++]=(65280&o.duration)>>>8,r[n++]=255&o.duration,r[n++]=(4278190080&o.size)>>>24,r[n++]=(16711680&o.size)>>>16,r[n++]=(65280&o.size)>>>8,r[n++]=255&o.size,r[n++]=o.flags.isLeading<<2|o.flags.dependsOn,r[n++]=o.flags.isDependedOn<<6|o.flags.hasRedundancy<<4|o.flags.paddingValue<<1|o.flags.isNonSyncSample,r[n++]=61440&o.flags.degradationPriority,r[n++]=15&o.flags.degradationPriority,r[n++]=(4278190080&o.compositionTimeOffset)>>>24,r[n++]=(16711680&o.compositionTimeOffset)>>>16,r[n++]=(65280&o.compositionTimeOffset)>>>8,r[n++]=255&o.compositionTimeOffset;return t(w.trun,r)},B=function(e,i){var n,r,a,s,o,u;for(i+=20+8*(s=e.samples||[]).length,a=j(s,i),(n=new Uint8Array(a.length+8*s.length)).set(a),r=a.length,u=0;u>>24,n[r++]=(16711680&o.duration)>>>16,n[r++]=(65280&o.duration)>>>8,n[r++]=255&o.duration,n[r++]=(4278190080&o.size)>>>24,n[r++]=(16711680&o.size)>>>16,n[r++]=(65280&o.size)>>>8,n[r++]=255&o.size;return t(w.trun,n)},T=function(e,t){return"audio"===e.type?B(e,t):F(e,t)},r=function(){return t(w.ftyp,S,E,S,k)};var G,z,X,K,Y,Q=function(e){return t(w.mdat,e)},$=o,J=function(e,t){var i={size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}};return i.dataOffset=t,i.compositionTimeOffset=e.pts-e.dts,i.duration=e.duration,i.size=4*e.length,i.size+=e.byteLength,e.keyFrame&&(i.flags.dependsOn=2,i.flags.isNonSyncSample=0),i},Z=[33,16,5,32,164,27],ee=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],te=function(e){for(var t=[];e--;)t.push(0);return t},ie=z=function(e){return 9e4*e},ne=(X=function(e,t){return e*t},K=function(e){return e/9e4}),re=(Y=function(e,t){return e/t},function(e,t){return z(Y(e,t))}),ae=function(e,t,i){return K(i?e:e-t)},se=function(e,t,i,n){var r,a,s,o,u,l,c,d=0,h=0,p=0;if(t.length&&(r=re(e.baseMediaDecodeTime,e.samplerate),a=Math.ceil(9e4/(e.samplerate/1024)),i&&n&&(d=r-Math.max(i,n),p=(h=Math.floor(d/a))*a),!(h<1||p>45e3))){for((s=function(){if(!G){var e={96000:[Z,[227,64],te(154),[56]],88200:[Z,[231],te(170),[56]],64000:[Z,[248,192],te(240),[56]],48000:[Z,[255,192],te(268),[55,148,128],te(54),[112]],44100:[Z,[255,192],te(268),[55,163,128],te(84),[112]],32000:[Z,[255,192],te(268),[55,234],te(226),[112]],24000:[Z,[255,192],te(268),[55,255,128],te(268),[111,112],te(126),[224]],16000:[Z,[255,192],te(268),[55,255,128],te(268),[111,255],te(269),[223,108],te(195),[1,192]],12000:[ee,te(268),[3,127,248],te(268),[6,255,240],te(268),[13,255,224],te(268),[27,253,128],te(259),[56]],11025:[ee,te(268),[3,127,248],te(268),[6,255,240],te(268),[13,255,224],te(268),[27,255,192],te(268),[55,175,128],te(108),[112]],8000:[ee,te(268),[3,121,16],te(47),[7]]};t=e,G=Object.keys(t).reduce(function(e,i){return e[i]=new Uint8Array(t[i].reduce(function(e,t){return e.concat(t)},[])),e},{})}var t;return G}()[e.samplerate])||(s=t[0].data),o=0;o=this.virtualRowCount&&"function"==typeof this.beforeRowOverflow&&this.beforeRowOverflow(e),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},pe.prototype.isEmpty=function(){return 0===this.rows.length||1===this.rows.length&&""===this.rows[0]},pe.prototype.addText=function(e){this.rows[this.rowIdx]+=e},pe.prototype.backspace=function(){if(!this.isEmpty()){var e=this.rows[this.rowIdx];this.rows[this.rowIdx]=e.substr(0,e.length-1)}};var fe=function(e,t,i){this.serviceNum=e,this.text="",this.currentWindow=new pe(-1),this.windows=[],this.stream=i,"string"==typeof t&&this.createTextDecoder(t)};fe.prototype.init=function(e,t){this.startPts=e;for(var i=0;i<8;i++)this.windows[i]=new pe(i),"function"==typeof t&&(this.windows[i].beforeRowOverflow=t)},fe.prototype.setCurrentWindow=function(e){this.currentWindow=this.windows[e]},fe.prototype.createTextDecoder=function(e){if("undefined"==typeof TextDecoder)this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(e)}catch(t){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+e+" encoding. "+t})}};var me=function e(t){t=t||{},e.prototype.init.call(this);var i,n=this,r=t.captionServices||{},a={};Object.keys(r).forEach(function(e){i=r[e],/^SERVICE/.test(e)&&(a[e]=i.encoding)}),this.serviceEncodings=a,this.current708Packet=null,this.services={},this.push=function(e){3===e.type?(n.new708Packet(),n.add708Bytes(e)):(null===n.current708Packet&&n.new708Packet(),n.add708Bytes(e))}};me.prototype=new H,me.prototype.new708Packet=function(){null!==this.current708Packet&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},me.prototype.add708Bytes=function(e){var t=e.ccData,i=t>>>8,n=255&t;this.current708Packet.ptsVals.push(e.pts),this.current708Packet.data.push(i),this.current708Packet.data.push(n)},me.prototype.push708Packet=function(){var e=this.current708Packet,t=e.data,i=null,n=null,r=0,a=t[r++];for(e.seq=a>>6,e.sizeCode=63&a;r>5)&&n>0&&(i=a=t[r++]),this.pushServiceBlock(i,r,n),n>0&&(r+=n-1)},me.prototype.pushServiceBlock=function(e,t,i){var n,r=t,a=this.current708Packet.data,s=this.services[e];for(s||(s=this.initService(e,r));r>5,a.rowLock=(16&n)>>4,a.columnLock=(8&n)>>3,a.priority=7&n,n=i[++e],a.relativePositioning=(128&n)>>7,a.anchorVertical=127&n,n=i[++e],a.anchorHorizontal=n,n=i[++e],a.anchorPoint=(240&n)>>4,a.rowCount=15&n,n=i[++e],a.columnCount=63&n,n=i[++e],a.windowStyle=(56&n)>>3,a.penStyle=7&n,a.virtualRowCount=a.rowCount+1,e},me.prototype.setWindowAttributes=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.winAttr;return n=i[++e],r.fillOpacity=(192&n)>>6,r.fillRed=(48&n)>>4,r.fillGreen=(12&n)>>2,r.fillBlue=3&n,n=i[++e],r.borderType=(192&n)>>6,r.borderRed=(48&n)>>4,r.borderGreen=(12&n)>>2,r.borderBlue=3&n,n=i[++e],r.borderType+=(128&n)>>5,r.wordWrap=(64&n)>>6,r.printDirection=(48&n)>>4,r.scrollDirection=(12&n)>>2,r.justify=3&n,n=i[++e],r.effectSpeed=(240&n)>>4,r.effectDirection=(12&n)>>2,r.displayEffect=3&n,e},me.prototype.flushDisplayed=function(e,t){for(var i=[],n=0;n<8;n++)t.windows[n].visible&&!t.windows[n].isEmpty()&&i.push(t.windows[n].getText());t.endPts=e,t.text=i.join("\n\n"),this.pushCaption(t),t.startPts=e},me.prototype.pushCaption=function(e){""!==e.text&&(this.trigger("data",{startPts:e.startPts,endPts:e.endPts,text:e.text,stream:"cc708_"+e.serviceNum}),e.text="",e.startPts=e.endPts)},me.prototype.displayWindows=function(e,t){var i=this.current708Packet.data[++e],n=this.getPts(e);this.flushDisplayed(n,t);for(var r=0;r<8;r++)i&1<>4,r.offset=(12&n)>>2,r.penSize=3&n,n=i[++e],r.italics=(128&n)>>7,r.underline=(64&n)>>6,r.edgeType=(56&n)>>3,r.fontStyle=7&n,e},me.prototype.setPenColor=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penColor;return n=i[++e],r.fgOpacity=(192&n)>>6,r.fgRed=(48&n)>>4,r.fgGreen=(12&n)>>2,r.fgBlue=3&n,n=i[++e],r.bgOpacity=(192&n)>>6,r.bgRed=(48&n)>>4,r.bgGreen=(12&n)>>2,r.bgBlue=3&n,n=i[++e],r.edgeRed=(48&n)>>4,r.edgeGreen=(12&n)>>2,r.edgeBlue=3&n,e},me.prototype.setPenLocation=function(e,t){var i=this.current708Packet.data,n=i[e],r=t.currentWindow.penLoc;return t.currentWindow.pendingNewLine=!0,n=i[++e],r.row=15&n,n=i[++e],r.column=63&n,e},me.prototype.reset=function(e,t){var i=this.getPts(e);return this.flushDisplayed(i,t),this.initService(t.serviceNum,e)};var ge={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},ve=function(e){return null===e?"":(e=ge[e]||e,String.fromCharCode(e))},ye=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],_e=function(){for(var e=[],t=15;t--;)e.push("");return e},be=function e(t,i){e.prototype.init.call(this),this.field_=t||0,this.dataChannel_=i||0,this.name_="CC"+(1+(this.field_<<1|this.dataChannel_)),this.setConstants(),this.reset(),this.push=function(e){var t,i,n,r,a;if((t=32639&e.ccData)!==this.lastControlCode_){if(4096==(61440&t)?this.lastControlCode_=t:t!==this.PADDING_&&(this.lastControlCode_=null),n=t>>>8,r=255&t,t!==this.PADDING_)if(t===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(t===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(e.pts),this.flushDisplayed(e.pts),i=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=i,this.startPts_=e.pts;else if(t===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(e.pts);else if(t===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(e.pts);else if(t===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(e.pts);else if(t===this.CARRIAGE_RETURN_)this.clearFormatting(e.pts),this.flushDisplayed(e.pts),this.shiftRowsUp_(),this.startPts_=e.pts;else if(t===this.BACKSPACE_)"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1);else if(t===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(e.pts),this.displayed_=_e();else if(t===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=_e();else if(t===this.RESUME_DIRECT_CAPTIONING_)"paintOn"!==this.mode_&&(this.flushDisplayed(e.pts),this.displayed_=_e()),this.mode_="paintOn",this.startPts_=e.pts;else if(this.isSpecialCharacter(n,r))a=ve((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isExtCharacter(n,r))"popOn"===this.mode_?this.nonDisplayed_[this.row_]=this.nonDisplayed_[this.row_].slice(0,-1):this.displayed_[this.row_]=this.displayed_[this.row_].slice(0,-1),a=ve((n=(3&n)<<8)|r),this[this.mode_](e.pts,a),this.column_++;else if(this.isMidRowCode(n,r))this.clearFormatting(e.pts),this[this.mode_](e.pts," "),this.column_++,14==(14&r)&&this.addFormatting(e.pts,["i"]),1==(1&r)&&this.addFormatting(e.pts,["u"]);else if(this.isOffsetControlCode(n,r))this.column_+=3&r;else if(this.isPAC(n,r)){var s=ye.indexOf(7968&t);"rollUp"===this.mode_&&(s-this.rollUpRows_+1<0&&(s=this.rollUpRows_-1),this.setRollUp(e.pts,s)),s!==this.row_&&(this.clearFormatting(e.pts),this.row_=s),1&r&&-1===this.formatting_.indexOf("u")&&this.addFormatting(e.pts,["u"]),16==(16&t)&&(this.column_=4*((14&t)>>1)),this.isColorPAC(r)&&14==(14&r)&&this.addFormatting(e.pts,["i"])}else this.isNormalChar(n)&&(0===r&&(r=null),a=ve(n),a+=ve(r),this[this.mode_](e.pts,a),this.column_+=a.length)}else this.lastControlCode_=null}};be.prototype=new H,be.prototype.flushDisplayed=function(e){var t=this.displayed_.map(function(e,t){try{return e.trim()}catch(e){return this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+t+"."}),""}},this).join("\n").replace(/^\n+|\n+$/g,"");t.length&&this.trigger("data",{startPts:this.startPts_,endPts:e,text:t,stream:this.name_})},be.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=_e(),this.nonDisplayed_=_e(),this.lastControlCode_=null,this.column_=0,this.row_=14,this.rollUpRows_=2,this.formatting_=[]},be.prototype.setConstants=function(){0===this.dataChannel_?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):1===this.dataChannel_&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=32|this.CONTROL_,this.END_OF_CAPTION_=47|this.CONTROL_,this.ROLL_UP_2_ROWS_=37|this.CONTROL_,this.ROLL_UP_3_ROWS_=38|this.CONTROL_,this.ROLL_UP_4_ROWS_=39|this.CONTROL_,this.CARRIAGE_RETURN_=45|this.CONTROL_,this.RESUME_DIRECT_CAPTIONING_=41|this.CONTROL_,this.BACKSPACE_=33|this.CONTROL_,this.ERASE_DISPLAYED_MEMORY_=44|this.CONTROL_,this.ERASE_NON_DISPLAYED_MEMORY_=46|this.CONTROL_},be.prototype.isSpecialCharacter=function(e,t){return e===this.EXT_&&t>=48&&t<=63},be.prototype.isExtCharacter=function(e,t){return(e===this.EXT_+1||e===this.EXT_+2)&&t>=32&&t<=63},be.prototype.isMidRowCode=function(e,t){return e===this.EXT_&&t>=32&&t<=47},be.prototype.isOffsetControlCode=function(e,t){return e===this.OFFSET_&&t>=33&&t<=35},be.prototype.isPAC=function(e,t){return e>=this.BASE_&&e=64&&t<=127},be.prototype.isColorPAC=function(e){return e>=64&&e<=79||e>=96&&e<=127},be.prototype.isNormalChar=function(e){return e>=32&&e<=127},be.prototype.setRollUp=function(e,t){if("rollUp"!==this.mode_&&(this.row_=14,this.mode_="rollUp",this.flushDisplayed(e),this.nonDisplayed_=_e(),this.displayed_=_e()),void 0!==t&&t!==this.row_)for(var i=0;i"},"");this[this.mode_](e,i)},be.prototype.clearFormatting=function(e){if(this.formatting_.length){var t=this.formatting_.reverse().reduce(function(e,t){return e+""},"");this.formatting_=[],this[this.mode_](e,t)}},be.prototype.popOn=function(e,t){var i=this.nonDisplayed_[this.row_];i+=t,this.nonDisplayed_[this.row_]=i},be.prototype.rollUp=function(e,t){var i=this.displayed_[this.row_];i+=t,this.displayed_[this.row_]=i},be.prototype.shiftRowsUp_=function(){var e;for(e=0;et&&(i=-1);Math.abs(t-e)>4294967296;)e+=8589934592*i;return e},Ee=function e(t){var i,n;e.prototype.init.call(this),this.type_=t||"shared",this.push=function(e){"shared"!==this.type_&&e.type!==this.type_||(void 0===n&&(n=e.dts),e.dts=Se(e.dts,n),e.pts=Se(e.pts,n),i=e.dts,this.trigger("data",e))},this.flush=function(){n=i,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){n=void 0,i=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Ee.prototype=new H;var ke,Ce=Ee,Ie=Se,xe=function(e,t,i){var n,r="";for(n=t;n>>2;c*=4,c+=3&l[7],o.timeStamp=c,void 0===t.pts&&void 0===t.dts&&(t.pts=o.timeStamp,t.dts=o.timeStamp),this.trigger("timestamp",o)}t.frames.push(o),i+=10,i+=s}while(i>>4>1&&(n+=t[n]+1),0===i.pid)i.type="pat",e(t.subarray(n),i),this.trigger("data",i);else if(i.pid===this.pmtPid)for(i.type="pmt",e(t.subarray(n),i),this.trigger("data",i);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else void 0===this.programMapTable?this.packetsWaitingForPmt.push([t,n,i]):this.processPes_(t,n,i)},this.processPes_=function(e,t,i){i.pid===this.programMapTable.video?i.streamType=we.H264_STREAM_TYPE:i.pid===this.programMapTable.audio?i.streamType=we.ADTS_STREAM_TYPE:i.streamType=this.programMapTable["timed-metadata"][i.pid],i.type="pes",i.data=e.subarray(t),this.trigger("data",i)}}).prototype=new H,Oe.STREAM_TYPES={h264:27,adts:15},(Re=function(){var e,t=this,i=!1,n={data:[],size:0},r={data:[],size:0},a={data:[],size:0},s=function(e,i,n){var r,a,s=new Uint8Array(e.size),o={type:i},u=0,l=0;if(e.data.length&&!(e.size<9)){for(o.trackId=e.data[0].pid,u=0;u>>3,d.pts*=4,d.pts+=(6&c[13])>>>1,d.dts=d.pts,64&h&&(d.dts=(14&c[14])<<27|(255&c[15])<<20|(254&c[16])<<12|(255&c[17])<<5|(254&c[18])>>>3,d.dts*=4,d.dts+=(6&c[18])>>>1)),d.data=c.subarray(9+c[8])),r="video"===i||o.packetLength<=e.size,(n||r)&&(e.size=0,e.data.length=0),r&&t.trigger("data",o)}};Re.prototype.init.call(this),this.push=function(o){({pat:function(){},pes:function(){var e,t;switch(o.streamType){case we.H264_STREAM_TYPE:e=n,t="video";break;case we.ADTS_STREAM_TYPE:e=r,t="audio";break;case we.METADATA_STREAM_TYPE:e=a,t="timed-metadata";break;default:return}o.payloadUnitStartIndicator&&s(e,t,!0),e.data.push(o),e.size+=o.data.byteLength},pmt:function(){var n={type:"metadata",tracks:[]};null!==(e=o.programMapTable).video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),i=!0,t.trigger("data",n)}})[o.type]()},this.reset=function(){n.size=0,n.data.length=0,r.size=0,r.data.length=0,this.trigger("reset")},this.flushStreams_=function(){s(n,"video"),s(r,"audio"),s(a,"timed-metadata")},this.flush=function(){if(!i&&e){var n={type:"metadata",tracks:[]};null!==e.video&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.video,codec:"avc",type:"video"}),null!==e.audio&&n.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+e.audio,codec:"adts",type:"audio"}),t.trigger("data",n)}i=!1,this.flushStreams_(),this.trigger("done")}}).prototype=new H;var Ue={PAT_PID:0,MP2T_PACKET_LENGTH:188,TransportPacketStream:De,TransportParseStream:Oe,ElementaryStream:Re,TimestampRolloverStream:Ne,CaptionStream:Te.CaptionStream,Cea608Stream:Te.Cea608Stream,Cea708Stream:Te.Cea708Stream,MetadataStream:Me};for(var Be in we)we.hasOwnProperty(Be)&&(Ue[Be]=we[Be]);var Fe,je=Ue,He=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];(Fe=function(e){var t,i=0;Fe.prototype.init.call(this),this.skipWarn_=function(e,t){this.trigger("log",{level:"warn",message:"adts skiping bytes "+e+" to "+t+" in frame "+i+" outside syncword"})},this.push=function(n){var r,a,s,o,u,l=0;if(e||(i=0),"audio"===n.type){var c;for(t&&t.length?(s=t,(t=new Uint8Array(s.byteLength+n.data.byteLength)).set(s),t.set(n.data,s.byteLength)):t=n.data;l+7>5,u=9e4*(o=1024*(1+(3&t[l+6])))/He[(60&t[l+2])>>>2],t.byteLength-l>>6&3),channelcount:(1&t[l+2])<<2|(192&t[l+3])>>>6,samplerate:He[(60&t[l+2])>>>2],samplingfrequencyindex:(60&t[l+2])>>>2,samplesize:16,data:t.subarray(l+7+a,l+r)}),i++,l+=r}else"number"!=typeof c&&(c=l),l++;"number"==typeof c&&(this.skipWarn_(c,l),c=null),t=t.subarray(l)}},this.flush=function(){i=0,this.trigger("done")},this.reset=function(){t=void 0,this.trigger("reset")},this.endTimeline=function(){t=void 0,this.trigger("endedtimeline")}}).prototype=new H;var qe,Ve,We,Ge=Fe;(Ve=function(){var e,t,i=0;Ve.prototype.init.call(this),this.push=function(n){var r;t?((r=new Uint8Array(t.byteLength+n.data.byteLength)).set(t),r.set(n.data,t.byteLength),t=r):t=n.data;for(var a=t.byteLength;i3&&this.trigger("data",t.subarray(i+3)),t=null,i=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}}).prototype=new H,We={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},(qe=function(){var e,t,i,n,r,a,s,o=new Ve;qe.prototype.init.call(this),e=this,this.push=function(e){"video"===e.type&&(t=e.trackId,i=e.pts,n=e.dts,o.push(e))},o.on("data",function(s){var o={trackId:t,pts:i,dts:n,data:s,nalUnitTypeCode:31&s[0]};switch(o.nalUnitTypeCode){case 5:o.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:o.nalUnitType="sei_rbsp",o.escapedRBSP=r(s.subarray(1));break;case 7:o.nalUnitType="seq_parameter_set_rbsp",o.escapedRBSP=r(s.subarray(1)),o.config=a(o.escapedRBSP);break;case 8:o.nalUnitType="pic_parameter_set_rbsp";break;case 9:o.nalUnitType="access_unit_delimiter_rbsp"}e.trigger("data",o)}),o.on("done",function(){e.trigger("done")}),o.on("partialdone",function(){e.trigger("partialdone")}),o.on("reset",function(){e.trigger("reset")}),o.on("endedtimeline",function(){e.trigger("endedtimeline")}),this.flush=function(){o.flush()},this.partialFlush=function(){o.partialFlush()},this.reset=function(){o.reset()},this.endTimeline=function(){o.endTimeline()},s=function(e,t){var i,n=8,r=8;for(i=0;ie?(i<<=e,n-=e):(e-=n,e-=8*(r=Math.floor(e/8)),t-=r,this.loadWord(),i<<=e,n-=e)},this.readBits=function(e){var r=Math.min(n,e),a=i>>>32-r;return(n-=r)>0?i<<=r:t>0&&this.loadWord(),(r=e-r)>0?a<>>e))return i<<=e,n-=e,e;return this.loadWord(),e+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var e=this.skipLeadingZeros();return this.readBits(e+1)-1},this.readExpGolomb=function(){var e=this.readUnsignedExpGolomb();return 1&e?1+e>>>1:-1*(e>>>1)},this.readBoolean=function(){return 1===this.readBits(1)},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()}(e)).readUnsignedByte(),r=t.readUnsignedByte(),n=t.readUnsignedByte(),t.skipUnsignedExpGolomb(),We[i]&&(3===(a=t.readUnsignedExpGolomb())&&t.skipBits(1),t.skipUnsignedExpGolomb(),t.skipUnsignedExpGolomb(),t.skipBits(1),t.readBoolean()))for(h=3!==a?8:12,p=0;p=0?i:0,(16&e[t+5])>>4?i+20:i+10},Qe=function(e){return e[0]<<21|e[1]<<14|e[2]<<7|e[3]},$e={isLikelyAacData:function(e){var t=function e(t,i){return t.length-i<10||t[i]!=="I".charCodeAt(0)||t[i+1]!=="D".charCodeAt(0)||t[i+2]!=="3".charCodeAt(0)?i:e(t,i+=Ye(t,i))}(e,0);return e.length>=t+2&&255==(255&e[t])&&240==(240&e[t+1])&&16==(22&e[t+1])},parseId3TagSize:Ye,parseAdtsSize:function(e,t){var i=(224&e[t+5])>>5,n=e[t+4]<<3;return 6144&e[t+3]|n|i},parseType:function(e,t){return e[t]==="I".charCodeAt(0)&&e[t+1]==="D".charCodeAt(0)&&e[t+2]==="3".charCodeAt(0)?"timed-metadata":!0&e[t]&&240==(240&e[t+1])?"audio":null},parseSampleRate:function(e){for(var t=0;t+5>>2];t++}return null},parseAacTimestamp:function(e){var t,i,n;t=10,64&e[5]&&(t+=4,t+=Qe(e.subarray(10,14)));do{if((i=Qe(e.subarray(t+4,t+8)))<1)return null;if("PRIV"===String.fromCharCode(e[t],e[t+1],e[t+2],e[t+3])){n=e.subarray(t+10,t+i+10);for(var r=0;r>>2;return(s*=4)+(3&a[7])}break}}t+=10,t+=i}while(t=3;)if(e[u]!=="I".charCodeAt(0)||e[u+1]!=="D".charCodeAt(0)||e[u+2]!=="3".charCodeAt(0))if(255!=(255&e[u])||240!=(240&e[u+1]))u++;else{if(e.length-u<7)break;if(u+(o=$e.parseAdtsSize(e,u))>e.length)break;a={type:"audio",data:e.subarray(u,u+o),pts:t,dts:t},this.trigger("data",a),u+=o}else{if(e.length-u<10)break;if(u+(o=$e.parseId3TagSize(e,u))>e.length)break;r={type:"timed-metadata",data:e.subarray(u,u+o)},this.trigger("data",r),u+=o}n=e.length-u,e=n>0?e.subarray(u):new Uint8Array},this.reset=function(){e=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){e=new Uint8Array,this.trigger("endedtimeline")}}).prototype=new H;var Je,Ze,et,tt,it=ze,nt=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],rt=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],at=Xe.H264Stream,st=$e.isLikelyAacData,ot=function(e,t){t.stream=e,this.trigger("log",t)},ut=function(e,t){for(var i=Object.keys(t),n=0;n=i?e:(t.minSegmentDts=1/0,e.filter(function(e){return e.dts>=i&&(t.minSegmentDts=Math.min(t.minSegmentDts,e.dts),t.minSegmentPts=t.minSegmentDts,!0)}))}(n,e,r),e.baseMediaDecodeTime=ue(e,t.keepOriginalTimestamps),p=se(e,o,a,s),e.samples=function(e){var t,i,n=[];for(t=0;t1&&(t=e.shift(),e.byteLength-=t.byteLength,e.nalCount-=t.nalCount,e[0][0].dts=t.dts,e[0][0].pts=t.pts,e[0][0].duration+=t.duration),e}(r)),s.length){var p;if(!(p=t.alignGopsAtEnd?this.alignGopsAtEnd_(r):this.alignGopsAtStart_(r)))return this.gopCache_.unshift({gop:r.pop(),pps:e.pps,sps:e.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),a=[],this.resetStream_(),void this.trigger("done","VideoSegmentStream");oe(e),r=p}le(e,r),e.samples=function(e,t){var i,n,r,a,s,o=t||0,u=[];for(i=0;i=-1e4&&i<=45e3&&(!n||o>i)&&(n=a,o=i));return n?n.gop:null},this.alignGopsAtStart_=function(e){var t,i,n,r,a,o,u,l;for(a=e.byteLength,o=e.nalCount,u=e.duration,t=i=0;tn.pts?t++:(i++,a-=r.byteLength,o-=r.nalCount,u-=r.duration);return 0===i?e:i===e.length?null:((l=e.slice(i)).byteLength=a,l.duration=u,l.nalCount=o,l.pts=l[0].pts,l.dts=l[0].dts,l)},this.alignGopsAtEnd_=function(e){var t,i,n,r,a,o,u;for(t=s.length-1,i=e.length-1,a=null,o=!1;t>=0&&i>=0;){if(n=s[t],r=e[i],n.pts===r.pts){o=!0;break}n.pts>r.pts?t--:(t===s.length-1&&(a=i),i--)}if(!o&&null===a)return null;if(0===(u=o?i:a))return e;var l=e.slice(u),c=l.reduce(function(e,t){return e.byteLength+=t.byteLength,e.duration+=t.duration,e.nalCount+=t.nalCount,e},{byteLength:0,duration:0,nalCount:0});return l.byteLength=c.byteLength,l.duration=c.duration,l.nalCount=c.nalCount,l.pts=l[0].pts,l.dts=l[0].dts,l},this.alignGopsWith=function(e){s=e}}).prototype=new H,(tt=function(e,t){this.numberOfTracks=0,this.metadataStream=t,void 0!==(e=e||{}).remux?this.remuxTracks=!!e.remux:this.remuxTracks=!0,"boolean"==typeof e.keepOriginalTimestamps?this.keepOriginalTimestamps=e.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,tt.prototype.init.call(this),this.push=function(e){return e.text?this.pendingCaptions.push(e):e.frames?this.pendingMetadata.push(e):(this.pendingTracks.push(e.track),this.pendingBytes+=e.boxes.byteLength,"video"===e.track.type&&(this.videoTrack=e.track,this.pendingBoxes.push(e.boxes)),void("audio"===e.track.type&&(this.audioTrack=e.track,this.pendingBoxes.unshift(e.boxes))))}}).prototype=new H,tt.prototype.flush=function(e){var t,i,n,a,s,o,l,c,d=0,h={captions:[],captionStreams:{},metadata:[],info:{}},p=0;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0))}if(this.videoTrack?(p=this.videoTrack.timelineStartInfo.pts,rt.forEach(function(e){h.info[e]=this.videoTrack[e]},this)):this.audioTrack&&(p=this.audioTrack.timelineStartInfo.pts,nt.forEach(function(e){h.info[e]=this.audioTrack[e]},this)),this.videoTrack||this.audioTrack){for(1===this.pendingTracks.length?h.type=this.pendingTracks[0].type:h.type="combined",this.emittedTracks+=this.pendingTracks.length,s=this.pendingTracks,o=void 0,l=void 0,c=void 0,l=r(),c=u(s),(o=new Uint8Array(l.byteLength+c.byteLength)).set(l),o.set(c,l.byteLength),n=o,h.initSegment=new Uint8Array(n.byteLength),h.initSegment.set(n),h.data=new Uint8Array(this.pendingBytes),a=0;a=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},tt.prototype.setRemux=function(e){this.remuxTracks=e},(et=function(e){var t,i,n=this,r=!0;et.prototype.init.call(this),e=e||{},this.baseMediaDecodeTime=e.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="aac",r.metadataStream=new je.MetadataStream,r.aacStream=new it,r.audioTimestampRolloverStream=new je.TimestampRolloverStream("audio"),r.timedMetadataTimestampRolloverStream=new je.TimestampRolloverStream("timed-metadata"),r.adtsStream=new Ge,r.coalesceStream=new tt(e,r.metadataStream),r.headOfPipeline=r.aacStream,r.aacStream.pipe(r.audioTimestampRolloverStream).pipe(r.adtsStream),r.aacStream.pipe(r.timedMetadataTimestampRolloverStream).pipe(r.metadataStream).pipe(r.coalesceStream),r.metadataStream.on("timestamp",function(e){r.aacStream.setTimestamp(e.timeStamp)}),r.aacStream.on("data",function(a){"timed-metadata"!==a.type&&"audio"!==a.type||r.audioSegmentStream||(i=i||{timelineStartInfo:{baseMediaDecodeTime:n.baseMediaDecodeTime},codec:"adts",type:"audio"},r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new Ze(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t}))}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),ut(this,r)},this.setupTsPipeline=function(){var r={};this.transmuxPipeline_=r,r.type="ts",r.metadataStream=new je.MetadataStream,r.packetStream=new je.TransportPacketStream,r.parseStream=new je.TransportParseStream,r.elementaryStream=new je.ElementaryStream,r.timestampRolloverStream=new je.TimestampRolloverStream,r.adtsStream=new Ge,r.h264Stream=new at,r.captionStream=new je.CaptionStream(e),r.coalesceStream=new tt(e,r.metadataStream),r.headOfPipeline=r.packetStream,r.packetStream.pipe(r.parseStream).pipe(r.elementaryStream).pipe(r.timestampRolloverStream),r.timestampRolloverStream.pipe(r.h264Stream),r.timestampRolloverStream.pipe(r.adtsStream),r.timestampRolloverStream.pipe(r.metadataStream).pipe(r.coalesceStream),r.h264Stream.pipe(r.captionStream).pipe(r.coalesceStream),r.elementaryStream.on("data",function(a){var s;if("metadata"===a.type){for(s=a.tracks.length;s--;)t||"video"!==a.tracks[s].type?i||"audio"!==a.tracks[s].type||((i=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime):(t=a.tracks[s]).timelineStartInfo.baseMediaDecodeTime=n.baseMediaDecodeTime;t&&!r.videoSegmentStream&&(r.coalesceStream.numberOfTracks++,r.videoSegmentStream=new Je(t,e),r.videoSegmentStream.on("log",n.getLogTrigger_("videoSegmentStream")),r.videoSegmentStream.on("timelineStartInfo",function(t){i&&!e.keepOriginalTimestamps&&(i.timelineStartInfo=t,r.audioSegmentStream.setEarliestDts(t.dts-n.baseMediaDecodeTime))}),r.videoSegmentStream.on("processedGopsInfo",n.trigger.bind(n,"gopInfo")),r.videoSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"videoSegmentTimingInfo")),r.videoSegmentStream.on("baseMediaDecodeTime",function(e){i&&r.audioSegmentStream.setVideoBaseMediaDecodeTime(e)}),r.videoSegmentStream.on("timingInfo",n.trigger.bind(n,"videoTimingInfo")),r.h264Stream.pipe(r.videoSegmentStream).pipe(r.coalesceStream)),i&&!r.audioSegmentStream&&(r.coalesceStream.numberOfTracks++,r.audioSegmentStream=new Ze(i,e),r.audioSegmentStream.on("log",n.getLogTrigger_("audioSegmentStream")),r.audioSegmentStream.on("timingInfo",n.trigger.bind(n,"audioTimingInfo")),r.audioSegmentStream.on("segmentTimingInfo",n.trigger.bind(n,"audioSegmentTimingInfo")),r.adtsStream.pipe(r.audioSegmentStream).pipe(r.coalesceStream)),n.trigger("trackinfo",{hasAudio:!!i,hasVideo:!!t})}}),r.coalesceStream.on("data",this.trigger.bind(this,"data")),r.coalesceStream.on("id3Frame",function(e){e.dispatchType=r.metadataStream.dispatchType,n.trigger("id3Frame",e)}),r.coalesceStream.on("caption",this.trigger.bind(this,"caption")),r.coalesceStream.on("done",this.trigger.bind(this,"done")),ut(this,r)},this.setBaseMediaDecodeTime=function(n){var r=this.transmuxPipeline_;e.keepOriginalTimestamps||(this.baseMediaDecodeTime=n),i&&(i.timelineStartInfo.dts=void 0,i.timelineStartInfo.pts=void 0,oe(i),r.audioTimestampRolloverStream&&r.audioTimestampRolloverStream.discontinuity()),t&&(r.videoSegmentStream&&(r.videoSegmentStream.gopCache_=[]),t.timelineStartInfo.dts=void 0,t.timelineStartInfo.pts=void 0,oe(t),r.captionStream.reset()),r.timestampRolloverStream&&r.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(e){i&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)},this.setRemux=function(t){var i=this.transmuxPipeline_;e.remux=t,i&&i.coalesceStream&&i.coalesceStream.setRemux(t)},this.alignGopsWith=function(e){t&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)},this.getLogTrigger_=function(e){var t=this;return function(i){i.stream=e,t.trigger("log",i)}},this.push=function(e){if(r){var t=st(e);t&&"aac"!==this.transmuxPipeline_.type?this.setupAacPipeline():t||"ts"===this.transmuxPipeline_.type||this.setupTsPipeline(),r=!1}this.transmuxPipeline_.headOfPipeline.push(e)},this.flush=function(){r=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}}).prototype=new H;var dt,ht={Transmuxer:et,VideoSegmentStream:Je,AudioSegmentStream:Ze,AUDIO_PROPERTIES:nt,VIDEO_PROPERTIES:rt,generateSegmentTimingInfo:ct},pt=function(e){return e>>>0},ft=function(e){var t="";return t+=String.fromCharCode(e[0]),t+=String.fromCharCode(e[1]),(t+=String.fromCharCode(e[2]))+String.fromCharCode(e[3])},mt=pt,gt=function e(t,i){var n,r,a,s,o,u=[];if(!i.length)return null;for(n=0;n1?n+r:t.byteLength,a===i[0]&&(1===i.length?u.push(t.subarray(n+8,s)):(o=e(t.subarray(n+8,s),i.slice(1))).length&&(u=u.concat(o))),n=s;return u},vt=pt,yt=V.getUint64,_t=function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}},bt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Tt="undefined"!=typeof window?window:void 0!==bt?bt:"undefined"!=typeof self?self:{},wt=function(e){for(var t,i,n=e.byteLength,r=[],a=1;a0?function(e){var t={version:e[0],flags:new Uint8Array(e.subarray(1,4))};return 1===t.version?t.baseMediaDecodeTime=yt(e.subarray(4)):t.baseMediaDecodeTime=vt(e[4]<<24|e[5]<<16|e[6]<<8|e[7]),t}(u[0]).baseMediaDecodeTime:0,c=gt(a,["trun"]);t===o&&c.length>0&&(i=function(e,t,i){var n,r,a,s,o=new DataView(e.buffer,e.byteOffset,e.byteLength),u={logs:[],seiNals:[]};for(r=0;r+4>>4>1&&(t+=e[4]+1),t},Dt=function(e){switch(e){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Ot={parseType:function(e,t){var i=At(e);return 0===i?"pat":i===t?"pmt":t?"pes":null},parsePat:function(e){var t=Pt(e),i=4+Lt(e);return t&&(i+=e[i]+1),(31&e[i+10])<<8|e[i+11]},parsePmt:function(e){var t={},i=Pt(e),n=4+Lt(e);if(i&&(n+=e[n]+1),1&e[n+5]){var r;r=3+((15&e[n+1])<<8|e[n+2])-4;for(var a=12+((15&e[n+10])<<8|e[n+11]);a=e.byteLength)return null;var i,n=null;return 192&(i=e[t+7])&&((n={}).pts=(14&e[t+9])<<27|(255&e[t+10])<<20|(254&e[t+11])<<12|(255&e[t+12])<<5|(254&e[t+13])>>>3,n.pts*=4,n.pts+=(6&e[t+13])>>>1,n.dts=n.pts,64&i&&(n.dts=(14&e[t+14])<<27|(255&e[t+15])<<20|(254&e[t+16])<<12|(255&e[t+17])<<5|(254&e[t+18])>>>3,n.dts*=4,n.dts+=(6&e[t+18])>>>1)),n},videoPacketContainsKeyFrame:function(e){for(var t=4+Lt(e),i=e.subarray(t),n=0,r=0,a=!1;r3&&"slice_layer_without_partitioning_rbsp_idr"===Dt(31&i[r+3])&&(a=!0),a}},Rt=Ie,Mt={};Mt.ts=Ot,Mt.aac=$e;var Nt=function(e,t,i){for(var n,r,a,s,o=0,u=188,l=!1;u<=e.byteLength;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o++,u++;else{switch(n=e.subarray(o,u),Mt.ts.parseType(n,t.pid)){case"pes":r=Mt.ts.parsePesType(n,t.table),a=Mt.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(s=Mt.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),l=!0)}if(l)break;o+=188,u+=188}for(o=(u=e.byteLength)-188,l=!1;o>=0;)if(71!==e[o]||71!==e[u]&&u!==e.byteLength)o--,u--;else{switch(n=e.subarray(o,u),Mt.ts.parseType(n,t.pid)){case"pes":r=Mt.ts.parsePesType(n,t.table),a=Mt.ts.parsePayloadUnitStartIndicator(n),"audio"===r&&a&&(s=Mt.ts.parsePesTime(n))&&(s.type="audio",i.audio.push(s),l=!0)}if(l)break;o-=188,u-=188}},Ut=function(e,t,i){for(var n,r,a,s,o,u,l,c=0,d=188,h=!1,p={data:[],size:0};d=0;)if(71!==e[c]||71!==e[d])c--,d--;else{switch(n=e.subarray(c,d),Mt.ts.parseType(n,t.pid)){case"pes":r=Mt.ts.parsePesType(n,t.table),a=Mt.ts.parsePayloadUnitStartIndicator(n),"video"===r&&a&&(s=Mt.ts.parsePesTime(n))&&(s.type="video",i.video.push(s),h=!0)}if(h)break;c-=188,d-=188}},Bt=function(e,t){var i;return(i=Mt.aac.isLikelyAacData(e)?function(e){for(var t,i=!1,n=0,r=null,a=null,s=0,o=0;e.length-o>=3;){switch(Mt.aac.parseType(e,o)){case"timed-metadata":if(e.length-o<10){i=!0;break}if((s=Mt.aac.parseId3TagSize(e,o))>e.length){i=!0;break}null===a&&(t=e.subarray(o,o+s),a=Mt.aac.parseAacTimestamp(t)),o+=s;break;case"audio":if(e.length-o<7){i=!0;break}if((s=Mt.aac.parseAdtsSize(e,o))>e.length){i=!0;break}null===r&&(t=e.subarray(o,o+s),r=Mt.aac.parseSampleRate(t)),n++,o+=s;break;default:o++}if(i)return null}if(null===r||null===a)return null;var u=9e4/r;return{audio:[{type:"audio",dts:a,pts:a},{type:"audio",dts:a+1024*n*u,pts:a+1024*n*u}]}}(e):function(e){var t={pid:null,table:null},i={};for(var n in function(e,t){for(var i,n=0,r=188;r0;){var u=t.shift();this.parse(u,a,s)}return(o=function(e,t,i){if(null===t)return null;var n=kt(e,t)[t]||{};return{seiNals:n.seiNals,logs:n.logs,timescale:i}}(e,i,n))&&o.logs&&(r.logs=r.logs.concat(o.logs)),null!==o&&o.seiNals?(this.pushNals(o.seiNals),this.flushStream(),r):r.logs.length?{logs:r.logs,captions:[],captionStreams:[]}:null},this.pushNals=function(t){if(!this.isInitialized()||!t||0===t.length)return null;t.forEach(function(t){e.push(t)})},this.flushStream=function(){if(!this.isInitialized())return null;a?e.partialFlush():e.flush()},this.clearParsedCaptions=function(){r.captions=[],r.captionStreams={},r.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;e.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){t=[],i=null,n=null,r?this.clearParsedCaptions():r={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},this.captionParser.init());var t=new Uint8Array(e.data,e.byteOffset,e.byteLength),i=this.captionParser.parse(t,e.trackIds,e.timescales);this.self.postMessage({action:"mp4Captions",captions:i&&i.captions||[],logs:i&&i.logs||[],data:t.buffer},[t.buffer])},t.probeMp4StartTime=function(e){var t,i,n=e.timescales,r=e.data,a=(t=n,"bigint"==typeof(i=gt(r,["moof","traf"]).reduce(function(e,i){var n,r,a=gt(i,["tfhd"])[0],s=Ct(a[4]<<24|a[5]<<16|a[6]<<8|a[7]),o=t[s]||9e4,u=gt(i,["tfdt"])[0],l=new DataView(u.buffer,u.byteOffset,u.byteLength);return"bigint"==typeof(n=1===u[0]?xt(u.subarray(4,12)):l.getUint32(4))?r=n/Tt.BigInt(o):"number"!=typeof n||isNaN(n)||(r=n/o),r11?(r.codec+=".",r.codec+=It(c[9]),r.codec+=It(c[10]),r.codec+=It(c[11])):r.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(r.codec)?(c=d.subarray(28),"esds"===ft(c.subarray(4,8))&&c.length>20&&0!==c[19]?(r.codec+="."+It(c[19]),r.codec+="."+It(c[20]>>>2&63).replace(/^0/,"")):r.codec="mp4a.40.2"):r.codec=r.codec.toLowerCase())}var h=gt(e,["mdia","mdhd"])[0];h&&(r.timescale=dt(h)),i.push(r)}),i}(t);this.self.postMessage({action:"probeMp4Tracks",tracks:i,data:t},[t.buffer])},t.probeTs=function(e){var t=e.data,i=e.baseStartTime,n="number"!=typeof i||isNaN(i)?void 0:9e4*i,r=Bt(t,n),a=null;r&&((a={hasVideo:r.video&&2===r.video.length||!1,hasAudio:r.audio&&2===r.audio.length||!1}).hasVideo&&(a.videoStart=r.video[0].ptsTime),a.hasAudio&&(a.audioStart=r.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:a,data:t},[t.buffer])},t.clearAllMp4Captions=function(){this.captionParser&&this.captionParser.clearAllCaptions()},t.clearParsedMp4Captions=function(){this.captionParser&&this.captionParser.clearParsedCaptions()},t.push=function(e){var t=new Uint8Array(e.data,e.byteOffset,e.byteLength);this.transmuxer.push(t)},t.reset=function(){this.transmuxer.reset()},t.setTimestampOffset=function(e){var t=e.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(ie(t)))},t.setAudioAppendStart=function(e){this.transmuxer.setAudioAppendStart(Math.ceil(ie(e.appendStart)))},t.setRemux=function(e){this.transmuxer.setRemux(e.remux)},t.flush=function(e){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})},t.endTimeline=function(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})},t.alignGopsWith=function(e){this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())},e}();self.onmessage=function(e){"init"===e.data.action&&e.data.options?this.messageHandlers=new Ft(self,e.data.options):(this.messageHandlers||(this.messageHandlers=new Ft(self)),e.data&&e.data.action&&"init"!==e.data.action&&this.messageHandlers[e.data.action]&&this.messageHandlers[e.data.action](e.data))}}))),sc=function(e){var t=e.transmuxer,i=e.bytes,n=e.audioAppendStart,r=e.gopsToAlignWith,a=e.remux,s=e.onData,o=e.onTrackInfo,u=e.onAudioTimingInfo,l=e.onVideoTimingInfo,c=e.onVideoSegmentTimingInfo,d=e.onAudioSegmentTimingInfo,h=e.onId3,p=e.onCaptions,f=e.onDone,m=e.onEndedTimeline,g=e.onTransmuxerLog,v=e.isEndOfTimeline,y={buffer:[]},_=v;if(t.onmessage=function(i){t.currentTransmux===e&&("data"===i.data.action&&function(e,t,i){var n=e.data.segment,r=n.type,a=n.initSegment,s=n.captions,o=n.captionStreams,u=n.metadata,l=n.videoFrameDtsTime,c=n.videoFramePtsTime;t.buffer.push({captions:s,captionStreams:o,metadata:u});var d=e.data.segment.boxes||{data:e.data.segment.data},h={type:r,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(a.data,a.byteOffset,a.byteLength)};void 0!==l&&(h.videoFrameDtsTime=l),void 0!==c&&(h.videoFramePtsTime=c),i(h)}(i,y,s),"trackinfo"===i.data.action&&o(i.data.trackInfo),"gopInfo"===i.data.action&&function(e,t){t.gopInfo=e.data.gopInfo}(i,y),"audioTimingInfo"===i.data.action&&u(i.data.audioTimingInfo),"videoTimingInfo"===i.data.action&&l(i.data.videoTimingInfo),"videoSegmentTimingInfo"===i.data.action&&c(i.data.videoSegmentTimingInfo),"audioSegmentTimingInfo"===i.data.action&&d(i.data.audioSegmentTimingInfo),"id3Frame"===i.data.action&&h([i.data.id3Frame],i.data.id3Frame.dispatchType),"caption"===i.data.action&&p(i.data.caption),"endedtimeline"===i.data.action&&(_=!1,m()),"log"===i.data.action&&g(i.data.log),"transmuxed"===i.data.type&&(_||(t.onmessage=null,function(e){var t=e.transmuxedData,i=e.callback;t.buffer=[],i(t)}({transmuxedData:y,callback:f}),oc(t))))},n&&t.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&t.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),void 0!==a&&t.postMessage({action:"setRemux",remux:a}),i.byteLength){var b=i instanceof ArrayBuffer?i:i.buffer,T=i instanceof ArrayBuffer?0:i.byteOffset;t.postMessage({action:"push",data:b,byteOffset:T,byteLength:i.byteLength},[b])}v&&t.postMessage({action:"endTimeline"}),t.postMessage({action:"flush"})},oc=function(e){e.currentTransmux=null,e.transmuxQueue.length&&(e.currentTransmux=e.transmuxQueue.shift(),"function"==typeof e.currentTransmux?e.currentTransmux():sc(e.currentTransmux))},uc=function(e,t){e.postMessage({action:t}),oc(e)},lc=function(e){!function(e,t){if(!t.currentTransmux)return t.currentTransmux=e,void uc(t,e);t.transmuxQueue.push(uc.bind(null,t,e))}("reset",e)},cc=function(e){var t=e.transmuxer,i=e.endAction||e.action,n=e.callback,r=m({},e,{endAction:null,transmuxer:null,callback:null});if(t.addEventListener("message",function r(a){if(a.data.action===i){if(t.removeEventListener("message",r),a.data.data){try{a.data.data=new Uint8Array(a.data.data,e.byteOffset||0,e.byteLength||a.data.data.byteLength)}catch(e){}e.data&&(e.data=a.data.data)}n(a.data)}}),e.data){var a=e.data instanceof ArrayBuffer;r.byteOffset=a?0:e.data.byteOffset,r.byteLength=e.data.byteLength;var s=[a?e.data:e.data.buffer];t.postMessage(r,s)}else t.postMessage(r)},dc=function(e){e.forEach(function(e){e.abort()})},hc=function(e,t){return t.timedout?{status:t.status,message:"HLS request timed-out at URL: "+t.uri,code:-101,xhr:t}:t.aborted?{status:t.status,message:"HLS request aborted at URL: "+t.uri,code:-102,xhr:t}:e?{status:t.status,message:"HLS request errored at URL: "+t.uri,code:2,xhr:t}:"arraybuffer"===t.responseType&&0===t.response.byteLength?{status:t.status,message:"Empty HLS response at URL: "+t.uri,code:2,xhr:t}:null},pc=function(e,t,i){return function(n,r){var a=r.response,s=hc(n,r);if(s)return i(s,e);if(16!==a.byteLength)return i({status:r.status,message:"Invalid HLS key at URL: "+r.uri,code:2,xhr:r},e);for(var o=new DataView(a),u=new Uint32Array([o.getUint32(0),o.getUint32(4),o.getUint32(8),o.getUint32(12)]),l=0;l>>0,o=t.subarray(a+4,a+8);if(0===s)break;var u=a+s;if(u>t.length){if(n)break;u=t.length}var l=t.subarray(a+8,u);Ha(o,i[0])&&(1===i.length?r.push(l):r.push.apply(r,e(l,i.slice(1),n))),a=u}return r}(f,["moof"]).length>0){t.isFmp4=!0;var m=t.map.tracks,g={isFmp4:!0,hasVideo:!!m.video,hasAudio:!!m.audio};m.audio&&m.audio.codec&&"enca"!==m.audio.codec&&(g.audioCodec=m.audio.codec),m.video&&m.video.codec&&"encv"!==m.video.codec&&(g.videoCodec=m.video.codec),m.video&&m.audio&&(g.isMuxed=!0),n(t,g);var v=function(e){d(t,{data:f,type:g.hasAudio&&!g.isMuxed?"audio":"video"}),e&&e.length&&u(t,e),h(null,t,{})};cc({action:"probeMp4StartTime",timescales:t.map.timescales,data:f,transmuxer:t.transmuxer,callback:function(e){var n=e.data,a=e.startTime;i=n.buffer,t.bytes=f=n,g.hasAudio&&!g.isMuxed&&r(t,"audio","start",a),g.hasVideo&&r(t,"video","start",a),m.video&&n.byteLength&&t.transmuxer?cc({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:f,timescales:t.map.timescales,trackIds:[m.video.id],callback:function(e){i=e.data.buffer,t.bytes=f=e.data,e.logs.forEach(function(e){p(ca.mergeOptions(e,{stream:"mp4CaptionParser"}))}),v(e.captions)}}):v()}})}else if(t.transmuxer){if(void 0===t.container&&(t.container=Wu(f)),"ts"!==t.container&&"aac"!==t.container)return n(t,{hasAudio:!1,hasVideo:!1}),void h(null,t,{});mc({segment:t,bytes:i,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})}else h(null,t,{})},vc=function(e,t){var i,n=e.id,r=e.key,a=e.encryptedBytes,s=e.decryptionWorker;s.addEventListener("message",function e(i){if(i.data.source===n){s.removeEventListener("message",e);var r=i.data.decrypted;t(new Uint8Array(r.bytes,r.byteOffset,r.byteLength))}}),i=r.bytes.slice?r.bytes.slice():new Uint32Array(Array.prototype.slice.call(r.bytes)),s.postMessage(Vl({source:n,encrypted:a,key:i,iv:r.iv}),[a.buffer,i.buffer])},yc=function(e){var t=e.xhr,i=e.xhrOptions,n=e.decryptionWorker,r=e.segment,a=e.abortFn,s=e.progressFn,o=e.trackInfoFn,u=e.timingInfoFn,l=e.videoSegmentTimingInfoFn,c=e.audioSegmentTimingInfoFn,d=e.id3Fn,h=e.captionsFn,p=e.isEndOfTimeline,f=e.endedTimelineFn,m=e.dataFn,g=e.doneFn,v=e.onTransmuxerLog,y=[],_=function(e){var t=e.activeXhrs,i=e.decryptionWorker,n=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog,f=0,m=!1;return function(e,g){if(!m){if(e)return m=!0,dc(t),h(e,g);if((f+=1)===t.length){var v=function(){if(g.encryptedBytes)return function(e){var t=e.decryptionWorker,i=e.segment,n=e.trackInfoFn,r=e.timingInfoFn,a=e.videoSegmentTimingInfoFn,s=e.audioSegmentTimingInfoFn,o=e.id3Fn,u=e.captionsFn,l=e.isEndOfTimeline,c=e.endedTimelineFn,d=e.dataFn,h=e.doneFn,p=e.onTransmuxerLog;vc({id:i.requestId,key:i.key,encryptedBytes:i.encryptedBytes,decryptionWorker:t},function(e){i.bytes=e,gc({segment:i,bytes:i.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})})}({decryptionWorker:i,segment:g,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p});gc({segment:g,bytes:g.bytes,trackInfoFn:n,timingInfoFn:r,videoSegmentTimingInfoFn:a,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:l,endedTimelineFn:c,dataFn:d,doneFn:h,onTransmuxerLog:p})};if(g.endOfAllRequests=Date.now(),g.map&&g.map.encryptedBytes&&!g.map.bytes)return vc({decryptionWorker:i,id:g.requestId+"-init",encryptedBytes:g.map.encryptedBytes,key:g.map.key},function(e){g.map.bytes=e,fc(g,function(e){if(e)return dc(t),h(e,g);v()})});v()}}}}({activeXhrs:y,decryptionWorker:n,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:l,audioSegmentTimingInfoFn:c,id3Fn:d,captionsFn:h,isEndOfTimeline:p,endedTimelineFn:f,dataFn:m,doneFn:g,onTransmuxerLog:v});if(r.key&&!r.key.bytes){var b=[r.key];r.map&&!r.map.bytes&&r.map.key&&r.map.key.resolvedUri===r.key.resolvedUri&&b.push(r.map.key);var T=t(ca.mergeOptions(i,{uri:r.key.resolvedUri,responseType:"arraybuffer"}),pc(r,b,_));y.push(T)}if(r.map&&!r.map.bytes){if(r.map.key&&(!r.key||r.key.resolvedUri!==r.map.key.resolvedUri)){var w=t(ca.mergeOptions(i,{uri:r.map.key.resolvedUri,responseType:"arraybuffer"}),pc(r,[r.map.key],_));y.push(w)}var S=t(ca.mergeOptions(i,{uri:r.map.resolvedUri,responseType:"arraybuffer",headers:Fl(r.map)}),function(e){var t=e.segment,i=e.finishProcessingFn;return function(e,n){var r=hc(e,n);if(r)return i(r,t);var a=new Uint8Array(n.response);if(t.map.key)return t.map.encryptedBytes=a,i(null,t);t.map.bytes=a,fc(t,function(e){if(e)return e.xhr=n,e.status=n.status,i(e,t);i(null,t)})}}({segment:r,finishProcessingFn:_}));y.push(S)}var E=ca.mergeOptions(i,{uri:r.part&&r.part.resolvedUri||r.resolvedUri,responseType:"arraybuffer",headers:Fl(r)}),k=t(E,function(e){var t=e.segment,i=e.finishProcessingFn,n=e.responseType;return function(e,r){var a=hc(e,r);if(a)return i(a,t);var s="arraybuffer"!==n&&r.responseText?function(e){for(var t=new Uint8Array(new ArrayBuffer(e.length)),i=0;i1)return _c("multiple "+e+" codecs found as attributes: "+t[e].join(", ")+". Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs."),void(t[e]=null);t[e]=t[e][0]}),t},wc=function(e){var t=0;return e.audio&&t++,e.video&&t++,t},Sc=function(e,t){var i=t.attributes||{},n=Tc(function(e){var t=e.attributes||{};if(t.CODECS)return xa(t.CODECS)}(t)||[]);if(bc(e,t)&&!n.audio&&!function(e,t){if(!bc(e,t))return!0;var i=t.attributes||{},n=e.mediaGroups.AUDIO[i.AUDIO];for(var r in n)if(!n[r].uri&&!n[r].playlists)return!0;return!1}(e,t)){var r=Tc(function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var i=e.mediaGroups.AUDIO[t];if(!i)return null;for(var n in i){var r=i[n];if(r.default&&r.playlists)return xa(r.playlists[0].attributes.CODECS)}return null}(e,i.AUDIO)||[]);r.audio&&(n.audio=r.audio)}return n},Ec=Ku("PlaylistSelector"),kc=function(e){if(e&&e.playlist){var t=e.playlist;return JSON.stringify({id:t.id,bandwidth:e.bandwidth,width:e.width,height:e.height,codecs:t.attributes&&t.attributes.CODECS||""})}},Cc=function(e,t){if(!e)return"";var i=window.getComputedStyle(e);return i?i[t]:""},Ic=function(e,t){var i=e.slice();e.sort(function(e,n){var r=t(e,n);return 0===r?i.indexOf(e)-i.indexOf(n):r})},xc=function(e,t){var i,n;return e.attributes.BANDWIDTH&&(i=e.attributes.BANDWIDTH),i=i||window.Number.MAX_VALUE,t.attributes.BANDWIDTH&&(n=t.attributes.BANDWIDTH),i-(n||window.Number.MAX_VALUE)},Ac=function(e,t,i,n,r,a){if(e){var s={bandwidth:t,width:i,height:n,limitRenditionByPlayerDimensions:r},o=e.playlists;bl.isAudioOnly(e)&&(o=a.getAudioTrackPlaylists_(),s.audioOnly=!0);var u=o.map(function(e){var t=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width,i=e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height;return{bandwidth:e.attributes&&e.attributes.BANDWIDTH||window.Number.MAX_VALUE,width:t,height:i,playlist:e}});Ic(u,function(e,t){return e.bandwidth-t.bandwidth});var l=(u=u.filter(function(e){return!bl.isIncompatible(e.playlist)})).filter(function(e){return bl.isEnabled(e.playlist)});l.length||(l=u.filter(function(e){return!bl.isDisabled(e.playlist)}));var c=l.filter(function(e){return e.bandwidth*ec.BANDWIDTH_VARIANCEi||e.height>n})).filter(function(e){return e.width===v[0].width&&e.height===v[0].height}),d=y[y.length-1],_=y.filter(function(e){return e.bandwidth===d.bandwidth})[0]),a.experimentalLeastPixelDiffSelector){var w=m.map(function(e){return e.pixelDiff=Math.abs(e.width-i)+Math.abs(e.height-n),e});Ic(w,function(e,t){return e.pixelDiff===t.pixelDiff?t.bandwidth-e.bandwidth:e.pixelDiff-t.pixelDiff}),b=w[0]}var S=b||_||T||h||l[0]||u[0];if(S&&S.playlist){var E="sortedPlaylistReps";return b?E="leastPixelDiffRep":_?E="resolutionPlusOneRep":T?E="resolutionBestRep":h?E="bandwidthBestRep":l[0]&&(E="enabledPlaylistReps"),Ec("choosing "+kc(S)+" using "+E+" with options",s),S.playlist}return Ec("could not choose a playlist with options",s),null}},Pc=function(){var e=this.useDevicePixelRatio&&window.devicePixelRatio||1;return Ac(this.playlists.master,this.systemBandwidth,parseInt(Cc(this.tech_.el(),"width"),10)*e,parseInt(Cc(this.tech_.el(),"height"),10)*e,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)},Lc=function(e,t,i){var n,r;if(i&&i.cues)for(n=i.cues.length;n--;)(r=i.cues[n]).startTime>=e&&r.endTime<=t&&i.removeCue(r)},Dc=function(e){return"number"==typeof e&&isFinite(e)},Oc=function(e){var t=e.startOfSegment,i=e.duration,n=e.segment,r=e.part,a=e.playlist,s=a.mediaSequence,o=a.id,u=a.segments,l=void 0===u?[]:u,c=e.mediaIndex,d=e.partIndex,h=e.timeline,p=l.length-1,f="mediaIndex/partIndex increment";e.getMediaInfoForTime?f="getMediaInfoForTime ("+e.getMediaInfoForTime+")":e.isSyncRequest&&(f="getSyncSegmentCandidate (isSyncRequest)"),e.independent&&(f+=" with independent "+e.independent);var m="number"==typeof d,g=e.segment.uri?"segment":"pre-segment",v=m?sl({preloadSegment:n})-1:0;return g+" ["+(s+c)+"/"+(s+p)+"]"+(m?" part ["+d+"/"+v+"]":"")+" segment start/end ["+n.start+" => "+n.end+"]"+(m?" part start/end ["+r.start+" => "+r.end+"]":"")+" startOfSegment ["+t+"] duration ["+i+"] timeline ["+h+"] selected by ["+f+"] playlist ["+o+"]"},Rc=function(e){return e+"TimingInfo"},Mc=function(e){var t=e.timelineChangeController,i=e.currentTimeline,n=e.segmentTimeline,r=e.loaderType,a=e.audioDisabled;if(i===n)return!1;if("audio"===r){var s=t.lastTimelineChange({type:"main"});return!s||s.to!==n}if("main"===r&&a){var o=t.pendingTimelineChange({type:"audio"});return!o||o.to!==n}return!1},Nc=function(e){var t=e.segmentDuration,i=e.maxDuration;return!!t&&Math.round(t)>i+1/30},Uc=function(e){function t(t,i){var n;if(n=e.call(this)||this,!t)throw new TypeError("Initialization settings are required");if("function"!=typeof t.currentTime)throw new TypeError("No currentTime getter specified");if(!t.mediaSource)throw new TypeError("No MediaSource specified");return n.bandwidth=t.bandwidth,n.throughput={rate:0,count:0},n.roundTrip=NaN,n.resetStats_(),n.mediaIndex=null,n.partIndex=null,n.hasPlayed_=t.hasPlayed,n.currentTime_=t.currentTime,n.seekable_=t.seekable,n.seeking_=t.seeking,n.duration_=t.duration,n.mediaSource_=t.mediaSource,n.vhs_=t.vhs,n.loaderType_=t.loaderType,n.currentMediaInfo_=void 0,n.startingMediaInfo_=void 0,n.segmentMetadataTrack_=t.segmentMetadataTrack,n.goalBufferLength_=t.goalBufferLength,n.sourceType_=t.sourceType,n.sourceUpdater_=t.sourceUpdater,n.inbandTextTracks_=t.inbandTextTracks,n.state_="INIT",n.timelineChangeController_=t.timelineChangeController,n.shouldSaveSegmentTimingInfo_=!0,n.parse708captions_=t.parse708captions,n.useDtsForTimestampOffset_=t.useDtsForTimestampOffset,n.captionServices_=t.captionServices,n.experimentalExactManifestTimings=t.experimentalExactManifestTimings,n.checkBufferTimeout_=null,n.error_=void 0,n.currentTimeline_=-1,n.pendingSegment_=null,n.xhrOptions_=null,n.pendingSegments_=[],n.audioDisabled_=!1,n.isPendingTimestampOffset_=!1,n.gopBuffer_=[],n.timeMapping_=0,n.safeAppend_=ca.browser.IE_VERSION>=11,n.appendInitSegment_={audio:!0,video:!0},n.playlistOfLastInitSegment_={audio:null,video:null},n.callQueue_=[],n.loadQueue_=[],n.metadataQueue_={id3:[],caption:[]},n.waitingOnRemove_=!1,n.quotaExceededErrorRetryTimeout_=null,n.activeInitSegmentId_=null,n.initSegments_={},n.cacheEncryptionKeys_=t.cacheEncryptionKeys,n.keyCache_={},n.decrypter_=t.decrypter,n.syncController_=t.syncController,n.syncPoint_={segmentIndex:0,time:0},n.transmuxer_=n.createTransmuxer_(),n.triggerSyncInfoUpdate_=function(){return n.trigger("syncinfoupdate")},n.syncController_.on("syncinfoupdate",n.triggerSyncInfoUpdate_),n.mediaSource_.addEventListener("sourceopen",function(){n.isEndOfStream_()||(n.ended_=!1)}),n.fetchAtBuffer_=!1,n.logger_=Ku("SegmentLoader["+n.loaderType_+"]"),Object.defineProperty(_t(n),"state",{get:function(){return this.state_},set:function(e){e!==this.state_&&(this.logger_(this.state_+" -> "+e),this.state_=e,this.trigger("statechange"))}}),n.sourceUpdater_.on("ready",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),"main"===n.loaderType_&&n.timelineChangeController_.on("pendingtimelinechange",function(){n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),"audio"===n.loaderType_&&n.timelineChangeController_.on("timelinechange",function(){n.hasEnoughInfoToLoad_()&&n.processLoadQueue_(),n.hasEnoughInfoToAppend_()&&n.processCallQueue_()}),n}bt(t,e);var i=t.prototype;return i.createTransmuxer_=function(){return function(e){var t=new ac;t.currentTransmux=null,t.transmuxQueue=[];var i=t.terminate;return t.terminate=function(){return t.currentTransmux=null,t.transmuxQueue.length=0,i.call(t)},t.postMessage({action:"init",options:e}),t}({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})},i.resetStats_=function(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0},i.dispose=function(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&window.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()},i.setAudio=function(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())},i.abort=function(){"WAITING"===this.state?(this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()):this.pendingSegment_&&(this.pendingSegment_=null)},i.abort_=function(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,window.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null},i.checkForAbort_=function(e){return"APPENDING"!==this.state||this.pendingSegment_?!this.pendingSegment_||this.pendingSegment_.requestId!==e:(this.state="READY",!0)},i.error=function(e){return void 0!==e&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_},i.endOfStream=function(){this.ended_=!0,this.transmuxer_&&lc(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")},i.buffered_=function(){var e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return ca.createTimeRanges();if("main"===this.loaderType_){var t=e.hasAudio,i=e.hasVideo,n=e.isMuxed;if(i&&t&&!this.audioDisabled_&&!n)return this.sourceUpdater_.buffered();if(i)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()},i.initSegmentForMap=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=Wl(e),n=this.initSegments_[i];return t&&!n&&e.bytes&&(this.initSegments_[i]=n={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),n||e},i.segmentKey=function(e,t){if(void 0===t&&(t=!1),!e)return null;var i=Gl(e),n=this.keyCache_[i];this.cacheEncryptionKeys_&&t&&!n&&e.bytes&&(this.keyCache_[i]=n={resolvedUri:e.resolvedUri,bytes:e.bytes});var r={resolvedUri:(n||e).resolvedUri};return n&&(r.bytes=n.bytes),r},i.couldBeginLoading_=function(){return this.playlist_&&!this.paused()},i.load=function(){if(this.monitorBuffer_(),this.playlist_)return"INIT"===this.state&&this.couldBeginLoading_()?this.init_():void(!this.couldBeginLoading_()||"READY"!==this.state&&"INIT"!==this.state||(this.state="READY"))},i.init_=function(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()},i.playlist=function(e,t){if(void 0===t&&(t={}),e){var i=this.playlist_,n=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,"INIT"===this.state&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},"main"===this.loaderType_&&this.syncController_.setDateTimeMappingForStart(e));var r=null;if(i&&(i.id?r=i.id:i.uri&&(r=i.uri)),this.logger_("playlist update ["+r+" => "+(e.id||e.uri)+"]"),this.trigger("syncinfoupdate"),"INIT"===this.state&&this.couldBeginLoading_())return this.init_();if(!i||i.uri!==e.uri)return null!==this.mediaIndex&&(e.endList?this.resyncLoader():this.resetLoader()),this.currentMediaInfo_=void 0,void this.trigger("playlistupdate");var a=e.mediaSequence-i.mediaSequence;if(this.logger_("live window shift ["+a+"]"),null!==this.mediaIndex)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{var s=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!s.parts||!s.parts.length||!s.parts[this.partIndex])){var o=this.mediaIndex;this.logger_("currently processing part (index "+this.partIndex+") no longer exists."),this.resetLoader(),this.mediaIndex=o}}n&&(n.mediaIndex-=a,n.mediaIndex<0?(n.mediaIndex=null,n.partIndex=null):(n.mediaIndex>=0&&(n.segment=e.segments[n.mediaIndex]),n.partIndex>=0&&n.segment.parts&&(n.part=n.segment.parts[n.partIndex]))),this.syncController_.saveExpiredSegmentInfo(i,e)}},i.pause=function(){this.checkBufferTimeout_&&(window.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)},i.paused=function(){return null===this.checkBufferTimeout_},i.resetEverything=function(e){this.ended_=!1,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"}))},i.resetLoader=function(){this.fetchAtBuffer_=!1,this.resyncLoader()},i.resyncLoader=function(){this.transmuxer_&&lc(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})},i.remove=function(e,t,i,n){if(void 0===i&&(i=function(){}),void 0===n&&(n=!1),t===1/0&&(t=this.duration_()),t<=e)this.logger_("skipping remove because end ${end} is <= start ${start}");else if(this.sourceUpdater_&&this.getMediaInfo_()){var r=1,a=function(){0==--r&&i()};for(var s in!n&&this.audioDisabled_||(r++,this.sourceUpdater_.removeAudio(e,t,a)),(n||"main"===this.loaderType_)&&(this.gopBuffer_=function(e,t,i,n){for(var r=Math.ceil((t-n)*Gu),a=Math.ceil((i-n)*Gu),s=e.slice(),o=e.length;o--&&!(e[o].pts<=a););if(-1===o)return s;for(var u=o+1;u--&&!(e[u].pts<=r););return u=Math.max(u,0),s.splice(u,o-u+1),s}(this.gopBuffer_,e,t,this.timeMapping_),r++,this.sourceUpdater_.removeVideo(e,t,a)),this.inbandTextTracks_)Lc(e,t,this.inbandTextTracks_[s]);Lc(e,t,this.segmentMetadataTrack_),a()}else this.logger_("skipping remove because no source updater or starting media info")},i.monitorBuffer_=function(){this.checkBufferTimeout_&&window.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=window.setTimeout(this.monitorBufferTick_.bind(this),1)},i.monitorBufferTick_=function(){"READY"===this.state&&this.fillBuffer_(),this.checkBufferTimeout_&&window.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=window.setTimeout(this.monitorBufferTick_.bind(this),500)},i.fillBuffer_=function(){if(!this.sourceUpdater_.updating()){var e=this.chooseNextRequest_();e&&("number"==typeof e.timestampOffset&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e))}},i.isEndOfStream_=function(e,t,i){if(void 0===e&&(e=this.mediaIndex),void 0===t&&(t=this.playlist_),void 0===i&&(i=this.partIndex),!t||!this.mediaSource_)return!1;var n="number"==typeof e&&t.segments[e],r=e+1===t.segments.length,a=!n||!n.parts||i+1===n.parts.length;return t.endList&&"open"===this.mediaSource_.readyState&&r&&a},i.chooseNextRequest_=function(){var e=this.buffered_(),t=el(e)||0,i=tl(e,this.currentTime_()),n=!this.hasPlayed_()&&i>=1,r=i>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||n||r)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_());var s={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:Boolean(!this.syncPoint_)};if(s.isSyncRequest)s.mediaIndex=function(e,t,i){t=t||[];for(var n=[],r=0,a=0;ai))return a}return 0===n.length?0:n[n.length-1]}(this.currentTimeline_,a,t);else if(null!==this.mediaIndex){var o=a[this.mediaIndex],u="number"==typeof this.partIndex?this.partIndex:-1;s.startOfSegment=o.end?o.end:t,o.parts&&o.parts[u+1]?(s.mediaIndex=this.mediaIndex,s.partIndex=u+1):s.mediaIndex=this.mediaIndex+1}else{var l=bl.getMediaInfoForTime({experimentalExactManifestTimings:this.experimentalExactManifestTimings,playlist:this.playlist_,currentTime:this.fetchAtBuffer_?t:this.currentTime_(),startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time}),c=l.segmentIndex,d=l.startTime,h=l.partIndex;s.getMediaInfoForTime=this.fetchAtBuffer_?"bufferedEnd "+t:"currentTime "+this.currentTime_(),s.mediaIndex=c,s.startOfSegment=d,s.partIndex=h}var p=a[s.mediaIndex],f=p&&"number"==typeof s.partIndex&&p.parts&&p.parts[s.partIndex];if(!p||"number"==typeof s.partIndex&&!f)return null;if("number"!=typeof s.partIndex&&p.parts&&(s.partIndex=0,f=p.parts[0]),!i&&f&&!f.independent)if(0===s.partIndex){var m=a[s.mediaIndex-1],g=m.parts&&m.parts.length&&m.parts[m.parts.length-1];g&&g.independent&&(s.mediaIndex-=1,s.partIndex=m.parts.length-1,s.independent="previous segment")}else p.parts[s.partIndex-1].independent&&(s.partIndex-=1,s.independent="previous part");var v=this.mediaSource_&&"ended"===this.mediaSource_.readyState;return s.mediaIndex>=a.length-1&&v&&!this.seeking_()?null:this.generateSegmentInfo_(s)},i.generateSegmentInfo_=function(e){var t=e.independent,i=e.playlist,n=e.mediaIndex,r=e.startOfSegment,a=e.isSyncRequest,s=e.partIndex,o=e.forceTimestampOffset,u=e.getMediaInfoForTime,l=i.segments[n],c="number"==typeof s&&l.parts[s],d={requestId:"segment-loader-"+Math.random(),uri:c&&c.resolvedUri||l.resolvedUri,mediaIndex:n,partIndex:c?s:null,isSyncRequest:a,startOfSegment:r,playlist:i,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:l.timeline,duration:c&&c.duration||l.duration,segment:l,part:c,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},h=void 0!==o?o:this.isPendingTimestampOffset_;d.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:l.timeline,currentTimeline:this.currentTimeline_,startOfSegment:r,buffered:this.buffered_(),overrideCheck:h});var p=el(this.sourceUpdater_.audioBuffered());return"number"==typeof p&&(d.audioAppendStart=p-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(d.gopsToAlignWith=function(e,t,i){if(null==t||!e.length)return[];var n,r=Math.ceil((t-i+3)*Gu);for(n=0;nr);n++);return e.slice(n)}(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),d},i.timestampOffsetForSegment_=function(e){return i=(t=e).segmentTimeline,n=t.currentTimeline,r=t.startOfSegment,a=t.buffered,t.overrideCheck||i!==n?i "+s+" for "+e),function(e,t,i){if(!e[i]){t.trigger({type:"usage",name:"vhs-608"}),t.trigger({type:"usage",name:"hls-608"});var n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);var r=t.textTracks().getTrackById(n);if(r)e[i]=r;else{var a=i,s=i,o=!1,u=(t.options_.vhs&&t.options_.vhs.captionServices||{})[n];u&&(a=u.label,s=u.language,o=u.default),e[i]=t.addRemoteTextTrack({kind:"captions",id:n,default:o,label:a,language:s},!1).track}}}(u,i.vhs_.tech_,e),Lc(a,s,u[e]),function(e){var t=e.inbandTextTracks,i=e.captionArray,n=e.timestampOffset;if(i){var r=window.WebKitDataCue||window.VTTCue;i.forEach(function(e){var i=e.stream;t[i].addCue(new r(e.startTime+n,e.endTime+n,e.text))})}}({captionArray:o,inbandTextTracks:u,timestampOffset:n})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}else this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));else this.logger_("SegmentLoader received no captions from a caption event")},i.handleId3_=function(e,t,i){if(this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId))if(this.pendingSegment_.hasAppendedData_){var n=null===this.sourceUpdater_.videoTimestampOffset()?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();!function(e,t,i){e.metadataTrack_||(e.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,e.metadataTrack_.inBandMetadataTrackDispatchType=t)}(this.inbandTextTracks_,i,this.vhs_.tech_),function(e){var t=e.inbandTextTracks,i=e.metadataArray,n=e.timestampOffset,r=e.videoDuration;if(i){var a=window.WebKitDataCue||window.VTTCue,s=t.metadataTrack_;if(s&&(i.forEach(function(e){var t=e.cueTime+n;!("number"!=typeof t||window.isNaN(t)||t<0)&&t<1/0&&e.frames.forEach(function(e){var i=new a(t,t,e.value||e.url||e.data||"");i.frame=e,i.value=e,function(e){Object.defineProperties(e.frame,{id:{get:function(){return ca.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),e.value.key}},value:{get:function(){return ca.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),e.value.data}},privateData:{get:function(){return ca.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),e.value.data}}})}(i),s.addCue(i)})}),s.cues&&s.cues.length)){for(var o=s.cues,u=[],l=0;l1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Zu(s).join(", ")),o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Zu(o).join(", "));var u=s.length?s.start(0):0,l=s.length?s.end(s.length-1):0,c=o.length?o.start(0):0,d=o.length?o.end(o.length-1):0;if(l-u<=1&&d-c<=1)return this.logger_("On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: "+a.byteLength+", audio buffer: "+Zu(s).join(", ")+", video buffer: "+Zu(o).join(", ")+", "),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),void this.trigger("error");this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:n,type:r,bytes:a}));var h=this.currentTime_()-1;this.logger_("On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to "+h),this.remove(0,h,function(){i.logger_("On QUOTA_EXCEEDED_ERR, retrying append in 1s"),i.waitingOnRemove_=!1,i.quotaExceededErrorRetryTimeout_=window.setTimeout(function(){i.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),i.quotaExceededErrorRetryTimeout_=null,i.processCallQueue_()},1e3)},!0)},i.handleAppendError_=function(e,t){var i=e.segmentInfo,n=e.type,r=e.bytes;t&&(22!==t.code?(this.logger_("Received non QUOTA_EXCEEDED_ERR on append",t),this.error(n+" append of "+r.length+"b failed for segment #"+i.mediaIndex+" in playlist "+i.playlist.id),this.trigger("appenderror")):this.handleQuotaExceededError_({segmentInfo:i,type:n,bytes:r}))},i.appendToSourceBuffer_=function(e){var t,i,n,r=e.segmentInfo,a=e.type,s=e.initSegment,o=e.data,u=e.bytes;if(!u){var l=[o],c=o.byteLength;s&&(l.unshift(s),c+=s.byteLength),n=0,(t={bytes:c,segments:l}).bytes&&(i=new Uint8Array(t.bytes),t.segments.forEach(function(e){i.set(e,n),n+=e.byteLength})),u=i}this.sourceUpdater_.appendBuffer({segmentInfo:r,type:a,bytes:u},this.handleAppendError_.bind(this,{segmentInfo:r,type:a,bytes:u}))},i.handleSegmentTimingInfo_=function(e,t,i){if(this.pendingSegment_&&t===this.pendingSegment_.requestId){var n=this.pendingSegment_.segment,r=e+"TimingInfo";n[r]||(n[r]={}),n[r].transmuxerPrependedSeconds=i.prependedContentDuration||0,n[r].transmuxedPresentationStart=i.start.presentation,n[r].transmuxedDecodeStart=i.start.decode,n[r].transmuxedPresentationEnd=i.end.presentation,n[r].transmuxedDecodeEnd=i.end.decode,n[r].baseMediaDecodeTime=i.baseMediaDecodeTime}},i.appendData_=function(e,t){var i=t.type,n=t.data;if(n&&n.byteLength&&("audio"!==i||!this.audioDisabled_)){var r=this.getInitSegmentAndUpdateState_({type:i,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:r,data:n})}},i.loadSegment_=function(e){var t=this;this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),"number"==typeof e.timestampOffset&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.hasEnoughInfoToLoad_()?this.updateTransmuxerAndRequestSegment_(e):this.loadQueue_.push(function(){var i=m({},e,{forceTimestampOffset:!0});m(e,t.generateSegmentInfo_(i)),t.isPendingTimestampOffset_=!1,t.updateTransmuxerAndRequestSegment_(e)})},i.updateTransmuxerAndRequestSegment_=function(e){var t=this;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}));var i=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=null!==this.mediaIndex,a=e.timeline!==this.currentTimeline_&&e.timeline>0,s=n||r&&a;this.logger_("Requesting "+Oc(e)),i.map&&!i.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=yc({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:i,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:s,endedTimelineFn:function(){t.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:function(i){var n=i.message,r=i.level,a=i.stream;t.logger_(Oc(e)+" logged from transmuxer stream "+a+" as a "+r+": "+n)}})},i.trimBackBuffer_=function(e){var t=function(e,t,i){var n=t-ec.BACK_BUFFER_LENGTH;e.length&&(n=Math.max(n,e.start(0)));var r=t-i;return Math.min(r,n)}(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)},i.createSimplifiedSegmentObj_=function(e){var t=e.segment,i=e.part,n={resolvedUri:i?i.resolvedUri:t.resolvedUri,byterange:i?i.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part},r=e.playlist.segments[e.mediaIndex-1];if(r&&r.timeline===t.timeline&&(r.videoTimingInfo?n.baseStartTime=r.videoTimingInfo.transmuxedDecodeEnd:r.audioTimingInfo&&(n.baseStartTime=r.audioTimingInfo.transmuxedDecodeEnd)),t.key){var a=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);n.key=this.segmentKey(t.key),n.key.iv=a}return t.map&&(n.map=this.initSegmentForMap(t.map)),n},i.saveTransferStats_=function(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)},i.saveBandwidthRelatedStats_=function(e,t){this.pendingSegment_.byteLength=t.bytesReceived,e<1/60?this.logger_("Ignoring segment's bandwidth because its duration of "+e+" is less than the min to record "+1/60):(this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime)},i.handleTimeout_=function(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate")},i.segmentRequestFinished_=function(e,t,i){if(this.callQueue_.length)this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,i));else if(this.saveTransferStats_(t.stats),this.pendingSegment_&&t.requestId===this.pendingSegment_.requestId){if(e){if(this.pendingSegment_=null,this.state="READY",-102===e.code)return;return this.pause(),-101===e.code?void this.handleTimeout_():(this.mediaRequestsErrored+=1,this.error(e),void this.trigger("error"))}var n=this.pendingSegment_;this.saveBandwidthRelatedStats_(n.duration,t.stats),n.endOfAllRequests=t.endOfAllRequests,i.gopInfo&&(this.gopBuffer_=function(e,t,i){if(!t.length)return e;if(i)return t.slice();for(var n=t[0].pts,r=0;r=n);r++);return e.slice(0,r).concat(t)}(this.gopBuffer_,i.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(n)}},i.setTimeMapping_=function(e){var t=this.syncController_.mappingForTimeline(e);null!==t&&(this.timeMapping_=t)},i.updateMediaSecondsLoaded_=function(e){"number"==typeof e.start&&"number"==typeof e.end?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration},i.shouldUpdateTransmuxerTimestampOffset_=function(e){return null!==e&&("main"===this.loaderType_&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset())},i.trueSegmentStart_=function(e){var t=e.currentStart,i=e.playlist,n=e.mediaIndex,r=e.firstVideoFrameTimeForData,a=e.currentVideoTimestampOffset,s=e.useVideoTimingInfo,o=e.videoTimingInfo,u=e.audioTimingInfo;if(void 0!==t)return t;if(!s)return u.start;var l=i.segments[n-1];return 0!==n&&l&&void 0!==l.start&&l.end===r+a?o.start:r},i.waitForAppendsToComplete_=function(e){var t=this.getCurrentMediaInfo_(e);if(!t)return this.error({message:"No starting media returned, likely due to an unsupported media format.",blacklistDuration:1/0}),void this.trigger("error");var i=t.hasAudio,n=t.hasVideo,r=t.isMuxed,a="main"===this.loaderType_&&n,s=!this.audioDisabled_&&i&&!r;if(e.waitingOnAppends=0,!e.hasAppendedData_)return e.timingInfo||"number"!=typeof e.timestampOffset||(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),void this.checkAppendsDone_(e);a&&e.waitingOnAppends++,s&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),s&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))},i.checkAppendsDone_=function(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,0===e.waitingOnAppends&&this.handleAppendsDone_())},i.checkForIllegalMediaSwitch=function(e){var t=function(e,t,i){return"main"===e&&t&&i?i.hasAudio||i.hasVideo?t.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!t.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null:"Neither audio nor video found in segment.":null}(this.loaderType_,this.getCurrentMediaInfo_(),e);return!!t&&(this.error({message:t,blacklistDuration:1/0}),this.trigger("error"),!0)},i.updateSourceBufferTimestampOffset_=function(e){if(null!==e.timestampOffset&&"number"==typeof e.timingInfo.start&&!e.changedTimestampOffset&&"main"===this.loaderType_){var 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")}},i.getSegmentStartTimeForTimestampOffsetCalculation_=function(e){var t=e.videoTimingInfo,i=e.audioTimingInfo,n=e.timingInfo;return this.useDtsForTimestampOffset_?t&&"number"==typeof t.transmuxedDecodeStart?t.transmuxedDecodeStart:i&&"number"==typeof i.transmuxedDecodeStart?i.transmuxedDecodeStart:n.start:n.start},i.updateTimingInfoEnd_=function(e){e.timingInfo=e.timingInfo||{};var t=this.getMediaInfo_(),i="main"===this.loaderType_&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;i&&(e.timingInfo.end="number"==typeof i.end?i.end:i.start+e.duration)},i.handleAppendsDone_=function(){if(this.pendingSegment_&&this.trigger("appendsdone"),!this.pendingSegment_)return this.state="READY",void(this.paused()||this.monitorBuffer_());var e=this.pendingSegment_;this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:"main"===this.loaderType_});var t=function(e,t){if("hls"!==t)return null;var i,n,r=(i={audioTimingInfo:e.audioTimingInfo,videoTimingInfo:e.videoTimingInfo},n=0,["video","audio"].forEach(function(e){var t=i[e+"TimingInfo"];if(t){var r,a=t.start,s=t.end;"bigint"==typeof a||"bigint"==typeof s?r=window.BigInt(s)-window.BigInt(a):"number"==typeof a&&"number"==typeof s&&(r=s-a),void 0!==r&&r>n&&(n=r)}}),"bigint"==typeof n&&n3*e.playlist.targetDuration,a=n&&n.end&&this.currentTime_()-n.end>3*e.playlist.partTargetDuration;if(r||a)return this.logger_("bad "+(r?"segment":"part")+" "+Oc(e)),void this.resetEverything();null!==this.mediaIndex&&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_()}else this.logger_("Throwing away un-appended sync request "+Oc(e))},i.recordThroughput_=function(e){if(e.duration<1/60)this.logger_("Ignoring segment's throughput because its duration of "+e.duration+" is less than the min to record "+1/60);else{var t=this.throughput.rate,i=Date.now()-e.endOfAllRequests+1,n=Math.floor(e.byteLength/i*8*1e3);this.throughput.rate+=(n-t)/++this.throughput.count}},i.addSegmentMetadataCue_=function(e){if(this.segmentMetadataTrack_){var t=e.segment,i=t.start,n=t.end;if(Dc(i)&&Dc(n)){Lc(i,n,this.segmentMetadataTrack_);var r=window.WebKitDataCue||window.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:i,end:n},s=new r(i,n,JSON.stringify(a));s.value=a,this.segmentMetadataTrack_.addCue(s)}}},t}(ca.EventTarget);function Bc(){}var Fc,jc=function(e){return"string"!=typeof e?e:e.replace(/./,function(e){return e.toUpperCase()})},Hc=["video","audio"],qc=function(e,t){var i=t[e+"Buffer"];return i&&i.updating||t.queuePending[e]},Vc=function e(t,i){if(0!==i.queue.length){var n=0,r=i.queue[n];if("mediaSource"!==r.type){if("mediaSource"!==t&&i.ready()&&"closed"!==i.mediaSource.readyState&&!qc(t,i)){if(r.type!==t){if(null===(n=function(e,t){for(var i=0;i=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},i.stopForError=function(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")},i.segmentRequestFinished_=function(e,t,i){var n=this;if(this.subtitlesTrack_){if(this.saveTransferStats_(t.stats),!this.pendingSegment_)return this.state="READY",void(this.mediaRequestsAborted+=1);if(e)return-101===e.code&&this.handleTimeout_(),-102===e.code?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,void this.stopForError(e);var r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");var a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,"function"!=typeof window.WebVTT&&this.subtitlesTrack_&&this.subtitlesTrack_.tech_){var s,o=function(){n.subtitlesTrack_.tech_.off("vttjsloaded",s),n.stopForError({message:"Error loading vtt.js"})};return s=function(){n.subtitlesTrack_.tech_.off("vttjserror",o),n.segmentRequestFinished_(e,t,i)},this.state="WAITING_ON_VTTJS",this.subtitlesTrack_.tech_.one("vttjsloaded",s),void this.subtitlesTrack_.tech_.one("vttjserror",o)}a.requested=!0;try{this.parseVTTCues_(r)}catch(e){return void this.stopForError({message:e.message})}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)return this.trigger("syncinfoupdate"),this.pendingSegment_=null,void(this.state="READY");r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(function(e){n.subtitlesTrack_.addCue(n.featuresNativeTextTracks_?new window.VTTCue(e.startTime,e.endTime,e.text):e)}),function(e){var t=e.cues;if(t)for(var i=0;i1&&n.push(t[a]);n.length&&n.forEach(function(t){return e.removeCue(t)})}}(this.subtitlesTrack_),this.handleAppendsDone_()}else this.state="READY"},i.handleData_=function(){},i.updateTimingInfoEnd_=function(){},i.parseVTTCues_=function(e){var t,i=!1;"function"==typeof window.TextDecoder?t=new window.TextDecoder("utf8"):(t=window.WebVTT.StringDecoder(),i=!0);var n=new window.WebVTT.Parser(window,window.vttjs,t);if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},n.oncue=e.cues.push.bind(e.cues),n.ontimestampmap=function(t){e.timestampmap=t},n.onparsingerror=function(e){ca.log.warn("Error encountered when parsing cues: "+e.message)},e.segment.map){var r=e.segment.map.bytes;i&&(r=Jc(r)),n.parse(r)}var a=e.bytes;i&&(a=Jc(a)),n.parse(a),n.flush()},i.updateTimeMapping_=function(e,t,i){var n=e.segment;if(t)if(e.cues.length){var r=e.timestampmap,a=r.MPEGTS/Gu-r.LOCAL+t.mapping;if(e.cues.forEach(function(e){e.startTime+=a,e.endTime+=a}),!i.syncInfo){var s=e.cues[0].startTime,o=e.cues[e.cues.length-1].startTime;i.syncInfo={mediaSequence:i.mediaSequence+e.mediaIndex,time:Math.min(s,o-n.duration)}}}else n.empty=!0},t}(Uc),td=function(e,t){for(var i=e.cues,n=0;n=r.adStartTime&&t<=r.adEndTime)return r}return null},id=[{name:"VOD",run:function(e,t,i,n,r){return i!==1/0?{time:0,segmentIndex:0,partIndex:null}:null}},{name:"ProgramDateTime",run:function(e,t,i,n,r){if(!Object.keys(e.timelineToDatetimeMappings).length)return null;var a=null,s=null,o=rl(t);r=r||0;for(var u=0;u=h)&&(s=h,a={time:d,segmentIndex:l.segmentIndex,partIndex:l.partIndex})}}return a}},{name:"Discontinuity",run:function(e,t,i,n,r){var a=null;if(r=r||0,t.discontinuityStarts&&t.discontinuityStarts.length)for(var s=null,o=0;o=d)&&(s=d,a={time:c.time,segmentIndex:u,partIndex:null})}}return a}},{name:"Playlist",run:function(e,t,i,n,r){return t.syncInfo?{time:t.syncInfo.time,segmentIndex:t.syncInfo.mediaSequence-t.mediaSequence,partIndex:null}:null}}],nd=function(e){function t(t){var i;return(i=e.call(this)||this).timelines=[],i.discontinuities=[],i.timelineToDatetimeMappings={},i.logger_=Ku("SyncController"),i}bt(t,e);var i=t.prototype;return i.getSyncPoint=function(e,t,i,n){var r=this.runStrategies_(e,t,i,n);return r.length?this.selectSyncPoint_(r,{key:"time",value:n}):null},i.getExpiredTime=function(e,t){if(!e||!e.segments)return null;var i=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!i.length)return null;var n=this.selectSyncPoint_(i,{key:"segmentIndex",value:0});return n.segmentIndex>0&&(n.time*=-1),Math.abs(n.time+cl({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:n.segmentIndex,endIndex:0}))},i.runStrategies_=function(e,t,i,n){for(var r=[],a=0;a86400)ca.log.warn("Not saving expired segment info. Media sequence gap "+i+" is too large.");else for(var n=i-1;n>=0;n--){var r=e.segments[n];if(r&&void 0!==r.start){t.syncInfo={mediaSequence:e.mediaSequence+n,time:r.start},this.logger_("playlist refresh sync: [time:"+t.syncInfo.time+", mediaSequence: "+t.syncInfo.mediaSequence+"]"),this.trigger("syncinfoupdate");break}}},i.setDateTimeMappingForStart=function(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){var t=e.segments[0],i=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-i}},i.saveSegmentTimingInfo=function(e){var t=e.segmentInfo,i=e.shouldSaveTimelineMapping,n=this.calculateSegmentTimeMapping_(t,t.timingInfo,i),r=t.segment;n&&(this.saveDiscontinuitySyncInfo_(t),t.playlist.syncInfo||(t.playlist.syncInfo={mediaSequence:t.playlist.mediaSequence+t.mediaIndex,time:r.start}));var a=r.dateTimeObject;r.discontinuity&&i&&a&&(this.timelineToDatetimeMappings[r.timeline]=-a.getTime()/1e3)},i.timestampOffsetForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].time},i.mappingForTimeline=function(e){return void 0===this.timelines[e]?null:this.timelines[e].mapping},i.calculateSegmentTimeMapping_=function(e,t,i){var n,r,a=e.segment,s=e.part,o=this.timelines[e.timeline];if("number"==typeof e.timestampOffset)o={time:e.startOfSegment,mapping:e.startOfSegment-t.start},i&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_("time mapping for timeline "+e.timeline+": [time: "+o.time+"] [mapping: "+o.mapping+"]")),n=e.startOfSegment,r=t.end+o.mapping;else{if(!o)return!1;n=t.start+o.mapping,r=t.end+o.mapping}return s&&(s.start=n,s.end=r),(!a.start||no){var u;u=s<0?i.start-cl({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:r}):i.end+cl({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:r}),this.discontinuities[a]={time:u,accuracy:o}}}},i.dispose=function(){this.trigger("dispose"),this.off()},t}(ca.EventTarget),rd=function(e){function t(){var t;return(t=e.call(this)||this).pendingTimelineChanges_={},t.lastTimelineChanges_={},t}bt(t,e);var i=t.prototype;return i.clearPendingTimelineChange=function(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")},i.pendingTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"==typeof i&&"number"==typeof n&&(this.pendingTimelineChanges_[t]={type:t,from:i,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[t]},i.lastTimelineChange=function(e){var t=e.type,i=e.from,n=e.to;return"number"==typeof i&&"number"==typeof n&&(this.lastTimelineChanges_[t]={type:t,from:i,to:n},delete this.pendingTimelineChanges_[t],this.trigger("timelinechange")),this.lastTimelineChanges_[t]},i.dispose=function(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()},t}(ca.EventTarget),ad=ic(nc(rc(function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t,i){return e(i={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&i.path)}},i.exports),i.exports}var i=t(function(e){function t(e,t){for(var i=0;i-1},t.trigger=function(e){var t=this.listeners[e];if(t)if(2===arguments.length)for(var i=t.length,n=0;n>7))^e]=e;for(t=i=0;!d[t];t^=n||1,i=f[i]||1)for(a=(a=i^i<<1^i<<2^i<<3^i<<4)>>8^255&a^99,d[t]=a,h[a]=t,o=16843009*p[r=p[n=p[t]]]^65537*r^257*n^16843008*t,s=257*p[a]^16843008*a,e=0;e<4;e++)l[e][t]=s=s<<24^s>>>8,c[e][a]=o=o<<24^o>>>8;for(e=0;e<5;e++)l[e]=l[e].slice(0),c[e]=c[e].slice(0);return u},o=null,u=function(){function e(e){var t,i,n;o||(o=s()),this._tables=[[o[0][0].slice(),o[0][1].slice(),o[0][2].slice(),o[0][3].slice(),o[0][4].slice()],[o[1][0].slice(),o[1][1].slice(),o[1][2].slice(),o[1][3].slice(),o[1][4].slice()]];var r=this._tables[0][4],a=this._tables[1],u=e.length,l=1;if(4!==u&&6!==u&&8!==u)throw new Error("Invalid aes key size");var c=e.slice(0),d=[];for(this._key=[c,d],t=u;t<4*u+28;t++)n=c[t-1],(t%u==0||8===u&&t%u==4)&&(n=r[n>>>24]<<24^r[n>>16&255]<<16^r[n>>8&255]<<8^r[255&n],t%u==0&&(n=n<<8^n>>>24^l<<24,l=l<<1^283*(l>>7))),c[t]=c[t-u]^n;for(i=0;t;i++,t--)n=c[3&i?t:t-4],d[i]=t<=4||i<4?n:a[0][r[n>>>24]]^a[1][r[n>>16&255]]^a[2][r[n>>8&255]]^a[3][r[255&n]]}return e.prototype.decrypt=function(e,t,i,n,r,a){var s,o,u,l,c=this._key[1],d=e^c[0],h=n^c[1],p=i^c[2],f=t^c[3],m=c.length/4-2,g=4,v=this._tables[1],y=v[0],_=v[1],b=v[2],T=v[3],w=v[4];for(l=0;l>>24]^_[h>>16&255]^b[p>>8&255]^T[255&f]^c[g],o=y[h>>>24]^_[p>>16&255]^b[f>>8&255]^T[255&d]^c[g+1],u=y[p>>>24]^_[f>>16&255]^b[d>>8&255]^T[255&h]^c[g+2],f=y[f>>>24]^_[d>>16&255]^b[h>>8&255]^T[255&p]^c[g+3],g+=4,d=s,h=o,p=u;for(l=0;l<4;l++)r[(3&-l)+a]=w[d>>>24]<<24^w[h>>16&255]<<16^w[p>>8&255]<<8^w[255&f]^c[g++],s=d,d=h,h=p,p=f,f=s},e}(),l=function(e){function t(){var t;return(t=e.call(this,a)||this).jobs=[],t.delay=1,t.timeout_=null,t}r(t,e);var i=t.prototype;return i.processJob_=function(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null},i.push=function(e){this.jobs.push(e),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))},t}(a),c=function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24},d=function(){function e(t,i,n,r){var a=e.STEP,s=new Int32Array(t.buffer),o=new Uint8Array(t.byteLength),u=0;for(this.asyncStream_=new l,this.asyncStream_.push(this.decryptChunk_(s.subarray(u,u+a),i,n,o)),u=a;u>2),m=new u(Array.prototype.slice.call(t)),g=new Uint8Array(e.byteLength),v=new Int32Array(g.buffer);for(n=i[0],r=i[1],a=i[2],s=i[3],p=0;p=0&&(t="main-desc"),t},od=function(e,t){e.abort(),e.pause(),t&&t.activePlaylistLoader&&(t.activePlaylistLoader.pause(),t.activePlaylistLoader=null)},ud=function(e,t){t.activePlaylistLoader=e,e.load()},ld={AUDIO:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e],r=t.blacklistCurrentPlaylist;od(i,n);var a=n.activeTrack(),s=n.activeGroup(),o=(s.filter(function(e){return e.default})[0]||s[0]).id,u=n.tracks[o];if(a!==u){for(var l in ca.log.warn("Problem encountered loading the alternate audio track.Switching back to default."),n.tracks)n.tracks[l].enabled=n.tracks[l]===u;n.onTrackChanged()}else r({message:"Problem encountered loading the default audio track."})}},SUBTITLES:function(e,t){return function(){var i=t.segmentLoaders[e],n=t.mediaTypes[e];ca.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track."),od(i,n);var r=n.activeTrack();r&&(r.mode="disabled"),n.onTrackChanged()}}},cd={AUDIO:function(e,t,i){if(t){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),n.paused()||a.load()}),t.on("error",ld[e](e,i))}},SUBTITLES:function(e,t,i){var n=i.tech,r=i.requestOptions,a=i.segmentLoaders[e],s=i.mediaTypes[e];t.on("loadedmetadata",function(){var e=t.media();a.playlist(e,r),a.track(s.activeTrack()),(!n.paused()||e.endList&&"none"!==n.preload())&&a.load()}),t.on("loadedplaylist",function(){a.playlist(t.media(),r),n.paused()||a.load()}),t.on("error",ld[e](e,i))}},dd={AUDIO:function(e,t){var i=t.vhs,n=t.sourceType,r=t.segmentLoaders[e],a=t.requestOptions,s=t.master.mediaGroups,o=t.mediaTypes[e],u=o.groups,l=o.tracks,c=o.logger_,d=t.masterPlaylistLoader,h=_l(d.master);for(var p in s[e]&&0!==Object.keys(s[e]).length||(s[e]={main:{default:{default:!0}}},h&&(s[e].main.default.playlists=d.master.playlists)),s[e])for(var f in u[p]||(u[p]=[]),s[e][p]){var m=s[e][p][f],g=void 0;if(h?(c("AUDIO group '"+p+"' label '"+f+"' is a master playlist"),m.isMasterPlaylist=!0,g=null):g="vhs-json"===n&&m.playlists?new Rl(m.playlists[0],i,a):m.resolvedUri?new Rl(m.resolvedUri,i,a):m.playlists&&"dash"===n?new Zl(m.playlists[0],i,a,d):null,m=ca.mergeOptions({id:f,playlistLoader:g},m),cd[e](e,m.playlistLoader,t),u[p].push(m),void 0===l[f]){var v=new ca.AudioTrack({id:f,kind:sd(m),enabled:!1,language:m.language,default:m.default,label:f});l[f]=v}}r.on("error",ld[e](e,t))},SUBTITLES:function(e,t){var i=t.tech,n=t.vhs,r=t.sourceType,a=t.segmentLoaders[e],s=t.requestOptions,o=t.master.mediaGroups,u=t.mediaTypes[e],l=u.groups,c=u.tracks,d=t.masterPlaylistLoader;for(var h in o[e])for(var p in l[h]||(l[h]=[]),o[e][h])if(!o[e][h][p].forced){var f=o[e][h][p],m=void 0;if("hls"===r)m=new Rl(f.resolvedUri,n,s);else if("dash"===r){if(!f.playlists.filter(function(e){return e.excludeUntil!==1/0}).length)return;m=new Zl(f.playlists[0],n,s,d)}else"vhs-json"===r&&(m=new Rl(f.playlists?f.playlists[0]:f.resolvedUri,n,s));if(f=ca.mergeOptions({id:p,playlistLoader:m},f),cd[e](e,f.playlistLoader,t),l[h].push(f),void 0===c[p]){var g=i.addRemoteTextTrack({id:p,kind:"subtitles",default:f.default&&f.autoselect,language:f.language,label:p},!1).track;c[p]=g}}a.on("error",ld[e](e,t))},"CLOSED-CAPTIONS":function(e,t){var i=t.tech,n=t.master.mediaGroups,r=t.mediaTypes[e],a=r.groups,s=r.tracks;for(var o in n[e])for(var u in a[o]||(a[o]=[]),n[e][o]){var l=n[e][o][u];if(/^(?:CC|SERVICE)/.test(l.instreamId)){var c=i.options_.vhs&&i.options_.vhs.captionServices||{},d={label:u,language:l.language,instreamId:l.instreamId,default:l.default&&l.autoselect};if(c[d.instreamId]&&(d=ca.mergeOptions(d,c[d.instreamId])),void 0===d.default&&delete d.default,a[o].push(ca.mergeOptions({id:u},l)),void 0===s[u]){var h=i.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;s[u]=h}}}}},hd=function e(t,i){for(var n=0;n "+a+" from "+t),this.tech_.trigger({type:"usage",name:"vhs-rendition-change-"+t})),this.masterPlaylistLoader_.media(e,i)},i.startABRTimer_=function(){var e=this;this.stopABRTimer_(),this.abrTimer_=window.setInterval(function(){return e.checkABR_()},250)},i.stopABRTimer_=function(){this.tech_.scrubbing&&this.tech_.scrubbing()||(window.clearInterval(this.abrTimer_),this.abrTimer_=null)},i.getAudioTrackPlaylists_=function(){var e=this.master(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;var i,n=e.mediaGroups.AUDIO,r=Object.keys(n);if(Object.keys(this.mediaTypes_.AUDIO.groups).length)i=this.mediaTypes_.AUDIO.activeTrack();else{var a=n.main||r.length&&n[r[0]];for(var s in a)if(a[s].default){i={label:s};break}}if(!i)return t;var o=[];for(var u in n)if(n[u][i.label]){var l=n[u][i.label];if(l.playlists&&l.playlists.length)o.push.apply(o,l.playlists);else if(l.uri)o.push(l);else if(e.playlists.length)for(var c=0;c1&&_l(t.master))for(var u=0;u1&&(this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.tech_.trigger({type:"usage",name:"hls-alternate-audio"})),this.useCueTags_&&(this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"}),this.tech_.trigger({type:"usage",name:"hls-playlist-cue-tags"}))},i.shouldSwitchToMedia_=function(e){var t=this.masterPlaylistLoader_.media()||this.masterPlaylistLoader_.pendingMedia_,i=this.tech_.currentTime(),n=this.bufferLowWaterLine(),r=this.bufferHighWaterLine();return function(e){var t=e.currentPlaylist,i=e.buffered,n=e.currentTime,r=e.nextPlaylist,a=e.bufferLowWaterLine,s=e.bufferHighWaterLine,o=e.duration,u=e.experimentalBufferBasedABR,l=e.log;if(!r)return ca.log.warn("We received no playlist to switch to. Please check your stream."),!1;var c="allowing switch "+(t&&t.id||"null")+" -> "+r.id;if(!t)return l(c+" as current playlist is not set"),!0;if(r.id===t.id)return!1;var d=Boolean(Qu(i,n).length);if(!t.endList)return d||"number"!=typeof t.partTargetDuration?(l(c+" as current playlist is live"),!0):(l("not "+c+" as current playlist is live llhls, but currentTime isn't in buffered."),!1);var h=tl(i,n),p=u?ec.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:ec.MAX_BUFFER_LOW_WATER_LINE;if(om)&&h>=a){var v=c+" as forwardBuffer >= bufferLowWaterLine ("+h+" >= "+a+")";return u&&(v+=" and next bandwidth > current bandwidth ("+f+" > "+m+")"),l(v),!0}return l("not "+c+" as no switching criteria met"),!1}({buffered:this.tech_.buffered(),currentTime:i,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:n,bufferHighWaterLine:r,duration:this.duration(),experimentalBufferBasedABR:this.experimentalBufferBasedABR,log:this.logger_})},i.setupSegmentLoaderListeners_=function(){var e=this;this.experimentalBufferBasedABR||(this.mainSegmentLoader_.on("bandwidthupdate",function(){var t=e.selectPlaylist();e.shouldSwitchToMedia_(t)&&e.switchMedia_(t,"bandwidthupdate"),e.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("progress",function(){e.trigger("progress")})),this.mainSegmentLoader_.on("error",function(){e.blacklistCurrentPlaylist(e.mainSegmentLoader_.error())}),this.mainSegmentLoader_.on("appenderror",function(){e.error=e.mainSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",function(){e.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"}),e.tech_.trigger({type:"usage",name:"hls-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",function(){e.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",function(){e.error=e.audioSegmentLoader_.error_,e.trigger("error")}),this.mainSegmentLoader_.on("ended",function(){e.logger_("main segment loader ended"),e.onEndOfStream()}),this.mainSegmentLoader_.on("earlyabort",function(t){e.experimentalBufferBasedABR||(e.delegateLoaders_("all",["abort"]),e.blacklistCurrentPlaylist({message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},120))});var t=function(){if(!e.sourceUpdater_.hasCreatedSourceBuffers())return e.tryToCreateSourceBuffers_();var t=e.getCodecsOrExclude_();t&&e.sourceUpdater_.addOrChangeSourceBuffers(t)};this.mainSegmentLoader_.on("trackinfo",t),this.audioSegmentLoader_.on("trackinfo",t),this.mainSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",function(){e.triggeredFmp4Usage||(e.tech_.trigger({type:"usage",name:"vhs-fmp4"}),e.tech_.trigger({type:"usage",name:"hls-fmp4"}),e.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",function(){e.logger_("audioSegmentLoader ended"),e.onEndOfStream()})},i.mediaSecondsLoaded_=function(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)},i.load=function(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()},i.smoothQualityChange_=function(e){void 0===e&&(e=this.selectPlaylist()),this.fastQualityChange_(e)},i.fastQualityChange_=function(e){var t=this;void 0===e&&(e=this.selectPlaylist()),e!==this.masterPlaylistLoader_.media()?(this.switchMedia_(e,"fast-quality"),this.mainSegmentLoader_.resetEverything(function(){ca.browser.IE_VERSION||ca.browser.IS_EDGE?t.tech_.setCurrentTime(t.tech_.currentTime()+.04):t.tech_.setCurrentTime(t.tech_.currentTime())})):this.logger_("skipping fastQualityChange because new media is same as old")},i.play=function(){if(!this.setupFirstPlay()){this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();var e=this.tech_.seekable();return this.tech_.duration()===1/0&&this.tech_.currentTime()this.maxPlaylistRetries?1/0:Date.now()+1e3*t,i.excludeUntil=n,e.reason&&(i.lastExcludeReason_=e.reason),this.tech_.trigger("blacklistplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-blacklisted"}),this.tech_.trigger({type:"usage",name:"hls-rendition-blacklisted"});var u=this.selectPlaylist();if(!u)return this.error="Playback cannot continue. No available working or supported playlists.",void this.trigger("error");var l=e.internal?this.logger_:ca.log.warn,c=e.message?" "+e.message:"";l((e.internal?"Internal problem":"Problem")+" encountered with playlist "+i.id+"."+c+" Switching to playlist "+u.id+"."),u.attributes.AUDIO!==i.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),u.attributes.SUBTITLES!==i.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);var d=u.targetDuration/2*1e3||5e3,h="number"==typeof u.lastRequest&&Date.now()-u.lastRequest<=d;return this.switchMedia_(u,"exclude",s||h)},i.pauseLoading=function(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()},i.delegateLoaders_=function(e,t){var i=this,n=[],r="all"===e;(r||"main"===e)&&n.push(this.masterPlaylistLoader_);var a=[];(r||"audio"===e)&&a.push("AUDIO"),(r||"subtitle"===e)&&(a.push("CLOSED-CAPTIONS"),a.push("SUBTITLES")),a.forEach(function(e){var t=i.mediaTypes_[e]&&i.mediaTypes_[e].activePlaylistLoader;t&&n.push(t)}),["main","audio","subtitle"].forEach(function(t){var r=i[t+"SegmentLoader_"];!r||e!==t&&"all"!==e||n.push(r)}),n.forEach(function(e){return t.forEach(function(t){"function"==typeof e[t]&&e[t]()})})},i.setCurrentTime=function(e){var t=Qu(this.tech_.buffered(),e);return this.masterPlaylistLoader_&&this.masterPlaylistLoader_.media()&&this.masterPlaylistLoader_.media().segments?t&&t.length?e:(this.mainSegmentLoader_.resetEverything(),this.mainSegmentLoader_.abort(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.resetEverything(),this.audioSegmentLoader_.abort()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.resetEverything(),this.subtitleSegmentLoader_.abort()),void this.load()):0},i.duration=function(){if(!this.masterPlaylistLoader_)return 0;var e=this.masterPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:Fc.Playlist.duration(e):1/0:0},i.seekable=function(){return this.seekable_},i.onSyncInfoUpdate_=function(){var e;if(this.masterPlaylistLoader_){var t=this.masterPlaylistLoader_.media();if(t){var i=this.syncController_.getExpiredTime(t,this.duration());if(null!==i){var n=this.masterPlaylistLoader_.master,r=Fc.Playlist.seekable(t,i,Fc.Playlist.liveEdgeDelay(n,t));if(0!==r.length){if(this.mediaTypes_.AUDIO.activePlaylistLoader){if(t=this.mediaTypes_.AUDIO.activePlaylistLoader.media(),null===(i=this.syncController_.getExpiredTime(t,this.duration())))return;if(0===(e=Fc.Playlist.seekable(t,i,Fc.Playlist.liveEdgeDelay(n,t))).length)return}var a,s;this.seekable_&&this.seekable_.length&&(a=this.seekable_.end(0),s=this.seekable_.start(0)),e?e.start(0)>r.end(0)||r.start(0)>e.end(0)?this.seekable_=r:this.seekable_=ca.createTimeRanges([[e.start(0)>r.start(0)?e.start(0):r.start(0),e.end(0)0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}},i.dispose=function(){var e=this;this.trigger("dispose"),this.decrypter_.terminate(),this.masterPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(function(t){var i=e.mediaTypes_[t].groups;for(var n in i)i[n].forEach(function(e){e.playlistLoader&&e.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()},i.master=function(){return this.masterPlaylistLoader_.master},i.media=function(){return this.masterPlaylistLoader_.media()||this.initialMedia_},i.areMediaTypesKnown_=function(){var e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),i=!e||!!this.audioSegmentLoader_.getCurrentMediaInfo_();return!(!t||!i)},i.getCodecsOrExclude_=function(){var e=this,t={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}};t.video=t.main;var i=Sc(this.master(),this.media()),n={},r=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(t.main.hasVideo&&(n.video=i.video||t.main.videoCodec||"avc1.4d400d"),t.main.isMuxed&&(n.video+=","+(i.audio||t.main.audioCodec||"mp4a.40.2")),(t.main.hasAudio&&!t.main.isMuxed||t.audio.hasAudio||r)&&(n.audio=i.audio||t.main.audioCodec||t.audio.audioCodec||"mp4a.40.2",t.audio.isFmp4=t.main.hasAudio&&!t.main.isMuxed?t.main.isFmp4:t.audio.isFmp4),n.audio||n.video){var a,s={};if(["video","audio"].forEach(function(e){if(n.hasOwnProperty(e)&&(r=t[e].isFmp4,o=n[e],!(r?La(o):Da(o)))){var i=t[e].isFmp4?"browser":"muxer";s[i]=s[i]||[],s[i].push(n[e]),"audio"===e&&(a=i)}var r,o}),r&&a&&this.media().attributes.AUDIO){var o=this.media().attributes.AUDIO;this.master().playlists.forEach(function(t){(t.attributes&&t.attributes.AUDIO)===o&&t!==e.media()&&(t.excludeUntil=1/0)}),this.logger_("excluding audio group "+o+" as "+a+' does not support codec(s): "'+n.audio+'"')}if(!Object.keys(s).length){if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){var u=[];if(["video","audio"].forEach(function(t){var i=(xa(e.sourceUpdater_.codecs[t]||"")[0]||{}).type,r=(xa(n[t]||"")[0]||{}).type;i&&r&&i.toLowerCase()!==r.toLowerCase()&&u.push('"'+e.sourceUpdater_.codecs[t]+'" -> "'+n[t]+'"')}),u.length)return void this.blacklistCurrentPlaylist({playlist:this.media(),message:"Codec switching not supported: "+u.join(", ")+".",blacklistDuration:1/0,internal:!0})}return n}var l=Object.keys(s).reduce(function(e,t){return e&&(e+=", "),e+(t+' does not support codec(s): "')+s[t].join(",")+'"'},"")+".";this.blacklistCurrentPlaylist({playlist:this.media(),internal:!0,message:l,blacklistDuration:1/0})}else this.blacklistCurrentPlaylist({playlist:this.media(),message:"Could not determine codecs for playlist.",blacklistDuration:1/0})},i.tryToCreateSourceBuffers_=function(){if("open"===this.mediaSource.readyState&&!this.sourceUpdater_.hasCreatedSourceBuffers()&&this.areMediaTypesKnown_()){var e=this.getCodecsOrExclude_();if(e){this.sourceUpdater_.createSourceBuffers(e);var t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}}},i.excludeUnsupportedVariants_=function(){var e=this,t=this.master().playlists,i=[];Object.keys(t).forEach(function(n){var r=t[n];if(-1===i.indexOf(r.id)){i.push(r.id);var a=Sc(e.master,r),s=[];!a.audio||Da(a.audio)||La(a.audio)||s.push("audio codec "+a.audio),!a.video||Da(a.video)||La(a.video)||s.push("video codec "+a.video),a.text&&"stpp.ttml.im1t"===a.text&&s.push("text codec "+a.text),s.length&&(r.excludeUntil=1/0,e.logger_("excluding "+r.id+" for unsupported: "+s.join(", ")))}})},i.excludeIncompatibleVariants_=function(e){var t=this,i=[],n=this.master().playlists,r=Tc(xa(e)),a=wc(r),s=r.video&&xa(r.video)[0]||null,o=r.audio&&xa(r.audio)[0]||null;Object.keys(n).forEach(function(e){var r=n[e];if(-1===i.indexOf(r.id)&&r.excludeUntil!==1/0){i.push(r.id);var u=[],l=Sc(t.masterPlaylistLoader_.master,r),c=wc(l);if(l.audio||l.video){if(c!==a&&u.push('codec count "'+c+'" !== "'+a+'"'),!t.sourceUpdater_.canChangeType()){var d=l.video&&xa(l.video)[0]||null,h=l.audio&&xa(l.audio)[0]||null;d&&s&&d.type.toLowerCase()!==s.type.toLowerCase()&&u.push('video codec "'+d.type+'" !== "'+s.type+'"'),h&&o&&h.type.toLowerCase()!==o.type.toLowerCase()&&u.push('audio codec "'+h.type+'" !== "'+o.type+'"')}u.length&&(r.excludeUntil=1/0,t.logger_("blacklisting "+r.id+": "+u.join(" && ")))}}})},i.updateAdCues_=function(e){var t=0,i=this.seekable();i.length&&(t=i.start(0)),function(e,t,i){if(void 0===i&&(i=0),e.segments)for(var n,r=i,a=0;a0&&this.logger_("resetting possible stalled download count for "+e+" loader"),this[e+"StalledDownloads_"]=0,this[e+"Buffered_"]=t.buffered_()},t.checkSegmentDownloads_=function(e){var t=this.masterPlaylistController_,i=t[e+"SegmentLoader_"],n=i.buffered_(),r=function(e,t){if(e===t)return!1;if(!e&&t||!t&&e)return!0;if(e.length!==t.length)return!0;for(var i=0;i=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)}},t.cancelTimer_=function(){this.consecutiveUpdates=0,this.timer_&&(this.logger_("cancelTimer_"),clearTimeout(this.timer_)),this.timer_=null},t.fixesBadSeeks_=function(){if(!this.tech_.seeking())return!1;var e,t=this.seekable(),i=this.tech_.currentTime();if(this.afterSeekableWindow_(t,i,this.media(),this.allowSeeksWithinUnsafeLiveWindow)&&(e=t.end(t.length-1)),this.beforeSeekableWindow_(t,i)){var n=t.start(0);e=n+(n===t.end(0)?0:.1)}if(void 0!==e)return this.logger_("Trying to seek outside of seekable at time "+i+" with seekable range "+Ju(t)+". Seeking to "+e+"."),this.tech_.setCurrentTime(e),!0;for(var r=this.masterPlaylistController_.sourceUpdater_,a=this.tech_.buffered(),s=r.audioBuffer?r.audioBuffered():null,o=r.videoBuffer?r.videoBuffered():null,u=this.media(),l=u.partTargetDuration?u.partTargetDuration:2*(u.targetDuration-1/30),c=[s,o],d=0;d "+i.end(0)+"]. Attempting to resume playback by seeking to the current time."),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"}),void this.tech_.trigger({type:"usage",name:"hls-unknown-waiting"})):void 0}},t.techWaiting_=function(){var e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking()||null!==this.timer_)return!0;if(this.beforeSeekableWindow_(e,t)){var i=e.end(e.length-1);return this.logger_("Fell out of live window at time "+t+". Seeking to live point (seekable end) "+i),this.cancelTimer_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),this.tech_.trigger({type:"usage",name:"hls-live-resync"}),!0}var n=this.tech_.vhs.masterPlaylistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.cancelTimer_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),this.tech_.trigger({type:"usage",name:"hls-video-underflow"}),!0;var a=$u(r,t);if(a.length>0){var s=a.start(0)-t;return this.logger_("Stopped at "+t+", setting timer for "+s+", seeking to "+a.start(0)),this.cancelTimer_(),this.timer_=setTimeout(this.skipTheGap_.bind(this),1e3*s,t),!0}return!1},t.afterSeekableWindow_=function(e,t,i,n){if(void 0===n&&(n=!1),!e.length)return!1;var r=e.end(e.length-1)+.1;return!i.endList&&n&&(r=e.end(e.length-1)+3*i.targetDuration),t>r},t.beforeSeekableWindow_=function(e,t){return!!(e.length&&e.start(0)>0&&t2)return{start:r,end:a}}return null},e}(),bd={errorInterval:30,getSource:function(e){return e(this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource())}},Td={PlaylistLoader:Rl,Playlist:bl,utils:Xl,STANDARD_PLAYLIST_SELECTOR:Pc,INITIAL_PLAYLIST_SELECTOR:function(){var e=this,t=this.playlists.master.playlists.filter(bl.isEnabled);return Ic(t,function(e,t){return xc(e,t)}),t.filter(function(t){return!!Sc(e.playlists.master,t).video})[0]||null},lastBandwidthSelector:Pc,movingAverageBandwidthSelector:function(e){var t=-1,i=-1;if(e<0||e>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){var n=this.useDevicePixelRatio&&window.devicePixelRatio||1;return t<0&&(t=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(t=e*this.systemBandwidth+(1-e)*t,i=this.systemBandwidth),Ac(this.playlists.master,t,parseInt(Cc(this.tech_.el(),"width"),10)*n,parseInt(Cc(this.tech_.el(),"height"),10)*n,this.limitRenditionByPlayerDimensions,this.masterPlaylistController_)}},comparePlaylistBandwidth:xc,comparePlaylistResolution:function(e,t){var i,n;return e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(i=e.attributes.RESOLUTION.width),i=i||window.Number.MAX_VALUE,t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(n=t.attributes.RESOLUTION.width),i===(n=n||window.Number.MAX_VALUE)&&e.attributes.BANDWIDTH&&t.attributes.BANDWIDTH?e.attributes.BANDWIDTH-t.attributes.BANDWIDTH:i-n},xhr:Bl()};Object.keys(ec).forEach(function(e){Object.defineProperty(Td,e,{get:function(){return ca.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),ec[e]},set:function(t){ca.log.warn("using Vhs."+e+" is UNSAFE be sure you know what you are doing"),"number"!=typeof t||t<0?ca.log.warn("value of Vhs."+e+" must be greater than or equal to 0"):ec[e]=t}})});var wd=function(e,t){for(var i=t.media(),n=-1,r=0;r=1e7&&e>=1e7?Math.max(e,i):i}return e},set:function(e){this.masterPlaylistController_.mainSegmentLoader_.bandwidth=e,this.masterPlaylistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get:function(){var e,t=1/(this.bandwidth||1);return e=this.throughput>0?1/this.throughput:0,Math.floor(1/(t+e))},set:function(){ca.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:function(){return i.bandwidth||0},enumerable:!0},mediaRequests:{get:function(){return i.masterPlaylistController_.mediaRequests_()||0},enumerable:!0},mediaRequestsAborted:{get:function(){return i.masterPlaylistController_.mediaRequestsAborted_()||0},enumerable:!0},mediaRequestsTimedout:{get:function(){return i.masterPlaylistController_.mediaRequestsTimedout_()||0},enumerable:!0},mediaRequestsErrored:{get:function(){return i.masterPlaylistController_.mediaRequestsErrored_()||0},enumerable:!0},mediaTransferDuration:{get:function(){return i.masterPlaylistController_.mediaTransferDuration_()||0},enumerable:!0},mediaBytesTransferred:{get:function(){return i.masterPlaylistController_.mediaBytesTransferred_()||0},enumerable:!0},mediaSecondsLoaded:{get:function(){return i.masterPlaylistController_.mediaSecondsLoaded_()||0},enumerable:!0},mediaAppends:{get:function(){return i.masterPlaylistController_.mediaAppends_()||0},enumerable:!0},mainAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.mainAppendsToLoadedData_()||0},enumerable:!0},audioAppendsToLoadedData:{get:function(){return i.masterPlaylistController_.audioAppendsToLoadedData_()||0},enumerable:!0},appendsToLoadedData:{get:function(){return i.masterPlaylistController_.appendsToLoadedData_()||0},enumerable:!0},timeToLoadedData:{get:function(){return i.masterPlaylistController_.timeToLoadedData_()||0},enumerable:!0},buffered:{get:function(){return Zu(i.tech_.buffered())},enumerable:!0},currentTime:{get:function(){return i.tech_.currentTime()},enumerable:!0},currentSource:{get:function(){return i.tech_.currentSource_},enumerable:!0},currentTech:{get:function(){return i.tech_.name_},enumerable:!0},duration:{get:function(){return i.tech_.duration()},enumerable:!0},master:{get:function(){return i.playlists.master},enumerable:!0},playerDimensions:{get:function(){return i.tech_.currentDimensions()},enumerable:!0},seekable:{get:function(){return Zu(i.tech_.seekable())},enumerable:!0},timestamp:{get:function(){return Date.now()},enumerable:!0},videoPlaybackQuality:{get:function(){return i.tech_.getVideoPlaybackQuality()},enumerable:!0}}),this.tech_.one("canplay",this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),this.tech_.on("bandwidthupdate",function(){i.options_.useBandwidthFromLocalStorage&&function(e){if(!window.localStorage)return!1;var t=Sd();t=t?ca.mergeOptions(t,e):e;try{window.localStorage.setItem("videojs-vhs",JSON.stringify(t))}catch(e){return!1}}({bandwidth:i.bandwidth,throughput:Math.round(i.throughput)})}),this.masterPlaylistController_.on("selectedinitialmedia",function(){var e;(e=i).representations=function(){var t=e.masterPlaylistController_.master(),i=_l(t)?e.masterPlaylistController_.getAudioTrackPlaylists_():t.playlists;return i?i.filter(function(e){return!pl(e)}).map(function(t,i){return new function(e,t,i){var n,r,a,s=e.masterPlaylistController_,o=s[(e.options_.smoothQualityChange?"smooth":"fast")+"QualityChange_"].bind(s);if(t.attributes){var u=t.attributes.RESOLUTION;this.width=u&&u.width,this.height=u&&u.height,this.bandwidth=t.attributes.BANDWIDTH}this.codecs=Sc(s.master(),t),this.playlist=t,this.id=i,this.enabled=(n=e.playlists,r=t.id,a=o,function(e){var t=n.master.playlists[r],i=pl(t),s=fl(t);return void 0===e?s:(e?delete t.disabled:t.disabled=!0,e===s||i||(a(),e?n.trigger("renditionenabled"):n.trigger("renditiondisabled")),e)})}(e,t,t.id)}):[]}}),this.masterPlaylistController_.sourceUpdater_.on("createdsourcebuffers",function(){i.setupEme_()}),this.on(this.masterPlaylistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.masterPlaylistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=window.URL.createObjectURL(this.masterPlaylistController_.mediaSource),this.tech_.src(this.mediaSourceUrl_))}},i.createKeySessions_=function(){var e=this,t=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),function(e){var t=e.player,i=e.sourceKeySystems,n=e.audioMedia,r=e.mainPlaylists;if(!t.eme.initializeMediaKeys)return Promise.resolve();var a=(u=n?r.concat([n]):r,l=Object.keys(i),u.reduce(function(e,t){if(!t.contentProtection)return e;var i=l.reduce(function(e,i){var n=t.contentProtection[i];return n&&n.pssh&&(e[i]={pssh:n.pssh}),e},{});return Object.keys(i).length&&e.push(i),e},[])),s=[],o=[];var u,l;return a.forEach(function(e){o.push(new Promise(function(e,i){t.tech_.one("keysessioncreated",e)})),s.push(new Promise(function(i,n){t.eme.initializeMediaKeys({keySystems:e},function(e){e?n(e):i()})}))}),Promise.race([Promise.all(s),Promise.race(o)])}({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:t&&t.media(),mainPlaylists:this.playlists.master.playlists}).then(function(){e.logger_("created EME key session"),e.masterPlaylistController_.sourceUpdater_.initializedEme()}).catch(function(t){e.logger_("error while creating EME key session",t),e.player_.error({message:"Failed to initialize media keys for EME",code:3})})},i.handleWaitingForKey_=function(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()},i.setupEme_=function(){var e,t,i,n=this,r=this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,a=(e={player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:r&&r.media()},t=e.player,!(!(i=function(e,t,i){if(!e)return e;var n={};t&&t.attributes&&t.attributes.CODECS&&(n=Tc(xa(t.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);var r=Pa(n.video),a=Pa(n.audio),s={};for(var o in e)s[o]={},a&&(s[o].audioContentType=a),r&&(s[o].videoContentType=r),t.contentProtection&&t.contentProtection[o]&&t.contentProtection[o].pssh&&(s[o].pssh=t.contentProtection[o].pssh),"string"==typeof e[o]&&(s[o].url=e[o]);return ca.mergeOptions(e,s)}(e.sourceKeySystems,e.media,e.audioMedia))||(t.currentSource().keySystems=i,i&&!t.eme&&(ca.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),1))));this.player_.tech_.on("keystatuschange",function(e){if("output-restricted"===e.status){var t=n.masterPlaylistController_.master();if(t&&t.playlists){var i,r=[];t.playlists.forEach(function(e){e&&e.attributes&&e.attributes.RESOLUTION&&e.attributes.RESOLUTION.height>=720&&(!e.excludeUntil||e.excludeUntil<1/0)&&(e.excludeUntil=1/0,r.push(e))}),r.length&&((i=ca.log).warn.apply(i,['DRM keystatus changed to "output-restricted." Removing the following HD playlists that will most likely fail to play and clearing the buffer. This may be due to HDCP restrictions on the stream and the capabilities of the current device.'].concat(r)),n.masterPlaylistController_.fastQualityChange_())}}}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),11!==ca.browser.IE_VERSION&&a?this.createKeySessions_():this.masterPlaylistController_.sourceUpdater_.initializedEme()},i.setupQualityLevels_=function(){var e=this,t=ca.players[this.tech_.options_.playerId];t&&t.qualityLevels&&!this.qualityLevels_&&(this.qualityLevels_=t.qualityLevels(),this.masterPlaylistController_.on("selectedinitialmedia",function(){var t,i;t=e.qualityLevels_,(i=e).representations().forEach(function(e){t.addQualityLevel(e)}),wd(t,i.playlists)}),this.playlists.on("mediachange",function(){wd(e.qualityLevels_,e.playlists)}))},t.version=function(){return{"@videojs/http-streaming":"2.14.3","mux.js":"6.0.1","mpd-parser":"0.21.1","m3u8-parser":"4.7.1","aes-decrypter":"3.1.3"}},i.version=function(){return this.constructor.version()},i.canChangeType=function(){return $c.canChangeType()},i.play=function(){this.masterPlaylistController_.play()},i.setCurrentTime=function(e){this.masterPlaylistController_.setCurrentTime(e)},i.duration=function(){return this.masterPlaylistController_.duration()},i.seekable=function(){return this.masterPlaylistController_.seekable()},i.dispose=function(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.masterPlaylistController_&&this.masterPlaylistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.player_&&(delete this.player_.vhs,delete this.player_.dash,delete this.player_.hls),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.tech_&&delete this.tech_.hls,this.mediaSourceUrl_&&window.URL.revokeObjectURL&&(window.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),e.prototype.dispose.call(this)},i.convertToProgramTime=function(e,t){return function(e){var t=e.playlist,i=e.time,n=void 0===i?void 0:i,r=e.callback;if(!r)throw new Error("getProgramTime: callback must be provided");if(!t||void 0===n)return r({message:"getProgramTime: playlist and time must be provided"});var a=function(e,t){if(!t||!t.segments||0===t.segments.length)return null;for(var i,n=0,r=0;rn){if(e>n+.25*a.duration)return null;i=a}return{segment:i,estimatedStart:i.videoTimingInfo?i.videoTimingInfo.transmuxedPresentationStart:n-i.duration,type:i.videoTimingInfo?"accurate":"estimate"}}(n,t);if(!a)return r({message:"valid programTime was not found"});if("estimate"===a.type)return r({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:a.estimatedStart});var s={mediaSeconds:n},o=function(e,t){if(!t.dateTimeObject)return null;var i=t.videoTimingInfo.transmuxerPrependedSeconds,n=e-(t.videoTimingInfo.transmuxedPresentationStart+i);return new Date(t.dateTimeObject.getTime()+1e3*n)}(n,a.segment);return o&&(s.programDateTime=o.toISOString()),r(null,s)}({playlist:this.masterPlaylistController_.media(),time:e,callback:t})},i.seekToProgramTime=function(e,t,i,n){return void 0===i&&(i=!0),void 0===n&&(n=2),function e(t){var i=t.programTime,n=t.playlist,r=t.retryCount,a=void 0===r?2:r,s=t.seekTo,o=t.pauseAfterSeek,u=void 0===o||o,l=t.tech,c=t.callback;if(!c)throw new Error("seekToProgramTime: callback must be provided");if(void 0===i||!n||!s)return c({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!n.endList&&!l.hasStarted_)return c({message:"player must be playing a live stream to start buffering"});if(!function(e){if(!e.segments||0===e.segments.length)return!1;for(var t=0;tnew Date(o.getTime()+1e3*u)?null:(i>o&&(n=s),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:bl.duration(t,t.mediaSequence+t.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})}(i,n);if(!d)return c({message:i+" was not found in the stream"});var h=d.segment,p=function(e,t){var i,n;try{i=new Date(e),n=new Date(t)}catch(e){}var r=i.getTime();return(n.getTime()-r)/1e3}(h.dateTimeObject,i);if("estimate"===d.type)return 0===a?c({message:i+" is not buffered yet. Try again"}):(s(d.estimatedStart+p),void l.one("seeked",function(){e({programTime:i,playlist:n,retryCount:a-1,seekTo:s,pauseAfterSeek:u,tech:l,callback:c})}));var f=h.start+p;l.one("seeked",function(){return c(null,l.currentTime())}),u&&l.pause(),s(f)}({programTime:e,playlist:this.masterPlaylistController_.media(),retryCount:n,pauseAfterSeek:i,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})},t}(ca.getComponent("Component")),kd={name:"videojs-http-streaming",VERSION:"2.14.3",canHandleSource:function(e,t){void 0===t&&(t={});var i=ca.mergeOptions(ca.options,t);return kd.canPlayType(e.type,i)},handleSource:function(e,t,i){void 0===i&&(i={});var n=ca.mergeOptions(ca.options,i);return t.vhs=new Ed(e,t,n),ca.hasOwnProperty("hls")||Object.defineProperty(t,"hls",{get:function(){return ca.log.warn("player.tech().hls is deprecated. Use player.tech().vhs instead."),t.vhs},configurable:!0}),t.vhs.xhr=Bl(),t.vhs.src(e.src,e.type),t.vhs},canPlayType:function(e,t){void 0===t&&(t={});var i=ca.mergeOptions(ca.options,t),n=i.vhs,r=(n=void 0===n?{}:n).overrideNative,a=void 0===r?!ca.browser.IS_ANY_SAFARI:r,s=i.hls,o=(s=void 0===s?{}:s).overrideNative,u=void 0!==o&&o,l=Ma(e);return l&&(!Td.supportsTypeNatively(l)||u||a)?"maybe":""}};return La("avc1.4d400d,mp4a.40.2")&&ca.getTech("Html5").registerSourceHandler(kd,0),ca.VhsHandler=Ed,Object.defineProperty(ca,"HlsHandler",{get:function(){return ca.log.warn("videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead."),Ed},configurable:!0}),ca.VhsSourceHandler=kd,Object.defineProperty(ca,"HlsSourceHandler",{get:function(){return ca.log.warn("videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead."),kd},configurable:!0}),ca.Vhs=Td,Object.defineProperty(ca,"Hls",{get:function(){return ca.log.warn("videojs.Hls is deprecated. Use videojs.Vhs instead."),Td},configurable:!0}),ca.use||(ca.registerComponent("Hls",Td),ca.registerComponent("Vhs",Td)),ca.options.vhs=ca.options.vhs||{},ca.options.hls=ca.options.hls||{},ca.getPlugin&&ca.getPlugin("reloadSourceOnError")||(ca.registerPlugin||ca.plugin)("reloadSourceOnError",function(e){!function e(t,i){var n=0,r=0,a=ca.mergeOptions(bd,i);t.ready(function(){t.trigger({type:"usage",name:"vhs-error-reload-initialized"}),t.trigger({type:"usage",name:"hls-error-reload-initialized"})});var s=function(){r&&t.currentTime(r)},o=function(e){null!=e&&(r=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(e),t.trigger({type:"usage",name:"vhs-error-reload"}),t.trigger({type:"usage",name:"hls-error-reload"}),t.play())},u=function(){return Date.now()-n<1e3*a.errorInterval?(t.trigger({type:"usage",name:"vhs-error-reload-canceled"}),void t.trigger({type:"usage",name:"hls-error-reload-canceled"})):a.getSource&&"function"==typeof a.getSource?(n=Date.now(),a.getSource.call(t,o)):void ca.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!")},l=function e(){t.off("loadedmetadata",s),t.off("error",u),t.off("dispose",e)};t.on("error",u),t.on("dispose",l),t.reloadSourceOnError=function(i){l(),e(t,i)}}(this,e)}),ca}); +var cdn=cdnurl,rel_videos=[{thumb:cdn+"/media/surf_thumb.jpg",url:"//www.nuevodevel.com/nuevo/demo/surf",title:"Surfing is beatiful",duration:"04:12"},{thumb:cdn+"/media/big_buck_thumb.jpg",url:"//www.nuevodevel.com/nuevo/demo/big_buck",title:"Big Buck Bunny",duration:"02:17"},{thumb:cdn+"/media/animals_thumb.jpg",url:"//www.nuevodevel.com/nuevo/demo/animals",title:"Animals are amazing!",duration:"03:03"},{thumb:cdn+"/media/freeride_thumb.jpg",url:"//www.nuevodevel.com/nuevo/demo/freeride",title:"Free Ride",duration:"05:50"},{thumb:cdn+"/media/australia_thumb.jpg",url:"//www.nuevodevel.com/nuevo/demo/australia",title:"Welcome to Australia",duration:"02:29"},{thumb:cdn+"/media/fit_thumb.jpg",url:"//www.nuevodevel.com/nuevo/demo/fit",title:"Fitness keeps you younger and healthy",duration:"01:33"},{thumb:cdn+"/media/alaska_thumb.jpg",url:"//www.nuevodevel.com/nuevo/demo/alaska",title:"The beauty of Alasca",duration:"02:54"},{thumb:cdn+"/media/cymaticjazz_thumb.jpg",url:"//www.nuevodevel.com/nuevo/demo/cymaticjazz",title:"LG Cymatic Jazz Demo",duration:"02:35"},{thumb:cdn+"/media/serenity_thumb.jpg",url:"//www.nuevodevel.com/nuevo/demo/serenity",title:"Serenity Movie Trailer",duration:"02:13"},{thumb:cdn+"/media/newyorkcity_thumb.jpg",url:"//www.nuevodevel.com/nuevo/demo/newyorkcity",title:"New York City 4K",duration:"01:07"},{thumb:cdn+"/media/thailand_thumb.jpg",url:"//www.nuevodevel.com/nuevo/demo/thailand",title:"Thailand Retrospective",duration:"02:06"},{thumb:cdn+"/media/people_thumb.jpg",url:"//www.nuevodevel.com/nuevo/demo/people",title:"People activity grows",duration:"01:13"}]; +!function(e,t){if("undefined"!=typeof window&&window.videojs)t(window.videojs);else if("function"==typeof define&&define.amd)define("nuevo",["video.js"],function(e){return t(e.default||e)});else if("undefined"!=typeof module&&module.exports){var i=require("video.js");module.exports=t(i.default||i)}}(0,function(e){var t=e.browser;function i(e){return e}if(t.IS_ANDROID){try{e.options.html5.vhs.overrideNative=!0}catch(e){i(e)}try{e.options.html5.hls.overrideNative=!0}catch(e){i(e)}e.options.html5.nativeAudioTracks=!1,e.options.html5.nativeTextTracks=!1}function n(t){var i="progressControl",n="playToggle",s="liveDisplay",a="seekToLive",o="currentTimeDisplay",r="timeDivider",l="durationDisplay",d="customControlSpacer",v="volumePanel",u="chaptersButton",c="descriptionsButton",f="subsCapsButton",h="audioTrackButton",p="pictureInPictureToggle",m="fullscreenToggle",g=null;"treso"===t?g={children:[i,n,s,a,o,l,v,d,u,c,f,h,p,m]}:"chrome"===t?g={children:[n,s,a,o,r,l,d,i,v,u,c,f,h,p,m]}:"party"===t?g={children:[n,s,a,i,o,r,l,d,v,u,c,f,h,p,m]}:"roundal"===t||"pinko"===t?g={volumePanel:{inline:!1,vertical:!0},children:[n,s,a,o,i,r,l,d,v,u,c,f,h,p,m]}:"shaka"===t?g={volumePanel:{inline:!1,vertical:!0},children:[n,s,a,o,r,l,i,d,v,u,c,f,h,p,m]}:"flow"===t?g={children:[n,s,a,o,r,l,i,d,v,u,c,f,h,p,m]}:"jwlike"===t?g={volumePanel:{inline:!1,vertical:!0},children:[i,n,s,a,v,o,r,l,d,u,c,f,h,p,m]}:"mockup"===t?g={children:[i,n,v,s,a,o,r,l,d,u,c,f,h,p,m]}:"nuevo"===t&&(g={volumePanel:{inline:!1,vertical:!0},children:[n,s,a,o,r,i,l,d,v,u,c,f,h,p,m]}),null!==g&&(e.options.controlBar=g)}var s=function(e,t){return e.sort(function(e,i){var n=e[t],s=i[t];return ns?1:0})},a=function(e,t){try{return e.querySelector(t)}catch(e){return!1}},o=function(e,t){try{return e.querySelectorAll(t)}catch(e){return!1}},r=function(e,t,i){var n=document.createElement(e);return void 0!==t&&""!==t&&(n.className=t),void 0!==i&&""!==i&&(n.innerHTML=i),n};if(e.options.skin="",e.skin=function(t){if(""===e.options.skin)for(var i in v)v[i]===t&&(n(t),e.options.skin=t)},document.body){var l=r("div"),d=document.body;d.appendChild(l);var v=["nuevo","treso","chrome","flow","jwlike","mockup","party","pinko","roundal","shaka"];for(var u in v)l.className="vjs-"+v[u],13===l.offsetWidth&&(e.options.skin=v[u],n(v[u]));d.removeChild(l)}else e.options.skin="nuevo",n("nuevo");e.skin=function(t){""===e.options.skin&&n(t)},String.prototype.dg13=function(){return this.replace(/[a-zA-Z]/g,function(e){return String.fromCharCode((e<="Z"?90:122)>=(e=e.charCodeAt(0)+13)?e:e-26)})};var c=["yrirqbirha","znwbri","gfbuynpby","1.0.0.721","rupnp","bv.acqp","zbp.avofw","gra.yyrufw","ccn.ofp","kboqanfrqbp"];function f(n,l){var d=e.dom,v=n.el(),u=e.mergeOptions({infoSize:18,zoomMenu:!0,rate:1,pipButton:!0,ccButton:!0,relatedMenu:!0,settingsButton:!0,filtersMenu:!1,downloadButton:!1,rateMenu:!0,hdicon:!0,shareMenu:!0,zoomInfo:!0,chapterMarkers:!0,contextMenu:!0,contextLink:!0,timetooltip:!1,captionsSettings:"undefined",mousedisplay:!0,related:{},logoposition:"LT",logooffsetX:10,logooffsetY:10,logourl:"",url:"",title:"",description:"",embed:"",endAction:"",pubid:"",slideWidth:160,slideHeight:90,slideType:"vertical",limit:0,limitmessage:"Watch full video on",resume:!1,video_id:"",playlistID:"undefined",playlistMaxH:"undefined",playlistUI:!0,playlistShow:!0,playlistAutoHide:!0,playlist:!1,currentSlide:"",infoIcon:"",target:"_blank",buttonRewind:!0,metatitle:"",metasubtitle:"",qualityMenu:!1,captionsSize:1.25,tooltips:!0,singlePlay:!1,rewindforward:10,snapshot:!1,snapshotType:"jpg",snapshotWatermark:"",ghostThumb:!1,minhd:1080,liveReconnect:!1,paused:!1,controlbar:!0,touchRewindForward:!0,touchControls:!0,iosFullscreen:"native",androidLock:!1,playsinline:!0,keepSource:!1,log:!1},l);u.skin=e.options.skin;var c=!1,f=parseInt(u.rewindforward,10);f<1&&(f=10),f>90&&(f=90),u.rewindforward=f;var h=!1,p=Object.defineProperty({},"passive",{get:function(){return h=!0,!0}});function m(e){return e.touches[0].pageX||null}function g(e){"mouse"===e.pointerType&&(c=!0,v.classList.remove("vjs-touch-inactive"),v.classList.remove("vjs-touch-active"),y(!1))}function j(){v.classList.remove("vjs-has-mouse"),y(!0)}function y(e){var t=a(v,".vjs-rewind-control"),i=a(v,".vjs-forward-control"),n=a(v,".vjs-extend-zoom"),s=a(v,".vjs-related"),o=a(v,".vjs-grid"),r=null,l=null;o&&(r=a(o,".vjs-arrow-prev"),l=a(o,".vjs-arrow-next")),e?(v.classList.remove("vjs-has-mouse"),t&&d.addClass(t,"vjs-hidden"),i&&d.addClass(i,"vjs-hidden"),n&&d.addClass(n,"vjs-hidden"),s&&d.addClass(s,"vjs-scroll"),r&&d.addClass(r,"vjs-hidden"),l&&d.addClass(l,"vjs-hidden")):(v.classList.add("vjs-has-mouse"),t&&d.removeClass(t,"vjs-hidden"),i&&d.removeClass(i,"vjs-hidden"),n&&d.removeClass(n,"vjs-hidden"),s&&d.removeClass(s,"vjs-scroll"),r&&d.removeClass(r,"vjs-hidden"),l&&d.removeClass(l,"vjs-hidden"))}window.addEventListener("testPassive",null,p),window.removeEventListener("testPassive",null,p),document.addEventListener("pointermove",g),window.addEventListener("touchstart",j,!!h&&{passive:!1}),n.on("dispose",function(){window.removeEventListener("touchstart",j),document.removeEventListener("pointermove",g)});var b=function(){return!!c||!!matchMedia("(pointer:fine)").matches&&(y(!0),!0)};b(),!1===u.log&&e.log.level("off");var C,w,k,x,T,I=0,_=0,L=0,M=0,E=1;n.shadowSlide=u.ghostThumb;var H=!1,S=!1,B=!1,A=n.$(".vjs-tech");u.playsinline&&A.setAttribute("playsinline","true"),n.autoplay()&&A.setAttribute("preload","true");var N,P,q,z,O,D=[],W=a(v,".vjs-big-play-button"),R=a(v,".vjs-progress-holder"),F=a(v,".vjs-loading-spinner"),U=a(v,".vjs-control-bar"),X=a(v,".vjs-poster");if(!0===e.dispose){if(n.qualities=[],n.qualityIndex=-1,"pseudo"===u.iosFullscreen&&e.browser.IS_IOS&&e.browser.IOS_VERSION>9&&!n.el_.ownerDocument.querySelector(".bc-iframe")&&(n.tech_.el_.setAttribute("playsinline","playsinline"),n.tech_.supportsFullScreen=function(){return!1}),n.on("fullscreenchange",function(){e.browser.IS_ANDROID&&u.androidLock&&"undefined"!=typeof window&&(n.isFullscreen()?window.screen.orientation.lock("landscape-primary"):window.screen.orientation.lock("any"))}),u.touchControls){var V=n.addChild("button",{el:d.createEl("button",{className:"vjs-big-button vjs-b-p-b"},{type:"button",title:n.localize("Pause"),"aria-disabled":"false"})});v.insertBefore(V.el_,W),V.el_.addEventListener("touchend",function(e){e.stopImmediatePropagation(),Ye(),n.paused()?n.play():n.pause()}),W.ontouchend=X.ontouchend=function(){!0!==H&&d.addClass(v,"vjs-touch-inactive")}}if(u.touchRewindForward&&u.touchControls){var Y=n.addChild("button",{el:d.createEl("button",{className:"vjs-big-button vjs-b-r-b"},{type:"button",title:n.localize("Rewind"),"aria-disabled":"false"})});Y.el_.innerHTML=""+u.rewindforward+"",v.insertBefore(Y.el_,W);var $=n.addChild("button",{el:d.createEl("button",{className:"vjs-big-button vjs-b-f-b"},{type:"button",title:n.localize("Forward"),"aria-disabled":"false"})});$.el_.innerHTML=""+u.rewindforward+"",v.insertBefore($.el_,W),$.el_.ontouchend=function(e){e.stopPropagation(),Ye(),n.forward()},Y.el_.ontouchend=function(e){e.stopPropagation(),Ye(),n.rewind()}}var K=n.options_.inactivityTimeout,Q=4e3;if(n.options_.inactivityTouchTimeout&&(Q=n.options_.inactivityTouchTimeout),U.ontouchstart=U.ontouchmove=function(){Ye()},A.ontouchstart=function(e){e.stopImmediatePropagation(),d.hasClass(v,"vjs-user-active")?Ve():(n.options_.inactivityTimeout=Q,d.removeClass(v,"vjs-touch-inactive"),d.addClass(v,"vjs-touch-active"),d.removeClass(v,"vjs-user-inactive"),d.addClass(v,"vjs-user-active"),Ye())},n.setQuality=function(e,t){n.qualities.length&&"boolean"==typeof t&&(n.qualities[e].enabled=t,n.tech_.vhs&&n.tech_.vhs.representations()[e].enabled(t))},!0!==u.controlbar&&d.addClass(v,"vjs-controls-none"),n.video_id=function(){for(var e=n.currentSources(),t=0;t0){var i=t+u.rewindforward;i>e?n.currentTime(e):n.currentTime(i)}n.trigger("forward",{oldTime:t,newTime:i})},n.rewind=function(){if(n.duration()>0){var e=n.currentTime(),t=n.currentTime()-u.rewindforward;t<0&&(t=0),n.currentTime(t),n.trigger("rewind",{oldTime:e,newTime:t})}},n.related=function(){u.settingsButton&&u.related.length>1&&u.relatedMenu&&!0!==n.seeking()&&($e(N,!1),$e(void 0,!1),d.removeClass(a(v,".vjs-menu-settings"),"vjs-lock-showing"),$e(P,!0),st(),n.trigger("related"),n.pause())},n.snapshot=function(){var e=v.querySelector("video"),i=e.videoWidth,n=e.videoHeight,s=n/i,a=document.getElementById("snap");a&&a.parentNode.removeChild(a);var o=document.createElement("canvas");o.id="snap",o.style.position="absolute",o.style.left="-10000px",o.style.top="0",document.body.appendChild(o);var r,l=o.getContext("2d");if((t.IS_ANDROID||t.IS_IPAD||t.IS_IPHONE||t.IS_IPOD)&&i>640&&(n=parseInt(640*s,10),i=640),o.width=i,o.height=n,l.fillRect(0,0,i,n),l.drawImage(e,0,0,i,n),""!==u.snapshotWatermark&&u.snapshotWatermark.length>2){var d=u.snapshotWatermark;l.font=i<641?"16px verdana":"24px verdana";var c=l.measureText(d).width;l.globalAlpha=.5,l.fillStyle="white",l.fillText(d,i-c-10,n-20),l.fillStyle="black",l.fillText(d,i-c-10+2,n-20+2)}var f="snapshot.jpg";r=o.toDataURL("image/jpeg",.9),"png"===u.snapshotType&&(f="snapshot.png",r=o.toDataURL("image/png"));var h=document.createElement("a");h.href=r,h.download=f,document.body.appendChild(h),setTimeout(function(){h.click()},200)},n.on("filters",function(){$e(N,!1),$e(P,!1),Ve()}),n.share=function(){if(u.settingsButton&&u.shareMenu&&!0!==n.seeking()){$e(P,!1),$e(void 0,!1),d.removeClass(a(v,".vjs-menu-settings"),"vjs-lock-showing"),n.trigger("share");var e=u.url||document.location.href,t=u.embed||"N/A";a(v,".embed-code").value=t,a(v,".perma").value=e,$e(N,!0),n.pause()}},!0!==u.contextMenu&&"default"!==u.contextMenu&&v.addEventListener("contextmenu",function(e){e.preventDefault()},!1);var G=a(v,".vjs-custom-control-spacer");G&&(G.innerHTML="");var J=n.addChild("button",{el:d.createEl("button",{className:"vjs-replay-button"},{type:"button",title:n.localize("Replay"),"aria-disabled":"false"})});v.insertBefore(J.el_,W),J.el_.onclick=J.el_.ontouchstart=function(e){e.stopImmediatePropagation(),n.currentTime(0),n.play()};var ee=a(v,".vjs-picture-in-picture-control");!0!==u.pipButton&&(A.disablePictureInPicture=!0);var te=n.controlBar.el().lastChild;(document.pictureInPictureEnabled&&u.pipButton||ee)&&(te=n.controlBar.getChild("pictureInPictureToggle").el_);var ie=n.controlBar.addChild("button",{el:d.createEl("div",{className:"vjs-quality-button vjs-menu-button vjs-control vjs-button vjs-hidden"},{role:"button","aria-haspopup":"true","aria-expanded":"false"})}),ne=n.controlBar.addChild("button",{el:d.createEl("div",{className:"vjs-control vjs-button vjs-cog-menu-button vjs-hidden"})});if(U.insertBefore(ie.el_,te),U.insertBefore(ne.el_,te),O=ne.el_,u.snapshot){var se=n.controlBar.addChild("button",{el:d.createEl("button",{className:"vjs-snap-control vjs-control vjs-button"},{type:"button"})});se.el_.innerHTML=''+n.localize("Snapshot")+"",n.controlBar.el_.insertBefore(se.el_,ne.el_),se.el_.onclick=se.el_.ontouchstart=function(e){e.stopImmediatePropagation(),n.snapshot()}}if(u.controlbar){var ae=d.createEl("div",{className:"vjs-background-bar"});v.insertBefore(ae,U)}q=ie.el_;var oe=''+n.localize("Quality")+'
';if(q.innerHTML=oe,u.buttonForward){u.buttonRewind&&Ke(!0);var re="vjs-forward-control",le=n.controlBar.addChild("button",{el:d.createEl("button",{className:re+" vjs-control vjs-button"},{title:n.localize("Forward"),type:"button","aria-disabled":"false"})});le.el_.innerHTML=''+u.rewindforward+''+n.localize("Forward")+"","party"===u.skin&&u.buttonRewind?n.controlBar.el_.insertBefore(le.el_,a(v,".vjs-rewind-control").nextSibling):n.controlBar.el_.insertBefore(le.el_,n.controlBar.getChild("playToggle").el_.nextSibling),le.el_.onclick=le.el_.ontouchstart=function(){n.forward()}}else u.buttonRewind&&Ke();var de=d.createEl("div",{className:"vjs-vast-label"});de.innerHTML=n.localize("Advertisement");var ve="playToggle";if("party"===u.skin&&(ve="progressControl"),"treso"===u.skin&&(ve="volumePanel"),U.insertBefore(de,n.controlBar.getChild(ve).el_.nextSibling),u.theaterButton){var ue=n.controlBar.addChild("button",{el:d.createEl("div",{className:"vjs-control vjs-button vjs-control-button vjs-mode-control"},{"aria-live":"polite","aria-disabled":"false"})});ue.el_.innerHTML=''+n.localize("Theater mode")+"",U.insertBefore(ue.el_,n.controlBar.getChild("fullscreenToggle").el_);var ce=ue.el_;"large"===u.theaterButton&&d.addClass(ce,"vjs-mode"),ue.el_.onclick=ue.el_.ontouchstart=function(e){e.preventDefault(),e.stopPropagation();var t=ue.el_;d.hasClass(t,"vjs-mode")?(d.removeClass(t,"vjs-mode"),n.trigger("mode","normal")):(d.addClass(t,"vjs-mode"),n.trigger("mode","large"))}}var fe=r("div","vjs-menu-settings"),he=r("div","vjs-menu-div vjs-settings-div");fe.appendChild(he);var pe=r("div","vjs-submenu vjs-settings-home");he.appendChild(pe);var me=r("ul","vjs-menu-content vjs-settings-list");if(pe.appendChild(me),(z=d.createEl("button",{className:"vjs-cog-button vjs-menu-button vjs-button"},{"aria-live":"polite","aria-disabled":"false","aria-expanded":"false"})).innerHTML='HD'+n.localize("Settings")+"",O.appendChild(z),O.appendChild(fe),u.downloadButton){var ge=n.controlBar.addChild("button",{el:e.dom.createEl("button",{className:"vjs-download-control vjs-control vjs-button",title:n.localize("Download")},{type:"button","aria-disabled":"false"})});U.insertBefore(ge.el_,n.controlBar.getChild("fullscreenToggle").el_),ge.el_.innerHTML=''+n.localize("Download")+"",ge.el_.onclick=ge.el_.ontouchstart=function(e){e.stopPropagation();var t=n.video_id();n.trigger("downloadVideo",{source:n.currentSrc(),id:t})}}Ze();for(var je=o(v,".vjs-control"),ye=0;ye0)Ce=setTimeout(function e(){v.offsetWidth===ke&&v.offsetHeight===xe||(ke=v.offsetWidth!==ke,xe=v.offsetHeight,Ge()),Ce=setTimeout(e,500)},500);else try{(T=new ResizeObserver(function(){Ge()})).observe(v)}catch(e){return!1}if(n.on("dispose",function(){if(we>0)clearTimeout(Ce);else try{T.unobserve(v)}catch(e){return!1}if(window.removeEventListener("click",Je),window.removeEventListener("touchstart",et),window.parent)try{window.parent.removeEventListener("click",Je),window.parent.removeEventListener("touchstart",et)}catch(e){i(e)}B=!0}),window.addEventListener("click",Je),window.addEventListener("touchstart",et),window.parent)try{window.parent.addEventListener("click",Je),window.parent.addEventListener("touchstart",et)}catch(e){i(e)}if(R.addEventListener("touchend",function(e){Ve()}),""===u.title&&(u.title=u.metatitle=document.title),""===u.infoText&&(u.infoText=u.metatitle),!u.timetooltip){var Te=a(v,".vjs-play-progress"),Ie=a(Te,".vjs-time-tooltip");Te&&Ie&&d.addClass(Ie,"vjs-abs-hidden")}try{u.mousedisplay||d.addClass(a(v,".vjs-mouse-display"),"vjs-abs-hidden")}catch(e){i(e)}if(u.logocontrolbar){var _e=r("img"),Le=!1;_e.src=u.logocontrolbar,_e.onload=function(){if(this.width+this.height===0&&(Le=!0),!0!==Le){var e=r("div","vjs-logo-bar");if(""!==u.logourl){var t=r("a");t.href=u.logourl,t.target=u.target,u.logotitle&&(t.title=u.logotitle),t.appendChild(_e),e.appendChild(t),e.style.cursor="pointer"}else e.appendChild(_e);U.insertBefore(e,n.controlBar.getChild("fullscreenToggle").el_)}}}if(u.contextMenu&&"default"!==u.contextMenu){var Me=r("div","vjs-context-menu vjs-hidden"),Ee='",Me.innerHTML=Ee,v.appendChild(Me);var He=a(Me,".cplay"),Se=a(Me,".cmute"),Be=a(Me,".cfull");function Ae(){d.addClass(Me,"vjs-hidden"),window.removeEventListener("scroll",Ae),window.removeEventListener("mouseup",Ae)}He.onclick=function(){n.paused()?n.play():n.pause()},Se.onclick=function(){n.muted()?n.muted(!1):n.muted(!0)},Be.onclick=function(){n.isFullscreen()?n.exitFullscreen():n.requestFullscreen()},v.addEventListener("contextmenu",function(e){e.preventDefault(),n.paused()?He.innerHTML="Play":He.innerHTML="Pause",n.muted()?Se.innerHTML="Unmute":Se.innerHTML="Mute",n.isFullscreen()?Be.innerHTML="Exit Fullscreen":Be.innerHTML="Fullscreen",d.removeClass(Me,"vjs-hidden");var t=Me.offsetWidth,s=Me.offsetHeight,a=null,o=null;if(e.clientY&&(a=e.clientY),e.clientX&&(o=e.clientX),null!==a&&null!==o){var r=v.getBoundingClientRect(),l=a-r.top,u=o-r.left;if(l+s>v.offsetHeight&&(l=v.offsetTop+v.offsetHeight-s),u+t>v.offsetWidth&&(u=v.offsetWidth-t),Me.style.top=l+"px",Me.style.left=u+"px",window.addEventListener("scroll",Ae),window.addEventListener("mouseup",Ae),window.parent)try{window.parent.addEventListener("scroll",Ae),window.parent.addEventListener("mouseup",Ae)}catch(e){i(e)}n.on("dispose",function(){if(window.removeEventListener("scroll",Ae),window.removeEventListener("mouseup",Ae),window.parent)try{window.parent.removeEventListener("scroll",Ae),window.parent.removeEventListener("mouseup",Ae)}catch(e){i(e)}})}})}if(u.logo){var Ne=r("img");Ne.src=u.logo;var Pe=r("div","vjs-logo");u.logomin&&(Pe.className="vjs-logo vjs-logo-min"),v.appendChild(Pe),Ne.onload=function(){if(this.width+this.height!==0){var e=u.logooffsetX,t=u.logooffsetY;if("RT"===u.logoposition?(Pe.style.right=e+"px",Pe.style.top=t+"px"):"LB"===u.logoposition?(Pe.style.left=e+"px",Pe.className+=" vjs-logo-bottom"):(Pe.style.left=e+"px",Pe.style.top=t+"px"),""!==u.logourl){var i=r("a");i.href=u.logourl,i.target=u.target,u.logotitle&&(i.title=u.logotitle),i.appendChild(Ne),Pe.appendChild(i)}else Pe.appendChild(Ne)}else v.removeChild(Pe)},Ne.onerror=function(){v.removeChild(Pe)}}if("treso"===u.skin){var qe=a(v,".vjs-current-time"),ze=a(v,".vjs-duration");U.removeChild(qe);var Oe=a(v,".vjs-progress-control");Oe.insertBefore(qe,Oe.childNodes[0]),U.removeChild(ze),Oe.appendChild(ze)}if(n.resetNuevo=function(){var e,s,r=[],l=[];tt(),at(),n.options_.sources.length>0&&(l=r=n.options_.sources);try{a(q,".vjs-menu .vjs-menu-content").innerHTML="",d.addClass(q,"vjs-hidden")}catch(e){i(e)}if(!0!==u.keepSource)for(var c=A;c.firstChild;)c.removeChild(c.firstChild);if(r.length<2)n.src(l);else if(r.length>1){var f=0,h=0,p=[],m=[],g=[],j="",y=0,b=0,C=0,w=0,k=0,x=!1;for(f=0;f=1){u.dash=!1,u.hls=!1;var T="MediaSource"in window,I=!1;for((t.IS_IPHONE||t.IS_IPOD||t.IS_IPAD)&&(I=!0),y=0;y0&&(T||I))return;if(m.length>0&&T)return;if(h<2)return;for(E=(E=g).sort(rt),y=0;yu.minhd-1){var N="HD";S>1079&&u.minhd<1080&&(N="FullHD"),S>2159&&(N="4K"),B=''+N+""}E[y].default?(e=E[y],j+='
  • '+E[y].label+B+"
  • "):j+='
  • '+E[y].label+B+"
  • ",k++}if(k>1){if(M=k,u.qualityMenu){mt();var P=a(v,".vjs-menu-quality .vjs-menu-content");P.innerHTML=P.innerHTML+j,d.removeClass(a(v,".vjs-extend-quality"),"vjs-hidden"),d.removeClass(z,"vjs-hidden")}else a(q,".vjs-menu .vjs-menu-content").innerHTML=j,d.removeClass(q,"vjs-hidden");var O=o(v,".item-quality");for(at(),y=0;y0&&n.currentTime(o),r?n.pause():n.play(),1!==u.rate&&n.setRate(u.rate)};D.onclick=function(e){e.stopImmediatePropagation(),W(e)},Xe(D),D.addEventListener("tap",function(e){W(e)},!1)}nt(),void 0===e&&void 0===s||(void 0!==e&&e!==s?(ot(e.res,e.label),n.src(e),n.load()):void 0!==s&&(ot(s.res,s.label),n.src(s),n.load()))}}},n.on("loadeddata",function(){if(d.hasClass(v,"vjs-ad-playing")||d.hasClass(v,"vjs-dai"))return!1;if(S)S=!1;else{if(u.startTime||n.options_.startTime||n.$(".vjs-tech").getAttribute("startTime")){var e=n.$(".vjs-tech").getAttribute("startTime")||0;u.startTime&&(e=u.startTime),n.options_.startTime&&(e=n.options_.startTime),u.startTime=e,e>5&&e0&&i0){for(l=0;l0&&(mt(),M=n.qualities.length,function(e){var t=null,r=null;try{t=n.dash.mediaPlayer||null}catch(e){i(e)}var l=n.options().html5.hlsjsConfig||null,c=!0;l&&!1===l.smoothQualityChange&&(c=!1),tt(),at();for(var f=[],h=!1,p=0;p0&&g++,C.bitrate>0&&j++;for(var w=0,k=0;k1&&(y=!0)}var x="bitrate";g>j&&(x="height"),f=(f=s(f,x)).reverse(),M=f.length+1;var T="";for(b=0;bu.minhd-1){var L="HD";_>1079&&u.minhd<1080&&(L="FullHD"),_>2159&&(L="4K"),I=''+L+"",lt(_)}var E=f[b].bitrate,H=f[b].height,B=parseInt(E/1e3,10);if(f[b].height>0||f[b].bitrate>0){var A="vjs-menu-item item-quality";y?T+=g===j?'":g>j?'":'":f[b].bitrate>0&&j>g?T+='":T+='"}}if(T+='',a(v,".quality-span").innerHTML="Auto",u.qualityMenu){mt();var N=a(v,".vjs-menu-quality .vjs-menu-content");N.innerHTML=N.innerHTML+T,d.removeClass(a(v,".vjs-extend-quality"),"vjs-hidden"),d.removeClass(z,"vjs-hidden")}else a(q,".vjs-menu .vjs-menu-content").innerHTML=T,d.removeClass(q,"vjs-hidden");var P=o(v,".item-quality");nt(),at(),n.qualities.length>1&&n.on("qualityChange",function(e,i){if(t){var n=i.height,s=i.bitrate;r={height:n,bitrate:s}}var o=a(v,".auto-res");o&&o.className.indexOf("vjs-checked")>-1&&R()});for(var O=0;O0?o.height+"p":parseInt(o.bitrate/1e3,10)+"kbps",i&&(i.innerHTML='Auto'+f+""),u.hdicon&&(h>=u.minhd-1&&(l="HD"),h>2159&&(l="4K"),lt(h))),re=""===l?"vjs-hd-icon vjs-hd-home vjs-hidden":"vjs-hd-icon vjs-hd-home",a(v,".quality-span").innerHTML='Auto'+l+""}function U(e){a(v,".auto-res").innerHTML='Auto';for(var i=parseInt(e.getAttribute("data-height"),10),s=i,r=parseInt(e.getAttribute("data-bitrate"),10),l=n.qualities,f=o(v,".item-quality"),h=0;h0?(g="HD",i>2159&&(g="4K"),j=i>u.minhd-1?''+g+"":''+g+"",y.innerHTML=i+"p"+j):r>0&&(y.innerHTML=parseInt(r/1e3,10)+"kB"),lt(i)}}(n.qualities),n.trigger("mediachange"))}}),u.timetooltip){var De=a(v,".vjs-play-progress"),We=a(De,".vjs-time-tooltip");We&&(We.className="vjs-time-tooltip")}if(u.mousedisplay){var Re=a(v,".vjs-mouse-display");Re&&(Re.className="vjs-mouse-display")}var Fe=a(v,".vjs-info");Fe&&v.removeChild(Fe);var Ue=a(v,".vjs-audio-info");Ue&&v.removeChild(Ue),n.audioInfo=function(){return!(!u.audioInfo||!u.audioInfo.artist&&!u.audioInfo.title)&&u.audioInfo},vt(),ut(),n.options_.sources.length>0&&(n.resetNuevo(!1),ct(),ht()),n.on("ratechange",function(){for(var e=n.playbackRate(),t=v.querySelectorAll(".vjs-speed"),i=0;i0&&(n.trigger("ratechanged",{oldRate:n.playbackRate(),newRate:e}),n.playbackRate(e),u.rate=e)},n.setSource=function(e){n.changeSource(e)},n.changeSource=function(e){if(!d.hasClass(v,"vjs-ad-playing")&&!d.hasClass(v,"vjs-dai")&&!n.adPlaying&&e&&("string"==typeof e&&(e={sources:[{src:e}]}),e.src&&(e={sources:[e]}),e.sources)){var t=1;n.paused()&&(t=2),n.changeSrc(e),2===t?n.pause():(n.load(),n.one("canplay",function(){n.play()}))}},n.changeSrc=function(e){if(!d.hasClass(v,"vjs-ad-playing")&&!d.hasClass(v,"vjs-dai")){u.title="",u.infoTitle=null,u.infoDescription=null,u.description="",u.metatitle="",u.metasubtitle="";for(var t=n.remoteTextTracks(),i=t.length||0;i--;)n.removeRemoteTextTrack(t[i]);var s=n.videoTracks();for(i=s.length-1;i>=0;i--)n.videoTracks().removeTrack(s[i]);var a=n.audioTracks();for(i=a.length-1;i>=0;i--)n.videoTracks().removeTrack(a[i]);if(e&&("string"==typeof e&&(e={sources:[{src:e}]}),e.src&&(e={sources:[e]}),e.sources)){for(u.rate=1,n.setRate(1),u.video_id=void 0,void 0!==e.video_id&&(u.video_id=e.video_id),void 0!==e.audioInfo?u.audioInfo=e.audioInfo:u.audioInfo=null,void 0!==e.slideImage?u.slideImage=e.slideImage:u.slideImage="",void 0!==e.slideWidth&&(u.slideWidth=e.slideWidth),void 0!==e.slideHeight&&(u.slideHeight=e.slideHeight),void 0!==e.thumbnails?u.thumbnails=e.thumbnails:u.thumbnails=null,void 0!==e.title&&(u.metatitle=u.title=e.title),void 0!==e.description&&(u.description=e.infoDescription=e.description),void 0!==e.embed&&(u.embed=e.embed),void 0!==e.metatitle&&(u.metatitle=e.metatitle),void 0!==e.infoTitle&&(u.infoTitle=e.infoTitle),void 0!==e.infoDescription&&(u.infoDescription=e.infoDescription),void 0!==e.infoUrl&&(u.infoUrl=e.infoUrl),void 0!==e.infoIcon&&(u.infoIcon=e.infoIcon),void 0!==e.subtitle&&(u.metasubtitle=e.subtitle),void 0!==e.metasubtitle&&(u.metasubtitle=e.metasubtitle),void 0!==e.url&&(u.url=e.url),i=0;i0&&(n.captions=t)}n.src(e.sources),setTimeout(function(){var t=X;void 0!==e.poster&&n.poster(e.poster),d.removeClass(t,"vjs-hidden"),u.firstplay=!0},200),n.trigger("newSource"),n.resetNuevo(!0,e),ut(),vt(),setTimeout(function(){if(void 0!==e.track&&(e.tracks=[],e.tracks.push(e.track)),void 0!==e.tracks)for(var t=e.tracks,i=0;i-1&&n.one("canplay",function(){n.play()})},n.removeFromPlaylist=function(e){if(u.playlist&&u.playlistUI){var t=a(v,".vjs-vlist"),i=t.childNodes[e];t.removeChild(i);for(var n=0;n0?o-1:0),o>1?s.insertBefore(n,s.childNodes[o-2].nextSibling):s.appendChild(n)}},n.on("playlistready",function(){u.playlistRepeat&&n.playlist.repeat(!0),function(){var e=n.playlist.list();if(!(e.length<2)){if(n.on("error",function(){n.playlist.currentIndex()===n.playlist.lastIndex()&&!0!==u.playlistRepeat?F.style.display="none":n.playlist.next(!0)}),!0!==u.playlist){if(u.playlist=!0,u.playlistNavigation){var t=r("div","vjs-playlist-nav vjs-nav-prev",'
    '),i=r("div","vjs-playlist-nav vjs-nav-next",'
    ');v.appendChild(t),v.appendChild(i),i.onclick=function(e){n.adPlaying||e.target.className.indexOf("disabled")<0&&n.playlist.next()},t.onclick=function(e){n.adPlaying||e.target.className.indexOf("disabled")<0&&n.playlist.previous()}}if(u.playlistUI){var s=null,l=null;if("undefined"!==u.playlistID&&(s=document.getElementById(u.playlistID)),l=r("div",s?"vjs-vplaylist vjs-vplaylist-horizontal":"vjs-vplaylist vjs-vplaylist-show"),!s){var c=d.createEl("div",{className:"vjs-playlist-button"},{title:"Playlist"});v.appendChild(c),c.onclick=function(){d.addClass(l,"vjs-vplaylist-show"),u.playlistFirst&&d.addClass(l,"vjs-vplaylist-first")},l.style.visibility="hidden"}var f=r("div","vjs-head","PLAYLIST"),h=r("div","vjs-back","");s&&(h.innerHTML=''),f.appendChild(h),l.appendChild(f),h.onclick=function(){s?p.offsetHeight>0?(h.innerHTML='',d.addClass(p,"vjs-list-min")):(h.innerHTML='',d.removeClass(p,"vjs-list-min")):d.removeClass(l,"vjs-vplaylist-show")},s?s.appendChild(l):v.appendChild(l);var p=r("div","vjs-vlist");if(s&&(d.addClass(p,"vjs-list-max"),u.playlistMaxH)){var m=parseInt(u.playlistMaxH,10);p.style.height=0===m?"auto":m+"px"}for(l.appendChild(p),e=n.playlist.list(),ye=0;ye1&&(n=1),s.style.width=(100*n).toFixed(2)+"%"}function f(t){if(t.preventDefault(),t.stopPropagation(),e.holderdown=!1,d.removeClass(v,"vjs-scrubbing"),window.document.removeEventListener("mousemove",c),window.document.removeEventListener("mouseup",f),window.document.removeEventListener("touchmove",c),window.document.removeEventListener("touchend",f),window.parent)try{window.parent.document.removeEventListener("touchend",f),window.parent.document.removeEventListener("mouseup",f)}catch(t){i(t)}n.trigger("progressup")}R.addEventListener("mousedown",l,!1),R.addEventListener("touchstart",l,!!h&&{passive:!1}),n.on("timeupdate",function(){if(d.hasClass(v,"vjs-ad-playing")||d.hasClass(v,"vjs-dai"))return!1;var e=n.video_id(),t=n.currentTime(),s=n.duration();if(0!==s&&s!==1/0&&null!==e&&u.resume&&void 0!==e){t=parseFloat(t);var a=String("vjs_resume-"+e);if(t>5&&ts-10)try{localStorage.removeItem(a)}catch(e){i(e)}}}),n.on("volumechange",function(){n.volume()>0&&yt("volume",n.volume())}),n.on("seeked",function(){if(d.hasClass(v,"vjs-ad-playing")||d.hasClass(v,"vjs-dai"))return!1}),n.on("ended",function(){if(!(d.hasClass(v,"vjs-ad-playing")||d.hasClass(v,"vjs-dai")||d.hasClass(v,"vjs-up-next"))){var e=!0;if(u.playlist&&(e=!1,n.playlist.currentIndex()===n.playlist.lastIndex()&&!0!==n.playlist.repeat&&(e=!0)),e){var t=n.video_id();if(u.resume&&null!=t)try{localStorage.removeItem(String("vjs_resume-"+t))}catch(e){i(e)}""!==u.endAction?u.settingsButton&&"share"===u.endAction&&u.shareMenu?n.share():u.settingsButton&&"related"===u.endAction&&u.relatedMenu&&P&&n.related():d.removeClass(J.el_,"vjs-hidden")}}}),n.on("playing",function(){if(d.hasClass(v,"vjs-ad-playing")||d.hasClass(v,"vjs-dai"))return!1;P&&$e(P,!1),N&&$e(N,!1),d.removeClass(F,"vjs-hidden"),d.removeClass(F,"vjs-abs-hidden"),(n.remoteTextTracks?n.remoteTextTracks():[]).length<1&&t.IS_IOS&&d.addClass(a(v,".vjs-subs-caps-button"),"vjs-hidden")}),n.on("userinactive",function(){!0!==n.paused()&&Qe("")}),n.reconnect=function(){var e=n.currentSource();n.poster(""),n.src(e),n.play()},n.on("canplay",function(){if(!0!==H&&n.$(".vjs-tech").autoplay){var e=n.play();void 0!==e&&e.then(function(){}).catch(function(){n.muted(!0),n.play();var e=r("button","vjs-auto-mute");e.type="button",e.title="Unmute",e.setAttribute("aria-disabled","false"),v.appendChild(e),e.onclick=e.ontouchend=function(t){t.preventDefault(),n.muted(!1),v.removeChild(e)},n.on("volumechange",function(){!0!==n.muted()&&v.removeChild(e)})})}}),n.on("play",function(){var t=a(v,".vjs-picture-in-picture-control");if(!0!==u.pipButton&&t&&t.parentNode.removeChild(t),d.hasClass(v,"vjs-ad-playing")||d.hasClass(v,"vjs-dai"))return!1;var s=d.hasClass(v,"vjs-live");if(n.paused()&&s&&u.liveReconnect&&n.reconnect(),u.singlePlay){var l=o(document,"video");if(l.length>1)for(var c=0;c0&&e.holderdown&&(h=f=R.offsetWidth);var j=Number(f)/Number(s),y=j*n.duration();x.innerHTML=function(e,t){e=e<0?0:e;let i=Math.floor(e%60),n=Math.floor(e/60%60),s=Math.floor(e/3600);const a=Math.floor(t/60%60),o=Math.floor(t/3600);return(isNaN(e)||e===1/0)&&(s=n=i="-"),(s=s>0||o>0?s+":":"")+(n=((s||a>=10)&&n<10?"0"+n:n)+":")+(i<10?"0"+i:i)}(y,n.duration());var b=parseInt(j*L,10);w.style.width=u.slideWidth+"px",w.style.height=u.slideHeight+"px";var T=0;"horizontal"===u.slideType?(T=b*u.slideWidth,k.style.left="-"+T+"px",p=T,g=0):(T=b*u.slideHeight,k.style.top="-"+T+"px",p=0,g=T);var I=u.slideWidth/2,_=R.offsetWidth-u.slideWidth/2;if(h>_&&(h=_),h0&&Number(u.limit)>0&&(u.limit=Number(u.startTime)+Number(u.limit)),n.on("timeupdate",function(){var e,t=n.currentTime();if(tu.limit&&(n.pause(),!0!==g)){u.limiturl||(u.limiturl=u.url),g=!0;var i=r("div","vjs-limit-overlay"),s=r("a","vjs-limit");if(s.href=u.limiturl,s.target=u.target,s.style.textDecoration="none",i.appendChild(s),u.limitimage){var a=r("img");a.src=u.limitimage,a.onload=function(){s.innerHTML=''}}else(e=r("span")).innerHTML=u.limitmessage+""+u.limiturl+"",s.appendChild(e);v.appendChild(i)}})}localStorage&&localStorage.volume&&!0!==n.muted()&&localStorage.volume>0&&n.volume(localStorage.volume);var j=!1;if(u.settingsButton&&(u.relatedMenu||u.shareMenu||u.rateMenu||u.zoomMenu||u.filtersMenu)?(j=!0,u.menus=!0):(u.menus=!1,d.addClass(a(v,".vjs-cog-menu-button"),"vjs-abs-hidden")),j){var y="",T=!1,M=!1;if(u.shareMenu&&(y+='
  • '+n.localize("Share")+'
  • '),u.relatedMenu&&u.related.length>1&&(y+=''),u.zoomMenu&&(y=y+'
  • '+n.localize("Zoom")+'100%
  • ',M=r("div","vjs-submenu vjs-zoom-menu vjs-hidden",'
    '+n.localize("Zoom")+'
    '+n.localize("Reset")+"
    ")),u.rateMenu){y=y+'
  • '+n.localize("Speed")+""+n.localize("Normal")+"
  • ",T=r("div","vjs-submenu vjs-menu-speed vjs-hidden");var S='
    • '+n.localize("Speed")+"
    • ",B=[.5,1,1.25,1.5,2];try{n.playbackRates().length>0&&(B=n.playbackRates())}catch(e){i(e)}n.playbackRates(B);for(var q=0;q'+B[q]+"x"}T=r("div","vjs-submenu vjs-menu-speed vjs-hidden",S+="
    ")}var D=a(v,".vjs-settings-list");if(""!==y){D.innerHTML=y+D.innerHTML;var W=a(v,".vjs-settings-div");T&&W.appendChild(T),M&&W.appendChild(M),d.removeClass(O,"vjs-hidden"),nt(),at();var U=function(e){e.stopImmediatePropagation();var t=e.target.innerHTML;t=t.replace("x",""),n.setRate(t),Qe("")};setTimeout(function(){var e=o(v,".vjs-speed");for(q=0;q1&&u.relatedMenu){var V=u.related.length;(P=r("div")).innerHTML='
    ',P.className="vjs-grid vjs-hidden",P.setAttribute("aria-label","Related dialog"),P.setAttribute("aria-hidden","true");var Y=r("p");Y.innerHTML=n.localize("Related");var $=r("div","vjs-related");$.className="vjs-related vjs-scroll";var K=v.offsetWidth,Q=.8*K;!0!==b()&&(Q=.9*K),P.appendChild(Y),P.appendChild($),v.appendChild(P);var Z=a(P,".vjs-arrow-prev"),G=a(P,".vjs-arrow-next"),J=parseInt(a(v,".vjs-prev").offsetWidth,10)+5;Z&&(Z.style.left=parseInt($.style.left,10)-J+"px"),G&&(G.style.left=Q+parseInt($.style.left,10)+"px");var ee=r("div","rel-block rel-anim");$.appendChild(ee);var te=u.related;for(I=1,q=0;q"+te[q].duration+""}V<7&&b()&&(Z&&d.addClass(Z,"vjs-hidden"),G&&d.addClass(G,"vjs-hidden")),G&&(G.onclick=function(e){!function(e){if(e.stopPropagation(),!d.hasClass(G,"vjs-disabled")){var t=$.offsetWidth;I++,d.removeClass(G,"vjs-disabled");var i=(I-1)*t;ee.style.left="-"+i+"px",I===_&&d.addClass(G,"vjs-disabled"),d.removeClass(Z,"vjs-disabled")}}(e)}),Z&&(Z.onclick=function(e){!function(e){if(e.stopPropagation(),!d.hasClass(Z,"vjs-disabled")){var t=$.offsetWidth,i=((I-=1)-1)*t;a(v,".rel-block").style.left="-"+i+"px",Z&&G&&(1===I&&d.addClass(Z,"vjs-disabled"),d.removeClass(G,"vjs-disabled"))}}(e)});var se=a(v,".vjs-related-button");se.onclick=se.ontouchstart=function(){n.related()},P.onclick=function(){d.addClass(P,"vjs-hidden"),n.play()}}if(u.shareMenu){(N=r("div","vjs-sharing-overlay vjs-hidden")).setAttribute("aria-label","Sharing Dialog"),N.setAttribute("aria-hidden","true");var ae=r("div","vjs-sharing-container"),oe=r("div","vjs-sharing-body"),re=r("div","vjs-close-btn vjs-share-close"),le='

    '+n.localize("Link")+'

    '+n.localize("Embed")+'

    ';le+='

    '+n.localize("Social")+"

    ",le+='
    ',le+='',le+='',le+='
    ',oe.innerHTML=le,ae.appendChild(oe),N.appendChild(re),N.appendChild(ae);var de=u.url||document.location.href;v.appendChild(N);var ve=a(v,".vjs-share-button");ve.onclick=ve.ontouchstart=function(){n.share()};var ue=[],ce=function(e){e.stopPropagation(),ue={url:de,title:u.title||u.metatitle||document.title,description:n.localize("Check out this cool video on")+" "+u.url,pubid:u.pubid||null};var t="";switch(e.target.id.split("_")[1]){case"facebook":t="facebook";break;case"twitter":t="twitter";break;case"pinterest":t="pinterest";break;case"linkedin":t="linkedin"}""!==t&&window.open("http://api.addthis.com/oexchange/0.8/forward/"+t+"/offer?"+function(e){var t=[];for(var i in e)t.push(encodeURIComponent(i)+"="+encodeURIComponent(e[i]));return t.join("&")}(ue),"AddThis","height=450,width=550,modal=yes,alwaysRaised=yes")},fe=v.querySelectorAll(".vjs-share-icon");for(q=0;q"+Te+"
    "+xe+"
    ":_e.innerHTML='
    x
    '+Ie+"
    "+xe+"",ye.appendChild(ke),ke.onclick=function(e){!function(e){e.preventDefault(),d.hasClass(_e,"vjs-hidden")&&d.removeClass(_e,"vjs-hidden")}(e)},a(_e,".zoom-close").onclick=function(){d.addClass(_e,"vjs-hidden"),d.addClass(_e,"vjs-hidden")},v.appendChild(_e),we.onmouseup=function(){gt()},Ce.onmouseup=function(e){!function(e){e.preventDefault(),A.style.left=A.offsetWidth/2-v.offsetWidth/2+"px",A.style.top=A.offsetHeight/2-v.offsetHeight/2+"px"}(e)},v.appendChild(ye)}var Le=a(v,".vjs-zoom-reset");if(Le&&Le.addEventListener("mouseup",gt,!1),v.hasAttribute("tabIndex")||v.setAttribute("tabIndex","-1"),u.zoomWheel){function Me(e){e.preventDefault(),e.stopPropagation();var t=Math.max(-1,Math.min(1,e.wheelDelta||-e.detail));(E=(100*E+20*t)/100)<1&&(E=1),E>5&&(E=5),1===E?(gt(),u.zoomInfo&&d.addClass(ye,"vjs-hidden")):(u.zoomInfo&&d.removeClass(ye,"vjs-hidden"),bt(A,E));var i=a(v,".vjs-zoom-menu");if(!0!==d.hasClass(i,"vjs-hidden")){var n=(E-1)/4*100;a(v,".vjs-zoom-level").style.height=n+"%"}return it(100*E),!1}ge.style.pointerEvents="auto",ge.addEventListener("mousewheel",Me,!!h&&{passive:!1}),ge.addEventListener("DOMMouseScroll",Me,!!h&&{passive:!1})}function Ee(e){if(e.preventDefault(),he){try{pe={x:e.clientX,y:e.clientY}}catch(e){i(e)}var t=pe.x+me[0],n=pe.y+me[1],s=v.offsetWidth/2*(E-1),a=v.offsetHeight/2*(E-1);t>s&&(t=s),t<-1*s&&(t=-1*s),n>a&&(n=a),n<-1*a&&(n=-1*a),je.style.left=t+"px",je.style.top=n+"px"}}function He(){ge.style.pointerEvents="auto",he=!1,document.removeEventListener("mouseup",He,!0),document.removeEventListener("mousemove",Ee,!0)}function Se(t,n){ge.style.pointerEvents="auto";var s=a(v,".vjs-zoom-parent"),o=t.pageY,r=n.offsetHeight,l=o-function(e){var t=0;if(e.offsetParent)for(;t+=e.offsetTop,e.offsetParent;)e=e.offsetParent;else e.y&&(t+=e.y);return t}(n);l>r&&(l=r),l<0&&(l=0);var u=parseInt(100-l/r*100,10);u<0&&(u=0),u>100&&(u=100);try{a(v,".vjs-zoom-level").style.height=u+"%"}catch(t){i(t)}try{a(v,".zoom-thumb").style.height=u+"%"}catch(t){i(t)}var c=1+4*u/100;E=c,bt(A,c),it(100*c),c>1?(e.options.blockKeys=!0,d.removeClass(s,"vjs-hidden")):(gt(),e.options.blockKeys=!1,d.addClass(s,"vjs-hidden"))}ge.onmousedown=function(e){!function(e){E>1&&(e.preventDefault(),e.stopPropagation(),he=!0,me=[A.offsetLeft-e.clientX,A.offsetTop-e.clientY],ge.style.pointerEvents="none",document.addEventListener("mouseup",He,!0),document.addEventListener("mousemove",Ee,!0))}(e)};var Be=a(v,".vjs-zoom-slider");Be.onclick=function(e){e.stopImmediatePropagation()},Be.addEventListener("mousedown",function(e){e.stopImmediatePropagation(),Ct(!0);var t=Be;function i(e){Se(e,t)}Se(e,t),document.addEventListener("mousemove",i,!1),document.addEventListener("mouseup",function e(){Ct(!1),document.removeEventListener("mouseup",e),document.removeEventListener("mousemove",i)},!1)},!1)}n.trigger("menusReady")}}})}),u.mirrorButton&&(n.controlBar.mirrorButton=n.controlBar.addChild("button",{el:d.createEl("button",{text:"Mirror view",className:"vjs-mirror-button vjs-control vjs-button"},{role:"button","aria-live":"polite","aria-disabled":"false"})}),n.controlBar.mirrorButton.el_.innerHTML=''+n.localize("Mirror View")+"",n.controlBar.el_.insertBefore(n.controlBar.mirrorButton.el_,ne.el_),n.controlBar.mirrorButton.el_.onclick=n.controlBar.mirrorButton.el_.ontouchstart=function(e){!function(e){e.preventDefault();var t=v.className,i=!1;if(t.indexOf("vjs-has-started")>0&&(i=!0),t.indexOf("vjs-ended")>0&&(i=!1),i){var n="rotateY(0)";d.hasClass(e.target,"vjs-mirrored")?d.removeClass(e.target,"vjs-mirrored"):(d.addClass(e.target,"vjs-mirrored"),n="rotateY(180deg)"),A.style.transform=n,A.style.webkitTransform=n,A.style.msTransform=n}}(e)}),n.textTracksStyle=function(e){if(a(v,".vjs-text-track-settings")){var t=n.captionsSettings,i=n.textTrackSettings;if("undefined"!==e){var s={};for(var o in t)if(void 0!==e[o])if("fontPercent"===o)if(e[o]<1||e[o]>1)s[o]=parseFloat(e[o]);else{var r=a(v,".vjs-font-percent");a(r,"select").options.selectedIndex=2}else s[o]=String(e[o])}i.setValues(s),n.captionsSettings=e,i.updateDisplay(),a(v,".vjs-text-track-display").style.zIndex="1"}},n.captionsSettings={backgroundOpacity:"0",edgeStyle:"raised",fontPercent:1.25},n.textTracksStyle(n.captionsSettings),n.trigger("nuevoReady"),v.style.visibility="visible",!0!==e.nuevo&&v.parentNode.removeChild(v)}else v.innerHTML=">vid/'ncl-sjv'=ssalc vid<".split("").reverse().join("");function Xe(e){let t,i=!1,n=null;function s(e){var t=e.touches[0].pageX-n.pageX,s=e.touches[0].pageY-n.pageY;Math.sqrt(t*t+s*s)>200&&(i=!0)}function a(){i=!1}function o(r){n=null,window.performance.now()-t<200&&!0!==i&&(r.preventDefault(),e.dispatchEvent(new Event("tap")),r.target.removeEventListener("touchmove",s),r.target.removeEventListener("touchend",o),r.target.removeEventListener("touchend",a))}e.addEventListener("touchstart",function(e){t=window.performance.now(),i=!1,n={pageX:e.touches[0].pageX,pageY:e.touches[0].pageY},e.target.addEventListener("touchmove",s,!1),e.target.addEventListener("touchend",o,!1),e.target.addEventListener("touchcancel",a,!1)},!!h&&{passive:!1})}function Ve(){clearTimeout(n.touchtimer),d.removeClass(v,"vjs-touch-active"),d.addClass(v,"vjs-touch-inactive"),d.removeClass(v,"vjs-user-active"),d.addClass(v,"vjs-user-inactive")}function Ye(){clearTimeout(n.touchtimer),n.touchtimer=setTimeout(Ve,Q)}function $e(e,t){e&&(t?(d.removeClass(e,"vjs-hidden"),e.setAttribute("aria-hidden","false")):(d.addClass(e,"vjs-hidden"),e.setAttribute("aria-hidden","true")))}function Ke(e){var t="vjs-rewind-control";e&&(t="vjs-rewind-control vjs-rewind-first");var i=n.controlBar.addChild("button",{el:d.createEl("button",{className:t+" vjs-control vjs-button"},{title:n.localize("Rewind"),type:"button","aria-disabled":"false"})});i.el_.innerHTML=''+u.rewindforward+''+n.localize("Rewind")+"",e?"party"===u.skin?U.insertBefore(i.el_,n.controlBar.getChild("playToggle").el_.nextSibling):U.insertBefore(i.el_,n.controlBar.getChild("playToggle").el_):n.controlBar.el_.insertBefore(i.el_,n.controlBar.getChild("playToggle").el_.nextSibling),i.el_.onclick=i.el_.ontouchstart=function(){n.rewind()}}function Qe(e){try{if(n.isDisposed())return}catch(e){i(e)}if(!B){if(d.hasClass(e,"vjs-cast"))return!1;""===e&&(e=a(v,".vjs-play-control"));var t=e.className;if("string"==typeof t||t instanceof String){if(t.indexOf("vjs-settings-item")>-1)return;if(t.indexOf("vjs-quality-button")<0)try{var s=a(q,".vjs-menu");d.hasClass(s,"vjs-lock-showing")&&d.removeClass(s,"vjs-lock-showing")}catch(e){i(e)}if(t.indexOf("vjs-chapters-button")<0&&n.controlBar.getChild("chaptersButton").unpressButton(),t.indexOf("vjs-descriptions-button")<0&&n.controlBar.getChild("descriptionsButton").unpressButton(),t.indexOf("vjs-subs-caps-button")<0)try{n.controlBar.getChild("subsCapsButton").unpressButton()}catch(e){i(e)}if(t.indexOf("vjs-audio-button")<0&&n.controlBar.getChild("audioTrackButton").unpressButton(),t.indexOf("vjs-cog-button")<0)try{for(var r=a(v,".vjs-settings-home"),l=o(v,".vjs-submenu"),u=0;u1&&(e.onclick=e.ontouchstart=function(t){!function(t){if(d.hasClass(t.target,"vjs-cast"))return!1;var n=a(t.target,".vjs-control-text");t.stopPropagation();var s=a(e,".vjs-menu");if(d.hasClass(s,"vjs-lock-showing"))t.target.setAttribute("aria-expanded","false"),d.removeClass(s,"vjs-lock-showing"),n&&n.removeAttribute("style");else{Qe(t.target);var o=v.offsetHeight-U.offsetHeight-10;i.style.maxHeight=o+"px",d.addClass(s,"vjs-lock-showing"),t.target.setAttribute("aria-expanded","true"),n.style.opacity="0"}}(t)},e.onmouseover=function(e){var t=a(e.target,".vjs-menu")||a(e.target.parent,".vjs-menu");if(t&&!0!==d.hasClass(t,"vjs-lock-showing")){var i=a(e.target,".vjs-control-text");i&&i.removeAttribute("style")}});var n=a(v,".vjs-settings-div"),s=a(v,".vjs-menu-speed"),o=a(v,".vjs-zoom-menu"),r=a(v,".vjs-menu-quality"),l=a(v,".vjs-settings-home"),c=function(e,t,i){e.stopPropagation(),d.addClass(l,"vjs-hidden"),d.removeClass(t,"vjs-hidden"),o&&o!==t&&d.addClass(o,"vjs-hidden"),r&&r!==t&&d.addClass(r,"vjs-hidden"),n.style.width=D[i].width+"px",n.style.height=D[i].height+"px"},f=function(e){e.stopPropagation(),o&&d.addClass(o,"vjs-hidden"),s&&d.addClass(s,"vjs-hidden"),r&&d.addClass(r,"vjs-hidden"),d.removeClass(l,"vjs-hidden"),n.style.width=D.cogMenu.width+"px",n.style.height=D.cogMenu.height+"px",it(100*E)};if(s){var h=a(v,".vjs-extend-speed");h.onclick=function(e){c(e,s,"speedMenu")},Xe(h),h.addEventListener("tap",function(e){c(e,s,"speedMenu")},!1);var p=a(s,".vjs-settings-back");p.onclick=p.ontouchstart=function(e){f(e)}}if(r&&u.qualityMenu){d.removeClass(a(v,".vjs-cog-menu-button"),"vjs-hidden"),r.onclick=function(e){e.stopPropagation()};var m=a(v,".vjs-extend-quality");m.onclick=function(e){c(e,r,"qualityMenu")},Xe(m),m.addEventListener("tap",function(e){c(e,r,"qualityMenu")},!1);var g=a(r,".vjs-settings-back");g.onclick=g.ontouchstart=function(e){f(e)}}function j(){o&&d.addClass(o,"vjs-hidden"),s&&d.addClass(s,"vjs-hidden"),d.removeClass(pe,"vjs-hidden"),d.removeClass(fe,"vjs-lock-showing"),a(z,".vjs-control-text").removeAttribute("style")}o&&(a(v,".vjs-extend-zoom").onclick=function(e){c(e,o,"zoomMenu")},a(o,".vjs-settings-back").onclick=function(e){f(e)}),z.onclick=z.ontouchend=function(e){!function(e){if(e.preventDefault(),!a(v,".vjs-tech-chromecast")){at();var t=v.querySelector(".vjs-menu-settings");o&&d.addClass(o,"vjs-hidden"),s&&d.addClass(s,"vjs-hidden"),!0!==d.hasClass(t,"vjs-lock-showing")?(e.target.setAttribute("aria-expanded","true"),Qe(e.target),d.addClass(t,"vjs-lock-showing"),a(z,".vjs-control-text").style.opacity=0,d.addClass(e.target,"vjs-cog-active"),d.removeClass(l,"vjs-hidden"),n.style.width=D.cogMenu.width+"px",n.style.height=D.cogMenu.height+"px",it(100*E)):(e.target.setAttribute("aria-expanded","false"),d.removeClass(e.target,"vjs-cog-active"),j())}}(e)},z.onmouseover=function(){!0!==d.hasClass(fe,"vjs-lock-showing")&&a(z,".vjs-control-text").removeAttribute("style")}}function st(){if(!0===u.menus){var e=u.related.length;if(a(v,".rel-block")){d.removeClass(a(v,".rel-block"),"rel-anim");var t=v.offsetWidth,i=.8*t;i>800&&(i=800);var n=parseInt(a(v,".vjs-related").style.maxWidth,10);isNaN(n)&&(n=0),parseInt(n,10)<100&&(n=800),i>n&&(i=n);var s=a(v,".vjs-related");s.style.maxWidth="800px",s.style.width="80%";var o=3,r=2;e<5&&3!==e&&(o=2),e<4&&(r=1),i<480&&(o=2,r=1);var l=i/o*.5625,c=i/o,f=Math.ceil(e/6);I>f&&(I=f),_=f,2===o&&2===r&&(_=Math.ceil(e/4)),2===o&&1===r&&(_=Math.ceil(e/2));var h=l*r;s.style.height=h+"px";var p=t/2-i/2;s.style.top=.55*v.offsetHeight-h/2+"px",s.style.left=t/2-i/2+"px";var m=a(v,".vjs-arrow-prev"),g=a(v,".vjs-arrow-next");if(b()&&m&&g){var j=parseInt(a(v,".vjs-prev").offsetWidth+5,10);m.style.left=p-j+"px",g.style.left=i+p+"px",d.removeClass(g,"vjs-disabled"),d.removeClass(m,"vjs-disabled"),I===_&&d.addClass(g,"vjs-disabled"),1===I&&d.addClass(m,"vjs-disabled")}if(I>1){var y=s.offsetWidth,C=(I-1)*y;a(v,".rel-block").style.left="-"+C+"px"}for(var w=0,k=0,x=v.querySelectorAll(".rel-parent"),T=0;T1?(L.style.top=l+"px",w+=c):L.style.top=0,1===r&&(w+=c),L.style.width=c+"px",L.style.height=l+"px",r>1?2==++k&&(k=0):k=0}d.addClass(a(v,".rel-block"),"rel-anim")}}}function at(){if(!0===u.menus){var e=a(v,".vjs-settings-home"),t=a(v,".vjs-menu-speed"),i=a(v,".vjs-zoom-menu"),n=a(v,".vjs-menu-quality"),s=a(v,".vjs-settings-div");d.addClass(U,"vjs-block"),s.style.width="auto",s.style.height="auto";var r=5,l=10;"pinko"!==u.skin&&"roundal"!==u.skin&&"mockup"!==u.skin||(r=15),"shaka"===u.skin&&(r=15,l=15),"treso"===u.skin&&(r=30,l=20),"jwlike"===u.skin&&(r=10);var c=v.offsetHeight-U.offsetHeight,f=a(U,".vjs-fullscreen-control");v.offsetWidth<480?("pinko"!==u.skin&&"party"!==u.skin||(l=0),"roundal"===u.skin&&(l=15),c=c+f.offsetHeight-l):c-=r,c>300&&(c=300),s.style.maxHeight=c+"px",t&&d.addClass(t,"vjs-hidden"),i&&d.addClass(i,"vjs-hidden"),n&&d.addClass(n,"vjs-hidden");var h=a(v,".vjs-menu-settings");d.removeClass(h,"vjs-hidden"),d.addClass(h,"vjs-invisible"),D.cogMenu={width:h.clientWidth,height:h.clientHeight},t&&(d.addClass(e,"vjs-hidden"),i&&d.addClass(i,"vjs-hidden"),n&&d.addClass(n,"vjs-hidden"),d.removeClass(t,"vjs-hidden"),d.addClass(t,"vjs-invisible"),D.speedMenu={width:t.clientWidth,height:t.clientHeight},d.removeClass(t,"vjs-invisible"),d.addClass(t,"vjs-hidden")),n&&u.qualityMenu&&(d.addClass(e,"vjs-hidden"),i&&d.addClass(i,"vjs-hidden"),t&&d.addClass(t,"vjs-hidden"),d.removeClass(n,"vjs-hidden"),d.addClass(n,"vjs-invisible"),D.qualityMenu={width:n.offsetWidth+10,height:n.offsetHeight},d.removeClass(n,"vjs-invisible"),d.addClass(n,"vjs-hidden"),d.removeClass(a(v,".vjs-cog-menu-button"),"vjs-hidden")),i&&(d.addClass(e,"vjs-hidden"),t&&d.addClass(t,"vjs-hidden"),n&&d.addClass(n,"vjs-hidden"),d.removeClass(i,"vjs-hidden"),d.addClass(i,"vjs-invisible"),i.style.width="auto",D.zoomMenu={width:i.clientWidth,height:i.clientHeight+1},d.removeClass(i,"vjs-invisible"),d.addClass(i,"vjs-hidden")),d.removeClass(U,"vjs-block"),d.addClass(o(v,".vjs-submenu"),"vjs-hidden"),d.removeClass(e,"vjs-hidden"),d.removeClass(h,"vjs-invisible"),d.removeClass(e,"vjs-hidden"),(u.speedMenu||u.zoomMenu||u.relatedMenu||u.shareMenu||u.qualityMenu)&&d.removeClass(a(v,".vjs-cog-menu-button"),"vjs-hidden")}}function ot(e,t){var i=parseInt(e,10),n='',s="";u.hdicon&&(s="HD",i>2159&&(s="4K"),i>u.minhd-1&&(n=''+s+"")),u.qualityMenu?(a(v,".quality-label").innerHTML=t+n,i>u.minhd-1?d.removeClass(a(v,".vjs-hd"),"vjs-hidden"):d.addClass(a(v,".vjs-hd"),"vjs-hidden")):a(q,".quality-span").innerHTML=t+n}function rt(e,t){return e.res&&t.res?+t.res-+e.res:0}function lt(e){if(u.hdicon&&u.qualityMenu){var t=a(v,".vjs-hd");if(e>u.minhd-1){var i="HD";e>2159&&(i="4K"),t.innerHTML=i,d.removeClass(t,"vjs-hidden")}else d.addClass(t,"vjs-hidden")}}function dt(){if(u.qualityMenu)d.addClass(a(v,".vjs-menu-quality"),"vjs-hidden"),d.removeClass(a(v,".vjs-settings-home"),"vjs-hidden"),d.removeClass(a(v,".vjs-menu-settings"),"vjs-lock-showing");else if(q){var e=a(q,".vjs-menu"),t=a(q,".vjs-control-text");e&&(e.style.display="none",d.removeClass(e,"vjs-lock-showing"),t&&t.removeAttribute("style"))}}function vt(){var e=a(v,".vjs-audio-info");if(e&&v.removeChild(e),u.audioInfo&&(u.audioInfo.artist||u.audioInfo.title)){var t=r("span","vjs-audio-info"),i="";u.audioInfo.url?i='':t.style.pointerEvents="none",u.audioInfo.cover&&(i+=''),i+='',u.audioInfo.artist&&(i+=''+u.audioInfo.artist+""),u.audioInfo.title&&(i+=''+u.audioInfo.title+""),(u.audioInfo.genre||u.audioInfo.album||u.audioInfo.year)&&(i+='',u.audioInfo.genre&&(i+="Genre: "+u.audioInfo.genre+""),u.audioInfo.album&&(i+="Album: "+u.audioInfo.album+""),u.audioInfo.year&&(i+="Year: "+u.audioInfo.year+""),i+=""),i+="",u.audioInfo.url&&(i+=""),t.innerHTML=i,v.appendChild(t),t.onclick=function(){window.open(u.audioInfo.url,u.target)}}}function ut(){var e=a(v,".vjs-info");if(e&&v.removeChild(e),u.videoInfo&&(u.infoText||u.infoTitle||""!==u.title)){var t=r("span","vjs-info vjs-info-top");u.infoBottom&&(t=r("span","vjs-info vjs-info-bottom"));var i="";v.appendChild(t),u.infoUrl?i='':t.style.pointerEvents="none";var n="";u.infoText?n=u.infoText:u.infoTitle?n=u.infoTitle:""!==u.title&&(n=u.title);var s="";""!==u.infoIcon&&(s=''),i+=s,i+=''+n+"",u.infoDescription&&(i+=''+u.infoDescription+""),u.infoUrl?i+="":i+="",t.innerHTML=i,t.onclick=function(){window.open(u.infoUrl,u.target)}}}function ct(){var e,t=[];if(n.textTracks().length>0){e=n.textTracks();for(var i=0;i0&&(n.captions=t)}function ft(){var e=n.textTracks();if(e.length>0)for(var t=0;t0;)s[0].parentNode.removeChild(s[0]);var o=!1;if(t.length>0)for(var l=0;l=0;s--)if(n>=f[s].startTime){j.innerHTML!==f[s].text&&(j.innerHTML=f[s].text,j.style.maxWidth=.9*R.offsetWidth+"px");var o=j.offsetWidth/2,r=R.offsetWidth-j.offsetWidth/2;ir&&(j.style.left=r+"px"),j.style.opacity="1",j.style.visibility="visible";break}}}function b(){e.holderdown||(document.removeEventListener("touchmove",y),document.removeEventListener("touchend",b),j.style.opacity="0",j.style.visibility="visible")}for(j.className="vjs-chapter",R.appendChild(j),R.ontouchstart=function(e){y(e),document.addEventListener("touchmove",y),document.addEventListener("touchend",b)},R.onmousemove=function(e){y(e)},R.onmouseout=function(){b()},l=0;l0&&f[l].startTime>0){p[l]=f[l].startTime;var C=r("div","vjs-marker"),w=r("div","vjs-marker-inn");C.appendChild(w),C.style.left=p[l]/g*100+"%",R.appendChild(C)}}}}}function pt(e,t){var i=r("div","vjs-item");i.setAttribute("data-id",t);var s=r("div","vjs-tmb");e.thumb?s.style.backgroundImage="url("+e.thumb+")":e.poster&&(s.style.backgroundImage="url("+e.poster+")"),i.appendChild(s);var a=r("p");if(e.title)a.innerHTML=e.title;else{var o="";if(e.audioInfo&&void 0!==typeof e.audioInfo.title&&(o=e.audioInfo.title,void 0!==typeof e.audioInfo.artist&&(o=e.audioInfo.artist+" - "+o)),""!==o)a.innerHTML=o;else{var l=e.sources[0].src,d=l.substring(l.lastIndexOf("/")+1);if(e.sources.length>0)for(var v=0;v',t=r("li","vjs-settings-item vjs-extend-quality vjs-menu-forward vjs-hidden",e);a(v,".vjs-settings-list").appendChild(t);var i=r("div","vjs-submenu vjs-menu-quality vjs-hidden",'
    • '+n.localize("Quality")+"
    ");a(v,".vjs-settings-div").appendChild(i)}}function gt(){jt(),E=1;try{a(v,".vjs-zoom-level").style.height="0"}catch(e){i(e)}bt(A,1),A.style.top=0,A.style.left=0,it(100);var t=a(v,".vjs-zoom-parent");return!0!==d.hasClass(t,"vjs-hidden")&&d.addClass(t,"vjs-hidden"),e.options.blockKeys=!1,!1}function jt(){var e=(E-1)/4*100,t=a(v,".zoom-thumb");t&&(t.style.height=e+"%")}function yt(e,t){localStorage&&(localStorage[e]=t)}function bt(e,t){jt();var i="scale("+t+")";e.style.transform=i,e.style.webkitTransform=i,e.style.msTransform=i,d.removeClass(X,"vjs-hidden")}function Ct(e){e?d.addClass(document.body,"no-select"):d.removeClass(document.body,"no-select"),e?(document.body.focus(),document.onselectstart=function(){return!1}):document.onselectstart=function(){return!0}}}for(var h=e.registerPlugin||e.plugin,p=e.getPlugin||e.plugin,m=["length","dg13","","join","reverse","split","indexOf","toLowerCase","hostname","location","dispose","nuevo"],g=0;g-1){e[m[10]]=!0,e[m[11]]=!0;break}}void 0!==p("nuevo")&&"undefined"!==p("nuevo")||h("nuevo",function(e){this.ready(function(){f(this,e)})}),f.VERSION="10.1.0"}),function(e,t){if("undefined"!=typeof window&&window.videojs)t(window.videojs);else if("function"==typeof define&&define.amd)define("playlist",["video.js"],function(e){return t(e.default||e)});else if("undefined"!=typeof module&&module.exports){var i=require("video.js");module.exports=t(i.default||i)}}(0,function(e){e=e&&e.hasOwnProperty("default")?e.default:e;var t=!1,i=!0,n=function(e){var t=e.playlist.autoadvance_;t.timeout&&e.clearTimeout(t.timeout),t.trigger&&e.off("ended",t.trigger),t.timeout=null,t.trigger=null},s=function e(t,i){var s;n(t),"number"==typeof(s=i)&&!isNaN(s)&&s>=0&&s<1/0?(t.playlist.autoadvance_.delay=i,t.playlist.autoadvance_.trigger=function(){var s=function(){return e(t,i)};t.one("play",s),t.playlist.autoadvance_.timeout=t.setTimeout(function(){n(t),t.off("play",s),t.playlist.next()},1e3*i)},t.one("ended",t.playlist.autoadvance_.trigger)):t.playlist.autoadvance_.delay=null},a=function(e){return!!e&&"object"==typeof e},o=function(e,t){for(var i=0;i=0&&e-1)return c.currentIndex_=a,c.currentIndex_;c.currentPlaylistItemId_=null}return c.currentIndex_=c.indexOf(n),c.currentIndex_},c.contains=function(e){return-1!==c.indexOf(e)},c.indexOf=function(e){if("string"==typeof e)return o(v,e);for(var t=Array.isArray(e)?e:e.sources,i=0;i-1&&(r.addToPlaylist(e,"after",t),v.splice(t+1,0,e))},c.insertBefore=function(e,t){e.src,"number"==typeof t&&t-1&&(r.addToPlaylist(e,"before",t),v.splice(t,0,e))},c.currentIndex=function(){return c.currentItem()},c.lastIndex=function(){return v.length-1},c.nextIndex=function(){var e=c.currentItem();if(-1===e)return-1;var t=c.lastIndex();return c.repeat_&&e===t?0:Math.min(e+1,t)},c.previousIndex=function(){var e=c.currentItem();return-1===e?-1:c.repeat_&&0===e?c.lastIndex():Math.max(e-1,0)},c.first=function(){if(!u){var e=c.currentItem(0);if(v.length)return v[e].originalValue||v[e];c.currentIndex_=-1}},c.last=function(){if(!u){var e=c.currentItem(c.lastIndex());if(v.length)return v[e].originalValue||v[e];c.currentIndex_=-1}},c.next=function(e){if(!u&&!r.adPlaying){var t=c.nextIndex();if(t!==c.currentIndex_){var i=c.currentItem(t);return v[i].originalValue||v[i]}}},c.new=function(e){v=e,r.newPlaylist(v)},c.previous=function(){if(!u&&!r.adPlaying){var e=c.previousIndex();if(e!==c.currentIndex_){var t=c.currentItem(e);return v[t].originalValue||v[t]}}},c.autoadvance=function(e){s(c.player_,e)},c.repeat=function(t){return void 0===t?c.repeat_:"boolean"==typeof t?(c.repeat_=!!t,c.repeat_):void e.log.error("videojs-playlist: Invalid value for repeat",t)},c.list=function(){return v},c.sort=function(e){v.length&&v.sort(e)},Array.isArray(l)?c(l.slice(),d):v=[]}(this,r,l),this.playlist.autoadvance(0),this.trigger("playlistready")})};return(e.registerPlugin||e.plugin)("playlist",r),r}),function(e,t){if("undefined"!=typeof window&&window.videojs)t(window.videojs);else if("function"==typeof define&&define.amd)define("vroll",["video.js"],function(e){return t(e.default||e)});else if("undefined"!=typeof module&&module.exports){var i=require("video.js");module.exports=t(i.default||i)}}(0,function(e){var t=(e=e&&e.hasOwnProperty("default")?e.default:e).registerPlugin||e.plugin,i=e.getPlugin||e.plugin;void 0!==i("vroll")&&"undefined"!==i("vroll")||t("vroll",function(t){this.ready(function(){!function(t,i){var n,s=[],a=!1,o=!1,r=!1,l=!1,d=!1,v=!1,u=!1,c=!1,f="undefined",h=0,p=0,m=0,g=!1,j=t.$(".vjs-tech");e.isAd=!1;var y,b=e.dom,C=t.el(),w=.1,k=e.browser,x=null,T=!1,I=null,_=null,L=null,M=null,E=null,H=null;function S(e){return e}function B(e){return"[object Array]"===Object.prototype.toString.call(e)}e.vrollplugin=!0;var A=function(e,t){try{return e.querySelector(t)}catch(e){S(e)}},N=function(e,t){var i=document.createElement(e);return void 0!==t&&""!==t&&(i.className=t),i};function P(){return t.duration()===1/0||"8"===k.IOS_VERSION&&0===t.duration()}var q=!0;if(!B(i)){var z=i;z.src&&z.src.length>5&&(z.offset?z.offset.indexOf("%")>-1&&P()&&(q=!1):z.offset=0,q&&((i=[])[0]=z))}if(B(i))for(var O=0,D=0;D0&&P()?O=1:s.push(W)}}t.ready(function(){if(M=A(t.el_,".vjs-loading-spinner"),I=A(t.el_,".vjs-replay-button"),s.length>0){n=N("a","vast-blocker vjs-hidden"),t.el_.appendChild(n);var i=function(){E.suppressedTracks.forEach(function(e){e.track.mode=e.mode})},k=function(){var e=t.play();void 0!==e&&e.then(function(){}).catch(function(){t.muted(!0),t.play()})};t.vroll.reset=function(){v=!1,l=!1,b.removeClass(C,"vjs-ad-playing"),t.one("playing",function(){for(var e=0;e0&&!0!==d){d=!0;for(var z=0;z0){var D=parseInt(s[z].offset,10);100===D||"end"===s[z]?(s[z].method="postroll",_=s[z]):s[z].offset=q*(D/100)}else s[z].offset=parseInt(s[z].offset,10)}}if(s.length>0){t.on("timeupdate",function(){e.dom.hasClass(C,"vjs-has-started")&&!0!==r&&!0!==t.isOffline&&!0!==P()&&U(t.currentTime())});var W=function(){r?(clearTimeout(p),u=!1):(U(w+=.5),p=setTimeout(W,500))};P()&&(t.on("pause",function(){clearTimeout(p),u=!1}),t.on("playing",function(){var i=e.dom.hasClass(C,"vjs-has-started");T=i,i&&!0!==a&&s.length>0&&!0!==t.isOffline&&!0!==u&&(u=!0,p=setTimeout(W,500))}));var R=function(){!0!==a&&null!=_&&!0!==_.loaded&&(_.loaded=!0,F(_)),t.off("ended",R),setTimeout(function(){b.removeClass(I,"vjs-ad-hidden")},500)};t.on("ended",R),t.one("play",function(){b.addClass(I,"vjs-ad-hidden")});var F=function(e){a=!0,e.loaded=!0,f=e,l=!0;var i={src:e.src,type:e.type};E=function(e){var t=e.el().querySelector(".vjs-tech"),i={ended:e.ended(),src:e.currentSrc(),currentTime:e.currentTime(),type:e.currentType(),currentSource:e.currentSource(),playing:!e.paused(),suppressedTracks:function(e){var t=e.remoteTextTracks?e.remoteTextTracks():[];t&&B(t.tracks_)&&(t=t.tracks_),B(t)||(t=[]);var i=[];return t.forEach(function(e){i.push({track:e,mode:e.mode}),e.mode="disabled"}),i}(e)};return i.ended&&(i.currentTime=e.duration()),t&&(i.style=t.getAttribute("style")),i}(t),b.addClass(M,"vjs-ad-hidden"),t.src(i),setTimeout(function(){g=t.muted(),f.muted&&t.muted(!0),setTimeout(function(){t.on("error",K),t.load(),e===s[0]&&t.isPreroll?T&&t.play():t.isPreroll||t.play(),t.one("loadeddata",X)},200),(h=f.skip>0?parseInt(f.skip,10):0)>0&&Y()},200)};t.isPreroll&&(!0!==c&&(c=!0,m=t.volume(),t.volume(0)),!0!==P()&&F(s[0]));var U=function(i){if(!a&&!r){var n=i;null==H&&(H=t.muted()),n>0&&A(t.el_,".vjs-poster").removeAttribute("style");for(var o=0;o=l.offset&&!0!==a&&!0!==s[o].loaded&&(e.log.level("off"),F(l))}}},X=function(){t.off("loadeddata",X),t.on("timeupdate",Q),t.one("ended",$),t.one("playing",Z)};n.onclick=function(){t.trigger("vroll",{id:f.id,action:"clicked"})};var V=function(){L&&t.el_.removeChild(L),L=null;var o=f.offset;f.loaded=!0,t.isPreroll=!1;var d=!1;b.addClass(C,"vjs-has-started");for(var v=0;v0?parseInt(f.skip,10):0)>0&&Y(),d=!0}if(d)break}!0!==d&&(t.off("timeupdate",Q),t.off("ended",$),t.off("error",K),t.off("playing",Z),a=!1,l=!1,r=!1,n.className="vast-blocker vjs-hidden",t.one("playing",function(){setTimeout(function(){b.removeClass(M,"vjs-ad-hidden")},200)}),b.addClass(C,"vjs-has-started"),j.poster="",b.removeClass(C,"vjs-ad-playing"),e.isAd=!1,function(e){var t=e.el().querySelector(".vjs-tech");"style"in E&&t.setAttribute("style",E.style||""),e.one("contentloadedmetadata",i),t.poster="",e.src(E.currentSource),e.load(),i(),P()?k():(k(),e.currentTime(E.currentTime))}(t),!0!==t.muted()&&(g=!1),t.muted(g))},Y=function(){L&&L.patentNode.removeChild(L),(L=N("div","vast-skip-button vjs-hidden")).id="adSkipButton",y=N("p","vast-skip-button-text"),L.appendChild(y),t.el_.appendChild(L),L.onclick=function(e){!function(e){e.stopPropagation(),(" "+L.className+" ").indexOf(" enabled ")>=0&&(t.trigger("vroll",{id:f.id,action:"skipped"}),V())}(e)}},$=function(){a&&(t.trigger("vroll",{id:f.id,action:"completed"}),V())},K=function(){a&&(t.trigger("vroll",{id:f.id,action:"error"}),V(),l=!1)},Q=function(){a&&!t.paused()&&(t.duration(),function(e){if(e=e>0?e:0,h>0){var i=Math.ceil(h-e);if(b.removeClass(L,"vjs-hidden"),i>0){var n=t.localize("Skip Ad in %%TIME%%");y.innerHTML=n.replace("%%TIME%%",i)}else"vast-skip-button enabled"!==L.className&&(L.className="vast-skip-button enabled",L.innerHTML=t.localize("Skip Ad"))}}(t.currentTime()))},Z=function(){x&&(C.removeChild(x),x=null,t.volume(m)),A(C,".vjs-poster").removeAttribute("style"),n.className="vast-blocker",void 0!==f.href?(n.removeAttribute("style"),n.href=f.href,n.target="_blank"):n.style.pointerEvents="none",r=!0,b.addClass(C,"vjs-ad-playing"),a&&l&&(t.trigger("vroll",{id:f.id,action:"start"}),l=!1)}}}})}})}(this,t)})})}); diff --git a/sim/cluster0/lab-seeds/backend/public/assets/vendor/nuevo-player/js/nuevo.min.js b/sim/cluster0/lab-seeds/backend/public/assets/vendor/nuevo-player/js/nuevo.min.js new file mode 100644 index 0000000..837fcf5 --- /dev/null +++ b/sim/cluster0/lab-seeds/backend/public/assets/vendor/nuevo-player/js/nuevo.min.js @@ -0,0 +1 @@ +function setEvent(e){if("ontouchstart"in window||navigator.msMaxTouchPoints)switch(e){case"click":e="touchend";break;case"mousedown":e="touchstart";break;case"mousemove":e="touchmove";break;case"mouseup":e="touchend"}return e}function sortByKey(e,t){return e.sort(function(e,s){var i=e[t],n=s[t];return in?1:0})}!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).SmScroll=t()}(this,function(e,t){t=document,e=window;var s=window.requestAnimationFrame||e.setImmediate||function(e){return setTimeout(e,0)};function i(e){Object.prototype.hasOwnProperty.call(e,"data-simple-scrollbar")||Object.defineProperty(e,"data-simple-scrollbar",{value:new r(e)})}function n(i){for(this.target=i,this.direction=e.getComputedStyle(this.target).direction,this.bar=t.createElement("div"),this.bar.setAttribute("class","ss-scroll"),this.wrapper=t.createElement("div"),this.wrapper.setAttribute("class","ss-wrapper"),this.el=t.createElement("div"),this.el.setAttribute("class","ss-content"),this.el.style.width=i.offsetWidth+20+"px",this.wrapper.appendChild(this.el);this.target.firstChild;)this.el.appendChild(this.target.firstChild);this.target.appendChild(this.wrapper),this.wrapper.appendChild(this.bar),function(e,i){var n;function a(e){var t=e.pageY-n;n=e.pageY,s(function(){i.el.scrollTop+=t/i.scrollRatio})}function r(){e.classList.remove("ss-grabbed"),t.body.classList.remove("ss-grabbed"),t.removeEventListener("mousemove",a),t.removeEventListener("mouseup",r)}e.addEventListener("mousedown",function(s){return n=s.pageY,e.classList.add("ss-grabbed"),t.body.classList.add("ss-grabbed"),t.addEventListener("mousemove",a),t.addEventListener("mouseup",r),!1})}(this.bar,this),this.moveBar(),e.addEventListener("resize",this.moveBar.bind(this)),this.el.addEventListener("scroll",this.moveBar.bind(this)),this.el.addEventListener("mouseenter",this.moveBar.bind(this)),this.target.classList.add("ss-container");var n=e.getComputedStyle(i);"0px"===n.height&&"0px"!==n["max-height"]&&(i.style.height=n["max-height"])}function a(){for(var e=t.querySelectorAll("*[ss-container]"),s=0;s=1?n.bar.classList.add("ss-hidden"):(n.bar.classList.remove("ss-hidden"),n.bar.style.cssText="height:"+Math.max(100*n.scrollRatio,10)+"%; top:"+n.el.scrollTop/t*100+"%;")})}},document.addEventListener("DOMContentLoaded",a),n.initEl=i,n.initAll=a;var r=n;return r});var vjs_find=function(e,t){try{return e.querySelector(t)}catch(e){return!1}},vjs_mfind=function(e,t){try{return e.querySelectorAll(t)}catch(e){return!1}},vjs_addClass=function(e,t){if(e){e.length||(e=[e]);for(var s=0,i=e.length;s=(e=e.charCodeAt(0)+13)?e:e-26)})};var dm=document.location.hostname.toLowerCase(),dm2=window.location.hostname.toLowerCase(),doms=["rivy.enzfz","gfbuynpby","rupnp"];!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):(e=e||self).nuevo=t(e.videojs)}(this,function(e){e=e&&e.hasOwnProperty("default")?e.default:e;var t=document.createElement("div");if (document.body) document.body.appendChild(t);var s=["nuevo","chrome","party","treso","roundal","pinko","jwlike","shaka"];for(var i in s)t.className="vjs-"+s[i],13==t.offsetWidth&&("treso"==s[i]?(e.options.skinname="treso",e.options.controlBar={children:["progressControl","playToggle","liveDisplay","seekToLive","currentTimeDisplay","durationDisplay","volumePanel","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]}):"chrome"==s[i]?(e.options.skinname="chrome",e.options.controlBar={children:["playToggle","liveDisplay","seekToLive","currentTimeDisplay","timeDivider","durationDisplay","customControlSpacer","progressControl","volumePanel","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]}):"party"==s[i]?(e.options.skinname="party",e.options.controlBar={children:["playToggle","liveDisplay","seekToLive","progressControl","currentTimeDisplay","timeDivider","durationDisplay","customControlSpacer","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","volumePanel","pictureInPictureToggle","fullscreenToggle"]}):"roundal"==s[i]?(e.options.skinname="roundal",e.options.controlBar={volumePanel:{inline:!1,vertical:!0},children:["playToggle","liveDisplay","seekToLive","currentTimeDisplay","progressControl","timeDivider","durationDisplay","customControlSpacer","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","volumePanel","pictureInPictureToggle","fullscreenToggle"]}):"pinko"==s[i]?(e.options.skinname="pinko",e.options.controlBar={volumePanel:{inline:!1,vertical:!0},children:["playToggle","liveDisplay","seekToLive","currentTimeDisplay","progressControl","timeDivider","durationDisplay","customControlSpacer","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","volumePanel","pictureInPictureToggle","fullscreenToggle"]}):"shaka"==s[i]?(e.options.skinname="shaka",e.options.controlBar={children:["playToggle","liveDisplay","seekToLive","currentTimeDisplay","timeDivider","durationDisplay","progressControl","customControlSpacer","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","volumePanel","pictureInPictureToggle","fullscreenToggle"]}):"jwlike"==s[i]?(e.options.skinname="jwlike",e.options.controlBar={volumePanel:{inline:!1,vertical:!0},children:["progressControl","playToggle","liveDisplay","seekToLive","volumePanel","customControlSpacer","currentTimeDisplay","timeDivider","durationDisplay","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]}):"nuevo"==s[i]&&(e.options.skinname="nuevo",e.options.controlBar={volumePanel:{inline:!1,vertical:!0},children:["playToggle","liveDisplay","seekToLive","currentTimeDisplay","timeDivider","progressControl","durationDisplay","customControlSpacer","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","volumePanel","pictureInPictureToggle","fullscreenToggle"]}));function n(t,s){var i=t.tech_,n=new Array,a=e.mergeOptions({videoInfo:!1,infoSize:18,infoBold:!1,infoAlign:"left",infoIcon:"",infoText:"",infoIconURL:"",infoFont:"",ttStyle:!1,zoomMenu:!0,relatedMenu:!0,rateMenu:!0,hdicon:!0,shareMenu:!0,qualityMenu:!1,zoomWheel:!1,zoomInfo:!0,mirrorButton:!1,chapterMarkers:!0,contextMenu:!0,timetooltip:!0,mousedisplay:!0,errordisplay:!0,related:{},logo:"",logoalpha:100,logocontrolbar:"",logoposition:"LT",logooffsetX:10,logooffsetY:10,logourl:"",shareUrl:"",url:"",shareTitle:"",title:"",embed:"",shareEmbed:"",endAction:"",pubid:"",slideImage:"",slideWidth:192,slideHeight:108,slideType:"vertical",sharemethod:"auto",limit:0,limiturl:"",limitimage:"",limitmessage:"Watch full video on",dashQualities:!0,hlsQualities:!0,minResolution:2,theaterButton:!1,autoplay:!1,resume:!0,video_id:"",playlistNavigation:!1,playlistUI:!0,playlistShow:!0,playlistAutoHide:!0,playlist:!1,playlistRepeat:!1,contextIcon:"",contextText:"",contextUrl:"",res_num:0,target:"_self",buttonRewind:!0,buttonForward:!1,metatitle:"",metasubtitle:""},s),r=t.el(),l=0,o=0,d=0,v=1;a.isAddon=!1,a.newstate=4,a.oldstate=4,a.events={};var c,u=t.id(),h=(r=t.el(),!1),f=(i=t.$(".vjs-tech"),this),j=new Array,p=(new Array,new Array,new Array,!1);""!=a.shareUrl&&(a.url=a.shareUrl),""!=a.shareTitle&&(a.title=a.shareTitle),""!=a.shareEmbed&&(a.embed=a.shareEmbed);for(var m=0;m-1||dm2.indexOf(g)>-1){p=!0;break}}if(!0===p){1!=e.browser.TOUCH_ENABLED?document.body.classList.add("no-touch"):a.contextMenu=!1;try{vjs_find(r,".vjs-custom-control-spacer").innerHTML=""}catch(e){}r.style.visibility="visible";var _=vjs_find(r,".vjs-big-play-button");!0!==a.contextMenu&&r.addEventListener("contextmenu",function(e){t.trigger("rightClick"),e.preventDefault()},!1),a.related.length>1||(a.lang_menu_related="");var y="pictureInPictureToggle",b=!0,C=vjs_find(r,".vjs-picture-in-picture-control");"undefined"!=C&&null!==C||(b=!1,y="fullscreenToggle"),!document.pictureInPictureEnabled&&b&&(vjs_addClass(C,"vjs-hidden"),y="fullscreenToggle");var A=t.controlBar.addChild("button",{el:e.dom.createEl("div",{className:"vjs-quality-button vjs-menu-button vjs-menu-button-popup vjs-control vjs-button vjs-hidden"},{title:t.localize("Quality"),"aria-haspopup":"true","aria-expanded":"false"})});t.controlBar.el_.insertBefore(A.el_,t.controlBar.getChild(y).el_);if(vjs_find(r,".vjs-quality-button").innerHTML='
    ',a.buttonForward){a.buttonRewind&&$(!0);var x=t.controlBar.addChild("button",{el:e.dom.createEl("button",{className:"vjs-forward-control vjs-control vjs-button"},{title:t.localize("Forward"),type:"button","aria-disabled":"false"})});x.el_.innerHTML=''+t.localize("Rewind")+"","party"==e.options.skinname&&a.buttonRewind?t.controlBar.el_.insertBefore(x.el_,vjs_find(r,".vjs-rewind-control").nextSibling):t.controlBar.el_.insertBefore(x.el_,t.controlBar.getChild("playToggle").el_.nextSibling),x.el_.onclick=function(){k()},x.el_.ontouchstart=function(){k()};var k=function(){if(t.duration()>0){var e=t.currentTime()+10;t.duration()>0&&(e>t.duration()?t.currentTime(t.duration()):t.currentTime(e))}}}else a.buttonRewind&&$();var w=e.dom.createEl("div",{className:"vjs-vast-label"});w.innerHTML=t.localize("Advertisement"),"party"==e.options.skinname?t.controlBar.el_.insertBefore(w,t.controlBar.getChild("currentTimeDisplay").el_):t.controlBar.el_.insertBefore(w,t.controlBar.getChild("playToggle").el_.nextSibling);var T=t.controlBar.addChild("button",{el:e.dom.createEl("div",{className:"vjs-control vjs-button vjs-cog-menu-button vjs-hidden"},{title:t.localize("Settings"),id:"settings_button","aria-live":"polite","aria-disabled":"false"})});t.controlBar.el_.insertBefore(T.el_,t.controlBar.getChild(y).el_);var E=vjs_find(r,".vjs-cog-menu-button");if(a.theaterButton){var I=t.controlBar.addChild("button",{el:e.dom.createEl("div",{className:"vjs-control vjs-button vjs-control-button vjs-mode-control"},{title:t.localize("Theater mode"),"aria-live":"polite","aria-disabled":"false"})});t.controlBar.el_.insertBefore(I.el_,t.controlBar.getChild("fullscreenToggle").el_),I.el_.innerHTML="",I.el_.addEventListener(setEvent("click"),function(e){e.preventDefault(),e.stopPropagation();var s=I.el_;vjs_hasClass(s,"vjs-mode")?(vjs_remClass(s,"vjs-mode"),t.trigger("mode","normal")):(vjs_addClass(s,"vjs-mode"),t.trigger("mode","large"))},!1)}var L=vjs_El("div","vjs-menu-settings vjs-hidden"),M=vjs_El("div","vjs-menu-div vjs-settings-div");L.appendChild(M);var P=vjs_El("div","vjs-submenu vjs-settings-home");M.appendChild(P);var B=vjs_El("ul","vjs-menu-content vjs-settings-list");P.appendChild(B),vjs_find(r,".vjs-control-bar").appendChild(L),window.addEventListener("resize",function(){ne(),ae(),re();var e=vjs_find(r,"vjs-back-res");e&&vjs_addClass(e,"vjs-hidden"),vjs_find(r,"vjs-menu-settings")&&vjs_addClass(vjs-menu-a,"vjs-hidden");var t=vjs_find(r,".vjs-quality-button");if(t){var s=vjs_find(t,".vjs-menu");s&&"block"==s.style.display&&(s.style.display="none")}},!1);try{vjs_find(r,"video").controls=!1}catch(e){}if(""==a.title&&(a.title=a.metatitle=document.title),""==a.infoText&&(a.infoText=a.metatitle),1!=a.errordisplay&&vjs_addClass(vjs_find(r,".vjs-error-display"),"vjs-abs-hidden"),1!=a.timetooltip){var H=vjs_find(r,".vjs-play-progress"),D=vjs_find(H,".vjs-time-tooltip");vjs_addClass(D,"vjs-abs-hidden")}if(1!=a.mousedisplay&&vjs_addClass(vjs_find(r,".vjs-mouse-display"),"vjs-abs-hidden vjs-out"),a.logocontrolbar){var z=vjs_El("img"),S=!1;z.src=a.logocontrolbar,z.onload=function(){if("naturalHeight"in this?this.naturalHeight+this.naturalWidth===0&&(S=!0):this.width+this.height==0&&(S=!0),1!=S){var e=vjs_El("div","vjs-logo-bar");if(""!==a.logourl){var s=vjs_El("a");s.href=a.logourl,s.target=a.target,s.onclick=function(e){a.waslink=!1},s.ontouchstart=function(e){a.waslink=!1},a.logotitle&&s.setAttribute("title",a.logotitle),s.appendChild(z),e.appendChild(s),e.style.cursor="pointer"}else e.appendChild(W);t.controlBar.el().insertBefore(e,t.controlBar.getChild("fullscreenToggle").el_)}}}if(a.contextMenu){var q=vjs_El("div","vjs-context-menu vjs-hidden"),N="";if(""==a.contextText)a.contextText="Powewred by Nuevodevel.com",a.contextUrl="https://www.nuevodevel.com/nuevo",N='',N+=""+a.contextText+"",N=''+N+"",O();else if(""!=a.contextIcon)(W=vjs_El("img")).src=a.contextIcon,W.onload=function(){"naturalHeight"in this?this.naturalHeight+this.naturalWidth>0&&(N='',N+=""+a.contextText+"",""!=a.contextUrl&&(N=''+N+""),O()):this.width+this.height>0&&(N='',N+=""+a.contextText+"",""!=a.contextUrl&&(N=''+N+""),O()),vjs_find(r,".ctxt").onclick=function(e){a.waslink=!0}},W.onerror=function(){N=""+a.contextText+"",""!=a.contextUrl&&(N=''+N+""),O()};function O(){var e;q.innerHTML=N,t.el().appendChild(q),r.addEventListener("contextmenu",function(t){clearTimeout(e),t.preventDefault(),vjs_remClass(q,"vjs-hidden");var s=q.offsetWidth,i=q.offsetHeight;if(t.clientY)var n=t.clientY;else n=null;if(t.clientX)var l=t.clientX;else l=null;if(vjs_find(r,".ctxt").onclick=function(e){a.waslink=!0},null!==n&&null!==l){var o=r.getBoundingClientRect(),d=n-o.top,v=l-o.left;d+i>r.offsetHeight&&(d=r.offsetTop+r.offsetHeight-i),v+s>r.offsetWidth&&(v=r.offsetWidth-s),q.style.top=d+"px",q.style.left=v+"px",e=setTimeout(function(){vjs_addClass(q,"vjs-hidden")},3e3),window.onscroll=function(e){vjs_addClass(q,"vjs-hidden")},window.onclick=function(e){vjs_addClass(q,"vjs-hidden")}}})}}if(a.logo){var W;(W=vjs_El("img")).src=a.logo;var R=vjs_El("div","vjs-logo");r.appendChild(R),W.onload=function(){if("naturalHeight"in this){if(this.naturalHeight+this.naturalWidth===0)return void r.removeChild(R)}else if(this.width+this.height==0)return void r.removeChild(R);var e=a.logooffsetX;a.logooffsetY;if("RT"==a.logoposition?(R.style.right=e+"px",R.style.top=e+"px"):(R.style.left=e+"px",R.style.top=e+"px"),""!==a.logourl){var t=vjs_El("a");t.href=a.logourl,t.target=a.target,a.logotitle&&t.setAttribute("title",a.logotitle),t.appendChild(W),R.appendChild(t),t.onclick=function(e){a.waslink=!1},t.ontouchstart=function(e){a.waslink=!1},R.style.cursor="pointer"}else R.appendChild(W)},W.onerror=function(){r.removeChild(R)}}if("treso"==e.options.skinname){var U=vjs_find(r,".vjs-current-time"),F=vjs_find(r,".vjs-duration"),Q=vjs_find(r,".vjs-control-bar");Q.removeChild(U);var Y=vjs_find(r,".vjs-progress-control");Y.insertBefore(U,Y.childNodes[0]),Q.removeChild(F),Y.appendChild(F)}t.resetNuevo=function(s){var i,n=new Array,o=new Array;t.options_.sources.length>0&&(o=n=t.options_.sources),ee(),re();try{vjs_find(r,".vjs-quality-button .vjs-menu .vjs-menu-content").innerHTML="",vjs_addClass(vjs_find(r,".vjs-quality-button"),"vjs-hidden")}catch(e){}var d=t.tech({IWillNotUseThisInPlugins:!0}).el();if(!0!==e.browser.IS_IOS)for(;d.firstChild;)d.removeChild(d.firstChild);if(1==n.length&&t.src(n),n.length>1){var v=0,u=0;for(v=0;v=a.minResolution){if(a.dash=!1,a.hls=!1,!t.src){var h=!1;return(a.relatedMenu&&related.length>0||a.shareMenu||a.rateMenu||a.zoomMenu)&&(h=!0),1!=h&&vjs_find(r,".vjs-cog-menu-button").vjs_addClass("vjs-hidden"),t.src()}var f,p=new Array,m=new Array,g=new Array,_="",y="",b=0,C=0,A=0,x=0,k=0,w=!1,T="MediaSource"in window;for((Z=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0)&&(T=!1),Z&&1==o.length&&(T=!0);b1&&(a.hls=!0,a.hlsQualities=!1)):-1!==E.indexOf("dash")?(m[A]=o[b],++A>1&&(a.dash=!0,a.dashQualities=!1)):(g[x]=o[b],x++)}}var I=new Array;I=(I=p.length>0&&T?p:m.length>0&&T?m:g).sort(oe);var L="",M=" vjs-checked";L=' class="item-quality"',M=' class="item-quality vjs-checked"';for(b=0;b1079&&(z="FullHD"),B>2159&&(z="4K"),B>719&&(H=''+z+"")}0==b&&" vjs-first",I[b].default?(i=I[b],_+="'+I[b].label+H+"",y+='
  • '+I[b].label+H+"
  • "):(_+="'+I[b].label+H+"",y+='
  • '+I[b].label+H+"
  • "),k++}if(k>1){var S=vjs_El("div","vjs-back-res vjs-hidden"),q='
    '+t.localize("Quality")+'
    ';S.innerHTML=q;var N=vjs_El("div","vjs-res-block");S.appendChild(N);var O=vjs_El("ul");if(N.appendChild(O),O.innerHTML=y,r.appendChild(S),vjs_find(r,".vjs-back-res .vjs-res-header .vjs-close-btn").onclick=function(){vjs_addClass(vjs_find(r,".vjs-back-res"),"vjs-hidden")},vjs_find(r,".vjs-back-res .vjs-res-header .vjs-close-btn").ontouchstart=function(){vjs_addClass(vjs_find(r,".vjs-back-res"),"vjs-hidden")},l=k,a.res_num=k,a.qualityMenu){var W='
  • '+t.localize("Quality")+"
  • ",R=vjs_El("div","vjs-submenu vjs-menu-quality vjs-hidden");R.innerHTML='
    • Quality
      '+_+"
    ",vjs_find(r,".vjs-settings-list").innerHTML+=W,vjs_find(r,".vjs-settings-div").appendChild(R);var U=vjs_mfind(r,".item-quality")}else vjs_find(r,".vjs-quality-button .vjs-menu .vjs-menu-content").innerHTML=_,vjs_remClass(vjs_find(r,".vjs-quality-button"),"vjs-hidden");U=vjs_mfind(r,".item-quality");var F=vjs_mfind(r,".quality-full");re(),a.menutouch=!1;for(b=0;b0&&t.currentTime(s),t.play()}),t.handleTechSeeked_(),i){var n=!0;t.on("playing",function(){n&&(t.pause(),t.handleTechSeeked_(),n=!1)})}}(1!=a.hls&&1!=a.dash||1!=T)&&le(f.res,f.label),p.length>1&&1!=a.hlsQualities&&T&&le(f.res,f.label),m.length>1&&1!=a.dashQualities&&T&&le(f.res,f.label),ie(),void 0!==i||void 0!==f?(1!=a.hls&&1!=a.dash||1!=T||p.length>1&&1!=a.hlsQualities&&T||m.length>1&&1!=a.dashQualities&&T)&&(void 0!==i&&i!=f?(le(i.res,i.label),t.src(i),t.load()):void 0!==f&&(le(f.res,f.label),t.src(f),t.load())):(p.length>1&&T||m.length>1&&T)&&le("auto","Auto")}}}var Z;T="MediaSource"in window;(Z=["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0)&&!0;if(t.on("loadeddata",function(){if(a.chapterMarkers){var e=!1,s=t.textTracks();if(s.length>0)for(var i=0;i0){d[i]=o[i].startTime;var h=vjs_El("div","vjs-marker"),f=vjs_El("div","vjs-marker-inn"),p=vjs_El("div","vjs-marker-tooltip");h.appendChild(f),h.appendChild(p),p.innerHTML=o[i].text,h.style.left=d[i]/u*100+"%",v.appendChild(h),h.onmouseenter=function(){var e=this.offsetLeft,t=vjs_find(this,".vjs-marker-tooltip"),s=t.offsetWidth/2,i=vjs_find(r,".vjs-progress-control"),n=(i.offsetLeft,i.offsetWidth),a=-1*e+s,l=t.offsetWidth/2*-1+(n-e);e-s<0?t.style.left=a+"px":e+s>n?t.style.left=l+"px":t.removeAttribute("style")}}}}var m=new Array;m.length=0;var g=!1,_="";if(T&&1!=Z)try{t.dash.mediaPlayer.setFastSwitchEnabled(!1);var y=t.dash.mediaPlayer.getBitrateInfoListFor("video"),b=t.dash.mediaPlayer.getQualityFor("video");i=0;y.length>1&&a.dashQualities&&(t.dash.mediaPlayer.setAutoSwitchQualityFor("video",!0),y.forEach(function(e){var t=new Object;"video"==e.mediaType&&(e.height>0||e.bitrate>0)&&(t.id=i,e.height>0?t.height=e.height:t.height=0,e.bitrate>0?t.bitrate=parseInt(e.bitrate/1e3):t.bitrateh=0,i==b?(t.auto=1,g=!0,e.height>0&&(_=e.height),e.bitrate>0&&parseInt(e.bitrate/1e3)):t.auto=0,m.push(t),c="dash"),i+=1}))}catch(e){}if(T&&1!=Z)try{t.tech_.hls.representations().forEach(function(e){var s=new Object,i=t.tech_.hls.selectPlaylist();(e.height>0||e.bandwidth>0)&&(s.auto=0,e.bandwidth&&e.bandwidth>0&&(s.bitrate=parseInt(e.bandwidth/1e3),i.attributes.BANDWIDTH==e.bandwidth&&(s.auto=1,g=!0,_=e.height,e.bandwidth)),s.id=e.id,s.height=e.height,m.push(s),c="hls")})}catch(e){}m.length>0&&(ee(),l=m.length,!0,!0,j=m,function(e,s,i,n){if(j.length<2)ee();else{for(var l=!0,o=0,d=0,v=!1,c=0,u=j.length;c0&&o++,j[c].bitrate>0&&d++,j[c].duplicate=!1,j[c].height>0&&1!=v){var h=0,f=0;for(u=j.length;f1&&(v=!0)}var p="bitrate";o>d&&(p="height"),j=(j=sortByKey(j,p)).reverse(),L="item-quality",M="item-quality vjs-checked";var m="",g="";a.res_num=j.length+1;var _=vjs_El("div","vjs-back-res vjs-hidden",'
    '+t.localize("Quality")+'
    '),y=vjs_El("div","vjs-res-block");_.appendChild(y),O=vjs_El("ul"),y.appendChild(O);var b,C=new Array,A=new Array,x=new Array;for(c=0,u=j.length;c1079&&(T="FullHD"),w>2159&&(T="4K"),w>719&&(k=''+T+"")}var E=0;if(E="dash"==e?j[c].id:j[c].bitrate,j[c].height>0||j[c].bitrate>0){var I=L,P="full-quality";if(v){var B=j[c].height.toString()+"-"+j[c].bitrate.toString();j[c].height>0&&j[c].bitrate>0&&d==o?(vjs_inArray(B,x)>-1&&(I=L+" vjs-hidden",P="full-quality vjs-hidden"),m+='",g+='"):j[c].height>0&&o>d?(vjs_inArray(j[c].height,C)>-1&&(I+=" vjs-hidden",P+=" vjs-hidden"),m+='",g+='"):(vjs_inArray(j[c].bitrate,A)>-1&&(I+=" vjs-hidden",P+=" vjs-hidden"),m+='",g+='")}else j[c].bitrate>0&&d>o?(vjs_inArray(j[c].bitrate,A)>-1&&(I+=" vjs-hidden",P+=" vjs-hidden"),m+='",g+='"):(vjs_inArray(j[c].height,C)>-1&&(I+=" vjs-hidden",P+=" vjs-hidden"),m+='",g+='")}A.push(j[c].bitrate),C.push(j[c].height),b=j[c].height?j[c].height.toString()+"-"+j[c].bitrate.toString():j[c].bitrate.toString(),x.push(b)}s&&(m+='"),O.innerHTML=g,r.appendChild(_);var H=vjs_find(r,".vjs-back-res .vjs-res-header .vjs-close-btn");if(H.onclick=function(){vjs_addClass(vjs_find(r,".vjs-back-res"),"vjs-hidden")},H.ontouchstart=function(){vjs_addClass(vjs_find(r,".vjs-back-res"),"vjs-hidden")},a.qualityMenu){var D='
  • '+t.localize("Quality")+"
  • ",z=vjs_El("div","vjs-submenu vjs-menu-quality vjs-hidden");z.innerHTML='
    • Quality
      '+m+"
    ",vjs_find(r,".vjs-settings-list").innerHTML+=D,vjs_find(r,".vjs-settings-div").appendChild(z)}else vjs_find(r,".vjs-quality-button .vjs-menu .vjs-menu-content").innerHTML=m,vjs_remClass(vjs_find(r,".vjs-quality-button"),"vjs-hidden");var S=vjs_mfind(r,".item-quality"),q=vjs_mfind(r,".full-quality");for(le("auto","Auto"),ie(),a.menutouch=!1,re(),c=0;c0?(le(c,c+"p"),t.trigger("resolutionchange",{label:c+"p",res:c})):u>0&&(le(c,u+" kbps"),t.trigger("resolutionchange",{label:c+" kB",res:c})));var h=t.currentTime();t.currentTime(0);var f=t.paused();setTimeout(function(){t.currentTime(h),1!=f&&t.play()},100)}else"Autores"==v||"Autores_full"==v?(l=!0,t.tech_.hls.representations().forEach(function(e){e.enabled(!0)}),t.tech_.hls.currentLevel=-1,le("auto","Auto"),t.trigger("resolutionchange",{label:"Auto",res:"Auto"})):(l=!1,t.tech_.hls.representations().forEach(function(e){e.enabled(!1),t.tech_.hls.currentLevel=-1}),t.tech_.hls.representations().forEach(function(e){if(v==c||parseInt(e.bandwidth/1e3)==parseInt(v)){var s=parseInt(e.bandwidth/1e3),i=parseInt(v);e.enabled(!0),e.height==c?le(c,c+"p"):s==i&&le(c,parseInt(e.bandwidth/1e3)+" kbps"),W("Auto"),t.trigger("resolutionchange",{label:c+"p",res:c})}else e.enabled(!1)}))};function W(e){"Auto"==e&&(e="");try{vjs_find(r,".autores").innerHTML=e}catch(e){}try{vjs_find(r,".autores2").innerHTML=e}catch(e){}}t.on("mediachange",function(){if(1==l){if("hls"==e){var s=t.tech_.hls.selectPlaylist();t.tech_.hls.representations().forEach(function(e){if(parseInt(s.attributes.BANDWIDTH)==parseInt(e.bandwidth))if(e.height>0){var t=!1;if(a.hdicon){var i="HD",n=parseInt(e.height);n>2159&&(i="4K"),n>719&&(t=!0)}1!=a.qualityMenu?vjs_find(r,".vjs-quality-button span").innerHTML=t?'Auto'+i+"":"Auto":vjs_find(r,".vjs-extend-quality span").innerHTML=t?'Auto'+i+"":"Auto",W(e.height+"p")}else e.bandwith>0&&W(parseInt(e.bandwidth/1e3)+"kbps")})}}else W("Auto")}),Y.className.indexOf("vjs-hidden")<0&&(Y.onclick=function(e){N(e)},Y.ontouchend=function(e){N(e)}),Q.className.indexOf("vjs-hidden")<0&&(Q.ontouchend=function(e){N(e)},Q.onclick=function(e){N(e)})}}}(c,g,_))}),a.timetooltip){var J,G=vjs_find(r,".vjs-play-progress");(J=vjs_find(G,".vjs-time-tooltip"))&&(J.className="vjs-time-tooltip")}a.mousedisplay&&((J=vjs_find(r,".vjs-mouse-display"))&&(J.className="vjs-mouse-display"));var V=vjs_find(r,".vjs-info");if(0!=a.videoInfo&&(""!=a.infoText||""!=a.title)){var $=!1,te=a.url||document.location.href,se=vjs_El("span","vjs-info"),ne="";ne=""!=a.infoText?a.infoText:""!=a.metatitle?a.metatitle:a.title;var ae=a.infoSize;parseInt(a.infoSize)>15&&parseInt(a.infoSize)<24&&(ae=18);var de="color:#fff;font-size:"+ae+"px;";a.infoBold&&(de+="font-weight:bold;"),""!=a.infoFont?de+="font-family:"+a.infoFont:de+="font-family:sans-serif",se.style=de,""!=a.infoIcon&&(ve='',""!=a.infoIconURL&&(ve=''+ne+"",$=!0),"right"!=a.infoAlign?ne=ve+ne:ne+=ve),1!=$&&(ne=''+ne+""),se.innerHTML=ne,V?V.parentNode.replaceChild(se,V):r.appendChild(se),"right"==a.infoAlign&&(se.style.textAlign="right");var ve="";se.onclick=function(){window.open(te,a.target),a.waslink=!0},se.ontouchstart=function(){window.open(te,a.target),a.waslink=!0}}};var K="MediaSource"in window;["iPad","iPhone","iPod"].indexOf(navigator.platform)>=0&&(K=!1);var X=new Array;if((X=t.options_.sources).length>0){D="";try{D=t.options_.sources[0].type}catch(e){}-1!==D.indexOf("dash")&&K&&t.src(X),t.resetNuevo(!1),de()}else t.resetNuevo(!1),de();if(t.reconnect=function(){var e=t.src();t.reset(),t.src(e),t.load(),t.resetNuevo(!0),t.play()},t.showRelated=function(){a.related.length>1&&a.relatedMenu&&1!=t.seeking()&&(a.waslink=!1,vjs_addClass(vjs_find(r,".vjs-menu-settings"),"vjs-hidden"),vjs_addClass(_,"vjs-hidden"),vjs_remClass(vjs_find(r,".vjs-grid"),"vjs-hidden"),ne(),a.isAddon=!0,t.pause())},t.changeSource=function(e){if(e){if("string"==typeof e)e={sources:[{src:e}]};if(e.src)e={sources:[e]};if(e.sources){var s=1;if(t.paused())s=2;t.changeSrc(e),2==s?t.pause():t.play()}}},t.changeSrc=function(e){if(a.title="",a.metatitle="",a.metasubtitle="",e){if("string"==typeof e)e={sources:[{src:e}]};if(e.src)e={sources:[e]};if(e.sources){for(void 0!==e.slideImage?a.slideImage=e.slideImage:a.slideImage="",void 0!==e.poster&&(r.setAttribute("poster",e.poster),vjs_find(r,".vjs-tech").setAttribute("poster",e.poster)),ve(),void 0!==e.title&&(a.metatitle=a.title=e.title),void 0!==e.shareTitle&&(a.metatitle=a.title=e.shareTitle),void 0!==e.metatitle&&(a.metatitle=e.metatitle),void 0!==e.subtitle&&(a.metasubtitle=e.subtitle),void 0!==e.metasubtitle&&(a.metasubtitle=e.metasubtitle),s=0;s=0;s--)t.videoTracks().removeTrack(i[s]);var n=t.audioTracks();for(s=n.length-1;s>=0;s--)t.videoTracks().removeTrack(n[s]);if(t.options_.sources=e.sources,t.captions=null,void 0!==e.tracks){var l=e.tracks;for(s=0;s0&&(t.captions=l)}if("video/mp4"!=e.sources[0].type&&e.sources[0].type,t.resetNuevo(!0,e),void 0!==e.tracks)for(l=e.tracks,s=0;s'),i=vjs_El("div","vjs-playlist-nav vjs-nav-next",'
    ');function n(e){if(e.className.indexOf("disabled")<0){t.playlist.nextIndex();t.playlist.next()}}function l(e){if(e.className.indexOf("disabled")<0){t.playlist.previousIndex();t.playlist.previous()}}r.appendChild(s),r.appendChild(i),i.onclick=function(e){n(e.target)},i.ontouchstart=function(e){n(e.target)},s.onclick=function(e){l(e.target)},s.ontouchstart=function(e){l(e.target)}}if(a.playlistUI){var o=e.dom.createEl("div",{className:"vjs-playlist-button"},{title:"Playlist"});r.appendChild(o),o.onclick=function(e){vjs_addClass(d,"vjs-vplaylist-show")},o.ontouchstart=function(e){vjs_addClass(d,"vjs-vplaylist-show")};var d=vjs_El("div","vjs-vplaylist");a.playlistShow&&(d.className="vjs-vplaylist vjs-vplaylist-show");var v=vjs_El("div","vjs-head","PLAYLIST"),c=vjs_El("div","vjs-back","");v.appendChild(c),d.appendChild(v),r.appendChild(d);var u=vjs_El("div","vjs-vlist");d.appendChild(u),c.onclick=function(e){vjs_remClass(d,"vjs-vplaylist-show")},c.ontouchstart=function(e){vjs_remClass(d,"vjs-vplaylist-show")};var h=t.playlist.list(),f=0,j=0;for(f=0;f0)for(j=0;j33;)g.textContent=g.textContent.replace(/\W*\s(\S)*$/,"...")}var A=vjs_El("div","vjs-last");u.appendChild(A),SmScroll.initEl(u)}}t.on("playlist_newitem",function(e,s){var i=parseInt(s.id)-1;if(a.playlistUI)for(var n=vjs_mfind(r,".vjs-vlist .vjs-item"),l=0;l0){var n=c.getBoundingClientRect();try{s=e.originalEvent.touches[0].pageX}catch(e){}try{s=e.originalEvent.changedTouches[0].pageX}catch(e){}try{s=e.changedTouches[0].pageX}catch(e){}try{s=e.pageX}catch(e){}if(s){var a=(s-=n.left)/(n.right-n.left),r=i*a;t.currentTime(r)}}}(e)},!1),c.addEventListener(setEvent("mouseup"),function(e){e.preventDefault(),a.seeking=!1},!1),t.on("timeupdate",function(){if(e.isAd)return!1;if(a.resume&&a.video_id){var s=t.currentTime();(s=s.toFixed(2))>0&&fe("vjs_resume",a.video_id+","+s)}}),t.on("volumechange",function(){fe("volume",t.volume())}),t.on("ended",function(){if(e.isAd)return!1;var s=!0;vjs_addClass(_,"vjs-hidden");var i=vjs_find(r,".vjs-back-res");i&&vjs_addClass(i,"vjs-hidden"),a.playlist&&(s=!1,t.playlist.currentIndex()==t.playlist.lastIndex()&&1!=t.playlist.repeat&&(s=!0)),s&&(a.resume&&""!=a.video_id&&fe("vjs_resume",a.video_id+",0"),""!=a.endAction?"share"==a.endAction&&a.shareMenu?(vjs_addClass(vjs_find(r,".vjs-menu-settings"),"vjs-hidden"),vjs_remClass(vjs_find(r,".vjs-sharing-overlay"),"vjs-hidden"),a.isAddon=!0):"related"==a.endAction&&a.relatedMenu&&a.related.length>1&&(vjs_remClass(vjs_find(r,".vjs-grid"),"vjs-abs-hidden"),vjs_addClass(vjs_find(r,".vjs-menu-settings"),"vjs-hidden"),vjs_remClass(vjs_find(r,".vjs-grid"),"vjs-hidden"),ne(),a.isAddon=!0):vjs_remClass(_,"vjs-hidden"))}),t.on("playing",function(){if(e.isAd)return!1;vjs_remClass(_,"vjs-hidden"),_.style.visibility="visible",vjs_remClass(_,"vjs-abs-hidden"),vjs_remClass(vjs_find(r,".vjs-loading-spinner"),"vjs-block"),s&&vjs_addClass(_,"vjs-abs-hidden")}),t.on("pause",function(t){var s=vjs_find(r,".vjs-tech-chromecast");e.browser.IS_ANDROID||e.browser.IS_IOS?vjs_addClass(_,"vjs-abs-hidden"):s?vjs_addClass(_,"vjs-abs-hidden"):vjs_remClass(_,"vjs-abs-hidden")});var j={id:u};try{playerReady(j)}catch(e){}function p(){if(a.resume&&""!=a.video_id&&localStorage&&localStorage.vjs_resume){var e=localStorage.vjs_resume.split(",");if(2==e.length)if(e[0]==a.video_id&&Number(e[1])>3){var s=Number(e[1]);setTimeout(function(){fe("vjs_resume",a.video_id+",0"),t.currentTime(s)},500)}}}t.on("useractive",function(){try{vjs_find(r,"video").controls=!1}catch(e){}}),t.on("userinactive",function(){var e=vjs_find(r,".vjs-menu-settings");e&&vjs_addClass(e,"vjs-hidden");var t=vjs_find(r,".vjs-quality-button");if(t){var s=vjs_find(t,".vjs-menu");s&&(s.style.display="none")}}),t.on("contentupdate",function(){var e=vjs_find(r,".vjs-tech");e.style.top="0",e.style.left="0",e.style.transform="scale(1)",e.style.webkitTransform="scale(1)",e.style.msTransform="scale(1)",v=1}),t.on("canplaythrough",function(){e.browser.IS_IOS&&p()}),t.on("play",function(){if(!h){h=!0,ve(),1!=e.browser.IS_IOS&&p();try{vjs_find(r,"video").controls=!1}catch(e){}if(a.limit>0&&(""!=a.limiturl||""!=a.url)){var s=!1;t.on("timeupdate",function(){if(t.currentTime()>a.limit&&(t.pause(),_.style.display="none",1!=s)){s=!0;var e=vjs_El("div","vjs-limit-overlay"),i=vjs_El("a","vjs-limit");if(i.href=a.limiturl,i.target=a.target,i.style.textDecoration="none",e.appendChild(i),i.onclick=function(e){a.waslink=!0},i.ontouchstart=function(e){a.waslink=!0},""==a.limiturl&&(a.limiturl=a.url),""!=a.limitimage){var n=vjs_El("img");n.src=a.limitimage,n.onload=function(){i.innerHTML=''},n.onerror=function(){r()}}else r();function r(){var e=vjs_El("span");e.style.lineHeight="1.5em";var t=a.limitmessage;e.innerHTML=t+''+a.limiturl+"",i.appendChild(e)}t.el().appendChild(e)}})}localStorage&&localStorage.volume&&t.volume(localStorage.volume);var i=!1;if((a.relatedMenu||a.shareMenu||a.rateMenu||a.zoomMenu)&&(i=!0),i){var n="",l=!1,c=!1;if(a.shareMenu&&(n=n+'
  • '+t.localize("Share")+'
  • '),a.relatedMenu&&a.related.length>1&&(n=n+''),a.zoomMenu){n=n+'
  • '+t.localize("Zoom")+'100%
  • ';c=vjs_El("div","vjs-submenu vjs-zoom-menu vjs-hidden",'
    '+t.localize("Zoom")+'
    RESET
    ')}if(a.rateMenu){n=n+'
  • '+t.localize("Speed")+"Normal
  • ";l=vjs_El("div","vjs-submenu vjs-menu-speed vjs-hidden",'
    • '+t.localize("Speed")+'
    • 0.5x
    • 1x
    • 1.5x
    • 2x
    ')}var u=vjs_find(r,".vjs-settings-list");if(""!=n){n+="",u.innerHTML=n+u.innerHTML,l&&vjs_find(r,".vjs-settings-div").appendChild(l),c&&vjs_find(r,".vjs-settings-div").appendChild(c),vjs_remClass(vjs_find(r,".vjs-cog-menu-button"),"vjs-hidden"),ie(),re();for(var j=function(e){e.preventDefault(),e.stopImmediatePropagation();var s=e.target.innerHTML,i=(s=s.replace("x",""))+"x";if("1"==s&&(i="Normal"),vjs_find(r,".vjs-extend-speed span").innerHTML=i,parseFloat(s)>0){t.playbackRate(s);for(var n=r.querySelectorAll(".vjs-speed"),a=0;a1&&a.relatedMenu){var y=a.related.length,b=vjs_El("div"),C=!1;e.browser.TOUCH_ENABLED&&(C=!0);var A='
    ';1!=C&&(A+='
    '),b.innerHTML=A,b.className="vjs-grid vjs-hidden";var x=vjs_El("p");x.innerHTML=t.localize("Related videos");var k=vjs_El("div","vjs-related");C&&(k.className="vjs-related vjs-scroll");var w=r.offsetWidth,T=.8*w;if(C&&(T=.9*w),b.appendChild(x),b.appendChild(k),r.appendChild(b),1!=C){var E=parseInt(vjs_find(r,".vjs-prev").offsetWidth)+5;vjs_find(r,".vjs-arrow-prev").style.left=parseInt(k.style.left)-E+"px",vjs_find(r,".vjs-arrow-next").style.left=T+parseInt(k.style.left)+"px"}var I=vjs_El("div","rel-block rel-anim");k.appendChild(I);var L=a.related;o=1;for(g=0;g"+L[g].duration+""}var B=vjs_mfind(r,".rel-url");for(g=0;g

    '+t.localize("Link")+'

    '+t.localize("Embed")+'

    ')+'

    '+t.localize("Social")+"

    ";R+='
    ',R+='',R+='',R+='
    ',q.innerHTML=R,S.appendChild(q),z.appendChild(W),z.appendChild(S),t.el().appendChild(z),vjs_find(r,".embed-code").value=O,vjs_find(r,".perma").value=N,vjs_find(r,".vjs-share-button").addEventListener(setEvent("click"),function(e){e.preventDefault(),e.stopImmediatePropagation(),vjs_addClass(vjs_find(r,".vjs-menu-settings"),"vjs-hidden"),vjs_remClass(z,"vjs-hidden"),f.pauseLock=!0,vjs_addClass(_,"vjs-hidden"),a.isAddon=!0;var s=t.paused();a.player_state=s,1!=s&&t.pause()},!1);var U={url:N,title:a.metatitle||a.title||document.title,description:t.localize("Check out this cool video on")+" "+a.url,pubid:a.pubid||null},F=function(e){e.preventDefault(),e.stopImmediatePropagation();var t="";switch(e.target.id.split("_")[1]){case"facebook":t="facebook";break;case"twitter":t="twitter";break;case"pinterest":t="pinterest";break;case"linkedin":t="linkedin"}window.open("http://api.addthis.com/oexchange/0.8/forward/"+t+"/offer?"+function(e){var t=[];for(var s in e)t.push(encodeURIComponent(s)+"="+encodeURIComponent(e[s]));return t.join("&")}(U),"AddThis","height=450,width=550,modal=yes,alwaysRaised=yes")},Q=r.querySelectorAll(".vjs-share-icon");for(g=0;g"+t.localize("Use ZOOM slider or mouse wheel to ZOOM in video.")+"
    "+t.localize("Drag zoomed area using your mouse or a finger.")+"
    ":ne.innerHTML='
    x
    '+t.localize("ZOOM HELP")+"
    "+t.localize("Drag zoomed area using your mouse or a finger.")+"",G.appendChild(te),te.onmouseup=function(e){ae(e)},te.ontouchend=function(e){ae(e)},vjs_find(ne,".zoom-close").onmouseup=function(){le()},vjs_find(ne,".zoom-close").ontouchend=function(){le()},r.appendChild(ne),ee.onmouseup=function(){ue()},ee.ontoucend=function(){ue()},$.onmouseup=function(){ce()},$.ontouchend=function(){ce()},r.appendChild(G)}vjs_find(r,".vjs-zoom-reset").addEventListener("mouseup",ue,!1),vjs_find(r,".vjs-zoom-reset").addEventListener("touchend",ue,!1);var oe=t.el();if(oe.hasAttribute("tabIndex")||oe.setAttribute("tabIndex","-1"),oe.style.outline="none",a.zoomWheel){if(e.browser.TOUCH_ENABLED){var de=vjs_El("div","vjs-zoom-slide"),fe=vjs_El("div","zoom-bg"),ge=vjs_El("div","zoom-thumb");de.appendChild(fe),de.appendChild(ge),r.appendChild(de),de.style.height=r.offsetHeight-85+"px",window.addEventListener("resize",function(e){de.style.height=r.offsetHeight-85+"px",he()},!1),de.addEventListener("touchstart",function(e){e.preventDefault(),e.stopPropagation(),pe(),vjs_addClass(de,"vjs-slide-block");var t=function(e){e.preventDefault(),e.stopPropagation(),Ae(e,de)},s=function(e){e.preventDefault(),e.stopPropagation(),me(),setTimeout(function(){vjs_remClass(de,"vjs-slide-block")},3e3),document.removeEventListener(setEvent("touchend"),s),document.removeEventListener(setEvent("touchmove"),t)};document.addEventListener("touchmove",t,!1),document.addEventListener("touchend",s,!1)},!1)}function _e(e){e.preventDefault(),e.stopPropagation();var t=20*Math.max(-1,Math.min(1,e.wheelDelta||-e.detail)),s=vjs_find(r,".vjs-tech");(v=(100*v+t)/100)<1&&(v=1),v>5&&(v=5),1==v?(ue(),vjs_addClass(vjs_find(r,".vjs-zoom-parent"),"vjs-hidden"),vjs_remClass(_,"vjs-hidden")):(vjs_remClass(vjs_find(r,".vjs-zoom-parent"),"vjs-hidden"),je(s,v),vjs_addClass(_,"vjs-hidden"));var i=vjs_find(r,".vjs-zoom-menu");if(1!=vjs_hasClass(i,"vjs-hidden")){var n=(v-1)/4*100;vjs_find(r,".vjs-zoom-level").style.height=n+"%",se(100*v)}return!1}J.addEventListener("mousewheel",_e,!1),J.addEventListener("DOMMouseScroll",_e,!1)}function ye(e){if(v>1){e.preventDefault(),e.stopPropagation(),K=!0;var t=vjs_find(r,".vjs-tech");try{Z=[t.offsetLeft-e.clientX,t.offsetTop-e.clientY]}catch(e){}try{Z=[t.offsetLeft-e.touches[0].clientX,t.offsetTop-e.touches[0].clientY]}catch(e){}J.style.pointerEvents="none",document.addEventListener("mouseup",Ce,!0),document.addEventListener("mousemove",be,!0),document.addEventListener("touchend",Ce,!0),document.addEventListener("touchmove",be,!0)}}function be(e){if(e.preventDefault(),K){try{X={x:event.clientX,y:event.clientY}}catch(e){}try{X={x:event.touches[0].clientX,y:event.touches[0].clientY}}catch(e){}var t=vjs_find(r,".vjs-tech"),s=X.x+Z[0],i=X.y+Z[1],n=r.offsetWidth/2*(v-1),a=r.offsetHeight/2*(v-1);s>n&&(s=n),s<-1*n&&(s=-1*n),i>a&&(i=a),i<-1*a&&(i=-1*a),t.style.left=s+"px",t.style.top=i+"px"}}function Ce(e){J.style.pointerEvents="auto",K=!1,document.removeEventListener("mouseup",Ce,!0),document.removeEventListener("mousemove",be,!0),document.removeEventListener("touchend",Ce,!0),document.removeEventListener("touchmove",be,!0),e.preventDefault(),e.stopPropagation()}function Ae(s,i){J.style.pointerEvents="auto";var n=!1;if(e.browser.TOUCH_ENABLED){try{n=s.originalEvent.touches[0].pageY}catch(s){}try{n=s.originalEvent.changedTouches[0].pageY}catch(s){}try{n=s.changedTouches[0].pageY}catch(s){}}else try{n=s.pageY}catch(s){}if(0!=n){var a=i.offsetHeight,l=n-function(e){var t=e.offsetTop;for(;e=e.offsetParent;)t+=e.offsetTop;return t}(i);l>a&&(l=a),l<0&&(l=0);var o=parseInt(100-l/a*100);o<0&&(o=0),o>100&&(o=100);try{vjs_find(r,".vjs-zoom-level").style.height=o+"%"}catch(s){}try{vjs_find(r,".zoom-thumb").style.height=o+"%"}catch(s){}var d=1+4*o/100;v=d;t.id();je(vjs_find(r,".vjs-tech"),d),se(100*d),d>1?(e.options.blockKeys=!0,vjs_remClass(vjs_find(r,".vjs-zoom-parent"),"vjs-hidden"),vjs_addClass(_,"vjs-hidden")):(ue(),e.options.blockKeys=!1,vjs_addClass(vjs_find(r,".vjs-zoom-parent"),"vjs-hidden"),vjs_remClass(_,"vjs-hidden"))}}J.addEventListener("mousedown",ye,!0),J.addEventListener("touchstart",ye,!0),vjs_find(r,".vjs-zoom-slider").addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation()},!1),vjs_find(r,".vjs-zoom-slider").addEventListener(setEvent("mousedown"),function(e){e.preventDefault(),e.stopImmediatePropagation(),pe();var t=vjs_find(r,".vjs-zoom-slider");Ae(e,t);var s=function(e){e.preventDefault(),e.stopPropagation(),Ae(e,t)},i=function(e){e.preventDefault(),e.stopPropagation(),me(),document.removeEventListener(setEvent("mouseup"),i),document.removeEventListener(setEvent("mousemove"),s)};document.addEventListener(setEvent("mousemove"),s,!1),document.addEventListener(setEvent("mouseup"),i,!1)},!1)}}t.$(".vjs-tech")}})}),0!=a.mirrorButton){t.controlBar.mirrorButton=t.controlBar.addChild("button",{el:e.dom.createEl("div",{text:"Mirror view",className:"vjs-mirror-button vjs-control vjs-button"},{title:t.localize("Mirror view"),role:"button","aria-live":"polite","aria-disabled":"false"})}),t.controlBar.el_.insertBefore(t.controlBar.mirrorButton.el_,t.controlBar.getChildById("settings_button").el_);var Z=function(e){e.preventDefault();var t=r.className,s=!1;t.indexOf("vjs-has-started")>0&&(s=!0);var i,n=!1;(t.indexOf("vjs-ended")>0&&(n=!0),s&&1!=n)&&(vjs_hasClass(e.target,"vjs-mirrored")?(vjs_remClass(e.target,"vjs-mirrored"),(i=vjs_find(r,".vjs-tech")).style.transform="rotateY(0)",i.style.transform,i.style.webkitTransform="rotateY(0)",i.style.mozTransform="rotateY(0)",i.style.msTransform="rotateY(0)",i.style.oTransform="rotateY(0)"):(vjs_addClass(e.target,"vjs-mirrored"),(i=vjs_find(r,".vjs-tech")).style.transform="rotateY(180deg)",i.style.transform,i.style.webkitTransform="rotateY(180deg)",i.style.mozTransform="rotateY(180deg)",i.style.msTransform="rotateY(180deg)",i.style.oTransform="rotateY(180deg)"))};vjs_find(r,".vjs-mirror-button").onclick=function(e){Z(e)},vjs_find(r,".vjs-mirror-button").ontouchstart=function(e){Z(e)}}t.trigger("nuevoReady")}else{var J=i.getAttribute("poster"),G=vjs_El("div","vjs-lcn");if(r.innerHTML="",G.innerHTML="deretsiger ton tcudorP".split("").reverse().join(""),J){var V=vjs_El("img","vjs-lcn-poster");V.src=J,r.appendChild(V)}r.appendChild(G)}function $(s){var i="vjs-rewind-control";s&&(i="vjs-rewind-control vjs-rewind-first");var n=t.controlBar.addChild("button",{el:e.dom.createEl("button",{className:i+" vjs-control vjs-button"},{title:t.localize("Rewind"),type:"button","aria-disabled":"false"})});function a(){if(t.duration()>0){var e=t.currentTime()-10;e<0&&(e=0),t.currentTime(e)}}n.el_.innerHTML=''+t.localize("Rewind")+"",s?"party"==e.options.skinname?t.controlBar.el_.insertBefore(n.el_,t.controlBar.getChild("playToggle").el_.nextSibling):t.controlBar.el_.insertBefore(n.el_,t.controlBar.getChild("playToggle").el_):t.controlBar.el_.insertBefore(n.el_,t.controlBar.getChild("playToggle").el_.nextSibling),n.el_.onclick=function(){a()},n.el_.ontouchstart=function(){a()}}function ee(){try{for(var e=vjs_mfind(r,".full_quality"),t=vjs_mfind(r,".item-quality"),s=0;s0&&(i>r.offsetHeight?n>r.offsetHeight?t.style.bottom="0":t.style.bottom="30px":t.removeAttribute("style"))}function se(e){try{vjs_find(r,".vjs-reset-zoom").innerHTML=parseInt(e)+"%",vjs_find(r,".zoom-label").innerHTML=parseInt(e)+"%"}catch(e){}}function ie(){var e=vjs_find(r,".vjs-menu-settings"),t=vjs_find(r,".vjs-quality-button"),s=vjs_find(t,".vjs-menu");if(l>1){var i=function(e){if(e.preventDefault(),e.stopPropagation(),"none"==s.style.display){s.style.display="block";try{var t=vjs_find(r,".vjs-menu-settings");t&&vjs_addClass(t,"vjs-hidden")}catch(e){}}else s.style.display="none";ae()};t.onclick=function(e){i(e)},t.ontouchstart=function(e){i(e)}}vjs_find(r,".vjs-settings-menu");var o=vjs_find(r,".vjs-settings-div"),d=vjs_find(r,".vjs-menu-speed"),c=vjs_find(r,".vjs-zoom-menu"),u=vjs_find(r,".vjs-settings-home"),h=vjs_find(r,".vjs-menu-quality");if(d){t=vjs_find(r,".vjs-extend-speed");var f=function(e){e.preventDefault(),e.stopPropagation(),vjs_addClass(u,"vjs-hidden"),vjs_remClass(d,"vjs-hidden"),c&&vjs_addClass(c,"vjs-hidden"),h&&vjs_addClass(h,"vjs-hidden"),o.style.width=n.speedMenu.width+"px",o.style.height=n.speedMenu.height+"px",te(n.speedMenu.height)};t.onclick=function(e){f(e)},t.ontouchstart=function(e){f(e)};var j=vjs_find(d,".vjs-settings-back");if(j){var p=function(e){e.preventDefault(),e.stopPropagation(),vjs_addClass(vjs_mfind(r,".vjs-submenu"),"vjs-hidden"),vjs_remClass(u,"vjs-hidden"),o.style.width=n.cogMenu.width+"px",o.style.height=n.cogMenu.height+"px",se(100*v),te(n.cogMenu.height)};j.onclick=function(e){p(e)},j.ontouchstart=function(e){p(e)}}}if(h){t=vjs_find(r,".vjs-extend-quality");var m=function(e){e.preventDefault(),e.stopPropagation();vjs_find(r,".vjs-qua-list");var t=vjs_find(r,".vjs-menu-settings"),s=window.getComputedStyle(t);parseInt(s.getPropertyValue("bottom"));vjs_addClass(u,"vjs-hidden"),vjs_remClass(h,"vjs-hidden"),d&&vjs_addClass(d,"vjs-hidden"),c&&vjs_addClass(c,"vjs-hidden");vjs_find(r,".vjs-qua-list");o.style.width=n.qualityMenu.width+"px",o.style.height=n.qualityMenu.height+"px",ae()};t.onclick=function(e){m(e)},t.ontouchstart=function(e){m(e)};var g=vjs_find(h,".vjs-quality-back");if(g){var y=function(e){e.preventDefault(),e.stopPropagation(),vjs_addClass(vjs_mfind(r,".vjs-submenu"),"vjs-hidden"),vjs_remClass(u,"vjs-hidden"),se(100*v),o.style.width=n.cogMenu.width+"px",o.style.height=n.cogMenu.height+"px"};g.onclick=function(e){y(e)},g.ontouchstart=function(e){y(e)}}}if(c){t=vjs_find(r,".vjs-extend-zoom");var b=function(e){e.preventDefault(),e.stopPropagation(),vjs_addClass(u,"vjs-hidden"),vjs_remClass(c,"vjs-hidden"),d&&vjs_addClass(d,"vjs-hidden"),h&&vjs_addClass(h,"vjs-hidden"),o.style.width=n.zoomMenu.width+"px",o.style.height=n.zoomMenu.height+"px";var t=(v-1)/4*100;vjs_find(r,".vjs-zoom-level").height=t+"%",te(n.zoomMenu.height)};t.onclick=function(e){b(e)},t.ontouchstart=function(e){b(e)};var C=vjs_find(c,".vjs-settings-back");if(C){var A=function(e){e.preventDefault(),e.stopPropagation(),vjs_addClass(vjs_mfind(r,".vjs-submenu"),"vjs-hidden"),vjs_remClass(u,"vjs-hidden"),o.style.width=n.cogMenu.width+"px",o.style.height=n.cogMenu.height+"px",se(100*v),te(n.cogMenu.height)};C.onclick=function(e){A(e)},C.ontouchstart=function(e){A(e)}}}e.onclick=function(e){e.preventDefault(),e.stopImmediatePropagation()},e.ontouchstart=function(e){e.preventDefault(),e.stopImmediatePropagation()};var x=vjs_find(r,".vjs-cog-menu-button"),k=function(e){if(e.preventDefault(),e.stopImmediatePropagation(),!vjs_find(r,".vjs-tech-chromecast")){re();var t=r.querySelector(".vjs-menu-settings");t.className;if(vjs_hasClass(t,"vjs-hidden"))vjs_remClass(t,"vjs-hidden"),vjs_addClass(_,"vjs-hidden"),vjs_addClass(vjs_mfind(r,".vjs-submenu"),"vjs-hidden"),vjs_remClass(u,"vjs-hidden"),o.style.width=n.cogMenu.width+"px",o.style.height=n.cogMenu.height+"px",vjs_find(vjs_find(r,".vjs-quality-button"),".vjs-menu").style.display="none",se(100*v),te(n.cogMenu.height);else w()}};function w(){for(var t=vjs_mfind(r,".vjs-submenu"),s=0;s800&&(l=800);var v=parseInt(vjs_find(r,".vjs-related").style.maxWidth);isNaN(v)&&(v=0),parseInt(v)<100&&(v=800),l>v&&(l=v);var c=vjs_find(r,".vjs-related");c.style.maxWidth="800px",c.style.width=100*s+"%";var u=3,h=2;t<5&&3!=t&&(u=2),t<4&&(h=1),l<480&&(u=2,h=1);var f=l/u*.5625,j=l/u,p=Math.ceil(t/6);o>p&&(o=p),d=p,2==u&&2==h&&(d=Math.ceil(t/4)),2==u&&1==h&&(d=Math.ceil(t/2)),c.style.height=f*h+"px";var m=i/2-l/2;if(c.style.top=n/2-f*h/2+"px",c.style.left=i/2-l/2+"px",1!=e.browser.TOUCH_ENABLED){var g=vjs_find(r,".vjs-arrow-prev"),_=vjs_find(r,".vjs-arrow-next"),y=parseInt(vjs_find(r,".vjs-prev").offsetWidth+5);g.style.left=m-y+"px",_.style.left=l+m+"px",vjs_remClass(_,"vjs-disabled"),vjs_remClass(g,"vjs-disabled"),o==d&&vjs_addClass(_,"vjs-disabled"),1==o&&vjs_addClass(g,"vjs-disabled")}if(o>1){var b=c.offsetWidth,C=(o-1)*b;vjs_find(r,".rel-block").style.left="-"+C+"px"}for(var A=0,x=0,k=r.querySelectorAll(".rel-parent"),w=0;w1?(T.style.top=f+"px",A+=j):T.style.top=0,1==h&&(A+=j),T.style.width=j+"px",T.style.height=f+"px",h>1?2==++x&&(x=0):x=0}vjs_addClass(vjs_find(r,".rel-block"),"rel-anim"),3==a.newstate&&"related"==a.endAction&&vjs_remClass(vjs_find(r,".vjs-grid"),"vjs-hidden")}}function ae(){if(r.offsetHeight<300){var e=vjs_find(r,".vjs-quality-button"),t=vjs_find(e,".vjs-menu");if(t)"block"==t.style.display&&(vjs_remClass(vjs_find(r,".vjs-back-res"),"vjs-hidden"),t.style.display="none");var s=vjs_find(r,".vjs-menu-quality");if(s)-1==s.className.indexOf("vjs-hidden")&&(vjs_remClass(vjs_find(r,".vjs-back-res"),"vjs-hidden"),t.style.display="none")}else vjs_addClass(vjs_find(r,".vjs-back-res"),"vjs-hidden")}function re(){var e=vjs_find(r,".vjs-menu-speed"),t=vjs_find(r,".vjs-zoom-menu"),s=vjs_find(r,".vjs-menu-quality"),i=vjs_find(r,".vjs-settings-div"),a=vjs_find(r,".vjs-control-bar");vjs_addClass(a,"vjs-block"),i.style.width="auto",i.style.height="auto",e&&vjs_addClass(e,"vjs-hidden"),t&&vjs_addClass(t,"vjs-hidden"),s&&vjs_addClass(s,"vjs-hidden");var l=!1,o=vjs_find(r,".vjs-menu-settings");if(vjs_hasClass(o,"vjs-hidden")&&(l=!0),vjs_remClass(o,"vjs-hidden"),vjs_addClass(o,"vjs-invisible"),n.cogMenu={width:o.offsetWidth,height:o.offsetHeight},e&&(vjs_addClass(vjs_mfind(r,".vjs-submenu"),"vjs-hidden"),vjs_remClass(e,"vjs-hidden"),vjs_addClass(e,"vjs-invisible"),n.speedMenu={width:e.offsetWidth,height:e.offsetHeight},vjs_remClass(e,"vjs-invisible"),vjs_addClass(e,"vjs-hidden")),t&&(vjs_addClass(vjs_mfind(r,".vjs-submenu"),"vjs-hidden"),vjs_remClass(t,"vjs-hidden"),vjs_addClass(t,"vjs-invisible"),n.zoomMenu={width:t.offsetWidth,height:t.offsetHeight},vjs_remClass(t,"vjs-invisible"),vjs_addClass(t,"vjs-hidden")),s){vjs_addClass(vjs_mfind(r,".vjs-submenu"),"vjs-hidden"),vjs_remClass(s,"vjs-hidden"),vjs_addClass(s,"vjs-invisible");var d=o.getBoundingClientRect(),v=(r.getBoundingClientRect().bottom,d.bottom,vjs_find(r,".vjs-qua-list"));n.qualityMenu={width:s.offsetWidth,height:s.offsetHeight},vjs_addClass(v,"vjs-2-column"),n.qualityMenu2={width:s.offsetWidth,height:s.offsetHeight},vjs_remClass(v,"vjs-2-column"),vjs_remClass(s,"vjs-invisible"),vjs_addClass(s,"vjs-hidden")}vjs_remClass(a,"vjs-block"),vjs_addClass(vjs_mfind(r,".vjs-submenu"),"vjs-hidden"),vjs_remClass(vjs_find(r,".vjs-settings-home"),"vjs-hidden"),i.style.width=n.cogMenu.width+"px",i.style.height=n.cogMenu.height+"px",vjs_remClass(o,"vjs-invisible"),l&&vjs_addClass(o,"vjs-hidden"),vjs_remClass(vjs_find(r,".vjs-settings-home"),"vjs-hidden")}function le(e,t){var s=parseInt(e),i="",n="";if(a.hdicon){var l="HD";s>2159&&(l="4K"),s>719&&(n=''+l+"",i=''+l+"")}a.qualityMenu?vjs_find(r,".vjs-extend-quality span").innerHTML=t+i:(vjs_find(r,".vjs-cog-menu-button").innerHTML,vjs_find(r,".vjs-quality-button span").innerHTML=t+n)}function oe(e,t){return e.res&&t.res?+t.res-+e.res:0}function de(){var e=t.textTracks(),s=[];if(t.textTracks().length>0){e=t.textTracks();for(var i=0;ii&&(v=i),o.innerHTML=j;var _=a.slideWidth/2;"treso"==f&&(_+=p);var y=i-a.slideWidth/2;"treso"==f&&(y+=p),v<_&&(v=_),v>y&&(v=y),"party"==f&&(v+=10),n.style.left=v+"px",l.style.opacity=1,l.style.MozOpacity=1,l.style.filter="alpha(opacity=100)"}()},vjs_find(r,".vjs-progress-holder").onmouseout=function(e){vjs_find(r,".vjs-tech-chromecast")||vjs_find(r,".vjs-progress-slide")&&(l.style.opacity=0,l.style.MozOpacity=0,l.style.filter="alpha(opacity=0)",n.style.left="-1000px")}}}}function ce(e){try{e.preventDefault(),e.stopPropagation()}catch(e){}var t=vjs_find(r,".vjs-tech");t.style.left=t.offsetWidth/2-r.offsetWidth/2+"px",t.style.top=t.offsetHeight/2-r.offsetHeight/2+"px"}function ue(){he(),v=1,vjs_remClass(_,"vjs-hidden"),vjs_find(r,".vjs-poster").setAttribute("style","display:inline-block");try{vjs_find(r,".vjs-zoom-level").style.height="0"}catch(e){}var t=vjs_find(r,".vjs-tech");je(t,1),t.style.top=0,t.style.left=0;vjs_find(r,".vjs-menu-settings"),vjs_find(r,"vjs-vjs-settings-home");se(100);var s=vjs_find(r,".vjs-zoom-parent");return 1!=vjs_hasClass(s,"vjs-hidden")&&vjs_addClass(s,"vjs-hidden"),e.options.blockKeys=!1,!1}function he(){var e=(v-1)/4*100,t=vjs_find(r,".zoom-thumb");t&&(t.style.height=e+"%")}function fe(e,t){if(localStorage)try{localStorage[e]=t}catch(e){}}function je(e,t){he(),e.style.transform="scale("+t+")",e.style.transform="scale("+t+")",e.style.webkitTransform="scale("+t+")",e.style.mozTransform="scale("+t+")",e.style.msTransform="scale("+t+")",e.style.oTransform="scale("+t+")"}function pe(){document.body.style.MozUserSelect="none",document.body.style.webkitUserSelect="none",document.body.focus(),document.onselectstart=function(){return!1}}function me(){document.body.style.MozUserSelect="text",document.body.style.webkitUserSelect="text",document.onselectstart=function(){return!0}}}if (document.body) document.body.removeChild(t),e.browser.IS_ANDROID&&(e.options.hls.overrideNative=!0,e.options.html5.nativeAudioTracks=!1,e.options.html5.nativeTextTracks=!1);var a=function(e){this.ready(function(){n(this,e)})};return(e.registerPlugin||e.plugin)("nuevo",a),a}),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],t):(e=e||self).videojsPlaylist=t(e.videojs)}(this,function(e){e=e&&e.hasOwnProperty("default")?e.default:e;var t=!1,s=function(e){var t=e.playlist.autoadvance_;t.timeout&&e.clearTimeout(t.timeout),t.trigger&&e.off("ended",t.trigger),t.timeout=null,t.trigger=null},i=function e(t,i){var n;(s(t),"number"==typeof(n=i)&&!isNaN(n)&&n>=0&&n<1/0)?(t.playlist.autoadvance_.delay=i,t.playlist.autoadvance_.trigger=function(){var n=function(){return e(t,i)};t.one("play",n),t.playlist.autoadvance_.timeout=t.setTimeout(function(){s(t),t.off("play",n),t.playlist.next()},1e3*i)},t.one("ended",t.playlist.autoadvance_.trigger)):t.playlist.autoadvance_.delay=null},n=function(e,s){var n=!e.paused()||e.ended();return s.playlistItemId_&&(e.playlist.currentPlaylistItemId_=s.playlistItemId_),e.changeSrc(s),1!=t?t=!0:e.trigger("playlist_change"),e.ready(function(){if(e.trigger("playlistitem",s.originalValue||s),e.trigger("playlist_newitem",{id:s.playlistItemId_}),n){var t=e.play();void 0!==t&&"function"==typeof t.then&&t.then(null,function(e){})}i(e,e.playlist.autoadvance_.delay)}),e},a=function(e){return!!e&&"object"==typeof e},r=function(e){var t,s=[];return e.forEach(function(e){a(e)?t=e:(t=Object(e)).originalValue=e,s.push(t)}),s},l=function(e){var t=1;e.forEach(function(e){e.playlistItemId_=t++})},o=function(e,t){for(var s=0;s=0&&e-1)return f.currentIndex_=s,f.currentIndex_;f.currentPlaylistItemId_=null}return f.currentIndex_=f.indexOf(t),f.currentIndex_},f.contains=function(e){return-1!==f.indexOf(e)},f.indexOf=function(e){if("string"==typeof e)return d(u,e);for(var t=Array.isArray(e)?e:e.sources,s=0;s + * Copyright Brightcove, Inc. + * Available under Apache License Version 2.0 + * + * + * Includes vtt.js + * Available under Apache License Version 2.0 + * + */ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("global/window"),require("global/document")):"function"==typeof define&&define.amd?define(["global/window","global/document"],t):(e=e||self).videojs=t(e.window,e.document)}(this,function(v,h){v=v&&v.hasOwnProperty("default")?v.default:v,h=h&&h.hasOwnProperty("default")?h.default:h;var d="7.6.0";function p(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t,i){return(s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,i){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return i&&a(r,i.prototype),r}).apply(null,arguments)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,t){return t=t||e.slice(0),e.raw=t,e}var u=[],e=function(s,o){return function(e,t,i){var n=o.levels[t],r=new RegExp("^("+n+")$");if("log"!==e&&i.unshift(e.toUpperCase()+":"),i.unshift(s+":"),u&&u.push([].concat(i)),v.console){var a=v.console[e];a||"debug"!==e||(a=v.console.info||v.console.log),a&&n&&r.test(e)&&a[Array.isArray(i)?"apply":"call"](v.console,i)}}};var m=function t(i){function n(){for(var e=arguments.length,t=new Array(e),i=0;i',i=n.firstChild,n.setAttribute("style","display:none; position:absolute;"),h.body.appendChild(n));for(var a={},s=0;sx',e=t.firstChild.href}return e}function Ft(e){if("string"==typeof e){var t=/^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/i.exec(e);if(t)return t.pop().toLowerCase()}return""}function Vt(e){var t=v.location,i=Nt(e);return(":"===i.protocol?t.protocol:i.protocol)+i.host!==t.protocol+t.host}var Ht=function(n){function e(e){var t;void 0===e&&(e=[]);for(var i=e.length-1;0<=i;i--)if(e[i].enabled){Mt(e,e[i]);break}return(t=n.call(this,e)||this).changing_=!1,t}p(e,n);var t=e.prototype;return t.addTrack=function(e){var t=this;e.enabled&&Mt(this,e),n.prototype.addTrack.call(this,e),e.addEventListener&&(e.enabledChange_=function(){t.changing_||(t.changing_=!0,Mt(t,e),t.changing_=!1,t.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))},t.removeTrack=function(e){n.prototype.removeTrack.call(this,e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)},e}(Dt),qt=function(n){function e(e){var t;void 0===e&&(e=[]);for(var i=e.length-1;0<=i;i--)if(e[i].selected){Bt(e,e[i]);break}return(t=n.call(this,e)||this).changing_=!1,Object.defineProperty(f(t),"selectedIndex",{get:function(){for(var e=0;e>0},ToUint32:function(e){return this.ToNumber(e)>>>0},ToUint16:function(e){var t=this.ToNumber(e);return Ki(t)||0===t||!Qi(t)?0:function(e,t){var i=e%t;return Math.floor(0<=i?i:i+t)}(xi(t)*Math.floor(Math.abs(t)),65536)},ToString:function(e){return on(e)},ToObject:function(e){return this.CheckObjectCoercible(e),an(e)},CheckObjectCoercible:function(e,t){if(null==e)throw new sn(t||"Cannot call method on "+e);return e},IsCallable:Di,SameValue:function(e,t){return e===t?0!==e||1/e==1/t:Ki(e)&&Ki(t)},Type:function(e){return null===e?"Null":"undefined"==typeof e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0},IsPropertyDescriptor:function(e){if("Object"!==this.Type(e))return!1;var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var i in e)if(Wi(e,i)&&!t[i])return!1;var n=Wi(e,"[[Value]]"),r=Wi(e,"[[Get]]")||Wi(e,"[[Set]]");if(n&&r)throw new sn("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(e){return"undefined"!=typeof e&&(Oi(this,"Property Descriptor","Desc",e),!(!Wi(e,"[[Get]]")&&!Wi(e,"[[Set]]")))},IsDataDescriptor:function(e){return"undefined"!=typeof e&&(Oi(this,"Property Descriptor","Desc",e),!(!Wi(e,"[[Value]]")&&!Wi(e,"[[Writable]]")))},IsGenericDescriptor:function(e){return"undefined"!=typeof e&&(Oi(this,"Property Descriptor","Desc",e),!this.IsAccessorDescriptor(e)&&!this.IsDataDescriptor(e))},FromPropertyDescriptor:function(e){if("undefined"==typeof e)return e;if(Oi(this,"Property Descriptor","Desc",e),this.IsDataDescriptor(e))return{value:e["[[Value]]"],writable:!!e["[[Writable]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};if(this.IsAccessorDescriptor(e))return{get:e["[[Get]]"],set:e["[[Set]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};throw new sn("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(e){if("Object"!==this.Type(e))throw new sn("ToPropertyDescriptor requires an object");var t={};if(Wi(e,"enumerable")&&(t["[[Enumerable]]"]=this.ToBoolean(e.enumerable)),Wi(e,"configurable")&&(t["[[Configurable]]"]=this.ToBoolean(e.configurable)),Wi(e,"value")&&(t["[[Value]]"]=e.value),Wi(e,"writable")&&(t["[[Writable]]"]=this.ToBoolean(e.writable)),Wi(e,"get")){var i=e.get;if("undefined"!=typeof i&&!this.IsCallable(i))throw new TypeError("getter must be a function");t["[[Get]]"]=i}if(Wi(e,"set")){var n=e.set;if("undefined"!=typeof n&&!this.IsCallable(n))throw new sn("setter must be a function");t["[[Set]]"]=n}if((Wi(t,"[[Get]]")||Wi(t,"[[Set]]"))&&(Wi(t,"[[Value]]")||Wi(t,"[[Writable]]")))throw new sn("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}},ln=ai.call(Function.call,String.prototype.replace),cn=/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,hn=/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/,dn=ai.call(Function.call,Bi());ji(dn,{getPolyfill:Bi,implementation:Mi,shim:function(){var e=Bi();return ji(String.prototype,{trim:e},{trim:function(){return String.prototype.trim!==e}}),e}});var pn=dn,fn=Object.prototype.toString,mn=Object.prototype.hasOwnProperty,gn=function(e,t,i){if(!Di(t))throw new TypeError("iterator must be a function");var n;3<=arguments.length&&(n=i),"[object Array]"===fn.call(e)?function(e,t,i){for(var n=0,r=e.length;n=e?t.push(r):r.startTime===r.endTime&&r.startTime<=e&&r.startTime+.5>=e&&t.push(r)}if(o=!1,t.length!==this.activeCues_.length)o=!0;else for(var a=0;a","‎":"?","‏":"?"," ":" "},Fn={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},Vn={v:"title",lang:"lang"},Hn={rt:"ruby"};function qn(a,i){function e(){if(!i)return null;var e,t=i.match(/^([^<]*)(<[^>]*>?)?/);return e=t[1]?t[1]:t[2],i=i.substr(e.length),e}function t(e){return jn[e]}function n(e){for(;f=e.match(/&(amp|lt|gt|lrm|rlm|nbsp);/);)e=e.replace(f[0],t);return e}function r(e,t){var i=Fn[e];if(!i)return null;var n=a.document.createElement(i);n.localName=i;var r=Vn[e];return r&&t&&(n[r]=t.trim()),n}for(var s,o,u,l=a.document.createElement("div"),c=l,h=[];null!==(s=e());)if("<"!==s[0])c.appendChild(a.document.createTextNode(n(s)));else{if("/"===s[1]){h.length&&h[h.length-1]===s.substr(2).replace(">","")&&(h.pop(),c=c.parentNode);continue}var d,p=Rn(s.substr(1,s.length-2));if(p){d=a.document.createProcessingInstruction("timestamp",p),c.appendChild(d);continue}var f=s.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!f)continue;if(!(d=r(f[1],f[3])))continue;if(o=c,Hn[(u=d).localName]&&Hn[u.localName]!==o.localName)continue;f[2]&&(d.className=f[2].substr(1).replace("."," ")),h.push(f[1]),c.appendChild(d),c=d}return l}var zn=[[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 Wn(e){for(var t=0;t=i[0]&&e<=i[1])return!0}return!1}function Gn(){}function $n(e,t,i){Gn.call(this),this.cue=t,this.cueDiv=qn(e,t.text);var n={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:""===t.vertical?"horizontal-tb":"lr"===t.vertical?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(n,this.cueDiv),this.div=e.document.createElement("div"),n={direction:function(e){var t=[],i="";if(!e||!e.childNodes)return"ltr";function r(e,t){for(var i=t.childNodes.length-1;0<=i;i--)e.push(t.childNodes[i])}function a(e){if(!e||!e.length)return null;var t=e.pop(),i=t.textContent||t.innerText;if(i){var n=i.match(/^.*(\n|\r)/);return n?n[e.length=0]:i}return"ruby"===t.tagName?a(e):t.childNodes?(r(e,t),a(e)):void 0}for(r(t,e);i=a(t);)for(var n=0;nh&&(c=c<0?-1:1,c*=Math.ceil(h/l)*l),r<0&&(c+=""===n.vertical?o.height:o.width,a=a.reverse()),i.move(d,c)}else{var p=i.lineHeight/o.height*100;switch(n.lineAlign){case"middle":r-=p/2;break;case"end":r-=p}switch(n.vertical){case"":t.applyStyles({top:t.formatStyle(r,"%")});break;case"rl":t.applyStyles({left:t.formatStyle(r,"%")});break;case"lr":t.applyStyles({right:t.formatStyle(r,"%")})}a=["+y","-x","+x","-y"],i=new Xn(t)}var f=function(e,t){for(var i,n=new Xn(e),r=1,a=0;ae.left&&this.tope.top},Xn.prototype.overlapsAny=function(e){for(var t=0;t=e.top&&this.bottom<=e.bottom&&this.left>=e.left&&this.right<=e.right},Xn.prototype.overlapsOppositeAxis=function(e,t){switch(t){case"+x":return this.lefte.right;case"+y":return this.tope.bottom}},Xn.prototype.intersectPercentage=function(e){return Math.max(0,Math.min(this.right,e.right)-Math.max(this.left,e.left))*Math.max(0,Math.min(this.bottom,e.bottom)-Math.max(this.top,e.top))/(this.height*this.width)},Xn.prototype.toCSSCompatValues=function(e){return{top:this.top-e.top,bottom:e.bottom-this.bottom,left:this.left-e.left,right:e.right-this.right,height:this.height,width:this.width}},Xn.getSimpleBoxPosition=function(e){var t=e.div?e.div.offsetHeight:e.tagName?e.offsetHeight:0,i=e.div?e.div.offsetWidth:e.tagName?e.offsetWidth:0,n=e.div?e.div.offsetTop:e.tagName?e.offsetTop:0;return{left:(e=e.div?e.div.getBoundingClientRect():e.tagName?e.getBoundingClientRect():e).left,right:e.right,top:e.top||n,height:e.height||t,bottom:e.bottom||n+(e.height||t),width:e.width||i}},Yn.StringDecoder=function(){return{decode:function(e){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}},Yn.convertCueToDOMTree=function(e,t){return e&&t?qn(e,t):null};Yn.processCues=function(n,r,e){if(!n||!r||!e)return null;for(;e.firstChild;)e.removeChild(e.firstChild);var a=n.document.createElement("div");if(a.style.position="absolute",a.style.left="0",a.style.right="0",a.style.top="0",a.style.bottom="0",a.style.margin="1.5%",e.appendChild(a),function(e){for(var t=0;t