generated from bombastictranz/the-book-of-secret-knowledge
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
remote.js.download
707 lines (707 loc) · 117 KB
/
remote.js.download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
(function(g){var window=this;'use strict';var a8=function(a){g.Mo(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^g.kb()).toString(36));return a},b8=function(a,b,c){Array.isArray(c)||(c=[String(c)]);
g.Fga(a.B,b,c)},rzb=function(a){if(a instanceof g.jt)return a;
if("function"==typeof a.Lk)return a.Lk(!1);if(g.ab(a)){var b=0,c=new g.jt;c.next=function(){for(;;){if(b>=a.length)return g.A2;if(b in a)return g.kt(a[b++]);b++}};
return c}throw Error("Not implemented");},szb=function(a,b,c){if(g.ab(a))g.bc(a,b,c);
else for(a=rzb(a);;){var d=a.next();if(d.done)break;b.call(c,d.value,void 0,a)}},tzb=function(a,b){var c=[];
szb(b,function(d){try{var e=g.Dv.prototype.B.call(this,d,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}void 0===e?c.push(d):g.vla(e)&&c.push(d)},a);
return c},uzb=function(a,b){tzb(a,b).forEach(function(c){g.Dv.prototype.remove.call(this,c)},a)},vzb=function(a){if(a.ma){if(a.ma.locationOverrideToken)return{locationOverrideToken:a.ma.locationOverrideToken};
if(null!=a.ma.latitudeE7&&null!=a.ma.longitudeE7)return{latitudeE7:a.ma.latitudeE7,longitudeE7:a.ma.longitudeE7}}return null},wzb=function(a,b){g.Fb(a,b)||a.push(b)},xzb=function(a){var b=0,c;
for(c in a)b++;return b},yzb=function(a,b){return g.kd(a,b)},zzb=function(a){try{return g.Sa.JSON.parse(a)}catch(b){}a=String(a);
if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);},c8=function(a){if(g.Sa.JSON)try{return g.Sa.JSON.parse(a)}catch(b){}return zzb(a)},Azb=function(a){if(a.jm&&"function"==typeof a.jm)return a.jm();
if("undefined"!==typeof Map&&a instanceof Map||"undefined"!==typeof Set&&a instanceof Set)return Array.from(a.values());if("string"===typeof a)return a.split("");if(g.ab(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}return g.gd(a)},Bzb=function(a){if(a.yp&&"function"==typeof a.yp)return a.yp();
if(!a.jm||"function"!=typeof a.jm){if("undefined"!==typeof Map&&a instanceof Map)return Array.from(a.keys());if(!("undefined"!==typeof Set&&a instanceof Set)){if(g.ab(a)||"string"===typeof a){var b=[];a=a.length;for(var c=0;c<a;c++)b.push(c);return b}return g.id(a)}}},Czb=function(a,b){if(a.forEach&&"function"==typeof a.forEach)a.forEach(b,void 0);
else if(g.ab(a)||"string"===typeof a)Array.prototype.forEach.call(a,b,void 0);else for(var c=Bzb(a),d=Azb(a),e=d.length,f=0;f<e;f++)b.call(void 0,d[f],c&&c[f],a)},Dzb=function(a,b,c,d){var e=new g.Eo(null);
a&&g.Fo(e,a);b&&g.Go(e,b);c&&g.Ho(e,c);d&&(e.C=d);return e},Ezb=function(){this.j=d8();
this.j.Kh("/client_streamz/youtube/living_room/mdx/channel/opened",{Pc:3,Oc:"channel_type"})},Fzb=function(a,b){a.j.rj("/client_streamz/youtube/living_room/mdx/channel/opened",b)},Gzb=function(){this.j=d8();
this.j.Kh("/client_streamz/youtube/living_room/mdx/channel/closed",{Pc:3,Oc:"channel_type"})},Hzb=function(a,b){a.j.rj("/client_streamz/youtube/living_room/mdx/channel/closed",b)},Izb=function(){this.j=d8();
this.j.Kh("/client_streamz/youtube/living_room/mdx/channel/message_received",{Pc:3,Oc:"channel_type"})},Jzb=function(a,b){a.j.rj("/client_streamz/youtube/living_room/mdx/channel/message_received",b)},Kzb=function(){this.j=d8();
this.j.Kh("/client_streamz/youtube/living_room/mdx/channel/error",{Pc:3,Oc:"channel_type"})},Lzb=function(a,b){a.j.rj("/client_streamz/youtube/living_room/mdx/channel/error",b)},Mzb=function(){this.j=d8();
this.j.Kh("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},Nzb=function(){this.j=d8();
this.j.Kh("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},Rzb=function(a){this.name=this.id="";
this.clientName="UNKNOWN_INTERFACE";this.app="";this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.capabilities=new Set;this.compatibleSenderThemes=new Set;this.experiments=new Set;this.theme="u";new g.Iv;this.model=this.brand="";this.year=0;this.chipset=this.osVersion=this.os="";this.mdxDialServerType="MDX_DIAL_SERVER_TYPE_UNKNOWN";a&&(this.id=a.id||a.name,this.name=a.name,this.clientName=a.clientName?a.clientName.toUpperCase():"UNKNOWN_INTERFACE",this.app=a.app,this.type=
a.type||"REMOTE_CONTROL",this.username=a.user||"",this.avatar=a.userAvatarUri||"",this.obfuscatedGaiaId=a.obfuscatedGaiaId||"",this.theme=a.theme||"u",Ozb(this,a.capabilities||""),Pzb(this,a.compatibleSenderThemes||""),Qzb(this,a.experiments||""),this.brand=a.brand||"",this.model=a.model||"",this.year=a.year||0,this.os=a.os||"",this.osVersion=a.osVersion||"",this.chipset=a.chipset||"",this.mdxDialServerType=a.mdxDialServerType||"MDX_DIAL_SERVER_TYPE_UNKNOWN",a=a.deviceInfo)&&(a=JSON.parse(a),this.brand=
a.brand||"",this.model=a.model||"",this.year=a.year||0,this.os=a.os||"",this.osVersion=a.osVersion||"",this.chipset=a.chipset||"",this.clientName=a.clientName?a.clientName.toUpperCase():"UNKNOWN_INTERFACE",this.mdxDialServerType=a.mdxDialServerType||"MDX_DIAL_SERVER_TYPE_UNKNOWN")},Ozb=function(a,b){a.capabilities.clear();
g.ot(b.split(","),g.jb(yzb,Szb)).forEach(function(c){a.capabilities.add(c)})},Pzb=function(a,b){a.compatibleSenderThemes.clear();
g.ot(b.split(","),g.jb(yzb,Tzb)).forEach(function(c){a.compatibleSenderThemes.add(c)})},Qzb=function(a,b){a.experiments.clear();
b.split(",").forEach(function(c){a.experiments.add(c)})},e8=function(a){a=a||{};
this.name=a.name||"";this.id=a.id||a.screenId||"";this.token=a.token||a.loungeToken||"";this.uuid=a.uuid||a.dialId||"";this.idType=a.screenIdType||"normal"},f8=function(a,b){return!!b&&(a.id==b||a.uuid==b)},Uzb=function(a){return{name:a.name,
screenId:a.id,loungeToken:a.token,dialId:a.uuid,screenIdType:a.idType}},Vzb=function(a){return new e8(a)},Wzb=function(a){return Array.isArray(a)?g.Er(a,Vzb):[]},g8=function(a){return a?'{name:"'+a.name+'",id:'+a.id.substr(0,6)+"..,token:"+((a.token?".."+a.token.slice(-6):"-")+",uuid:"+(a.uuid?".."+a.uuid.slice(-6):"-")+",idType:"+a.idType+"}"):"null"},Xzb=function(a){return Array.isArray(a)?"["+g.Er(a,g8).join(",")+"]":"null"},Yzb=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,
function(a){var b=16*Math.random()|0;
return("x"==a?b:b&3|8).toString(16)})},Zzb=function(a){return g.Er(a,function(b){return{key:b.id,
name:b.name}})},$zb=function(a,b){return g.Db(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},h8=function(a,b){return g.Db(a,function(c){return f8(c,b)})},aAb=function(){var a=(0,g.HC)();
a&&uzb(a,a.j.Lk(!0))},i8=function(){var a=g.JC("yt-remote-connected-devices")||[];
g.Xb(a);return a},bAb=function(a){if(0==a.length)return[];
var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return g.Er(a,function(d,e){return 0==e?d:d.substring(c.length)})},cAb=function(a){g.IC("yt-remote-connected-devices",a,86400)},j8=function(){if(dAb)return dAb;
var a=g.JC("yt-remote-device-id");a||(a=Yzb(),g.IC("yt-remote-device-id",a,31536E3));for(var b=i8(),c=1,d=a;g.Fb(b,d);)c++,d=a+"#"+c;return dAb=d},eAb=function(){var a=i8(),b=j8();
g.LC()&&g.$b(a,b);a=bAb(a);if(0==a.length)try{g.rpa("remote_sid")}catch(c){}else try{g.$B("remote_sid",a.join(","),-1)}catch(c){}},fAb=function(){return g.JC("yt-remote-session-browser-channel")},gAb=function(){return g.JC("yt-remote-local-screens")||[]},hAb=function(){g.IC("yt-remote-lounge-token-expiration",!0,86400)},iAb=function(a){5<a.length&&(a=a.slice(a.length-5));
var b=g.Er(gAb(),function(d){return d.loungeToken}),c=g.Er(a,function(d){return d.loungeToken});
g.Fr(c,function(d){return!g.Fb(b,d)})&&hAb();
g.IC("yt-remote-local-screens",a,31536E3)},k8=function(a){a||(g.KC("yt-remote-session-screen-id"),g.KC("yt-remote-session-video-id"));
eAb();a=i8();g.Ib(a,j8());cAb(a)},jAb=function(){if(!l8){var a=g.Qv();
a&&(l8=new g.Av(a))}},kAb=function(){jAb();
return l8?!!l8.get("yt-remote-use-staging-server"):!1},m8=function(a,b){g.vE[a]=!0;
var c=g.tE();c&&c.publish.apply(c,arguments);g.vE[a]=!1},lAb=function(){},d8=function(){if(!n8){n8=new g.Ag(new lAb);
var a=g.QB("client_streamz_web_flush_count",-1);-1!==a&&(n8.D=a)}return n8},mAb=function(){var a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/);
return a?parseInt(a[1],10):0},nAb=function(a){return!!document.currentScript&&(-1!=document.currentScript.src.indexOf("?"+a)||-1!=document.currentScript.src.indexOf("&"+a))},oAb=function(){return"function"==typeof window.__onGCastApiAvailable?window.__onGCastApiAvailable:null},o8=function(a){a.length?pAb(a.shift(),function(){o8(a)}):qAb()},rAb=function(a){return"chrome-extension://"+a+"/cast_sender.js"},pAb=function(a,b,c){var d=document.createElement("script");
d.onerror=b;c&&(d.onload=c);g.We(d,g.Ew(a));(document.head||document.documentElement).appendChild(d)},sAb=function(){var a=mAb(),b=[];
if(1<a){var c=a-1;b.push("//www.gstatic.com/eureka/clank/"+a+"/cast_sender.js");b.push("//www.gstatic.com/eureka/clank/"+c+"/cast_sender.js")}return b},qAb=function(){var a=oAb();
a&&a(!1,"No cast extension found")},uAb=function(){if(tAb){var a=2,b=oAb(),c=function(){a--;
0==a&&b&&b(!0)};
window.__onGCastApiAvailable=c;pAb("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",qAb,c)}},vAb=function(){uAb();
var a=sAb();a.push("//www.gstatic.com/eureka/clank/cast_sender.js");o8(a)},xAb=function(){uAb();
var a=sAb();a.push.apply(a,g.pa(wAb.map(rAb)));a.push("//www.gstatic.com/eureka/clank/cast_sender.js");o8(a)},p8=function(a,b,c){g.I.call(this);
this.K=null!=c?(0,g.ib)(a,c):a;this.gj=b;this.G=(0,g.ib)(this.b3,this);this.j=!1;this.B=0;this.C=this.qd=null;this.D=[]},q8=function(a,b,c){g.I.call(this);
this.D=null!=c?a.bind(c):a;this.gj=b;this.C=null;this.j=!1;this.B=0;this.qd=null},yAb=function(a){a.qd=g.yg(function(){a.qd=null;
a.j&&!a.B&&(a.j=!1,yAb(a))},a.gj);
var b=a.C;a.C=null;a.D.apply(null,b)},r8=function(){},zAb=function(){g.Ab.call(this,"p")},AAb=function(){g.Ab.call(this,"o")},CAb=function(){return BAb=BAb||new g.Ld},DAb=function(a){g.Ab.call(this,"serverreachability",a)},s8=function(a){var b=CAb();
b.dispatchEvent(new DAb(b,a))},EAb=function(a){g.Ab.call(this,"statevent",a)},t8=function(a){var b=CAb();
b.dispatchEvent(new EAb(b,a))},FAb=function(a,b,c,d){g.Ab.call(this,"timingevent",a);
this.size=b;this.retries=d},u8=function(a,b){if("function"!==typeof a)throw Error("Fn must not be null and must be a function");
return g.Sa.setTimeout(function(){a()},b)},v8=function(){},w8=function(a,b,c,d){this.G=a;
this.D=b;this.Lc=c;this.jc=d||1;this.Za=new g.Ep(this);this.ub=45E3;a=g.nS?125:void 0;this.ib=new g.xg(a);this.Na=null;this.C=!1;this.Y=this.fb=this.Z=this.Ra=this.Ca=this.Nb=this.ma=null;this.va=[];this.j=null;this.K=0;this.N=this.Ia=null;this.Gb=-1;this.Ma=!1;this.tb=0;this.Xa=null;this.Vb=this.Wa=this.Ob=this.Ea=!1;this.B=new GAb},GAb=function(){this.C=null;
this.j="";this.B=!1},IAb=function(a,b,c){a.Ra=1;
a.Z=a8(b.clone());a.Y=c;a.Ea=!0;HAb(a,null)},HAb=function(a,b){a.Ca=Date.now();
x8(a);a.fb=a.Z.clone();b8(a.fb,"t",a.jc);a.K=0;var c=a.G.Ra;a.B=new GAb;a.j=JAb(a.G,c?b:null,!a.Y);0<a.tb&&(a.Xa=new q8((0,g.ib)(a.pT,a,a.j),a.tb));a.Za.Ta(a.j,"readystatechange",a.f3);b=a.Na?g.pd(a.Na):{};a.Y?(a.Ia||(a.Ia="POST"),b["Content-Type"]="application/x-www-form-urlencoded",a.j.send(a.fb,a.Ia,a.Y,b)):(a.Ia="GET",a.j.send(a.fb,a.Ia,null,b));s8(1)},KAb=function(a){return a.j?"GET"==a.Ia&&2!=a.Ra&&a.G.Ff:!1},PAb=function(a,b,c){for(var d=!0,e;!a.Ma&&a.K<c.length;)if(e=LAb(a,c),e==MAb){4==b&&
(a.N=4,t8(14),d=!1);
break}else if(e==NAb){a.N=4;t8(15);d=!1;break}else OAb(a,e);KAb(a)&&0!=a.K&&(a.B.j=a.B.j.slice(a.K),a.K=0);4!=b||0!=c.length||a.B.B||(a.N=1,t8(16),d=!1);a.C=a.C&&d;d?0<c.length&&!a.Vb&&(a.Vb=!0,a.G.nQ(a)):(y8(a),z8(a))},LAb=function(a,b){var c=a.K,d=b.indexOf("\n",c);
if(-1==d)return MAb;c=Number(b.substring(c,d));if(isNaN(c))return NAb;d+=1;if(d+c>b.length)return MAb;b=b.slice(d,d+c);a.K=d+c;return b},x8=function(a){a.Nb=Date.now()+a.ub;
QAb(a,a.ub)},QAb=function(a,b){if(null!=a.ma)throw Error("WatchDog timer not null");
a.ma=u8((0,g.ib)(a.d3,a),b)},A8=function(a){a.ma&&(g.Sa.clearTimeout(a.ma),a.ma=null)},z8=function(a){a.G.Ug()||a.Ma||RAb(a.G,a)},y8=function(a){A8(a);
g.vb(a.Xa);a.Xa=null;a.ib.stop();a.Za.Tf();if(a.j){var b=a.j;a.j=null;b.abort();b.dispose()}},OAb=function(a,b){try{var c=a.G;
if(0!=c.Jh&&(c.j==a||SAb(c.B,a)))if(!a.Wa&&SAb(c.B,a)&&3==c.Jh){try{var d=c.Gf.j.parse(b)}catch(x){d=null}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.Z){if(c.j)if(c.j.Ca+3E3<a.Ca)B8(c),C8(c);else break a;TAb(c);t8(18)}}else c.me=e[1],0<c.me-c.Xa&&37500>e[2]&&c.Wa&&0==c.va&&!c.ma&&(c.ma=u8((0,g.ib)(c.g3,c),6E3));if(1>=UAb(c.B)&&c.Yc){try{c.Yc()}catch(x){}c.Yc=void 0}}else D8(c,11)}else if((a.Wa||c.j==a)&&B8(c),!g.fc(b))for(e=c.Gf.j.parse(b),b=0;b<e.length;b++){var f=e[b];c.Xa=f[0];
f=f[1];if(2==c.Jh)if("c"==f[0]){c.D=f[1];c.Vb=f[2];var h=f[3];null!=h&&(c.qT=h);var l=f[5];null!=l&&"number"===typeof l&&0<l&&(c.Za=1.5*l);d=c;var m=a.zO();if(m){var n=g.Pn(m,"X-Client-Wire-Protocol");if(n){var p=d.B;!p.j&&(g.ic(n,"spdy")||g.ic(n,"quic")||g.ic(n,"h2"))&&(p.D=p.G,p.j=new Set,p.B&&(VAb(p,p.B),p.B=null))}if(d.Ea){var q=g.Pn(m,"X-HTTP-Session-Id");q&&(d.Pe=q,g.Mo(d.Na,d.Ea,q))}}c.Jh=3;c.G&&c.G.wT();c.Jc&&(c.Kd=Date.now()-a.Ca);d=c;var r=a;d.Bd=WAb(d,d.Ra?d.Vb:null,d.jc);if(r.Wa){XAb(d.B,
r);var t=r,v=d.Za;v&&t.setTimeout(v);t.ma&&(A8(t),x8(t));d.j=r}else YAb(d);0<c.C.length&&E8(c)}else"stop"!=f[0]&&"close"!=f[0]||D8(c,7);else 3==c.Jh&&("stop"==f[0]||"close"==f[0]?"stop"==f[0]?D8(c,7):c.disconnect():"noop"!=f[0]&&c.G&&c.G.vT(f),c.va=0)}s8(4)}catch(x){}},ZAb=function(a,b){this.j=a;
this.map=b;this.context=null},$Ab=function(a){this.G=a||10;
g.Sa.PerformanceNavigationTiming?(a=g.Sa.performance.getEntriesByType("navigation"),a=0<a.length&&("hq"==a[0].nextHopProtocol||"h2"==a[0].nextHopProtocol)):a=!!(g.Sa.chrome&&g.Sa.chrome.loadTimes&&g.Sa.chrome.loadTimes()&&g.Sa.chrome.loadTimes().wasFetchedViaSpdy);this.D=a?this.G:1;this.j=null;1<this.D&&(this.j=new Set);this.B=null;this.C=[]},aBb=function(a){return a.B?!0:a.j?a.j.size>=a.D:!1},UAb=function(a){return a.B?1:a.j?a.j.size:0},SAb=function(a,b){return a.B?a.B==b:a.j?a.j.has(b):!1},VAb=
function(a,b){a.j?a.j.add(b):a.B=b},XAb=function(a,b){a.B&&a.B==b?a.B=null:a.j&&a.j.has(b)&&a.j.delete(b)},bBb=function(a){if(null!=a.B)return a.C.concat(a.B.va);
if(null!=a.j&&0!==a.j.size){var b=a.C;a=g.u(a.j.values());for(var c=a.next();!c.done;c=a.next())b=b.concat(c.value.va);return b}return g.Lb(a.C)},cBb=function(a,b){var c=new v8;
if(g.Sa.Image){var d=new Image;d.onload=g.jb(F8,c,"TestLoadImage: loaded",!0,b,d);d.onerror=g.jb(F8,c,"TestLoadImage: error",!1,b,d);d.onabort=g.jb(F8,c,"TestLoadImage: abort",!1,b,d);d.ontimeout=g.jb(F8,c,"TestLoadImage: timeout",!1,b,d);g.Sa.setTimeout(function(){if(d.ontimeout)d.ontimeout()},1E4);
d.src=a}else b(!1)},dBb=function(a,b){var c=new v8,d=new AbortController,e=setTimeout(function(){d.abort();
F8(c,"TestPingServer: timeout",!1,b)},1E4);
fetch(a,{signal:d.signal}).then(function(f){clearTimeout(e);f.ok?F8(c,"TestPingServer: ok",!0,b):F8(c,"TestPingServer: server error",!1,b)}).catch(function(){clearTimeout(e);
F8(c,"TestPingServer: error",!1,b)})},F8=function(a,b,c,d,e){try{e&&(e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null),d(c)}catch(f){}},eBb=function(){this.j=new r8},fBb=function(a,b,c){var d=c||"";
try{Czb(a,function(e,f){var h=e;g.bb(e)&&(h=g.Nm(e));b.push(d+f+"="+encodeURIComponent(h))})}catch(e){throw b.push(d+"type="+encodeURIComponent("_badmap")),e;
}},G8=function(a,b,c){return c&&c.r8?c.r8[a]||b:b},gBb=function(a){this.C=[];
this.Vb=this.Bd=this.Na=this.jc=this.j=this.Pe=this.Ea=this.Ma=this.N=this.Nb=this.Y=null;this.Xf=this.fb=0;this.Vf=G8("failFast",!1,a);this.Wa=this.ma=this.Z=this.K=this.G=null;this.Lc=!0;this.me=this.Xa=-1;this.Ob=this.va=this.Ca=0;this.wh=G8("baseRetryDelayMs",5E3,a);this.Yf=G8("retryDelaySeedMs",1E4,a);this.Wf=G8("forwardChannelMaxRetries",2,a);this.Ee=G8("forwardChannelRequestTimeoutMs",2E4,a);this.Fe=a&&a.Xob||void 0;this.rg=a&&a.Rnb||void 0;this.Ff=a&&a.Tob||!1;this.Za=void 0;this.Ra=a&&a.Rca||
!1;this.D="";this.B=new $Ab(a&&a.Xlb);this.Gf=new eBb;this.ub=a&&a.qmb||!1;this.tb=a&&a.dmb||!1;this.ub&&this.tb&&(this.tb=!1);this.Zf=a&&a.Olb||!1;a&&a.tmb&&(this.Lc=!1);this.Jc=!this.ub&&this.Lc&&a&&a.bmb||!1;this.rd=void 0;a&&a.KY&&0<a.KY&&(this.rd=a.KY);this.Yc=void 0;this.Kd=0;this.ib=!1;this.Gb=this.Ia=null},C8=function(a){a.j&&(hBb(a),a.j.cancel(),a.j=null)},iBb=function(a){C8(a);
a.Z&&(g.Sa.clearTimeout(a.Z),a.Z=null);B8(a);a.B.cancel();a.K&&("number"===typeof a.K&&g.Sa.clearTimeout(a.K),a.K=null)},E8=function(a){aBb(a.B)||a.K||(a.K=!0,g.ig(a.sT,a),a.Ca=0)},kBb=function(a,b){if(UAb(a.B)>=a.B.D-(a.K?1:0))return!1;
if(a.K)return a.C=b.va.concat(a.C),!0;if(1==a.Jh||2==a.Jh||a.Ca>=(a.Vf?0:a.Wf))return!1;a.K=u8((0,g.ib)(a.sT,a,b),jBb(a,a.Ca));a.Ca++;return!0},mBb=function(a,b){var c;
b?c=b.Lc:c=a.fb++;var d=a.Na.clone();g.Mo(d,"SID",a.D);g.Mo(d,"RID",c);g.Mo(d,"AID",a.Xa);H8(a,d);a.N&&a.Y&&g.Dp(d,a.N,a.Y);c=new w8(a,a.D,c,a.Ca+1);null===a.N&&(c.Na=a.Y);b&&(a.C=b.va.concat(a.C));b=lBb(a,c,1E3);c.setTimeout(Math.round(.5*a.Ee)+Math.round(.5*a.Ee*Math.random()));VAb(a.B,c);IAb(c,d,b)},H8=function(a,b){a.Ma&&g.bd(a.Ma,function(c,d){g.Mo(b,d,c)});
a.G&&Czb({},function(c,d){g.Mo(b,d,c)})},lBb=function(a,b,c){c=Math.min(a.C.length,c);
var d=a.G?(0,g.ib)(a.G.j3,a.G,a):null;a:for(var e=a.C,f=-1;;){var h=["count="+c];-1==f?0<c?(f=e[0].j,h.push("ofs="+f)):f=0:h.push("ofs="+f);for(var l=!0,m=0;m<c;m++){var n=e[m].j,p=e[m].map;n-=f;if(0>n)f=Math.max(0,e[m].j-100),l=!1;else try{fBb(p,h,"req"+n+"_")}catch(q){d&&d(p)}}if(l){d=h.join("&");break a}}a=a.C.splice(0,c);b.va=a;return d},YAb=function(a){a.j||a.Z||(a.Ob=1,g.ig(a.rT,a),a.va=0)},TAb=function(a){if(a.j||a.Z||3<=a.va)return!1;
a.Ob++;a.Z=u8((0,g.ib)(a.rT,a),jBb(a,a.va));a.va++;return!0},hBb=function(a){null!=a.Ia&&(g.Sa.clearTimeout(a.Ia),a.Ia=null)},nBb=function(a){a.j=new w8(a,a.D,"rpc",a.Ob);
null===a.N&&(a.j.Na=a.Y);a.j.tb=0;var b=a.Bd.clone();g.Mo(b,"RID","rpc");g.Mo(b,"SID",a.D);g.Mo(b,"AID",a.Xa);g.Mo(b,"CI",a.Wa?"0":"1");!a.Wa&&a.rd&&g.Mo(b,"TO",a.rd);g.Mo(b,"TYPE","xmlhttp");H8(a,b);a.N&&a.Y&&g.Dp(b,a.N,a.Y);a.Za&&a.j.setTimeout(a.Za);var c=a.j;a=a.Vb;c.Ra=1;c.Z=a8(b.clone());c.Y=null;c.Ea=!0;HAb(c,a)},B8=function(a){null!=a.ma&&(g.Sa.clearTimeout(a.ma),a.ma=null)},RAb=function(a,b){var c=null;
if(a.j==b){B8(a);hBb(a);a.j=null;var d=2}else if(SAb(a.B,b))c=b.va,XAb(a.B,b),d=1;else return;if(0!=a.Jh)if(b.C)if(1==d){c=b.Y?b.Y.length:0;b=Date.now()-b.Ca;var e=a.Ca;d=CAb();d.dispatchEvent(new FAb(d,c,b,e));E8(a)}else YAb(a);else{var f=b.Gb;e=b.getLastError();if(3==e||0==e&&0<f||!(1==d&&kBb(a,b)||2==d&&TAb(a)))switch(c&&0<c.length&&(b=a.B,b.C=b.C.concat(c)),e){case 1:D8(a,5);break;case 4:D8(a,10);break;case 3:D8(a,6);break;default:D8(a,2)}}},jBb=function(a,b){var c=a.wh+Math.floor(Math.random()*
a.Yf);
a.isActive()||(c*=2);return c*b},D8=function(a,b){if(2==b){var c=(0,g.ib)(a.Xca,a),d=a.rg,e=!d;
d=new g.Eo(d||"//www.google.com/images/cleardot.gif");g.Sa.location&&"http"==g.Sa.location.protocol||g.Fo(d,"https");a8(d);e?cBb(d.toString(),c):dBb(d.toString(),c)}else t8(2);a.Jh=0;a.G&&a.G.uT(b);oBb(a);iBb(a)},oBb=function(a){a.Jh=0;
a.Gb=[];if(a.G){var b=bBb(a.B);if(0!=b.length||0!=a.C.length)g.Mb(a.Gb,b),g.Mb(a.Gb,a.C),a.B.C.length=0,g.Lb(a.C),a.C.length=0;a.G.tT()}},pBb=function(a){if(0==a.Jh)return a.Gb;
var b=[];g.Mb(b,bBb(a.B));g.Mb(b,a.C);return b},WAb=function(a,b,c){var d=g.No(c);
""!=d.j?(b&&g.Go(d,b+"."+d.j),g.Ho(d,d.D)):(d=g.Sa.location,d=Dzb(d.protocol,b?b+"."+d.hostname:d.hostname,+d.port,c));b=a.Ea;c=a.Pe;b&&c&&g.Mo(d,b,c);g.Mo(d,"VER",a.qT);H8(a,d);return d},JAb=function(a,b,c){if(b&&!a.Ra)throw Error("Can't create secondary domain capable XhrIo object.");
b=a.Ff&&!a.Fe?new g.In(new g.Ao({q0:c})):new g.In(a.Fe);b.K=a.Ra;return b},qBb=function(){},rBb=function(){if(g.Cf&&!g.Uc(10))throw Error("Environmental error: no available transport.");
},J8=function(a,b){g.Ld.call(this);
this.j=new gBb(b);this.G=a;this.B=b&&b.g9||null;a=b&&b.f9||null;b&&b.Vlb&&(a?a["X-Client-Protocol"]="webchannel":a={"X-Client-Protocol":"webchannel"});this.j.Y=a;a=b&&b.vnb||null;b&&b.SY&&(a?a["X-WebChannel-Content-Type"]=b.SY:a={"X-WebChannel-Content-Type":b.SY});b&&b.WV&&(a?a["X-WebChannel-Client-Profile"]=b.WV:a={"X-WebChannel-Client-Profile":b.WV});this.j.Nb=a;(a=b&&b.unb)&&!g.fc(a)&&(this.j.N=a);this.K=b&&b.Rca||!1;this.D=b&&b.rob||!1;(b=b&&b.m8)&&!g.fc(b)&&(this.j.Ea=b,g.jd(this.B,b)&&(a=this.B,
b in a&&delete a[b]));this.C=new I8(this)},sBb=function(a){zAb.call(this);
a.__headers__&&(this.headers=a.__headers__,this.statusCode=a.__status__,delete a.__headers__,delete a.__status__);var b=a.__sm__;b?this.data=(this.j=g.fd(b))?g.nd(b,this.j):b:this.data=a},tBb=function(a){AAb.call(this);
this.status=1;this.errorCode=a},I8=function(a){this.j=a},uBb=function(a,b){this.B=a;
this.j=b},vBb=function(a){return pBb(a.j).map(function(b){var c=a.B;
b=b.map;"__data__"in b?(b=b.__data__,c=c.D?zzb(b):b):c=b;return c})},K8=function(a,b){if("function"!==typeof a)throw Error("Fn must not be null and must be a function");
return g.Sa.setTimeout(function(){a()},b)},M8=function(a){L8.dispatchEvent(new wBb(L8,a))},wBb=function(a){g.Ab.call(this,"statevent",a)},N8=function(a,b,c,d){this.j=a;
this.D=b;this.N=c;this.K=d||1;this.B=45E3;this.C=new g.Ep(this);this.G=new g.xg;this.G.setInterval(250)},yBb=function(a,b,c){a.Tx=1;
a.Ur=a8(b.clone());a.Iu=c;a.Ea=!0;xBb(a,null)},zBb=function(a,b,c,d,e){a.Tx=1;
a.Ur=a8(b.clone());a.Iu=null;a.Ea=c;e&&(a.P_=!1);xBb(a,d)},xBb=function(a,b){a.Sx=Date.now();
O8(a);a.Wr=a.Ur.clone();b8(a.Wr,"t",a.K);a.FG=0;a.qj=a.j.ML(a.j.cC()?b:null);0<a.KL&&(a.DG=new q8((0,g.ib)(a.xT,a,a.qj),a.KL));a.C.Ta(a.qj,"readystatechange",a.m3);b=a.Hu?g.pd(a.Hu):{};a.Iu?(a.EG="POST",b["Content-Type"]="application/x-www-form-urlencoded",a.qj.send(a.Wr,a.EG,a.Iu,b)):(a.EG="GET",a.P_&&!g.Vc&&(b.Connection="close"),a.qj.send(a.Wr,a.EG,null,b));a.j.Tn(1)},CBb=function(a,b){var c=a.FG,d=b.indexOf("\n",c);
if(-1==d)return ABb;c=Number(b.substring(c,d));if(isNaN(c))return BBb;d+=1;if(d+c>b.length)return ABb;b=b.slice(d,d+c);a.FG=d+c;return b},EBb=function(a,b){a.Sx=Date.now();
O8(a);var c=b?window.location.hostname:"";a.Wr=a.Ur.clone();g.Mo(a.Wr,"DOMAIN",c);g.Mo(a.Wr,"t",a.K);try{a.Do=new ActiveXObject("htmlfile")}catch(m){P8(a);a.Vr=7;M8(22);Q8(a);return}var d="<html><body>";if(b){var e="";for(b=0;b<c.length;b++){var f=c.charAt(b);if("<"==f)f=e+"\\x3c";else if(">"==f)f=e+"\\x3e";else{if(f in R8)f=R8[f];else if(f in DBb)f=R8[f]=DBb[f];else{var h=f.charCodeAt(0);if(31<h&&127>h)var l=f;else{if(256>h){if(l="\\x",16>h||256<h)l+="0"}else l="\\u",4096>h&&(l+="0");l+=h.toString(16).toUpperCase()}f=
R8[f]=l}f=e+f}e=f}d+='<script>document.domain="'+e+'"\x3c/script>'}c=g.te(d+"</body></html>");a.Do.open();a.Do.write(g.pe(c));a.Do.close();a.Do.parentWindow.m=(0,g.ib)(a.Xaa,a);a.Do.parentWindow.d=(0,g.ib)(a.MZ,a,!0);a.Do.parentWindow.rpcClose=(0,g.ib)(a.MZ,a,!1);c=a.Do.createElement("DIV");a.Do.parentWindow.document.body.appendChild(c);d=g.ye(a.Wr.toString());d=g.$e(g.ke(d));d=g.te('<iframe src="'+d+'"></iframe>');g.Qba(c,d);a.j.Tn(1)},O8=function(a){a.LL=Date.now()+a.B;
FBb(a,a.B)},FBb=function(a,b){if(null!=a.Ux)throw Error("WatchDog timer not null");
a.Ux=K8((0,g.ib)(a.l3,a),b)},GBb=function(a){a.Ux&&(g.Sa.clearTimeout(a.Ux),a.Ux=null)},Q8=function(a){a.j.Ug()||a.Gu||a.j.GG(a)},P8=function(a){GBb(a);
g.vb(a.DG);a.DG=null;a.G.stop();a.C.Tf();if(a.qj){var b=a.qj;a.qj=null;b.abort();b.dispose()}a.Do&&(a.Do=null)},HBb=function(a,b){try{a.j.yT(a,b),a.j.Tn(4)}catch(c){}},JBb=function(a,b,c,d,e){if(0==d)c(!1);
else{var f=e||0;d--;IBb(a,b,function(h){h?c(!0):g.Sa.setTimeout(function(){JBb(a,b,c,d,f)},f)})}},IBb=function(a,b,c){var d=new Image;
d.onload=function(){try{S8(d),c(!0)}catch(e){}};
d.onerror=function(){try{S8(d),c(!1)}catch(e){}};
d.onabort=function(){try{S8(d),c(!1)}catch(e){}};
d.ontimeout=function(){try{S8(d),c(!1)}catch(e){}};
g.Sa.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b);
d.src=a},S8=function(a){a.onload=null;
a.onerror=null;a.onabort=null;a.ontimeout=null},KBb=function(a){this.j=a;
this.B=new r8},LBb=function(a){var b=T8(a.j,a.NC,"/mail/images/cleardot.gif");
a8(b);JBb(b.toString(),5E3,(0,g.ib)(a.N5,a),3,2E3);a.Tn(1)},MBb=function(a){var b=a.j.K;
if(null!=b)M8(5),b?(M8(11),U8(a.j,a,!1)):(M8(12),U8(a.j,a,!0));else if(a.Pj=new N8(a),a.Pj.Hu=a.NL,b=a.j,b=T8(b,b.cC()?a.bC:null,a.OL),M8(5),!g.Cf||g.Uc(10))b8(b,"TYPE","xmlhttp"),zBb(a.Pj,b,!1,a.bC,!1);else{b8(b,"TYPE","html");var c=a.Pj;a=!!a.bC;c.Tx=3;c.Ur=a8(b.clone());EBb(c,a)}},NBb=function(a,b,c){this.j=1;
this.B=[];this.C=[];this.G=new r8;this.Y=a||null;this.K=null!=b?b:null;this.Z=c||!1},OBb=function(a,b){this.j=a;
this.map=b;this.context=null},PBb=function(a,b,c,d){g.Ab.call(this,"timingevent",a);
this.size=b;this.retries=d},QBb=function(a){g.Ab.call(this,"serverreachability",a)},SBb=function(a){a.n3(1,0);
a.HG=T8(a,null,a.PL);RBb(a)},TBb=function(a){a.Bs&&(a.Bs.abort(),a.Bs=null);
a.Qg&&(a.Qg.cancel(),a.Qg=null);a.mq&&(g.Sa.clearTimeout(a.mq),a.mq=null);V8(a);a.dk&&(a.dk.cancel(),a.dk=null);a.Xr&&(g.Sa.clearTimeout(a.Xr),a.Xr=null)},UBb=function(a,b){if(0==a.j)throw Error("Invalid operation: sending map when state is closed");
a.B.push(new OBb(a.o3++,b));2!=a.j&&3!=a.j||RBb(a)},VBb=function(a){var b=0;
a.Qg&&b++;a.dk&&b++;return b},RBb=function(a){a.dk||a.Xr||(a.Xr=K8((0,g.ib)(a.CT,a),0),a.Wx=0)},YBb=function(a,b){if(1==a.j){if(!b){a.eC=Math.floor(1E5*Math.random());
b=a.eC++;var c=new N8(a,"",b);c.Hu=a.Lo;var d=WBb(a),e=a.HG.clone();g.Mo(e,"RID",b);g.Mo(e,"CVER","1");W8(a,e);yBb(c,e,d);a.dk=c;a.j=2}}else 3==a.j&&(b?XBb(a,b):0==a.B.length||a.dk||XBb(a))},XBb=function(a,b){if(b)if(6<a.Ju){a.B=a.C.concat(a.B);
a.C.length=0;var c=a.eC-1;b=WBb(a)}else c=b.N,b=b.Iu;else c=a.eC++,b=WBb(a);var d=a.HG.clone();g.Mo(d,"SID",a.D);g.Mo(d,"RID",c);g.Mo(d,"AID",a.Xx);W8(a,d);c=new N8(a,a.D,c,a.Wx+1);c.Hu=a.Lo;c.setTimeout(1E4+Math.round(1E4*Math.random()));a.dk=c;yBb(c,d,b)},W8=function(a,b){a.Ti&&(a=a.Ti.GT())&&g.bd(a,function(c,d){g.Mo(b,d,c)})},WBb=function(a){var b=Math.min(a.B.length,1E3),c=["count="+b];
if(6<a.Ju&&0<b){var d=a.B[0].j;c.push("ofs="+d)}else d=0;for(var e={},f=0;f<b;e={wE:void 0},f++){e.wE=a.B[f].j;var h=a.B[f].map;e.wE=6>=a.Ju?f:e.wE-d;try{g.bd(h,function(l){return function(m,n){c.push("req"+l.wE+"_"+n+"="+encodeURIComponent(m))}}(e))}catch(l){c.push("req"+e.wE+"_type="+encodeURIComponent("_badmap"))}}a.C=a.C.concat(a.B.splice(0,b));
return c.join("&")},ZBb=function(a){a.Qg||a.mq||(a.N=1,a.mq=K8((0,g.ib)(a.BT,a),0),a.Vx=0)},aCb=function(a){if(a.Qg||a.mq||3<=a.Vx)return!1;
a.N++;a.mq=K8((0,g.ib)(a.BT,a),$Bb(a,a.Vx));a.Vx++;return!0},U8=function(a,b,c){a.hL=null==a.K?c:!a.K;
a.Mo=b.lq;a.Z||SBb(a)},V8=function(a){null!=a.Ku&&(g.Sa.clearTimeout(a.Ku),a.Ku=null)},$Bb=function(a,b){var c=5E3+Math.floor(1E4*Math.random());
a.isActive()||(c*=2);return c*b},X8=function(a,b){if(2==b||9==b){var c=null;
a.Ti&&(c=null);var d=(0,g.ib)(a.Wca,a);c||(c=new g.Eo("//www.google.com/images/cleardot.gif"),a8(c));IBb(c.toString(),1E4,d)}else M8(2);bCb(a,b)},bCb=function(a,b){a.j=0;
a.Ti&&a.Ti.DT(b);cCb(a);TBb(a)},cCb=function(a){a.j=0;
a.Mo=-1;if(a.Ti)if(0==a.C.length&&0==a.B.length)a.Ti.QL();else{var b=g.Lb(a.C),c=g.Lb(a.B);a.C.length=0;a.B.length=0;a.Ti.QL(b,c)}},T8=function(a,b,c){var d=g.No(c);
if(""!=d.j)b&&g.Go(d,b+"."+d.j),g.Ho(d,d.D);else{var e=window.location;d=Dzb(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.dC&&g.bd(a.dC,function(f,h){g.Mo(d,h,f)});
g.Mo(d,"VER",a.Ju);W8(a,d);return d},dCb=function(){},eCb=function(){this.j=[];
this.B=[]},fCb=function(a){g.Ab.call(this,"channelMessage");
this.message=a},gCb=function(a){g.Ab.call(this,"channelError");
this.error=a},hCb=function(a,b){this.action=a;
this.params=b||{}},Y8=function(a,b){g.I.call(this);
this.j=new g.Qu(this.Paa,0,this);g.N(this,this.j);this.gj=5E3;this.B=0;if("function"===typeof a)b&&(a=(0,g.ib)(a,b));else if(a&&"function"===typeof a.handleEvent)a=(0,g.ib)(a.handleEvent,a);else throw Error("Invalid listener argument");this.C=a},iCb=function(a,b,c,d,e){c=void 0===c?!1:c;
d=void 0===d?function(){return""}:d;
e=void 0===e?!1:e;this.Ca=a;this.N=b;this.C=new g.zv;this.B=new Y8(this.kca,this);this.j=null;this.ma=!1;this.K=null;this.Y="";this.Z=this.G=0;this.D=[];this.Ra=c;this.va=d;this.Wa=e;this.Na=new Ezb;this.Ia=new Gzb;this.Ma=new Izb;this.Ea=new Kzb;this.Xa=new Mzb;this.fb=new Nzb},jCb=function(a){if(a.j){var b=a.va(),c=a.j.Lo||{};
b?c["x-youtube-lounge-xsrf-token"]=b:delete c["x-youtube-lounge-xsrf-token"];a.j.Lo=c}},Z8=function(a){this.scheme="https";
this.port=this.domain="";this.j="/api/lounge";this.B=!0;a=a||document.location.href;var b=Number(g.Um(4,a))||"";b&&(this.port=":"+b);this.domain=g.Vm(a)||"";a=g.pc();0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>g.oc(a,"10.0")&&(this.B=!1))},$8=function(a,b){var c=a.j;
a.B&&(c=a.scheme+"://"+a.domain+a.port+a.j);return g.an(c+b,{})},kCb=function(a,b,c,d,e){a={format:"JSON",
method:"POST",context:a,timeout:5E3,withCredentials:!1,onSuccess:g.jb(a.D,d,!0),onError:g.jb(a.C,e),onTimeout:g.jb(a.G,e)};c&&(a.postParams=c,a.headers={"Content-Type":"application/x-www-form-urlencoded"});return g.RB(b,a)},lCb=function(a,b){g.Ld.call(this);
var c=this;this.Id=a();this.Id.subscribe("handlerOpened",this.t3,this);this.Id.subscribe("handlerClosed",this.r3,this);this.Id.subscribe("handlerError",function(d,e){c.onError(e)});
this.Id.subscribe("handlerMessage",this.s3,this);this.j=b},mCb=function(a,b,c){var d=this;
c=void 0===c?function(){return""}:c;
var e=void 0===e?new rBb:e;var f=void 0===f?new g.zv:f;this.pathPrefix=a;this.j=b;this.Ca=c;this.G=f;this.Z=null;this.Y=this.N=0;this.channel=null;this.K=0;this.C=new Y8(function(){d.C.isActive();var h;0===(null==(h=d.channel)?void 0:UAb((new uBb(h,h.j)).j.B))&&d.connect(d.Z,d.N)});
this.D={};this.B={};this.ma=!1;this.logger=null;this.va=[];this.Ig=void 0;this.Na=new Ezb;this.Ia=new Gzb;this.Ma=new Izb;this.Ea=new Kzb},nCb=function(a){g.Bd(a.channel,"m",function(){a.K=3;
a.C.reset();a.Z=null;a.N=0;for(var b=g.u(a.va),c=b.next();!c.done;c=b.next())c=c.value,a.channel&&a.channel.send(c);a.va=[];a.ra("webChannelOpened");Fzb(a.Na,"WEB_CHANNEL")});
g.Bd(a.channel,"n",function(){a.K=0;a.C.isActive()||a.ra("webChannelClosed");var b,c=null==(b=a.channel)?void 0:vBb(new uBb(b,b.j));c&&(a.va=[].concat(g.pa(c)));Hzb(a.Ia,"WEB_CHANNEL")});
g.Bd(a.channel,"p",function(b){var c=b.data;"gracefulReconnect"===c[0]?(a.C.start(),a.channel&&a.channel.close()):a.ra("webChannelMessage",new hCb(c[0],c[1]));a.Ig=b.statusCode;Jzb(a.Ma,"WEB_CHANNEL")});
g.Bd(a.channel,"o",function(){401===a.Ig||a.C.start();a.ra("webChannelError");Lzb(a.Ea,"WEB_CHANNEL")})},oCb=function(a){var b=a.Ca();
b?a.D["x-youtube-lounge-xsrf-token"]=b:delete a.D["x-youtube-lounge-xsrf-token"]},pCb=function(a){g.Ld.call(this);
this.j=a();this.j.subscribe("webChannelOpened",this.w3,this);this.j.subscribe("webChannelClosed",this.u3,this);this.j.subscribe("webChannelError",this.onError,this);this.j.subscribe("webChannelMessage",this.v3,this)},qCb=function(a,b,c,d,e){function f(){return new iCb($8(a,"/bc"),b,!1,c,d)}
c=void 0===c?function(){return""}:c;
return g.PB("enable_mdx_web_channel_desktop")?new pCb(function(){return new mCb($8(a,"/wc"),b,c)}):new lCb(f,e)},uCb=function(){var a=rCb;
sCb();a9.push(a);tCb()},b9=function(a,b){sCb();
var c=vCb(a,String(b));0==a9.length?wCb(c):(tCb(),g.bc(a9,function(d){d(c)}))},c9=function(a){b9("CP",a)},sCb=function(){a9||(a9=g.Wa("yt.mdx.remote.debug.handlers_")||[],g.Va("yt.mdx.remote.debug.handlers_",a9))},wCb=function(a){var b=(d9+1)%50;
d9=b;e9[b]=a;f9||(f9=49==b)},tCb=function(){var a=a9;
if(e9[0]){var b=f9?d9:-1;do{b=(b+1)%50;var c=e9[b];g.bc(a,function(d){d(c)})}while(b!=d9);
e9=Array(50);d9=-1;f9=!1}},vCb=function(a,b){var c=(Date.now()-xCb)/1E3;
c.toFixed&&(c=c.toFixed(3));var d=[];d.push("[",c+"s","] ");d.push("[","yt.mdx.remote","] ");d.push(a+": "+b,"\n");return d.join("")},g9=function(a){g.NF.call(this);
this.K=a;this.screens=[]},yCb=function(a,b){var c=a.get(b.uuid)||a.get(b.id);
if(c)return a=c.name,c.id=b.id||c.id,c.name=b.name,c.token=b.token,c.uuid=b.uuid||c.uuid,c.name!=a;a.screens.push(b);return!0},zCb=function(a,b){var c=a.screens.length!=b.length;
a.screens=g.ot(a.screens,function(f){return!!$zb(b,f)});
for(var d=0,e=b.length;d<e;d++)c=yCb(a,b[d])||c;return c},ACb=function(a,b){var c=a.screens.length;
a.screens=g.ot(a.screens,function(d){return!(d||b?!d!=!b?0:d.id==b.id:1)});
return a.screens.length<c},BCb=function(a,b,c,d,e){g.NF.call(this);
this.C=a;this.N=b;this.D=c;this.K=d;this.G=e;this.B=0;this.j=null;this.qd=NaN},i9=function(a){g9.call(this,"LocalScreenService");
this.B=a;this.j=NaN;h9(this);this.info("Initializing with "+Xzb(this.screens))},CCb=function(a){if(a.screens.length){var b=g.Er(a.screens,function(d){return d.id}),c=$8(a.B,"/pairing/get_lounge_token_batch");
kCb(a.B,c,{screen_ids:b.join(",")},(0,g.ib)(a.J7,a),(0,g.ib)(a.I7,a))}},h9=function(a){if(g.PB("deprecate_pair_servlet_enabled"))return zCb(a,[]);
var b=Wzb(gAb());b=g.ot(b,function(c){return!c.uuid});
return zCb(a,b)},j9=function(a,b){iAb(g.Er(a.screens,Uzb));
b&&hAb()},ECb=function(a,b){g.NF.call(this);
this.K=b;b=(b=g.JC("yt-remote-online-screen-ids")||"")?b.split(","):[];for(var c={},d=this.K(),e=d.length,f=0;f<e;++f){var h=d[f].id;c[h]=g.Fb(b,h)}this.j=c;this.G=a;this.C=this.D=NaN;this.B=null;DCb("Initialized with "+g.Nm(this.j))},FCb=function(a,b,c){var d=$8(a.G,"/pairing/get_screen_availability");
kCb(a.G,d,{lounge_token:b.token},(0,g.ib)(function(e){e=e.screens||[];for(var f=e.length,h=0;h<f;++h)if(e[h].loungeToken==b.token){c("online"==e[h].status);return}c(!1)},a),(0,g.ib)(function(){c(!1)},a))},HCb=function(a,b){a:if(xzb(b)!=xzb(a.j))var c=!1;
else{c=g.id(b);for(var d=c.length,e=0;e<d;++e)if(!a.j[c[e]]){c=!1;break a}c=!0}c||(DCb("Updated online screens: "+g.Nm(a.j)),a.j=b,a.ra("screenChange"));GCb(a)},k9=function(a){isNaN(a.C)||g.NB(a.C);
a.C=g.LB((0,g.ib)(a.sR,a),0<a.D&&a.D<g.kb()?2E4:1E4)},DCb=function(a){b9("OnlineScreenService",a)},ICb=function(a){var b={};
g.bc(a.K(),function(c){c.token?b[c.token]=c.id:this.qg("Requesting availability of screen w/o lounge token.")});
return b},GCb=function(a){a=g.id(g.cd(a.j,function(b){return b}));
g.Xb(a);a.length?g.IC("yt-remote-online-screen-ids",a.join(","),60):g.KC("yt-remote-online-screen-ids")},l9=function(a,b){b=void 0===b?!1:b;
g9.call(this,"ScreenService");this.D=a;this.N=b;this.j=this.B=null;this.C=[];this.G={};JCb(this)},LCb=function(a,b,c,d,e,f){a.info("getAutomaticScreenByIds "+c+" / "+b);
c||(c=a.G[b]);var h=a.Sk(),l=c?h8(h,c):null;c&&(a.N||l)||(l=h8(h,b));if(l){l.uuid=b;var m=m9(a,l);FCb(a.j,m,function(n){e(n?m:null)})}else c?KCb(a,c,(0,g.ib)(function(n){var p=m9(this,new e8({name:d,
screenId:c,loungeToken:n,dialId:b||""}));FCb(this.j,p,function(q){e(q?p:null)})},a),f):e(null)},MCb=function(a,b){for(var c=a.screens.length,d=0;d<c;++d)if(a.screens[d].name==b)return a.screens[d];
return null},NCb=function(a,b,c){FCb(a.j,b,c)},KCb=function(a,b,c,d){a.info("requestLoungeToken_ for "+b);
var e={postParams:{screen_ids:b},method:"POST",context:a,onSuccess:function(f,h){f=h&&h.screens||[];f[0]&&f[0].screenId==b?c(f[0].loungeToken):d(Error("Missing lounge token in token response"))},
onError:function(){d(Error("Request screen lounge token failed"))}};
g.RB($8(a.D,"/pairing/get_lounge_token_batch"),e)},OCb=function(a){a.screens=a.B.Sk();
var b=a.G,c={},d;for(d in b)c[b[d]]=d;b=a.screens.length;for(d=0;d<b;++d){var e=a.screens[d];e.uuid=c[e.id]||""}a.info("Updated manual screens: "+Xzb(a.screens))},JCb=function(a){PCb(a);
a.B=new i9(a.D);a.B.subscribe("screenChange",(0,g.ib)(a.T7,a));OCb(a);a.N||(a.C=Wzb(g.JC("yt-remote-automatic-screen-cache")||[]));PCb(a);a.info("Initializing automatic screens: "+Xzb(a.C));a.j=new ECb(a.D,(0,g.ib)(a.Sk,a,!0));a.j.subscribe("screenChange",(0,g.ib)(function(){this.ra("onlineScreenChange")},a))},m9=function(a,b){var c=a.get(b.id);
c?(c.uuid=b.uuid,b=c):((c=h8(a.C,b.uuid))?(c.id=b.id,c.token=b.token,b=c):a.C.push(b),a.N||QCb(a));PCb(a);a.G[b.uuid]=b.id;g.IC("yt-remote-device-id-map",a.G,31536E3);return b},QCb=function(a){a=g.ot(a.C,function(b){return"shortLived"!=b.idType});
g.IC("yt-remote-automatic-screen-cache",g.Er(a,Uzb))},PCb=function(a){a.G=g.JC("yt-remote-device-id-map")||{}},n9=function(a,b,c){g.NF.call(this);
this.Ea=c;this.D=a;this.B=b;this.j=null},o9=function(a,b){a.j=b;
a.ra("sessionScreen",a.j)},RCb=function(a,b){a.j&&(a.j.token=b,m9(a.D,a.j));
a.ra("sessionScreen",a.j)},p9=function(a,b){b9(a.Ea,b)},q9=function(a,b,c){n9.call(this,a,b,"CastSession");
var d=this;this.config_=c;this.C=null;this.va=(0,g.ib)(this.B3,this);this.Ia=(0,g.ib)(this.fba,this);this.ma=g.LB(function(){SCb(d,null)},12E4);
this.N=this.G=this.K=this.Z=0;this.Ca=!1;this.Y="unknown"},UCb=function(a,b){g.NB(a.N);
a.N=0;0==b?TCb(a):a.N=g.LB(function(){TCb(a)},b)},TCb=function(a){VCb(a,"getLoungeToken");
g.NB(a.G);a.G=g.LB(function(){WCb(a,null)},3E4)},VCb=function(a,b){a.info("sendYoutubeMessage_: "+b+" "+g.Nm());
var c={};c.type=b;a.C?a.C.sendMessage("urn:x-cast:com.google.youtube.mdx",c,function(){},(0,g.ib)(function(){p9(this,"Failed to send message: "+b+".")},a)):p9(a,"Sending yt message without session: "+g.Nm(c))},XCb=function(a,b){b?(a.info("onConnectedScreenId_: Received screenId: "+b),a.j&&a.j.id==b||a.jX(b,function(c){o9(a,c)},function(){return a.Fj()},5)):a.Fj(Error("Waiting for session status timed out."))},ZCb=function(a,b,c){a.info("onConnectedScreenData_: Received screenData: "+JSON.stringify(b));
var d=new e8(b);YCb(a,d,function(e){e?(a.Ca=!0,m9(a.D,d),o9(a,d),a.Y="unknown",UCb(a,c)):(g.wB(Error("CastSession, RemoteScreen from screenData: "+JSON.stringify(b)+" is not online.")),a.Fj())},5)},SCb=function(a,b){g.NB(a.ma);
a.ma=0;b?a.config_.enableCastLoungeToken&&b.loungeToken?b.deviceId?a.j&&a.j.uuid==b.deviceId||(b.loungeTokenRefreshIntervalMs?ZCb(a,{name:a.B.friendlyName,screenId:b.screenId,loungeToken:b.loungeToken,dialId:b.deviceId,screenIdType:"shortLived"},b.loungeTokenRefreshIntervalMs):(g.wB(Error("No loungeTokenRefreshIntervalMs presents in mdxSessionStatusData: "+JSON.stringify(b)+".")),XCb(a,b.screenId))):(g.wB(Error("No device id presents in mdxSessionStatusData: "+JSON.stringify(b)+".")),XCb(a,b.screenId)):
XCb(a,b.screenId):a.Fj(Error("Waiting for session status timed out."))},WCb=function(a,b){g.NB(a.G);
a.G=0;var c=null;if(b)if(b.loungeToken){var d;(null==(d=a.j)?void 0:d.token)==b.loungeToken&&(c="staleLoungeToken")}else c="missingLoungeToken";else c="noLoungeTokenResponse";c?(a.info("Did not receive a new lounge token in onLoungeToken_ with data: "+(JSON.stringify(b)+", error: "+c)),a.Y=c,UCb(a,3E4)):(RCb(a,b.loungeToken),a.Ca=!1,a.Y="unknown",UCb(a,b.loungeTokenRefreshIntervalMs))},YCb=function(a,b,c,d){g.NB(a.K);
a.K=0;NCb(a.D,b,function(e){e||0>d?c(e):a.K=g.LB(function(){YCb(a,b,c,d-1)},300)})},$Cb=function(a){g.NB(a.Z);
a.Z=0;g.NB(a.K);a.K=0;g.NB(a.ma);a.ma=0;g.NB(a.G);a.G=0;g.NB(a.N);a.N=0},r9=function(a,b,c,d){n9.call(this,a,b,"DialSession");
this.config_=d;this.C=this.Z=null;this.Ia="";this.Ra=c;this.Na=null;this.ma=function(){};
this.Y=NaN;this.Ma=(0,g.ib)(this.C3,this);this.G=function(){};
this.N=this.K=0;this.va=!1;this.Ca="unknown"},s9=function(a){var b;
return!!(a.config_.enableDialLoungeToken&&(null==(b=a.C)?0:b.getDialAppInfo))},aDb=function(a){a.G=a.D.IT(a.Ia,a.B.label,a.B.friendlyName,s9(a),function(b,c){a.G=function(){};
a.va=!0;o9(a,b);"shortLived"==b.idType&&0<c&&t9(a,c)},function(b){a.G=function(){};
a.Fj(b)})},bDb=function(a){var b={};
b.pairingCode=a.Ia;b.theme=a.Ra;kAb()&&(b.env_useStageMdx=1);return g.$m(b)},cDb=function(a){return new Promise(function(b){a.Ia=Yzb();
if(a.Na){var c=new chrome.cast.DialLaunchResponse(!0,bDb(a));b(c);aDb(a)}else a.ma=function(){g.NB(a.Y);a.ma=function(){};
a.Y=NaN;var d=new chrome.cast.DialLaunchResponse(!0,bDb(a));b(d);aDb(a)},a.Y=g.LB(function(){a.ma()},100)})},eDb=function(a,b,c){a.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(b));
var d=new e8(b);return(new Promise(function(e){dDb(a,d,function(f){f?(a.va=!0,m9(a.D,d),o9(a,d),t9(a,c)):g.wB(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(b)+" is not online."));e(f)},5)})).then(function(e){return e?new chrome.cast.DialLaunchResponse(!1):cDb(a)})},fDb=function(a,b){var c=a.Z.receiver.label,d=a.B.friendlyName;
return(new Promise(function(e){LCb(a.D,c,b,d,function(f){f&&f.token&&o9(a,f);e(f)},function(f){p9(a,"Failed to get DIAL screen: "+f);
e(null)})})).then(function(e){return e&&e.token?new chrome.cast.DialLaunchResponse(!1):cDb(a)})},dDb=function(a,b,c,d){g.NB(a.K);
a.K=0;NCb(a.D,b,function(e){e||0>d?c(e):a.K=g.LB(function(){dDb(a,b,c,d-1)},300)})},t9=function(a,b){a.info("getDialAppInfoWithTimeout_ "+b);
s9(a)&&(g.NB(a.N),a.N=0,0==b?gDb(a):a.N=g.LB(function(){gDb(a)},b))},gDb=function(a){s9(a)&&a.C.getDialAppInfo(function(b){a.info("getDialAppInfo dialLaunchData: "+JSON.stringify(b));
b=b.extraData||{};var c=null;if(b.loungeToken){var d;(null==(d=a.j)?void 0:d.token)==b.loungeToken&&(c="staleLoungeToken")}else c="missingLoungeToken";c?(a.Ca=c,t9(a,3E4)):(a.va=!1,a.Ca="unknown",RCb(a,b.loungeToken),t9(a,b.loungeTokenRefreshIntervalMs))},function(b){a.info("getDialAppInfo error: "+b);
a.Ca="noLoungeTokenResponse";t9(a,3E4)})},hDb=function(a){g.NB(a.K);
a.K=0;g.NB(a.N);a.N=0;a.G();a.G=function(){};
g.NB(a.Y)},u9=function(a,b){n9.call(this,a,b,"ManualSession");
this.C=g.LB((0,g.ib)(this.gA,this,null),150)},v9=function(a,b){g.NF.call(this);
this.config_=b;this.B=a;this.Z=b.appId||"233637DE";this.D=b.theme||"cl";this.Y=b.disableCastApi||!1;this.K=b.forceMirroring||!1;this.j=null;this.N=!1;this.C=[];this.G=(0,g.ib)(this.Y$,this)},iDb=function(a,b){return b?g.Db(a.C,function(c){return f8(b,c.label)},a):null},w9=function(a){b9("Controller",a)},rCb=function(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)},x9=function(a){return a.N||!!a.C.length||!!a.j},y9=function(a,b,c){b!=a.j&&(g.vb(a.j),(a.j=b)?(c?a.ra("yt-remote-cast2-receiver-resumed",
b.B):a.ra("yt-remote-cast2-receiver-selected",b.B),b.subscribe("sessionScreen",(0,g.ib)(a.KZ,a,b)),b.subscribe("sessionFailed",function(){return jDb(a,b)}),b.j?a.ra("yt-remote-cast2-session-change",b.j):c&&a.j.gA(null)):a.ra("yt-remote-cast2-session-change",null))},jDb=function(a,b){a.j==b&&a.ra("yt-remote-cast2-session-failed")},kDb=function(a){var b=a.B.HT(),c=a.j&&a.j.B;
a=g.Er(b,function(d){c&&f8(d,c.label)&&(c=null);var e=d.uuid?d.uuid:d.id,f=iDb(this,d);f?(f.label=e,f.friendlyName=d.name):(f=new chrome.cast.Receiver(e,d.name),f.receiverType=chrome.cast.ReceiverType.CUSTOM);return f},a);
c&&(c.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(c=new chrome.cast.Receiver(c.label,c.friendlyName),c.receiverType=chrome.cast.ReceiverType.CUSTOM),a.push(c));return a},rDb=function(a,b,c,d){d.disableCastApi?z9("Cannot initialize because disabled by Mdx config."):lDb()?mDb(b,d)&&(nDb(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?oDb(a,c):(window.__onGCastApiAvailable=function(e,f){e?oDb(a,c):(A9("Failed to load cast API: "+f),pDb(!1),nDb(!1),g.KC("yt-remote-cast-available"),g.KC("yt-remote-cast-receiver"),
qDb(),c(!1))},d.loadCastApiSetupScript?g.vta("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):0<=window.navigator.userAgent.indexOf("Android")&&0<=window.navigator.userAgent.indexOf("Chrome/")&&window.navigator.presentation?60<=mAb()&&vAb():!window.chrome||!window.navigator.presentation||0<=window.navigator.userAgent.indexOf("Edge")?qAb():89<=mAb()?xAb():(uAb(),o8(wAb.map(rAb))))):z9("Cannot initialize because not running Chrome")},qDb=function(){z9("dispose");
var a=B9();a&&a.dispose();g.Va("yt.mdx.remote.cloudview.instance_",null);sDb(!1);g.yE(tDb);tDb.length=0},C9=function(){return!!g.JC("yt-remote-cast-installed")},uDb=function(){var a=g.JC("yt-remote-cast-receiver");
return a?a.friendlyName:null},vDb=function(){z9("clearCurrentReceiver");
g.KC("yt-remote-cast-receiver")},wDb=function(){return C9()?B9()?B9().getCastSession():(A9("getCastSelector: Cast is not initialized."),null):(A9("getCastSelector: Cast API is not installed!"),null)},xDb=function(){C9()?B9()?D9()?(z9("Requesting cast selector."),B9().requestSession()):(z9("Wait for cast API to be ready to request the session."),tDb.push(g.xE("yt-remote-cast2-api-ready",xDb))):A9("requestCastSelector: Cast is not initialized."):A9("requestCastSelector: Cast API is not installed!")},
E9=function(a,b){D9()?B9().setConnectedScreenStatus(a,b):A9("setConnectedScreenStatus called before ready.")},lDb=function(){var a=0<=g.pc().search(/ (CrMo|Chrome|CriOS)\//);
return g.GK||a},yDb=function(a,b){B9().init(a,b)},mDb=function(a,b){var c=!1;
B9()||(a=new v9(a,b),a.subscribe("yt-remote-cast2-availability-change",function(d){g.IC("yt-remote-cast-available",d);m8("yt-remote-cast2-availability-change",d)}),a.subscribe("yt-remote-cast2-receiver-selected",function(d){z9("onReceiverSelected: "+d.friendlyName);
g.IC("yt-remote-cast-receiver",d);m8("yt-remote-cast2-receiver-selected",d)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(d){z9("onReceiverResumed: "+d.friendlyName);
g.IC("yt-remote-cast-receiver",d);m8("yt-remote-cast2-receiver-resumed",d)}),a.subscribe("yt-remote-cast2-session-change",function(d){z9("onSessionChange: "+g8(d));
d||g.KC("yt-remote-cast-receiver");m8("yt-remote-cast2-session-change",d)}),g.Va("yt.mdx.remote.cloudview.instance_",a),c=!0);
z9("cloudview.createSingleton_: "+c);return c},B9=function(){return g.Wa("yt.mdx.remote.cloudview.instance_")},oDb=function(a,b){pDb(!0);
nDb(!1);yDb(a,function(c){c?(sDb(!0),g.zE("yt-remote-cast2-api-ready")):(A9("Failed to initialize cast API."),pDb(!1),g.KC("yt-remote-cast-available"),g.KC("yt-remote-cast-receiver"),qDb());b(c)})},z9=function(a){b9("cloudview",a)},A9=function(a){b9("cloudview",a)},pDb=function(a){z9("setCastInstalled_ "+a);
g.IC("yt-remote-cast-installed",a)},D9=function(){return!!g.Wa("yt.mdx.remote.cloudview.apiReady_")},sDb=function(a){z9("setApiReady_ "+a);
g.Va("yt.mdx.remote.cloudview.apiReady_",a)},nDb=function(a){g.Va("yt.mdx.remote.cloudview.initializing_",a)},F9=function(a){this.index=-1;
this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.K=this.N=0;this.trackData=null;this.Vk=this.Cp=!1;this.Z=this.G=this.j=this.D=0;this.C=NaN;this.B=!1;this.reset(a)},zDb=function(a){a.audioTrackId=null;
a.trackData=null;a.playerState=-1;a.Cp=!1;a.Vk=!1;a.N=0;a.K=g.kb();a.D=0;a.j=0;a.G=0;a.Z=0;a.C=NaN;a.B=!1},G9=function(a){return a.isPlaying()?(g.kb()-a.K)/1E3:0},H9=function(a,b){a.N=b;
a.K=g.kb()},I9=function(a){switch(a.playerState){case 1:case 1081:return(g.kb()-a.K)/1E3+a.N;
case -1E3:return 0}return a.N},J9=function(a,b,c){var d=a.videoId;
a.videoId=b;a.index=c;b!=d&&zDb(a)},ADb=function(a){var b={};
b.index=a.index;b.listId=a.listId;b.videoId=a.videoId;b.playerState=a.playerState;b.volume=a.volume;b.muted=a.muted;b.audioTrackId=a.audioTrackId;b.trackData=g.qd(a.trackData);b.hasPrevious=a.Cp;b.hasNext=a.Vk;b.playerTime=a.N;b.playerTimeAt=a.K;b.seekableStart=a.D;b.seekableEnd=a.j;b.duration=a.G;b.loadedTime=a.Z;b.liveIngestionTime=a.C;return b},L9=function(a,b){g.NF.call(this);
var c=this;this.C=0;this.D=a;this.K=[];this.G=new eCb;this.B=this.j=null;this.Y=(0,g.ib)(this.O9,this);this.N=(0,g.ib)(this.HE,this);this.Z=(0,g.ib)(this.N9,this);this.ma=(0,g.ib)(this.R9,this);var d=0;a?(d=a.getProxyState(),3!=d&&(a.subscribe("proxyStateChange",this.QR,this),BDb(this))):d=3;0!=d&&(b?this.QR(d):g.LB(function(){c.QR(d)},0));
(a=wDb())&&K9(this,a);this.subscribe("yt-remote-cast2-session-change",this.ma)},M9=function(a){return new F9(a.D.getPlayerContextData())},BDb=function(a){g.bc("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(b){this.K.push(this.D.subscribe(b,g.jb(this.W$,b),this))},a)},CDb=function(a){g.bc(a.K,function(b){this.D.unsubscribeByKey(b)},a);
a.K.length=0},N9=function(a){return 1==a.getState()},O9=function(a,b){var c=a.G;
50>c.j.length+c.B.length&&a.G.B.push(b)},DDb=function(a,b,c){var d=M9(a);
H9(d,c);-1E3!=d.playerState&&(d.playerState=b);P9(a,d)},Q9=function(a,b,c){a.D.sendMessage(b,c)},P9=function(a,b){CDb(a);
a.D.setPlayerContextData(ADb(b));BDb(a)},K9=function(a,b){a.B&&(a.B.removeUpdateListener(a.Y),a.B.removeMediaListener(a.N),a.HE(null));
a.B=b;a.B&&(c9("Setting cast session: "+a.B.sessionId),a.B.addUpdateListener(a.Y),a.B.addMediaListener(a.N),a.B.media.length&&a.HE(a.B.media[0]))},EDb=function(a){var b=a.j.media,c=a.j.customData;
if(b&&c){var d=M9(a);b.contentId!=d.videoId&&c9("Cast changing video to: "+b.contentId);d.videoId=b.contentId;d.playerState=c.playerState;H9(d,a.j.getEstimatedTime());P9(a,d)}else c9("No cast media video. Ignoring state update.")},R9=function(a,b,c){return(0,g.ib)(function(d){this.qg("Failed to "+b+" with cast v2 channel. Error code: "+d.code);
d.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.qg("Retrying "+b+" using MDx browser channel."),Q9(this,b,c))},a)},U9=function(a,b,c,d){d=void 0===d?!1:d;
g.NF.call(this);var e=this;this.K=NaN;this.Ia=!1;this.Y=this.Z=this.va=this.Ca=NaN;this.ma=[];this.G=this.N=this.D=this.j=this.B=null;this.Na=a;this.Ma=d;this.ma.push(g.zC(window,"beforeunload",function(){e.pz(2)}));
this.C=[];this.j=new F9;this.Ra=b.id;this.Ea=b.idType;this.B=qCb(this.Na,c,this.NT,"shortLived"==this.Ea,this.Ra);this.B.Ta("channelOpened",function(){FDb(e)});
this.B.Ta("channelClosed",function(){S9("Channel closed");isNaN(e.K)?k8(!0):k8();e.dispose()});
this.B.Ta("channelError",function(f){k8();isNaN(e.ID())?(1==f&&"shortLived"==e.Ea&&e.ra("browserChannelAuthError",f),S9("Channel error: "+f+" without reconnection"),e.dispose()):(e.Ia=!0,S9("Channel error: "+f+" with reconnection in "+e.ID()+" ms"),T9(e,2))});
this.B.Ta("channelMessage",function(f){GDb(e,f)});
this.B.Er(b.token);this.subscribe("remoteQueueChange",function(){var f=e.j.videoId;g.LC()&&g.IC("yt-remote-session-video-id",f)})},HDb=function(a){return g.Db(a.C,function(b){return"LOUNGE_SCREEN"==b.type})},S9=function(a){b9("conn",a)},T9=function(a,b){a.ra("proxyStateChange",b)},IDb=function(a){a.K=g.LB(function(){S9("Connecting timeout");
a.pz(1)},2E4)},JDb=function(a){g.NB(a.K);
a.K=NaN},KDb=function(a){g.NB(a.Ca);
a.Ca=NaN},MDb=function(a){LDb(a);
a.va=g.LB(function(){V9(a,"getNowPlaying")},2E4)},LDb=function(a){g.NB(a.va);
a.va=NaN},FDb=function(a){S9("Channel opened");
a.Ia&&(a.Ia=!1,KDb(a),a.Ca=g.LB(function(){S9("Timing out waiting for a screen.");a.pz(1)},15E3))},ODb=function(a,b){var c=null;
if(b){var d=HDb(a);d&&(c={clientName:d.clientName,deviceMake:d.brand,deviceModel:d.model,osVersion:d.osVersion})}g.Va("yt.mdx.remote.remoteClient_",c);b&&(JDb(a),KDb(a));c=a.B.Uz()&&isNaN(a.K);b==c?b&&(T9(a,1),V9(a,"getSubtitlesTrack")):b?(a.eX()&&a.j.reset(),T9(a,1),V9(a,"getNowPlaying"),NDb(a)):a.pz(1)},PDb=function(a,b){var c=b.params.videoId;
delete b.params.videoId;c==a.j.videoId&&(g.md(b.params)?a.j.trackData=null:a.j.trackData=b.params,a.ra("remotePlayerChange"))},QDb=function(a,b,c){var d=b.params.videoId||b.params.video_id,e=parseInt(b.params.currentIndex,10);
a.j.listId=b.params.listId||a.j.listId;J9(a.j,d,e);a.ra("remoteQueueChange",c)},SDb=function(a,b){b.params=b.params||{};
QDb(a,b,"NOW_PLAYING_MAY_CHANGE");RDb(a,b);a.ra("autoplayDismissed")},RDb=function(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10);
H9(a.j,isNaN(c)?0:c);c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;-1==c&&-1E3==a.j.playerState&&(c=-1E3);a.j.playerState=c;c=Number(b.params.loadedTime);a.j.Z=isNaN(c)?0:c;a.j.wl(Number(b.params.duration));c=a.j;var d=Number(b.params.liveIngestionTime);c.C=d;c.B=isNaN(d)?!1:!0;c=a.j;d=Number(b.params.seekableStartTime);b=Number(b.params.seekableEndTime);c.D=isNaN(d)?0:d;c.j=isNaN(b)?0:b;1==a.j.playerState?MDb(a):LDb(a);a.ra("remotePlayerChange")},TDb=function(a,b){if(-1E3!=a.j.playerState){var c=
1085;
switch(parseInt(b.params.adState,10)){case 1:c=1081;break;case 2:c=1084;break;case 0:c=1083}a.j.playerState=c;b=parseInt(b.params.currentTime,10);H9(a.j,isNaN(b)?0:b);a.ra("remotePlayerChange")}},UDb=function(a,b){var c="true"==b.params.muted;
a.j.volume=parseInt(b.params.volume,10);a.j.muted=c;a.ra("remotePlayerChange")},VDb=function(a,b){a.N=b.params.videoId;
a.ra("nowAutoplaying",parseInt(b.params.timeout,10))},WDb=function(a,b){a.N=b.params.videoId||null;
a.ra("autoplayUpNext",a.N)},XDb=function(a,b){a.G=b.params.autoplayMode;
a.ra("autoplayModeChange",a.G);"DISABLED"==a.G&&a.ra("autoplayDismissed")},YDb=function(a,b){var c="true"==b.params.hasNext;
a.j.Cp="true"==b.params.hasPrevious;a.j.Vk=c;a.ra("previousNextChange")},GDb=function(a,b){b=b.message;
b.params?S9("Received: action="+b.action+", params="+g.Nm(b.params)):S9("Received: action="+b.action+" {}");switch(b.action){case "loungeStatus":b=c8(b.params.devices);a.C=g.Er(b,function(d){return new Rzb(d)});
b=!!g.Db(a.C,function(d){return"LOUNGE_SCREEN"==d.type});
ODb(a,b);b=a.gY("mlm");a.ra("multiStateLoopEnabled",b);break;case "loungeScreenDisconnected":g.Jb(a.C,function(d){return"LOUNGE_SCREEN"==d.type});
ODb(a,!1);break;case "remoteConnected":var c=new Rzb(c8(b.params.device));g.Db(a.C,function(d){return c?d.id==c.id:!1})||wzb(a.C,c);
break;case "remoteDisconnected":c=new Rzb(c8(b.params.device));g.Jb(a.C,function(d){return c?d.id==c.id:!1});
break;case "gracefulDisconnect":break;case "playlistModified":QDb(a,b,"QUEUE_MODIFIED");break;case "nowPlaying":SDb(a,b);break;case "onStateChange":RDb(a,b);break;case "onAdStateChange":TDb(a,b);break;case "onVolumeChanged":UDb(a,b);break;case "onSubtitlesTrackChanged":PDb(a,b);break;case "nowAutoplaying":VDb(a,b);break;case "autoplayDismissed":a.ra("autoplayDismissed");break;case "autoplayUpNext":WDb(a,b);break;case "onAutoplayModeChanged":XDb(a,b);break;case "onHasPreviousNextChanged":YDb(a,b);
break;case "requestAssistedSignIn":a.ra("assistedSignInRequested",b.params.authCode);break;case "onLoopModeChanged":a.ra("loopModeChange",b.params.loopMode);break;default:S9("Unrecognized action: "+b.action)}},NDb=function(a){g.NB(a.Y);
a.Y=g.LB(function(){a.pz(1)},864E5)},V9=function(a,b,c){c?S9("Sending: action="+b+", params="+g.Nm(c)):S9("Sending: action="+b);
a.B.sendMessage(b,c)},ZDb=function(a){g9.call(this,"ScreenServiceProxy");
this.jh=a;this.j=[];this.j.push(this.jh.$_s("screenChange",(0,g.ib)(this.G3,this)));this.j.push(this.jh.$_s("onlineScreenChange",(0,g.ib)(this.E$,this)))},dEb=function(a,b){jAb();
if(!l8||!l8.get("yt-remote-disable-remote-module-for-dev")){b=g.rB("MDX_CONFIG")||b;aAb();eAb();W9||(W9=new Z8(b?b.loungeApiHost:void 0),kAb()&&(W9.j="/api/loungedev"));X9||(X9=g.Wa("yt.mdx.remote.deferredProxies_")||[],g.Va("yt.mdx.remote.deferredProxies_",X9));$Db();var c=Y9();if(!c){var d=new l9(W9,b?b.disableAutomaticScreenCache||!1:!1);g.Va("yt.mdx.remote.screenService_",d);c=Y9();var e={};b&&(e={appId:b.appId,disableDial:b.disableDial,theme:b.theme,loadCastApiSetupScript:b.loadCastApiSetupScript,
disableCastApi:b.disableCastApi,enableDialLoungeToken:b.enableDialLoungeToken,enableCastLoungeToken:b.enableCastLoungeToken,forceMirroring:b.forceMirroring});g.Va("yt.mdx.remote.enableConnectWithInitialState_",b?b.enableConnectWithInitialState||!1:!1);rDb(a,d,function(f){f?Z9()&&E9(Z9(),"YouTube TV"):d.subscribe("onlineScreenChange",function(){m8("yt-remote-receiver-availability-change")})},e)}b&&!g.Wa("yt.mdx.remote.initialized_")&&(g.Va("yt.mdx.remote.initialized_",!0),$9("Initializing: "+g.Nm(b)),
a$.push(g.xE("yt-remote-cast2-api-ready",function(){m8("yt-remote-api-ready")})),a$.push(g.xE("yt-remote-cast2-availability-change",function(){m8("yt-remote-receiver-availability-change")})),a$.push(g.xE("yt-remote-cast2-receiver-selected",function(){b$(null);
m8("yt-remote-auto-connect","cast-selector-receiver")})),a$.push(g.xE("yt-remote-cast2-receiver-resumed",function(){m8("yt-remote-receiver-resumed","cast-selector-receiver")})),a$.push(g.xE("yt-remote-cast2-session-change",aEb)),a$.push(g.xE("yt-remote-connection-change",function(f){f?E9(Z9(),"YouTube TV"):c$()||(E9(null,null),vDb())})),a$.push(g.xE("yt-remote-cast2-session-failed",function(){m8("yt-remote-connection-failed")})),a=bEb(),b.isAuto&&(a.id+="#dial"),e=b.capabilities||[],g.PB("desktop_enable_autoplay")&&
e.push("atp"),0<e.length&&(a.capabilities=e),a.name=b.device,a.app=b.app,(b=b.theme)&&(a.theme=b),$9(" -- with channel params: "+g.Nm(a)),a?(g.IC("yt-remote-session-app",a.app),g.IC("yt-remote-session-name",a.name)):(g.KC("yt-remote-session-app"),g.KC("yt-remote-session-name")),g.Va("yt.mdx.remote.channelParams_",a),c.start(),Z9()||cEb())}},eEb=function(){var a=Y9().jh.$_gos();
var b=d$();b&&e$()&&($zb(a,b)||a.push(b));return Zzb(a)},gEb=function(){var a=fEb();
!a&&C9()&&uDb()&&(a={key:"cast-selector-receiver",name:uDb()});return a},fEb=function(){var a=eEb(),b=d$();
b||(b=c$());return g.Db(a,function(c){return b&&f8(b,c.key)?!0:!1})},d$=function(){var a=Z9();
if(!a)return null;var b=Y9().Sk();return h8(b,a)},aEb=function(a){$9("remote.onCastSessionChange_: "+g8(a));
if(a){var b=d$();if(b&&b.id==a.id){if(E9(b.id,"YouTube TV"),"shortLived"==a.idType&&(a=a.token))f$&&(f$.token=a),(b=e$())&&b.Er(a)}else b&&g$(),h$(a,1)}else e$()&&g$()},g$=function(){D9()?B9().stopSession():A9("stopSession called before API ready.");
var a=e$();a&&(a.disconnect(1),hEb(null))},iEb=function(){var a=e$();
return!!a&&3!=a.getProxyState()},$9=function(a){b9("remote",a)},Y9=function(){if(!jEb){var a=g.Wa("yt.mdx.remote.screenService_");
jEb=a?new ZDb(a):null}return jEb},Z9=function(){return g.Wa("yt.mdx.remote.currentScreenId_")},kEb=function(a){g.Va("yt.mdx.remote.currentScreenId_",a)},lEb=function(){return g.Wa("yt.mdx.remote.connectData_")},b$=function(a){g.Va("yt.mdx.remote.connectData_",a)},e$=function(){return g.Wa("yt.mdx.remote.connection_")},hEb=function(a){var b=e$();
b$(null);a||kEb("");g.Va("yt.mdx.remote.connection_",a);X9&&(g.bc(X9,function(c){c(a)}),X9.length=0);
b&&!a?m8("yt-remote-connection-change",!1):!b&&a&&m8("yt-remote-connection-change",!0)},c$=function(){var a=g.LC();
if(!a)return null;var b=Y9();if(!b)return null;b=b.Sk();return h8(b,a)},h$=function(a,b){Z9();
d$()&&d$();if(i$)f$=a;else{kEb(a.id);var c=g.Wa("yt.mdx.remote.enableConnectWithInitialState_")||!1;a=new U9(W9,a,bEb(),c);a.connect(b,lEb());a.subscribe("beforeDisconnect",function(d){m8("yt-remote-before-disconnect",d)});
a.subscribe("beforeDispose",function(){e$()&&(e$(),hEb(null))});
a.subscribe("browserChannelAuthError",function(){var d=d$();d&&"shortLived"==d.idType&&(D9()?B9().handleBrowserChannelAuthError():A9("refreshLoungeToken called before API ready."))});
hEb(a)}},cEb=function(){var a=c$();
a?($9("Resume connection to: "+g8(a)),h$(a,0)):(k8(),vDb(),$9("Skipping connecting because no session screen found."))},$Db=function(){var a=bEb();
if(g.md(a)){a=j8();var b=g.JC("yt-remote-session-name")||"",c=g.JC("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:b,app:c,mdxVersion:3};a.authuser=String(g.rB("SESSION_INDEX","0"));(b=g.rB("DELEGATED_SESSION_ID"))&&(a.pageId=String(b));g.Va("yt.mdx.remote.channelParams_",a)}},bEb=function(){return g.Wa("yt.mdx.remote.channelParams_")||{}},oEb=function(a,b,c){g.I.call(this);
var d=this;this.module=a;this.J=b;this.Kc=c;this.events=new g.IK(this);this.Y=this.events.T(this.J,"onVolumeChange",function(e){mEb(d,e)});
this.D=!1;this.G=new g.wL(64);this.j=new g.Qu(this.l0,500,this);this.B=new g.Qu(this.m0,1E3,this);this.N=new p8(this.vda,0,this);this.C={};this.Z=new g.Qu(this.d1,1E3,this);this.K=new q8(this.seekTo,1E3,this);g.N(this,this.events);this.events.T(b,"onCaptionsTrackListChanged",this.p$);this.events.T(b,"captionschanged",this.L9);this.events.T(b,"captionssettingschanged",this.v0);this.events.T(b,"videoplayerreset",this.PJ);this.events.T(b,"mdxautoplaycancel",function(){d.Kc.nW()});
b.L("enable_mdx_video_play_directly")&&this.events.T(b,"videodatachange",function(){nEb(d.module)||j$(d)||k$(d,0)});
a=this.Kc;a.isDisposed();a.subscribe("proxyStateChange",this.HZ,this);a.subscribe("remotePlayerChange",this.NE,this);a.subscribe("remoteQueueChange",this.PJ,this);a.subscribe("previousNextChange",this.EZ,this);a.subscribe("nowAutoplaying",this.AZ,this);a.subscribe("autoplayDismissed",this.iZ,this);g.N(this,this.j);g.N(this,this.B);g.N(this,this.N);g.N(this,this.Z);g.N(this,this.K);this.v0();this.PJ();this.NE()},mEb=function(a,b){if(j$(a)){a.Kc.unsubscribe("remotePlayerChange",a.NE,a);
var c=Math.round(b.volume);b=!!b.muted;var d=M9(a.Kc);if(c!==d.volume||b!==d.muted)a.Kc.setVolume(c,b),a.Z.start();a.Kc.subscribe("remotePlayerChange",a.NE,a)}},pEb=function(a){a.Rc(0);
a.j.stop();a.Gc(new g.wL(64))},qEb=function(a,b){if(j$(a)&&!a.D){var c=null;
b&&(c={style:a.J.getSubtitlesUserSettings()},g.rd(c,b));a.Kc.LT(a.J.getVideoData(1).videoId,c);a.C=M9(a.Kc).trackData}},k$=function(a,b){var c=a.J.getPlaylist();
if(null==c?0:c.listId){var d=c.index;var e=c.listId.toString()}c=a.J.getVideoData(1);a.Kc.playVideo(c.videoId,b,d,e,c.playerParams,c.va,vzb(c));a.Gc(new g.wL(1))},rEb=function(a,b){if(b){var c=a.J.getOption("captions","tracklist",{UX:1});
c&&c.length?(a.J.setOption("captions","track",b),a.D=!1):(a.J.loadModule("captions"),a.D=!0)}else a.J.setOption("captions","track",{})},j$=function(a){return M9(a.Kc).videoId===a.J.getVideoData(1).videoId},l$=function(){g.V.call(this,{I:"div",
S:"ytp-mdx-popup-dialog",X:{role:"dialog"},V:[{I:"div",S:"ytp-mdx-popup-dialog-inner-content",V:[{I:"div",S:"ytp-mdx-popup-title",ya:"You're signed out"},{I:"div",S:"ytp-mdx-popup-description",ya:"Videos that you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer."},{I:"div",S:"ytp-mdx-privacy-popup-buttons",V:[{I:"button",La:["ytp-button","ytp-mdx-privacy-popup-cancel"],ya:"Cancel"},{I:"button",La:["ytp-button",
"ytp-mdx-privacy-popup-confirm"],ya:"Confirm"}]}]}]});this.j=new g.CG(this,250);this.cancelButton=this.Ga("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.Ga("ytp-mdx-privacy-popup-confirm");g.N(this,this.j);this.T(this.cancelButton,"click",this.B);this.T(this.confirmButton,"click",this.C)},m$=function(a){g.V.call(this,{I:"div",
S:"ytp-remote",V:[{I:"div",S:"ytp-remote-display-status",V:[{I:"div",S:"ytp-remote-display-status-icon",V:[g.twa()]},{I:"div",S:"ytp-remote-display-status-text",ya:"{{statustext}}"}]}]});this.api=a;this.j=new g.CG(this,250);g.N(this,this.j);this.T(a,"presentingplayerstatechange",this.onStateChange);this.Hc(a.Xb())},n$=function(a,b){g.NX.call(this,"Play on",1,a,b);
this.J=a;this.Tt={};this.T(a,"onMdxReceiversChange",this.D);this.T(a,"presentingplayerstatechange",this.D);this.D()},sEb=function(a){g.RV.call(this,a);
this.Kp={key:Yzb(),name:"This computer"};this.Sl=null;this.subscriptions=[];this.ZQ=this.Kc=null;this.Tt=[this.Kp];this.Es=this.Kp;this.Le=new g.wL(64);this.rY=0;this.Vh=-1;this.fF=!1;this.dF=this.ZA=null;if(!g.aS(this.player.U())&&!g.$G(this.player.U())){a=this.player;var b=g.cU(a);b&&(b=b.zp())&&(b=new n$(a,b),g.N(this,b));b=new m$(a);g.N(this,b);g.oU(a,b.element,4);this.ZA=new l$;g.N(this,this.ZA);g.oU(a,this.ZA.element,4);this.fF=!!c$()}},o$=function(a){a.dF&&(a.player.removeEventListener("presentingplayerstatechange",
a.dF),a.dF=null)},tEb=function(a,b,c){a.Le=c;
a.player.ra("presentingplayerstatechange",new g.IG(c,b))},p$=function(a,b){if(b.key!==a.Es.key)if(b.key===a.Kp.key)g$();
else if(nEb(a)&&uEb(a),a.Es=b,!a.player.U().L("disable_mdx_connection_in_mdx_module_for_music_web")||!g.$G(a.player.U())){var c=a.player.getPlaylistId();var d=a.player.getVideoData(1);var e=d.videoId;if(!c&&!e||(2===a.player.getAppState()||1===a.player.getAppState())&&a.player.U().L("should_clear_video_data_on_player_cued_unstarted"))d=null;else{var f=a.player.getPlaylist();if(f){var h=[];for(var l=0;l<f.getLength();l++)h[l]=g.OV(f,l).videoId}else h=[e];f=a.player.getCurrentTime(1);a={videoIds:h,
listId:c,videoId:e,playerParams:d.playerParams,clickTrackingParams:d.va,index:Math.max(a.player.getPlaylistIndex(),0),currentTime:0===f?void 0:f};(d=vzb(d))&&(a.locationInfo=d);d=a}$9("Connecting to: "+g.Nm(b));"cast-selector-receiver"==b.key?(b$(d||null),b=d||null,D9()?B9().setLaunchParams(b):A9("setLaunchParams called before ready.")):!d&&iEb()&&Z9()==b.key?m8("yt-remote-connection-change",!0):(g$(),b$(d||null),d=Y9().Sk(),(b=h8(d,b.key))&&h$(b,1))}},nEb=function(a){var b=a.player.U();
return!b.L("mdx_enable_privacy_disclosure_ui")||a.isLoggedIn()||a.fF||!a.ZA?!1:g.kS(b)||g.mS(b)},uEb=function(a){a.player.Xb().isPlaying()?a.player.pauseVideo():(a.dF=function(b){!a.fF&&g.LG(b,8)&&(a.player.pauseVideo(),o$(a))},a.player.addEventListener("presentingplayerstatechange",a.dF));
a.ZA&&a.ZA.xd();e$()||(i$=!0)};
g.Ky.prototype.Rs=g.fa(0,function(){return g.sk(this,6)});
var DBb={"\x00":"\\0","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t","\v":"\\x0B",'"':'\\"',"\\":"\\\\","<":"\\u003C"},R8={"'":"\\'"},Szb={Voa:"atp",n6a:"ska",B2a:"que",LUa:"mus",m6a:"sus",RFa:"dsp",p4a:"seq",mTa:"mic",Awa:"dpa",qqa:"cds",AUa:"mlm",owa:"dsdtr",lVa:"ntb",Whb:"vsp",pxa:"scn",P2a:"rpe",lwa:"dcn",mwa:"dcp",d_a:"pas",nwa:"drq",LYa:"opf",oxa:"els",G4a:"svq"},Tzb={b5:"u",CLASSIC:"cl",K4:"k",o2:"i",T1:"cr",Q4:"m",l2:"g",ZU:"up"},dAb="",l8=null;
lAb.prototype.flush=function(a,b){a=void 0===a?[]:a;b=void 0===b?!1:b;if(g.PB("enable_client_streamz_web")){a=g.u(a);for(var c=a.next();!c.done;c=a.next())c=g.efa(c.value),c={serializedIncrementBatch:g.Dg(c.j())},g.bD("streamzIncremented",c,{sendIsolatedPayload:b})}};
var n8,tAb=nAb("loadCastFramework")||nAb("loadCastApplicationFramework"),wAb=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.ob(p8,g.I);g.k=p8.prototype;g.k.Z2=function(a){this.D=arguments;this.j=!1;this.qd?this.C=g.kb()+this.gj:this.qd=g.yg(this.G,this.gj)};
g.k.stop=function(){this.qd&&(g.Sa.clearTimeout(this.qd),this.qd=null);this.C=null;this.j=!1;this.D=[]};
g.k.pause=function(){++this.B};
g.k.resume=function(){this.B&&(--this.B,!this.B&&this.j&&(this.j=!1,this.K.apply(null,this.D)))};
g.k.xa=function(){this.stop();p8.Uf.xa.call(this)};
g.k.b3=function(){this.qd&&(g.Sa.clearTimeout(this.qd),this.qd=null);this.C?(this.qd=g.yg(this.G,this.C-g.kb()),this.C=null):this.B?this.j=!0:(this.j=!1,this.K.apply(null,this.D))};g.w(q8,g.I);g.k=q8.prototype;g.k.JL=function(a){this.C=arguments;this.qd||this.B?this.j=!0:yAb(this)};
g.k.stop=function(){this.qd&&(g.Sa.clearTimeout(this.qd),this.qd=null,this.j=!1,this.C=null)};
g.k.pause=function(){this.B++};
g.k.resume=function(){this.B--;this.B||!this.j||this.qd||(this.j=!1,yAb(this))};
g.k.xa=function(){g.I.prototype.xa.call(this);this.stop()};r8.prototype.stringify=function(a){return g.Sa.JSON.stringify(a,void 0)};
r8.prototype.parse=function(a){return g.Sa.JSON.parse(a,void 0)};g.ob(zAb,g.Ab);g.ob(AAb,g.Ab);var BAb=null;g.ob(DAb,g.Ab);g.ob(EAb,g.Ab);g.ob(FAb,g.Ab);v8.prototype.debug=function(){};
v8.prototype.info=function(){};
v8.prototype.warning=function(){};var NAb={},MAb={};g.k=w8.prototype;g.k.setTimeout=function(a){this.ub=a};
g.k.f3=function(a){a=a.target;var b=this.Xa;b&&3==g.Ln(a)?b.JL():this.pT(a)};
g.k.pT=function(a){try{if(a==this.j)a:{var b=g.Ln(this.j),c=this.j.B,d=this.j.getStatus();if(!(3>b)&&(3!=b||g.nS||this.j&&(this.B.B||g.Nn(this.j)||g.On(this.j)))){this.Ma||4!=b||7==c||(8==c||0>=d?s8(3):s8(2));A8(this);var e=this.j.getStatus();this.Gb=e;b:if(KAb(this)){var f=g.On(this.j);a="";var h=f.length,l=4==g.Ln(this.j);if(!this.B.C){if("undefined"===typeof TextDecoder){y8(this);z8(this);var m="";break b}this.B.C=new g.Sa.TextDecoder}for(c=0;c<h;c++)this.B.B=!0,a+=this.B.C.decode(f[c],{stream:l&&
c==h-1});f.length=0;this.B.j+=a;this.K=0;m=this.B.j}else m=g.Nn(this.j);if(this.C=200==e){if(this.Ob&&!this.Wa){b:{if(this.j){var n=g.Pn(this.j,"X-HTTP-Initial-Response");if(n&&!g.fc(n)){var p=n;break b}}p=null}if(e=p)this.Wa=!0,OAb(this,e);else{this.C=!1;this.N=3;t8(12);y8(this);z8(this);break a}}this.Ea?(PAb(this,b,m),g.nS&&this.C&&3==b&&(this.Za.Ta(this.ib,"tick",this.e3),this.ib.start())):OAb(this,m);4==b&&y8(this);this.C&&!this.Ma&&(4==b?RAb(this.G,this):(this.C=!1,x8(this)))}else g.Ufa(this.j),
400==e&&0<m.indexOf("Unknown SID")?(this.N=3,t8(12)):(this.N=0,t8(13)),y8(this),z8(this)}}}catch(q){}finally{}};
g.k.e3=function(){if(this.j){var a=g.Ln(this.j),b=g.Nn(this.j);this.K<b.length&&(A8(this),PAb(this,a,b),this.C&&4!=a&&x8(this))}};
g.k.cancel=function(){this.Ma=!0;y8(this)};
g.k.d3=function(){this.ma=null;var a=Date.now();0<=a-this.Nb?(2!=this.Ra&&(s8(3),t8(17)),y8(this),this.N=2,z8(this)):QAb(this,this.Nb-a)};
g.k.getLastError=function(){return this.N};
g.k.zO=function(){return this.j};$Ab.prototype.cancel=function(){this.C=bBb(this);if(this.B)this.B.cancel(),this.B=null;else if(this.j&&0!==this.j.size){for(var a=g.u(this.j.values()),b=a.next();!b.done;b=a.next())b.value.cancel();this.j.clear()}};g.k=gBb.prototype;g.k.qT=8;g.k.Jh=1;g.k.connect=function(a,b,c,d){t8(0);this.jc=a;this.Ma=b||{};c&&void 0!==d&&(this.Ma.OSID=c,this.Ma.OAID=d);this.Wa=this.Lc;this.Na=WAb(this,null,this.jc);E8(this)};
g.k.disconnect=function(){iBb(this);if(3==this.Jh){var a=this.fb++,b=this.Na.clone();g.Mo(b,"SID",this.D);g.Mo(b,"RID",a);g.Mo(b,"TYPE","terminate");H8(this,b);a=new w8(this,this.D,a);a.Ra=2;a.Z=a8(b.clone());b=!1;if(g.Sa.navigator&&g.Sa.navigator.sendBeacon)try{b=g.Sa.navigator.sendBeacon(a.Z.toString(),"")}catch(c){}!b&&g.Sa.Image&&((new Image).src=a.Z,b=!0);b||(a.j=JAb(a.G,null),a.j.send(a.Z));a.Ca=Date.now();x8(a)}oBb(this)};
g.k.Ug=function(){return 0==this.Jh};
g.k.getState=function(){return this.Jh};
g.k.sT=function(a){if(this.K)if(this.K=null,1==this.Jh){if(!a){this.fb=Math.floor(1E5*Math.random());a=this.fb++;var b=new w8(this,"",a),c=this.Y;this.Nb&&(c?(c=g.pd(c),g.rd(c,this.Nb)):c=this.Nb);null!==this.N||this.tb||(b.Na=c,c=null);var d;if(this.ub)a:{for(var e=d=0;e<this.C.length;e++){b:{var f=this.C[e];if("__data__"in f.map&&(f=f.map.__data__,"string"===typeof f)){f=f.length;break b}f=void 0}if(void 0===f)break;d+=f;if(4096<d){d=e;break a}if(4096===d||e===this.C.length-1){d=e+1;break a}}d=
1E3}else d=1E3;d=lBb(this,b,d);e=this.Na.clone();g.Mo(e,"RID",a);g.Mo(e,"CVER",22);this.Ea&&g.Mo(e,"X-HTTP-Session-Id",this.Ea);H8(this,e);c&&(this.tb?d="headers="+g.Ye(g.Gga(c))+"&"+d:this.N&&g.Dp(e,this.N,c));VAb(this.B,b);this.Zf&&g.Mo(e,"TYPE","init");this.ub?(g.Mo(e,"$req",d),g.Mo(e,"SID","null"),b.Ob=!0,IAb(b,e,null)):IAb(b,e,d);this.Jh=2}}else 3==this.Jh&&(a?mBb(this,a):0==this.C.length||aBb(this.B)||mBb(this))};
g.k.rT=function(){this.Z=null;nBb(this);if(this.Jc&&!(this.ib||null==this.j||0>=this.Kd)){var a=2*this.Kd;this.Ia=u8((0,g.ib)(this.K9,this),a)}};
g.k.K9=function(){this.Ia&&(this.Ia=null,this.Wa=!1,this.ib=!0,t8(10),C8(this),nBb(this))};
g.k.nQ=function(a){this.j==a&&this.Jc&&!this.ib&&(hBb(this),this.ib=!0,t8(11))};
g.k.g3=function(){null!=this.ma&&(this.ma=null,C8(this),TAb(this),t8(19))};
g.k.Xca=function(a){a?t8(2):t8(1)};
g.k.isActive=function(){return!!this.G&&this.G.isActive(this)};
g.k=qBb.prototype;g.k.wT=function(){};
g.k.vT=function(){};
g.k.uT=function(){};
g.k.tT=function(){};
g.k.isActive=function(){return!0};
g.k.j3=function(){};g.ob(J8,g.Ld);J8.prototype.open=function(){this.j.G=this.C;this.K&&(this.j.Ra=!0);this.j.connect(this.G,this.B||void 0)};
J8.prototype.close=function(){this.j.disconnect()};
J8.prototype.send=function(a){var b=this.j;if("string"===typeof a){var c={};c.__data__=a;a=c}else this.D&&(c={},c.__data__=g.Nm(a),a=c);b.C.push(new ZAb(b.Xf++,a));3==b.Jh&&E8(b)};
J8.prototype.xa=function(){this.j.G=null;delete this.C;this.j.disconnect();delete this.j;J8.Uf.xa.call(this)};
g.ob(sBb,zAb);g.ob(tBb,AAb);g.ob(I8,qBb);I8.prototype.wT=function(){this.j.dispatchEvent("m")};
I8.prototype.vT=function(a){this.j.dispatchEvent(new sBb(a))};
I8.prototype.uT=function(a){this.j.dispatchEvent(new tBb(a))};
I8.prototype.tT=function(){this.j.dispatchEvent("n")};var L8=new g.Ld;g.w(wBb,g.Ab);g.k=N8.prototype;g.k.Hu=null;g.k.kq=!1;g.k.Ux=null;g.k.LL=null;g.k.Sx=null;g.k.Tx=null;g.k.Ur=null;g.k.Wr=null;g.k.Iu=null;g.k.qj=null;g.k.FG=0;g.k.Do=null;g.k.EG=null;g.k.Vr=null;g.k.aC=-1;g.k.P_=!0;g.k.Gu=!1;g.k.KL=0;g.k.DG=null;var BBb={},ABb={};g.k=N8.prototype;g.k.setTimeout=function(a){this.B=a};
g.k.m3=function(a){a=a.target;var b=this.DG;b&&3==g.Ln(a)?b.JL():this.xT(a)};
g.k.xT=function(a){try{if(a==this.qj)a:{var b=g.Ln(this.qj),c=this.qj.B,d=this.qj.getStatus();if(g.Cf&&!g.Uc(10)||g.Vc&&!g.Tc("420+")){if(4>b)break a}else if(3>b||3==b&&!g.Nn(this.qj))break a;this.Gu||4!=b||7==c||(8==c||0>=d?this.j.Tn(3):this.j.Tn(2));GBb(this);var e=this.qj.getStatus();this.aC=e;var f=g.Nn(this.qj);if(this.kq=200==e){4==b&&P8(this);if(this.Ea){for(a=!0;!this.Gu&&this.FG<f.length;){var h=CBb(this,f);if(h==ABb){4==b&&(this.Vr=4,M8(15),a=!1);break}else if(h==BBb){this.Vr=4;M8(16);a=
!1;break}else HBb(this,h)}4==b&&0==f.length&&(this.Vr=1,M8(17),a=!1);this.kq=this.kq&&a;a||(P8(this),Q8(this))}else HBb(this,f);this.kq&&!this.Gu&&(4==b?this.j.GG(this):(this.kq=!1,O8(this)))}else 400==e&&0<f.indexOf("Unknown SID")?(this.Vr=3,M8(13)):(this.Vr=0,M8(14)),P8(this),Q8(this)}}catch(l){}finally{}};
g.k.Xaa=function(a){K8((0,g.ib)(this.Waa,this,a),0)};
g.k.Waa=function(a){this.Gu||(GBb(this),HBb(this,a),O8(this))};
g.k.MZ=function(a){K8((0,g.ib)(this.Vaa,this,a),0)};
g.k.Vaa=function(a){this.Gu||(P8(this),this.kq=a,this.j.GG(this),this.j.Tn(4))};
g.k.cancel=function(){this.Gu=!0;P8(this)};
g.k.l3=function(){this.Ux=null;var a=Date.now();0<=a-this.LL?(2!=this.Tx&&this.j.Tn(3),P8(this),this.Vr=2,M8(18),Q8(this)):FBb(this,this.LL-a)};
g.k.getLastError=function(){return this.Vr};g.k=KBb.prototype;g.k.NL=null;g.k.Pj=null;g.k.mK=!1;g.k.n0=null;g.k.PH=null;g.k.yP=null;g.k.OL=null;g.k.Ql=null;g.k.lq=-1;g.k.bC=null;g.k.NC=null;g.k.connect=function(a){this.OL=a;a=T8(this.j,null,this.OL);M8(3);this.n0=Date.now();var b=this.j.Y;null!=b?(this.bC=b[0],(this.NC=b[1])?(this.Ql=1,LBb(this)):(this.Ql=2,MBb(this))):(b8(a,"MODE","init"),this.Pj=new N8(this),this.Pj.Hu=this.NL,zBb(this.Pj,a,!1,null,!0),this.Ql=0)};
g.k.N5=function(a){if(a)this.Ql=2,MBb(this);else{M8(4);var b=this.j;b.Mo=b.Bs.lq;X8(b,9)}a&&this.Tn(2)};
g.k.ML=function(a){return this.j.ML(a)};
g.k.abort=function(){this.Pj&&(this.Pj.cancel(),this.Pj=null);this.lq=-1};
g.k.Ug=function(){return!1};
g.k.yT=function(a,b){this.lq=a.aC;if(0==this.Ql)if(b){try{var c=this.B.parse(b)}catch(d){a=this.j;a.Mo=this.lq;X8(a,2);return}this.bC=c[0];this.NC=c[1]}else a=this.j,a.Mo=this.lq,X8(a,2);else if(2==this.Ql)if(this.mK)M8(7),this.yP=Date.now();else if("11111"==b){if(M8(6),this.mK=!0,this.PH=Date.now(),a=this.PH-this.n0,!g.Cf||g.Uc(10)||500>a)this.lq=200,this.Pj.cancel(),M8(12),U8(this.j,this,!0)}else M8(8),this.PH=this.yP=Date.now(),this.mK=!1};
g.k.GG=function(){this.lq=this.Pj.aC;if(this.Pj.kq)0==this.Ql?this.NC?(this.Ql=1,LBb(this)):(this.Ql=2,MBb(this)):2==this.Ql&&((!g.Cf||g.Uc(10)?!this.mK:200>this.yP-this.PH)?(M8(11),U8(this.j,this,!1)):(M8(12),U8(this.j,this,!0)));else{0==this.Ql?M8(9):2==this.Ql&&M8(10);var a=this.j;this.Pj.getLastError();a.Mo=this.lq;X8(a,2)}};
g.k.cC=function(){return this.j.cC()};
g.k.isActive=function(){return this.j.isActive()};
g.k.Tn=function(a){this.j.Tn(a)};g.k=NBb.prototype;g.k.Lo=null;g.k.dC=null;g.k.dk=null;g.k.Qg=null;g.k.PL=null;g.k.HG=null;g.k.zT=null;g.k.IG=null;g.k.eC=0;g.k.o3=0;g.k.Ti=null;g.k.Xr=null;g.k.mq=null;g.k.Ku=null;g.k.Bs=null;g.k.hL=null;g.k.Xx=-1;g.k.AT=-1;g.k.Mo=-1;g.k.Wx=0;g.k.Vx=0;g.k.Ju=8;g.ob(PBb,g.Ab);g.ob(QBb,g.Ab);g.k=NBb.prototype;g.k.connect=function(a,b,c,d,e){M8(0);this.PL=b;this.dC=c||{};d&&void 0!==e&&(this.dC.OSID=d,this.dC.OAID=e);this.Z?(K8((0,g.ib)(this.YV,this,a),100),SBb(this)):this.YV(a)};
g.k.disconnect=function(){TBb(this);if(3==this.j){var a=this.eC++,b=this.HG.clone();g.Mo(b,"SID",this.D);g.Mo(b,"RID",a);g.Mo(b,"TYPE","terminate");W8(this,b);a=new N8(this,this.D,a);a.Tx=2;a.Ur=a8(b.clone());(new Image).src=a.Ur.toString();a.Sx=Date.now();O8(a)}cCb(this)};
g.k.YV=function(a){this.Bs=new KBb(this);this.Bs.NL=this.Lo;this.Bs.B=this.G;this.Bs.connect(a)};
g.k.Ug=function(){return 0==this.j};
g.k.getState=function(){return this.j};
g.k.CT=function(a){this.Xr=null;YBb(this,a)};
g.k.BT=function(){this.mq=null;this.Qg=new N8(this,this.D,"rpc",this.N);this.Qg.Hu=this.Lo;this.Qg.KL=0;var a=this.zT.clone();g.Mo(a,"RID","rpc");g.Mo(a,"SID",this.D);g.Mo(a,"CI",this.hL?"0":"1");g.Mo(a,"AID",this.Xx);W8(this,a);if(!g.Cf||g.Uc(10))g.Mo(a,"TYPE","xmlhttp"),zBb(this.Qg,a,!0,this.IG,!1);else{g.Mo(a,"TYPE","html");var b=this.Qg,c=!!this.IG;b.Tx=3;b.Ur=a8(a.clone());EBb(b,c)}};
g.k.yT=function(a,b){if(0!=this.j&&(this.Qg==a||this.dk==a))if(this.Mo=a.aC,this.dk==a&&3==this.j)if(7<this.Ju){try{var c=this.G.parse(b)}catch(d){c=null}if(Array.isArray(c)&&3==c.length)if(a=c,0==a[0])a:{if(!this.mq){if(this.Qg)if(this.Qg.Sx+3E3<this.dk.Sx)V8(this),this.Qg.cancel(),this.Qg=null;else break a;aCb(this);M8(19)}}else this.AT=a[1],0<this.AT-this.Xx&&37500>a[2]&&this.hL&&0==this.Vx&&!this.Ku&&(this.Ku=K8((0,g.ib)(this.q3,this),6E3));else X8(this,11)}else null!=b&&X8(this,11);else if(this.Qg==
a&&V8(this),!g.fc(b))for(a=this.G.parse(b),b=0;b<a.length;b++)c=a[b],this.Xx=c[0],c=c[1],2==this.j?"c"==c[0]?(this.D=c[1],this.IG=c[2],c=c[3],null!=c?this.Ju=c:this.Ju=6,this.j=3,this.Ti&&this.Ti.FT(),this.zT=T8(this,this.cC()?this.IG:null,this.PL),ZBb(this)):"stop"==c[0]&&X8(this,7):3==this.j&&("stop"==c[0]?X8(this,7):"noop"!=c[0]&&this.Ti&&this.Ti.ET(c),this.Vx=0)};
g.k.q3=function(){null!=this.Ku&&(this.Ku=null,this.Qg.cancel(),this.Qg=null,aCb(this),M8(20))};
g.k.GG=function(a){if(this.Qg==a){V8(this);this.Qg=null;var b=2}else if(this.dk==a)this.dk=null,b=1;else return;this.Mo=a.aC;if(0!=this.j)if(a.kq)if(1==b){b=a.Iu?a.Iu.length:0;a=Date.now()-a.Sx;var c=L8;c.dispatchEvent(new PBb(c,b,a,this.Wx));RBb(this);this.C.length=0}else ZBb(this);else{c=a.getLastError();var d;if(!(d=3==c||7==c||0==c&&0<this.Mo)){if(d=1==b)this.dk||this.Xr||1==this.j||2<=this.Wx?d=!1:(this.Xr=K8((0,g.ib)(this.CT,this,a),$Bb(this,this.Wx)),this.Wx++,d=!0);d=!(d||2==b&&aCb(this))}if(d)switch(c){case 1:X8(this,
5);break;case 4:X8(this,10);break;case 3:X8(this,6);break;case 7:X8(this,12);break;default:X8(this,2)}}};
g.k.n3=function(a){if(!g.Fb(arguments,this.j))throw Error("Unexpected channel state: "+this.j);};
g.k.Wca=function(a){a?M8(2):(M8(1),bCb(this,8))};
g.k.ML=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new g.In;a.K=!1;return a};
g.k.isActive=function(){return!!this.Ti&&this.Ti.isActive(this)};
g.k.Tn=function(a){var b=L8;b.dispatchEvent(new QBb(b,a))};
g.k.cC=function(){return!(!g.Cf||g.Uc(10))};
g.k=dCb.prototype;g.k.FT=function(){};
g.k.ET=function(){};
g.k.DT=function(){};
g.k.QL=function(){};
g.k.GT=function(){return{}};
g.k.isActive=function(){return!0};g.k=eCb.prototype;g.k.isEmpty=function(){return 0===this.j.length&&0===this.B.length};
g.k.clear=function(){this.j=[];this.B=[]};
g.k.contains=function(a){return g.Fb(this.j,a)||g.Fb(this.B,a)};
g.k.remove=function(a){var b=this.j;var c=(0,g.Dgb)(b,a);0<=c?(g.Hb(b,c),b=!0):b=!1;return b||g.Ib(this.B,a)};
g.k.jm=function(){for(var a=[],b=this.j.length-1;0<=b;--b)a.push(this.j[b]);var c=this.B.length;for(b=0;b<c;++b)a.push(this.B[b]);return a};g.w(fCb,g.Ab);g.w(gCb,g.Ab);g.ob(Y8,g.I);g.k=Y8.prototype;g.k.Paa=function(){this.gj=Math.min(3E5,2*this.gj);this.C();this.B&&this.start()};
g.k.start=function(){var a=this.gj+15E3*Math.random();g.Ru(this.j,a);this.B=Date.now()+a};
g.k.stop=function(){this.j.stop();this.B=0};
g.k.isActive=function(){return this.j.isActive()};
g.k.reset=function(){this.j.stop();this.gj=5E3};g.ob(iCb,dCb);g.k=iCb.prototype;g.k.subscribe=function(a,b,c){return this.C.subscribe(a,b,c)};
g.k.unsubscribe=function(a,b,c){return this.C.unsubscribe(a,b,c)};
g.k.Ih=function(a){return this.C.Ih(a)};
g.k.ra=function(a,b){return this.C.ra.apply(this.C,arguments)};
g.k.dispose=function(){this.ma||(this.ma=!0,g.vb(this.C),this.disconnect(),g.vb(this.B),this.B=null,this.va=function(){return""})};
g.k.isDisposed=function(){return this.ma};
g.k.connect=function(a,b,c){if(!this.j||2!=this.j.getState()){this.Y="";this.B.stop();this.K=a||null;this.G=b||0;a=this.Ca+"/test";b=this.Ca+"/bind";var d=new NBb(c?c.firstTestResults:null,c?c.secondTestResults:null,this.Ra),e=this.j;e&&(e.Ti=null);d.Ti=this;this.j=d;jCb(this);if(this.j){d=g.rB("ID_TOKEN");var f=this.j.Lo||{};d?f["x-youtube-identity-token"]=d:delete f["x-youtube-identity-token"];this.j.Lo=f}e?(3!=e.getState()&&0==VBb(e)||e.getState(),this.j.connect(a,b,this.N,e.D,e.Xx)):c?this.j.connect(a,
b,this.N,c.sessionId,c.arrayId):this.j.connect(a,b,this.N)}};
g.k.disconnect=function(a){this.Z=a||0;this.B.stop();jCb(this);this.j&&(3==this.j.getState()&&YBb(this.j),this.j.disconnect());this.Z=0};
g.k.sendMessage=function(a,b){a={_sc:a};b&&g.rd(a,b);this.B.isActive()||2==(this.j?this.j.getState():0)?this.D.push(a):this.Uz()&&(jCb(this),UBb(this.j,a))};
g.k.FT=function(){this.B.reset();this.K=null;this.G=0;if(this.D.length){var a=this.D;this.D=[];for(var b=0,c=a.length;b<c;++b)UBb(this.j,a[b])}this.ra("handlerOpened");Fzb(this.Na,"BROWSER_CHANNEL")};
g.k.DT=function(a){var b=2==a&&401==this.j.Mo;4==a||b||this.B.start();this.ra("handlerError",a,b);Lzb(this.Ea,"BROWSER_CHANNEL")};
g.k.QL=function(a,b){if(!this.B.isActive())this.ra("handlerClosed");else if(b)for(var c=0,d=b.length;c<d;++c){var e=b[c].map;e&&this.D.push(e)}Hzb(this.Ia,"BROWSER_CHANNEL");a&&this.Xa.j.SL("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps",a.length);b&&this.fb.j.SL("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps",b.length)};
g.k.GT=function(){var a={v:2};this.Y&&(a.gsessionid=this.Y);0!=this.G&&(a.ui=""+this.G);0!=this.Z&&(a.ui=""+this.Z);this.K&&g.rd(a,this.K);return a};
g.k.ET=function(a){"S"==a[0]?this.Y=a[1]:"gracefulReconnect"==a[0]?(this.B.start(),this.j.disconnect()):this.ra("handlerMessage",new hCb(a[0],a[1]));Jzb(this.Ma,"BROWSER_CHANNEL")};
g.k.Uz=function(){return!!this.j&&3==this.j.getState()};
g.k.Er=function(a){(this.N.loungeIdToken=a)||this.B.stop();if(this.Wa&&this.j){var b=this.j.Lo||{};a?b["X-YouTube-LoungeId-Token"]=a:delete b["X-YouTube-LoungeId-Token"];this.j.Lo=b}};
g.k.Rs=function(){return this.N.id};
g.k.Ws=function(){return this.B.isActive()?this.B.B-Date.now():NaN};
g.k.gx=function(){var a=this.B;g.Su(a.j);a.start()};
g.k.kca=function(){this.B.isActive();0==VBb(this.j)&&this.connect(this.K,this.G)};Z8.prototype.D=function(a,b,c,d){b?a(d):a({text:c.responseText})};
Z8.prototype.C=function(a,b){a(Error("Request error: "+b.status))};
Z8.prototype.G=function(a){a(Error("request timed out"))};g.w(lCb,g.Ld);g.k=lCb.prototype;g.k.connect=function(a,b,c){this.Id.connect(a,b,c)};
g.k.disconnect=function(a){this.Id.disconnect(a)};
g.k.gx=function(){this.Id.gx()};
g.k.Rs=function(){return this.Id.Rs()};
g.k.Ws=function(){return this.Id.Ws()};
g.k.Uz=function(){return this.Id.Uz()};
g.k.t3=function(){this.dispatchEvent("channelOpened");var a=this.Id,b=this.j;g.IC("yt-remote-session-browser-channel",{firstTestResults:[""],secondTestResults:!a.j.hL,sessionId:a.j.D,arrayId:a.j.Xx});g.IC("yt-remote-session-screen-id",b);a=i8();b=j8();g.Fb(a,b)||a.push(b);cAb(a);eAb()};
g.k.r3=function(){this.dispatchEvent("channelClosed")};
g.k.s3=function(a){this.dispatchEvent(new fCb(a))};
g.k.onError=function(a){this.dispatchEvent(new gCb(a?1:0))};
g.k.sendMessage=function(a,b){this.Id.sendMessage(a,b)};
g.k.Er=function(a){this.Id.Er(a)};
g.k.dispose=function(){this.Id.dispose()};g.k=mCb.prototype;
g.k.connect=function(a,b){a=void 0===a?{}:a;b=void 0===b?0:b;2!==this.K&&(this.C.stop(),this.Z=a,this.N=b,oCb(this),(a=g.rB("ID_TOKEN"))?this.D["x-youtube-identity-token"]=a:delete this.D["x-youtube-identity-token"],this.j&&(this.B.device=this.j.device,this.B.name=this.j.name,this.B.app=this.j.app,this.B.id=this.j.id,this.j.b9&&(this.B.mdxVersion=""+this.j.b9),this.j.theme&&(this.B.theme=this.j.theme),this.j.capabilities&&(this.B.capabilities=this.j.capabilities),this.j.b6&&(this.B.cst=this.j.b6),
this.j.authuser&&(this.B.authuser=this.j.authuser),this.j.pageId&&(this.B.pageId=this.j.pageId)),0!==this.N?this.B.ui=""+this.N:delete this.B.ui,Object.assign(this.B,this.Z),this.channel=new J8(this.pathPrefix,{m8:"gsessionid",f9:this.D,g9:this.B}),this.channel.open(),this.K=2,nCb(this))};
g.k.disconnect=function(a){this.Y=void 0===a?0:a;this.C.stop();oCb(this);this.channel&&(0!==this.Y?this.B.ui=""+this.Y:delete this.B.ui,this.channel.close());this.Y=0};
g.k.Ws=function(){return this.C.isActive()?this.C.B-Date.now():NaN};
g.k.gx=function(){var a=this.C;g.Su(a.j);a.start()};
g.k.sendMessage=function(a,b){this.channel&&(oCb(this),a=Object.assign({},{_sc:a},b),this.channel.send(a))};
g.k.Er=function(a){a||this.C.stop();a?this.D["X-YouTube-LoungeId-Token"]=a:delete this.D["X-YouTube-LoungeId-Token"]};
g.k.Rs=function(){return this.j?this.j.id:""};
g.k.ra=function(a){return this.G.ra.apply(this.G,[a].concat(g.pa(g.Ia.apply(1,arguments))))};
g.k.subscribe=function(a,b,c){return this.G.subscribe(a,b,c)};
g.k.unsubscribe=function(a,b,c){return this.G.unsubscribe(a,b,c)};
g.k.Ih=function(a){return this.G.Ih(a)};
g.k.dispose=function(){this.ma||(this.ma=!0,g.vb(this.G),this.disconnect(),g.vb(this.C),this.Ca=function(){return""})};
g.k.isDisposed=function(){return this.ma};g.w(pCb,g.Ld);g.k=pCb.prototype;g.k.connect=function(a,b){this.j.connect(a,b)};
g.k.disconnect=function(a){this.j.disconnect(a)};
g.k.gx=function(){this.j.gx()};
g.k.Rs=function(){return this.j.Rs()};
g.k.Ws=function(){return this.j.Ws()};
g.k.Uz=function(){return 3===this.j.K};
g.k.w3=function(){this.dispatchEvent("channelOpened")};
g.k.u3=function(){this.dispatchEvent("channelClosed")};
g.k.v3=function(a){this.dispatchEvent(new fCb(a))};
g.k.onError=function(){this.dispatchEvent(new gCb(401===this.j.Ig?1:0))};
g.k.sendMessage=function(a,b){this.j.sendMessage(a,b)};
g.k.Er=function(a){this.j.Er(a)};
g.k.dispose=function(){this.j.dispose()};var xCb=Date.now(),a9=null,e9=Array(50),d9=-1,f9=!1;g.ob(g9,g.NF);g9.prototype.Sk=function(){return this.screens};
g9.prototype.contains=function(a){return!!$zb(this.screens,a)};
g9.prototype.get=function(a){return a?h8(this.screens,a):null};
g9.prototype.info=function(a){b9(this.K,a)};g.w(BCb,g.NF);g.k=BCb.prototype;g.k.start=function(){!this.j&&isNaN(this.qd)&&this.g_()};
g.k.stop=function(){this.j&&(this.j.abort(),this.j=null);isNaN(this.qd)||(g.NB(this.qd),this.qd=NaN)};
g.k.xa=function(){this.stop();g.NF.prototype.xa.call(this)};
g.k.g_=function(){this.qd=NaN;this.j=g.RB($8(this.C,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:this.N},timeout:5E3,onSuccess:(0,g.ib)(this.y3,this),onError:(0,g.ib)(this.x3,this),onTimeout:(0,g.ib)(this.z3,this)})};
g.k.y3=function(a,b){this.j=null;a=b.screen||{};a.dialId=this.D;a.name=this.K;b=-1;this.G&&a.shortLivedLoungeToken&&a.shortLivedLoungeToken.value&&a.shortLivedLoungeToken.refreshIntervalMs&&(a.screenIdType="shortLived",a.loungeToken=a.shortLivedLoungeToken.value,b=a.shortLivedLoungeToken.refreshIntervalMs);this.ra("pairingComplete",new e8(a),b)};
g.k.x3=function(a){this.j=null;a.status&&404==a.status?this.B>=vEb.length?this.ra("pairingFailed",Error("DIAL polling timed out")):(a=vEb[this.B],this.qd=g.LB((0,g.ib)(this.g_,this),a),this.B++):this.ra("pairingFailed",Error("Server error "+a.status))};
g.k.z3=function(){this.j=null;this.ra("pairingFailed",Error("Server not responding"))};
var vEb=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.ob(i9,g9);g.k=i9.prototype;g.k.start=function(){h9(this)&&this.ra("screenChange");!g.JC("yt-remote-lounge-token-expiration")&&CCb(this);g.NB(this.j);this.j=g.LB((0,g.ib)(this.start,this),1E4)};
g.k.add=function(a,b){h9(this);yCb(this,a);j9(this,!1);this.ra("screenChange");b(a);a.token||CCb(this)};
g.k.remove=function(a,b){var c=h9(this);ACb(this,a)&&(j9(this,!1),c=!0);b(a);c&&this.ra("screenChange")};
g.k.gL=function(a,b,c,d){var e=h9(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,j9(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.ra("screenChange")};
g.k.xa=function(){g.NB(this.j);i9.Uf.xa.call(this)};
g.k.J7=function(a){h9(this);var b=this.screens.length;a=a&&a.screens||[];for(var c=0,d=a.length;c<d;++c){var e=a[c],f=this.get(e.screenId);f&&(f.token=e.loungeToken,--b)}j9(this,!b);b&&b9(this.K,"Missed "+b+" lounge tokens.")};
g.k.I7=function(a){b9(this.K,"Requesting lounge tokens failed: "+a)};g.w(ECb,g.NF);g.k=ECb.prototype;g.k.start=function(){var a=parseInt(g.JC("yt-remote-fast-check-period")||"0",10);(this.D=g.kb()-144E5<a?0:a)?k9(this):(this.D=g.kb()+3E5,g.IC("yt-remote-fast-check-period",this.D),this.sR())};
g.k.isEmpty=function(){return g.md(this.j)};
g.k.update=function(){DCb("Updating availability on schedule.");var a=this.K(),b=g.cd(this.j,function(c,d){return c&&!!h8(a,d)},this);
HCb(this,b)};
g.k.xa=function(){g.NB(this.C);this.C=NaN;this.B&&(this.B.abort(),this.B=null);g.NF.prototype.xa.call(this)};
g.k.sR=function(){g.NB(this.C);this.C=NaN;this.B&&this.B.abort();var a=ICb(this);if(xzb(a)){var b=$8(this.G,"/pairing/get_screen_availability");this.B=kCb(this.G,b,{lounge_token:g.id(a).join(",")},(0,g.ib)(this.vaa,this,a),(0,g.ib)(this.uaa,this))}else HCb(this,{}),k9(this)};
g.k.vaa=function(a,b){this.B=null;var c=g.id(ICb(this));if(g.Zb(c,g.id(a))){b=b.screens||[];c={};for(var d=b.length,e=0;e<d;++e)c[a[b[e].loungeToken]]="online"==b[e].status;HCb(this,c);k9(this)}else this.qg("Changing Screen set during request."),this.sR()};
g.k.uaa=function(a){this.qg("Screen availability failed: "+a);this.B=null;k9(this)};
g.k.qg=function(a){b9("OnlineScreenService",a)};g.ob(l9,g9);g.k=l9.prototype;g.k.start=function(){this.B.start();this.j.start();this.screens.length&&(this.ra("screenChange"),this.j.isEmpty()||this.ra("onlineScreenChange"))};
g.k.add=function(a,b,c){this.B.add(a,b,c)};
g.k.remove=function(a,b,c){this.B.remove(a,b,c);this.j.update()};
g.k.gL=function(a,b,c,d){this.B.contains(a)?this.B.gL(a,b,c,d):(a="Updating name of unknown screen: "+a.name,b9(this.K,a),d(Error(a)))};
g.k.Sk=function(a){return a?this.screens:g.Kb(this.screens,g.ot(this.C,function(b){return!this.contains(b)},this))};
g.k.HT=function(){return g.ot(this.Sk(!0),function(a){return!!this.j.j[a.id]},this)};
g.k.IT=function(a,b,c,d,e,f){var h=this;this.info("getDialScreenByPairingCode "+a+" / "+b);var l=new BCb(this.D,a,b,c,d);l.subscribe("pairingComplete",function(m,n){g.vb(l);e(m9(h,m),n)});
l.subscribe("pairingFailed",function(m){g.vb(l);f(m)});
l.start();return(0,g.ib)(l.stop,l)};
g.k.A3=function(a,b,c,d){g.RB($8(this.D,"/pairing/get_screen"),{method:"POST",postParams:{pairing_code:a},timeout:5E3,onSuccess:(0,g.ib)(function(e,f){e=new e8(f.screen||{});if(!e.name||MCb(this,e.name)){a:{f=e.name;for(var h=2,l=b(f,h);MCb(this,l);){h++;if(20<h)break a;l=b(f,h)}f=l}e.name=f}c(m9(this,e))},this),
onError:(0,g.ib)(function(e){d(Error("pairing request failed: "+e.status))},this),
onTimeout:(0,g.ib)(function(){d(Error("pairing request timed out."))},this)})};
g.k.xa=function(){g.vb(this.B);g.vb(this.j);l9.Uf.xa.call(this)};
g.k.T7=function(){OCb(this);this.ra("screenChange");this.j.update()};
l9.prototype.dispose=l9.prototype.dispose;g.ob(n9,g.NF);g.k=n9.prototype;g.k.Fj=function(a){this.isDisposed()||(a&&(p9(this,""+a),this.ra("sessionFailed")),this.j=null,this.ra("sessionScreen",null))};
g.k.info=function(a){b9(this.Ea,a)};
g.k.JT=function(){return null};
g.k.LR=function(a){var b=this.B;a?(b.displayStatus=new chrome.cast.ReceiverDisplayStatus(a,[]),b.displayStatus.showStop=!0):b.displayStatus=null;chrome.cast.setReceiverDisplayStatus(b,(0,g.ib)(function(){this.info("Updated receiver status for "+b.friendlyName+": "+a)},this),(0,g.ib)(function(){p9(this,"Failed to update receiver status for: "+b.friendlyName)},this))};
g.k.xa=function(){this.LR("");n9.Uf.xa.call(this)};g.w(q9,n9);g.k=q9.prototype;g.k.JR=function(a){if(this.C){if(this.C==a)return;p9(this,"Overriding cast session with new session object");$Cb(this);this.Ca=!1;this.Y="unknown";this.C.removeUpdateListener(this.va);this.C.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Ia)}this.C=a;this.C.addUpdateListener(this.va);this.C.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.Ia);VCb(this,"getMdxSessionStatus")};
g.k.gA=function(a){this.info("launchWithParams no-op for Cast: "+g.Nm(a))};
g.k.stop=function(){this.C?this.C.stop((0,g.ib)(function(){this.Fj()},this),(0,g.ib)(function(){this.Fj(Error("Failed to stop receiver app."))},this)):this.Fj(Error("Stopping cast device without session."))};
g.k.LR=function(){};
g.k.xa=function(){this.info("disposeInternal");$Cb(this);this.C&&(this.C.removeUpdateListener(this.va),this.C.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.Ia));this.C=null;n9.prototype.xa.call(this)};
g.k.fba=function(a,b){if(!this.isDisposed())if(b)if(b=c8(b),g.bb(b))switch(a=""+b.type,b=b.data||{},this.info("onYoutubeMessage_: "+a+" "+g.Nm(b)),a){case "mdxSessionStatus":SCb(this,b);break;case "loungeToken":WCb(this,b);break;default:p9(this,"Unknown youtube message: "+a)}else p9(this,"Unable to parse message.");else p9(this,"No data in message.")};
g.k.jX=function(a,b,c,d){g.NB(this.Z);this.Z=0;LCb(this.D,this.B.label,a,this.B.friendlyName,(0,g.ib)(function(e){e?b(e):0<=d?(p9(this,"Screen "+a+" appears to be offline. "+d+" retries left."),this.Z=g.LB((0,g.ib)(this.jX,this,a,b,c,d-1),300)):c(Error("Unable to fetch screen."))},this),c)};
g.k.JT=function(){return this.C};
g.k.B3=function(a){this.isDisposed()||a||(p9(this,"Cast session died."),this.Fj())};g.w(r9,n9);g.k=r9.prototype;g.k.JR=function(a){this.C=a;this.C.addUpdateListener(this.Ma)};
g.k.gA=function(a){this.Na=a;this.ma()};
g.k.stop=function(){hDb(this);this.C?this.C.stop((0,g.ib)(this.Fj,this,null),(0,g.ib)(this.Fj,this,"Failed to stop DIAL device.")):this.Fj()};
g.k.xa=function(){hDb(this);this.C&&this.C.removeUpdateListener(this.Ma);this.C=null;n9.prototype.xa.call(this)};
g.k.C3=function(a){this.isDisposed()||a||(p9(this,"DIAL session died."),this.G(),this.G=function(){},this.Fj())};g.w(u9,n9);u9.prototype.stop=function(){this.Fj()};
u9.prototype.JR=function(){};
u9.prototype.gA=function(){g.NB(this.C);this.C=NaN;var a=h8(this.D.Sk(),this.B.label);a?o9(this,a):this.Fj(Error("No such screen"))};
u9.prototype.xa=function(){g.NB(this.C);this.C=NaN;n9.prototype.xa.call(this)};g.w(v9,g.NF);g.k=v9.prototype;
g.k.init=function(a,b){chrome.cast.timeout.requestSession=3E4;var c=new chrome.cast.SessionRequest(this.Z,[chrome.cast.Capability.AUDIO_OUT]);this.Y||(c.dialRequest=new chrome.cast.DialRequest("YouTube"));var d=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;a=a||this.K?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var e=(0,g.ib)(this.baa,this);c=new chrome.cast.ApiConfig(c,(0,g.ib)(this.IZ,this),e,d,a);c.customDialLaunchCallback=(0,g.ib)(this.Y9,this);
chrome.cast.initialize(c,(0,g.ib)(function(){this.isDisposed()||(chrome.cast.addReceiverActionListener(this.G),uCb(),this.B.subscribe("onlineScreenChange",(0,g.ib)(this.KT,this)),this.C=kDb(this),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.ib)(function(f){this.qg("Failed to set initial custom receivers: "+g.Nm(f))},this)),this.ra("yt-remote-cast2-availability-change",x9(this)),b(!0))},this),(0,g.ib)(function(f){this.qg("Failed to initialize API: "+g.Nm(f));
b(!1)},this))};
g.k.tca=function(a,b){w9("Setting connected screen ID: "+a+" -> "+b);if(this.j){var c=this.j.j;if(!a||c&&c.id!=a)w9("Unsetting old screen status: "+this.j.B.friendlyName),y9(this,null)}if(a&&b){if(!this.j){a=h8(this.B.Sk(),a);if(!a){w9("setConnectedScreenStatus: Unknown screen.");return}if("shortLived"==a.idType){w9("setConnectedScreenStatus: Screen with id type to be short lived.");return}c=iDb(this,a);c||(w9("setConnectedScreenStatus: Connected receiver not custom..."),c=new chrome.cast.Receiver(a.uuid?
a.uuid:a.id,a.name),c.receiverType=chrome.cast.ReceiverType.CUSTOM,this.C.push(c),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.ib)(function(d){this.qg("Failed to set initial custom receivers: "+g.Nm(d))},this)));
w9("setConnectedScreenStatus: new active receiver: "+c.friendlyName);y9(this,new u9(this.B,c),!0)}this.j.LR(b)}else w9("setConnectedScreenStatus: no screen.")};
g.k.wca=function(a){this.isDisposed()?this.qg("Setting connection data on disposed cast v2"):this.j?this.j.gA(a):this.qg("Setting connection data without a session")};
g.k.E3=function(){this.isDisposed()?this.qg("Stopping session on disposed cast v2"):this.j?(this.j.stop(),y9(this,null)):w9("Stopping non-existing session")};
g.k.requestSession=function(){chrome.cast.requestSession((0,g.ib)(this.IZ,this),(0,g.ib)(this.yaa,this))};
g.k.xa=function(){this.B.unsubscribe("onlineScreenChange",(0,g.ib)(this.KT,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.G);var a=rCb,b=g.Wa("yt.mdx.remote.debug.handlers_");g.Ib(b||[],a);g.vb(this.j);g.NF.prototype.xa.call(this)};
g.k.qg=function(a){b9("Controller",a)};
g.k.KZ=function(a,b){this.j==a&&(b||y9(this,null),this.ra("yt-remote-cast2-session-change",b))};
g.k.Y$=function(a,b){if(!this.isDisposed())if(a)switch(a.friendlyName=chrome.cast.unescape(a.friendlyName),w9("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.j)if(this.j.B.label!=a.label)w9("onReceiverAction_: Stopping active receiver: "+this.j.B.friendlyName),this.j.stop();else{w9("onReceiverAction_: Casting to active receiver.");this.j.j&&this.ra("yt-remote-cast2-session-change",this.j.j);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:y9(this,
new u9(this.B,a));break;case chrome.cast.ReceiverType.DIAL:y9(this,new r9(this.B,a,this.D,this.config_));break;case chrome.cast.ReceiverType.CAST:y9(this,new q9(this.B,a,this.config_));break;default:this.qg("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.j&&this.j.B.label==a.label?this.j.stop():this.qg("Stopping receiver w/o session: "+a.friendlyName)}else this.qg("onReceiverAction_ called without receiver.")};
g.k.Y9=function(a){if(this.isDisposed())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.qg("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.j?this.j.B:null;if(!c||c.label!=b.label)return this.qg("Receiving DIAL launch request for non-clicked DIAL receiver: "+b.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(c&&c.label==b.label&&c.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.j.j)return w9("Reselecting dial screen."),
this.ra("yt-remote-cast2-session-change",this.j.j),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.qg('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);y9(this,new r9(this.B,b,this.D,this.config_))}b=this.j;b.Z=a;b.Z.appState==chrome.cast.DialAppState.RUNNING?(a=b.Z.extraData||{},c=a.screenId||null,s9(b)&&a.loungeToken?a.loungeTokenRefreshIntervalMs?a=eDb(b,{name:b.B.friendlyName,screenId:a.screenId,loungeToken:a.loungeToken,dialId:b.Z.receiver.label,screenIdType:"shortLived"},
a.loungeTokenRefreshIntervalMs):(g.wB(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(a)+".")),a=fDb(b,c)):a=fDb(b,c)):a=cDb(b);return a};
g.k.IZ=function(a){var b=this;if(!this.isDisposed()&&!this.K){w9("New cast session ID: "+a.sessionId);var c=a.receiver;if(c.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.j)if(c.receiverType==chrome.cast.ReceiverType.CAST)w9("Got resumed cast session before resumed mdx connection."),c.friendlyName=chrome.cast.unescape(c.friendlyName),y9(this,new q9(this.B,c,this.config_),!0);else{this.qg("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var d=this.j.B,e=h8(this.B.Sk(),
d.label);e&&f8(e,c.label)&&d.receiverType!=chrome.cast.ReceiverType.CAST&&c.receiverType==chrome.cast.ReceiverType.CAST&&(w9("onSessionEstablished_: manual to cast session change "+c.friendlyName),g.vb(this.j),this.j=new q9(this.B,c,this.config_),this.j.subscribe("sessionScreen",(0,g.ib)(this.KZ,this,this.j)),this.j.subscribe("sessionFailed",function(){return jDb(b,b.j)}),this.j.gA(null));
this.j.JR(a)}}};
g.k.D3=function(){return this.j?this.j.JT():null};
g.k.yaa=function(a){this.isDisposed()||(this.qg("Failed to estabilish a session: "+g.Nm(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&y9(this,null),this.ra("yt-remote-cast2-session-failed"))};
g.k.baa=function(a){w9("Receiver availability updated: "+a);if(!this.isDisposed()){var b=x9(this);this.N=a==chrome.cast.ReceiverAvailability.AVAILABLE;x9(this)!=b&&this.ra("yt-remote-cast2-availability-change",x9(this))}};
g.k.KT=function(){this.isDisposed()||(this.C=kDb(this),w9("Updating custom receivers: "+g.Nm(this.C)),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.ib)(function(){this.qg("Failed to set custom receivers.")},this)),this.ra("yt-remote-cast2-availability-change",x9(this)))};
v9.prototype.setLaunchParams=v9.prototype.wca;v9.prototype.setConnectedScreenStatus=v9.prototype.tca;v9.prototype.stopSession=v9.prototype.E3;v9.prototype.getCastSession=v9.prototype.D3;v9.prototype.requestSession=v9.prototype.requestSession;v9.prototype.init=v9.prototype.init;v9.prototype.dispose=v9.prototype.dispose;var tDb=[];g.k=F9.prototype;
g.k.reset=function(a){this.listId="";this.index=-1;this.videoId="";zDb(this);this.volume=-1;this.muted=!1;a&&(this.index=a.index,this.listId=a.listId,this.videoId=a.videoId,this.playerState=a.playerState,this.volume=a.volume,this.muted=a.muted,this.audioTrackId=a.audioTrackId,this.trackData=a.trackData,this.Cp=a.hasPrevious,this.Vk=a.hasNext,this.N=a.playerTime,this.K=a.playerTimeAt,this.D=a.seekableStart,this.j=a.seekableEnd,this.G=a.duration,this.Z=a.loadedTime,this.C=a.liveIngestionTime,this.B=
!isNaN(this.C))};
g.k.isPlaying=function(){return 1==this.playerState};
g.k.wl=function(a){this.G=isNaN(a)?0:a};
g.k.getDuration=function(){return this.B?this.G+G9(this):this.G};
g.k.clone=function(){return new F9(ADb(this))};g.w(L9,g.NF);g.k=L9.prototype;g.k.getState=function(){return this.C};
g.k.Ws=function(){return this.D.getReconnectTimeout()};
g.k.gx=function(){this.D.reconnect()};
g.k.play=function(){N9(this)?(this.j?this.j.play(null,g.Sd,R9(this,"play")):Q9(this,"play"),DDb(this,1,I9(M9(this))),this.ra("remotePlayerChange")):O9(this,this.play)};
g.k.pause=function(){N9(this)?(this.j?this.j.pause(null,g.Sd,R9(this,"pause")):Q9(this,"pause"),DDb(this,2,I9(M9(this))),this.ra("remotePlayerChange")):O9(this,this.pause)};
g.k.seekTo=function(a){if(N9(this)){if(this.j){var b=M9(this),c=new chrome.cast.media.SeekRequest;c.currentTime=a;b.isPlaying()||3==b.playerState?c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.j.seek(c,g.Sd,R9(this,"seekTo",{newTime:a}))}else Q9(this,"seekTo",{newTime:a});DDb(this,3,a);this.ra("remotePlayerChange")}else O9(this,g.jb(this.seekTo,a))};
g.k.stop=function(){if(N9(this)){this.j?this.j.stop(null,g.Sd,R9(this,"stopVideo")):Q9(this,"stopVideo");var a=M9(this);a.index=-1;a.videoId="";zDb(a);P9(this,a);this.ra("remotePlayerChange")}else O9(this,this.stop)};
g.k.setVolume=function(a,b){if(N9(this)){var c=M9(this);if(this.B){if(c.volume!=a){var d=Math.round(a)/100;this.B.setReceiverVolumeLevel(d,(0,g.ib)(function(){c9("set receiver volume: "+d)},this),(0,g.ib)(function(){this.qg("failed to set receiver volume.")},this))}c.muted!=b&&this.B.setReceiverMuted(b,(0,g.ib)(function(){c9("set receiver muted: "+b)},this),(0,g.ib)(function(){this.qg("failed to set receiver muted.")},this))}else{var e={volume:a,
muted:b};-1!=c.volume&&(e.delta=a-c.volume);Q9(this,"setVolume",e)}c.muted=b;c.volume=a;P9(this,c)}else O9(this,g.jb(this.setVolume,a,b))};
g.k.LT=function(a,b){if(N9(this)){var c=M9(this);a={videoId:a};b&&(c.trackData={trackName:b.name,languageCode:b.languageCode,sourceLanguageCode:b.translationLanguage?b.translationLanguage.languageCode:"",languageName:b.languageName,kind:b.kind},a.style=g.Nm(b.style),g.rd(a,c.trackData));Q9(this,"setSubtitlesTrack",a);P9(this,c)}else O9(this,g.jb(this.LT,a,b))};
g.k.setAudioTrack=function(a,b){N9(this)?(b=b.getLanguageInfo().getId(),Q9(this,"setAudioTrack",{videoId:a,audioTrackId:b}),a=M9(this),a.audioTrackId=b,P9(this,a)):O9(this,g.jb(this.setAudioTrack,a,b))};
g.k.playVideo=function(a,b,c,d,e,f,h){d=void 0===d?null:d;e=void 0===e?null:e;f=void 0===f?null:f;h=void 0===h?null:h;var l=M9(this),m={videoId:a};void 0!==c&&(m.currentIndex=c);J9(l,a,c||0);void 0!==b&&(H9(l,b),m.currentTime=b);d&&(m.listId=d);e&&(m.playerParams=e);f&&(m.clickTrackingParams=f);h&&(m.locationInfo=g.Nm(h));Q9(this,"setPlaylist",m);d||P9(this,l)};
g.k.gK=function(a,b){if(N9(this)){if(a&&b){var c=M9(this);J9(c,a,b);P9(this,c)}Q9(this,"previous")}else O9(this,g.jb(this.gK,a,b))};
g.k.nextVideo=function(a,b){if(N9(this)){if(a&&b){var c=M9(this);J9(c,a,b);P9(this,c)}Q9(this,"next")}else O9(this,g.jb(this.nextVideo,a,b))};
g.k.lH=function(){if(N9(this)){Q9(this,"clearPlaylist");var a=M9(this);a.reset();P9(this,a);this.ra("remotePlayerChange")}else O9(this,this.lH)};
g.k.nW=function(){N9(this)?Q9(this,"dismissAutoplay"):O9(this,this.nW)};
g.k.dispose=function(){if(3!=this.C){var a=this.C;this.C=3;this.ra("proxyStateChange",a,this.C)}g.NF.prototype.dispose.call(this)};
g.k.xa=function(){CDb(this);this.D=null;this.G.clear();K9(this,null);g.NF.prototype.xa.call(this)};
g.k.QR=function(a){if((a!=this.C||2==a)&&3!=this.C&&0!=a){var b=this.C;this.C=a;this.ra("proxyStateChange",b,a);if(1==a)for(;!this.G.isEmpty();)b=a=this.G,0===b.j.length&&(b.j=b.B,b.j.reverse(),b.B=[]),a.j.pop().apply(this);else 3==a&&this.dispose()}};
g.k.W$=function(a,b){this.ra(a,b)};
g.k.O9=function(a){if(!a)this.HE(null),K9(this,null);else if(this.B.receiver.volume){a=this.B.receiver.volume;var b=M9(this),c=Math.round(100*a.level||0);if(b.volume!=c||b.muted!=a.muted)c9("Cast volume update: "+a.level+(a.muted?" muted":"")),b.volume=c,b.muted=!!a.muted,P9(this,b)}};
g.k.HE=function(a){c9("Cast media: "+!!a);this.j&&this.j.removeUpdateListener(this.Z);if(this.j=a)this.j.addUpdateListener(this.Z),EDb(this),this.ra("remotePlayerChange")};
g.k.N9=function(a){a?(EDb(this),this.ra("remotePlayerChange")):this.HE(null)};
g.k.qS=function(){Q9(this,"sendDebugCommand",{debugCommand:"stats4nerds "})};
g.k.R9=function(){var a=wDb();a&&K9(this,a)};
g.k.qg=function(a){b9("CP",a)};g.w(U9,g.NF);g.k=U9.prototype;
g.k.connect=function(a,b){if(b){var c=b.listId,d=b.videoId,e=b.videoIds,f=b.playerParams,h=b.clickTrackingParams,l=b.index,m={videoId:d},n=b.currentTime,p=b.locationInfo;b=b.loopMode;void 0!==n&&(m.currentTime=5>=n?0:n);f&&(m.playerParams=f);p&&(m.locationInfo=p);h&&(m.clickTrackingParams=h);c&&(m.listId=c);e&&0<e.length&&(m.videoIds=e.join(","));void 0!==l&&(m.currentIndex=l);this.Ma&&(m.loopMode=b||"LOOP_MODE_OFF");c&&(this.j.listId=c);this.j.videoId=d;this.j.index=l||0;this.j.state=3;H9(this.j,
n);this.G="UNSUPPORTED";c=this.Ma?"setInitialState":"setPlaylist";S9("Connecting with "+c+" and params: "+g.Nm(m));this.B.connect({method:c,params:g.Nm(m)},a,fAb())}else S9("Connecting without params"),this.B.connect({},a,fAb());IDb(this)};
g.k.Er=function(a){this.B.Er(a)};
g.k.dispose=function(){this.isDisposed()||(g.Va("yt.mdx.remote.remoteClient_",null),this.ra("beforeDispose"),T9(this,3));g.NF.prototype.dispose.call(this)};
g.k.xa=function(){JDb(this);LDb(this);KDb(this);g.NB(this.Z);this.Z=NaN;g.NB(this.Y);this.Y=NaN;this.D=null;g.AC(this.ma);this.ma.length=0;this.B.dispose();g.NF.prototype.xa.call(this);this.G=this.N=this.C=this.j=this.B=null};
g.k.gY=function(a){if(!this.C||0===this.C.length)return!1;for(var b=g.u(this.C),c=b.next();!c.done;c=b.next())if(!c.value.capabilities.has(a))return!1;return!0};
g.k.p7=function(){var a=3;this.isDisposed()||(a=0,isNaN(this.ID())?this.B.Uz()&&isNaN(this.K)&&(a=1):a=2);return a};
g.k.pz=function(a){S9("Disconnecting with "+a);g.Va("yt.mdx.remote.remoteClient_",null);JDb(this);this.ra("beforeDisconnect",a);1==a&&k8();this.B.disconnect(a);this.dispose()};
g.k.k7=function(){var a=this.j;this.D&&(a=this.j.clone(),J9(a,this.D,a.index));return ADb(a)};
g.k.yca=function(a){var b=this,c=new F9(a);c.videoId&&c.videoId!=this.j.videoId&&(this.D=c.videoId,g.NB(this.Z),this.Z=g.LB(function(){if(b.D){var e=b.D;b.D=null;b.j.videoId!=e&&V9(b,"getNowPlaying")}},5E3));
var d=[];this.j.listId==c.listId&&this.j.videoId==c.videoId&&this.j.index==c.index||d.push("remoteQueueChange");this.j.playerState==c.playerState&&this.j.volume==c.volume&&this.j.muted==c.muted&&I9(this.j)==I9(c)&&g.Nm(this.j.trackData)==g.Nm(c.trackData)||d.push("remotePlayerChange");this.j.reset(a);g.bc(d,function(e){this.ra(e)},this)};
g.k.eX=function(){var a=this.B.Rs(),b=g.Db(this.C,function(c){return"REMOTE_CONTROL"==c.type&&c.id!=a});
return b?b.id:""};
g.k.ID=function(){return this.B.Ws()};
g.k.T6=function(){return this.G||"UNSUPPORTED"};
g.k.U6=function(){return this.N||""};
g.k.F3=function(){!isNaN(this.ID())&&this.B.gx()};
g.k.rca=function(a,b){V9(this,a,b);NDb(this)};
g.k.NT=function(){var a=g.aC("SAPISID","")||g.aC("__Secure-1PAPISID")||"",b=g.aC("__Secure-3PAPISID","")||"";if(!a&&!b)return"";a=g.Dg(g.Cg(a),2);b=g.Dg(g.Cg(b),2);return g.Dg(g.Cg(","+a+","+b),2)};
U9.prototype.subscribe=U9.prototype.subscribe;U9.prototype.unsubscribeByKey=U9.prototype.Ih;U9.prototype.getProxyState=U9.prototype.p7;U9.prototype.disconnect=U9.prototype.pz;U9.prototype.getPlayerContextData=U9.prototype.k7;U9.prototype.setPlayerContextData=U9.prototype.yca;U9.prototype.getOtherConnectedRemoteId=U9.prototype.eX;U9.prototype.getReconnectTimeout=U9.prototype.ID;U9.prototype.getAutoplayMode=U9.prototype.T6;U9.prototype.getAutoplayVideoId=U9.prototype.U6;U9.prototype.reconnect=U9.prototype.F3;
U9.prototype.sendMessage=U9.prototype.rca;U9.prototype.getXsrfToken=U9.prototype.NT;U9.prototype.isCapabilitySupportedOnConnectedDevices=U9.prototype.gY;g.w(ZDb,g9);g.k=ZDb.prototype;g.k.Sk=function(a){return this.jh.$_gs(a)};
g.k.contains=function(a){return!!this.jh.$_c(a)};
g.k.get=function(a){return this.jh.$_g(a)};
g.k.start=function(){this.jh.$_st()};
g.k.add=function(a,b,c){this.jh.$_a(a,b,c)};
g.k.remove=function(a,b,c){this.jh.$_r(a,b,c)};
g.k.gL=function(a,b,c,d){this.jh.$_un(a,b,c,d)};
g.k.xa=function(){for(var a=0,b=this.j.length;a<b;++a)this.jh.$_ubk(this.j[a]);this.j.length=0;this.jh=null;g9.prototype.xa.call(this)};
g.k.G3=function(){this.ra("screenChange")};
g.k.E$=function(){this.ra("onlineScreenChange")};
l9.prototype.$_st=l9.prototype.start;l9.prototype.$_gspc=l9.prototype.A3;l9.prototype.$_gsppc=l9.prototype.IT;l9.prototype.$_c=l9.prototype.contains;l9.prototype.$_g=l9.prototype.get;l9.prototype.$_a=l9.prototype.add;l9.prototype.$_un=l9.prototype.gL;l9.prototype.$_r=l9.prototype.remove;l9.prototype.$_gs=l9.prototype.Sk;l9.prototype.$_gos=l9.prototype.HT;l9.prototype.$_s=l9.prototype.subscribe;l9.prototype.$_ubk=l9.prototype.Ih;var f$=null,i$=!1,W9=null,X9=null,jEb=null,a$=[];g.w(oEb,g.I);g.k=oEb.prototype;g.k.xa=function(){g.I.prototype.xa.call(this);this.j.stop();this.B.stop();this.N.stop();var a=this.Kc;a.unsubscribe("proxyStateChange",this.HZ,this);a.unsubscribe("remotePlayerChange",this.NE,this);a.unsubscribe("remoteQueueChange",this.PJ,this);a.unsubscribe("previousNextChange",this.EZ,this);a.unsubscribe("nowAutoplaying",this.AZ,this);a.unsubscribe("autoplayDismissed",this.iZ,this);this.Kc=this.module=null};
g.k.Uk=function(a){var b=g.Ia.apply(1,arguments);if(2!=this.Kc.C)if(j$(this)){if(1081!=M9(this.Kc).playerState||"control_seek"!==a)switch(a){case "control_toggle_play_pause":M9(this.Kc).isPlaying()?this.Kc.pause():this.Kc.play();break;case "control_play":this.Kc.play();break;case "control_pause":this.Kc.pause();break;case "control_seek":this.K.JL(b[0],b[1]);break;case "control_subtitles_set_track":qEb(this,b[0]);break;case "control_set_audio_track":this.setAudioTrack(b[0])}}else switch(a){case "control_toggle_play_pause":case "control_play":case "control_pause":b=
this.J.getCurrentTime();k$(this,0===b?void 0:b);break;case "control_seek":k$(this,b[0]);break;case "control_subtitles_set_track":qEb(this,b[0]);break;case "control_set_audio_track":this.setAudioTrack(b[0])}};
g.k.L9=function(a){this.N.Z2(a)};
g.k.vda=function(a){this.Uk("control_subtitles_set_track",g.md(a)?null:a)};
g.k.v0=function(){var a=this.J.getOption("captions","track");g.md(a)||qEb(this,a)};
g.k.Rc=function(a){this.module.Rc(a,this.J.getVideoData().lengthSeconds)};
g.k.p$=function(){g.md(this.C)||rEb(this,this.C);this.D=!1};
g.k.HZ=function(a,b){this.B.stop();2===b&&this.m0()};
g.k.NE=function(){if(j$(this)){this.j.stop();var a=M9(this.Kc);switch(a.playerState){case 1080:case 1081:case 1084:case 1085:this.module.Vh=1;break;case 1082:case 1083:this.module.Vh=0;break;default:this.module.Vh=-1}switch(a.playerState){case 1081:case 1:this.Gc(new g.wL(8));this.l0();break;case 1085:case 3:this.Gc(new g.wL(9));break;case 1083:case 0:this.Gc(new g.wL(2));this.K.stop();this.Rc(this.J.getVideoData().lengthSeconds);break;case 1084:this.Gc(new g.wL(4));break;case 2:this.Gc(new g.wL(4));
this.Rc(I9(a));break;case -1:this.Gc(new g.wL(64));break;case -1E3:this.Gc(new g.wL(128,{errorCode:"mdx.remoteerror",errorMessage:"This video is not available for remote playback.",KH:2}))}a=M9(this.Kc).trackData;var b=this.C;(a||b?a&&b&&a.trackName==b.trackName&&a.languageCode==b.languageCode&&a.languageName==b.languageName&&a.kind==b.kind:1)||(this.C=a,rEb(this,a));a=M9(this.Kc);-1===a.volume||Math.round(this.J.getVolume())===a.volume&&this.J.isMuted()===a.muted||this.Z.isActive()||this.d1()}else pEb(this)};
g.k.EZ=function(){this.J.ra("mdxpreviousnextchange")};
g.k.PJ=function(){j$(this)||pEb(this)};
g.k.AZ=function(a){isNaN(a)||this.J.ra("mdxnowautoplaying",a)};
g.k.iZ=function(){this.J.ra("mdxautoplaycanceled")};
g.k.setAudioTrack=function(a){j$(this)&&this.Kc.setAudioTrack(this.J.getVideoData(1).videoId,a)};
g.k.seekTo=function(a,b){-1===M9(this.Kc).playerState?k$(this,a):b&&this.Kc.seekTo(a)};
g.k.d1=function(){var a=this;if(j$(this)){var b=M9(this.Kc);this.events.Tc(this.Y);b.muted?this.J.mute():this.J.unMute();this.J.setVolume(b.volume);this.Y=this.events.T(this.J,"onVolumeChange",function(c){mEb(a,c)})}};
g.k.l0=function(){this.j.stop();if(!this.Kc.isDisposed()){var a=M9(this.Kc);a.isPlaying()&&this.Gc(new g.wL(8));this.Rc(I9(a));this.j.start()}};
g.k.m0=function(){this.B.stop();this.j.stop();var a=this.Kc.Ws();2==this.Kc.C&&!isNaN(a)&&this.B.start()};
g.k.Gc=function(a){this.B.stop();var b=this.G;if(!g.XCa(b,a)){var c=g.JG(a,2);c!==g.JG(this.G,2)&&this.J.sB(c);this.G=a;tEb(this.module,b,a)}};g.w(l$,g.V);l$.prototype.xd=function(){this.j.show()};
l$.prototype.Qb=function(){this.j.hide()};
l$.prototype.B=function(){m8("mdx-privacy-popup-cancel");this.Qb()};
l$.prototype.C=function(){m8("mdx-privacy-popup-confirm");this.Qb()};g.w(m$,g.V);m$.prototype.onStateChange=function(a){this.Hc(a.state)};
m$.prototype.Hc=function(a){if(3===this.api.getPresentingPlayerType()){var b={RECEIVER_NAME:this.api.getOption("remote","currentReceiver").name};a=g.JG(a,128)?g.aK("Error on $RECEIVER_NAME",b):a.isPlaying()||a.isPaused()?g.aK("Playing on $RECEIVER_NAME",b):g.aK("Connected to $RECEIVER_NAME",b);this.updateValue("statustext",a);this.j.show()}else this.j.hide()};g.w(n$,g.NX);n$.prototype.D=function(){var a=this.J.getOption("remote","receivers");a&&1<a.length&&!this.J.getOption("remote","quickCast")?(this.Tt=g.cc(a,this.j,this),g.OX(this,g.Er(a,this.j)),a=this.J.getOption("remote","currentReceiver"),a=this.j(a),this.options[a]&&this.Qj(a),this.enable(!0)):this.enable(!1)};
n$.prototype.j=function(a){return a.key};
n$.prototype.Kk=function(a){return"cast-selector-receiver"===a?"Cast...":this.Tt[a].name};
n$.prototype.uh=function(a){g.NX.prototype.uh.call(this,a);this.J.setOption("remote","currentReceiver",this.Tt[a]);this.Hb.Qb()};g.w(sEb,g.RV);g.k=sEb.prototype;
g.k.create=function(){var a=this.player.U(),b=g.$R(a);a={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:a.L("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:a.L("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:a.L("enable_cast_short_lived_lounge_token")};dEb(b,a);this.subscriptions.push(g.xE("yt-remote-before-disconnect",this.J9,this));this.subscriptions.push(g.xE("yt-remote-connection-change",this.caa,this));this.subscriptions.push(g.xE("yt-remote-receiver-availability-change",this.GZ,
this));this.subscriptions.push(g.xE("yt-remote-auto-connect",this.aaa,this));this.subscriptions.push(g.xE("yt-remote-receiver-resumed",this.Z$,this));this.subscriptions.push(g.xE("mdx-privacy-popup-confirm",this.Fba,this));this.subscriptions.push(g.xE("mdx-privacy-popup-cancel",this.Eba,this));this.GZ()};
g.k.load=function(){this.player.cancelPlayback();g.RV.prototype.load.call(this);this.Sl=new oEb(this,this.player,this.Kc);var a=(a=lEb())?a.currentTime:0;var b=iEb()?new L9(e$(),void 0):null;0==a&&b&&(a=I9(M9(b)));0!==a&&this.Rc(a);tEb(this,this.Le,this.Le);this.player.Xp(6)};
g.k.unload=function(){this.player.ra("mdxautoplaycanceled");this.Es=this.Kp;g.xb(this.Sl,this.Kc);this.Kc=this.Sl=null;g.RV.prototype.unload.call(this);this.player.Xp(5);o$(this)};
g.k.xa=function(){g.yE(this.subscriptions);g.RV.prototype.xa.call(this)};
g.k.JE=function(a){var b=g.Ia.apply(1,arguments);this.loaded&&this.Sl.Uk.apply(this.Sl,[a].concat(g.pa(b)))};
g.k.getAdState=function(){return this.Vh};
g.k.Cp=function(){return this.Kc?M9(this.Kc).Cp:!1};
g.k.Vk=function(){return this.Kc?M9(this.Kc).Vk:!1};
g.k.Rc=function(a,b){this.rY=a||0;this.player.ra("progresssync",a,b);this.player.zc("onVideoProgress",a||0)};
g.k.getCurrentTime=function(){return this.rY};
g.k.getProgressState=function(){var a=M9(this.Kc),b=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:1081!=a.playerState&&this.player.Uh(),clipEnd:b.clipEnd,clipStart:b.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:a.getDuration(),ingestionTime:a.B?a.C+G9(a):a.C,isAtLiveHead:1>=(a.B?a.j+G9(a):a.j)-this.getCurrentTime(),loaded:a.Z,seekableEnd:a.B?a.j+G9(a):a.j,seekableStart:0<a.D?a.D+G9(a):a.D,offset:0,viewerLivestreamJoinMediaTime:0}};
g.k.nextVideo=function(){this.Kc&&this.Kc.nextVideo()};
g.k.gK=function(){this.Kc&&this.Kc.gK()};
g.k.J9=function(a){1===a&&(this.ZQ=this.Kc?M9(this.Kc):null)};
g.k.caa=function(){var a=iEb()?new L9(e$(),void 0):null;if(a){var b=this.Es;this.loaded&&this.unload();this.Kc=a;this.ZQ=null;b.key!==this.Kp.key&&(this.Es=b,this.load())}else g.vb(this.Kc),this.Kc=null,this.loaded&&(this.unload(),(a=this.ZQ)&&a.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(a.videoId,I9(a)));this.player.ra("videodatachange","newdata",this.player.getVideoData(),3)};
g.k.GZ=function(){var a=[this.Kp],b=a.concat,c=eEb();C9()&&g.JC("yt-remote-cast-available")&&c.push({key:"cast-selector-receiver",name:"Cast..."});this.Tt=b.call(a,c);a=gEb()||this.Kp;p$(this,a);this.player.zc("onMdxReceiversChange")};
g.k.aaa=function(){var a=gEb();p$(this,a)};
g.k.Z$=function(){this.Es=gEb()};
g.k.Fba=function(){this.fF=!0;o$(this);i$=!1;f$&&h$(f$,1);f$=null};
g.k.Eba=function(){this.fF=!1;o$(this);p$(this,this.Kp);this.Es=this.Kp;i$=!1;f$=null;this.player.playVideo()};
g.k.Lh=function(a,b){switch(a){case "casting":return this.loaded;case "receivers":return this.Tt;case "currentReceiver":return b&&("cast-selector-receiver"===b.key?xDb():p$(this,b)),this.loaded?this.Es:this.Kp;case "quickCast":return 2===this.Tt.length&&"cast-selector-receiver"===this.Tt[1].key?(b&&xDb(),!0):!1}};
g.k.qS=function(){this.Kc.qS()};
g.k.xl=function(){return!1};
g.k.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]};
g.k.isLoggedIn=function(){var a,b;return void 0!==(null==(a=g.rB("PLAYER_CONFIG"))?void 0:null==(b=a.args)?void 0:b.authuser)?!0:!(!g.rB("SESSION_INDEX")&&!g.rB("LOGGED_IN"))};g.QV("remote",sEb);})(_yt_player);