(function(){'use strict';var e,aa="function"==typeof Object.create?Object.create:function(a){var b=function(){};b.prototype=a;return new b},h;if("function"==typeof Object.setPrototypeOf)h=Object.setPrototypeOf;else{var k;a:{var ba={Db:!0},ca={};try{ca.__proto__=ba;k=ca.Db;break a}catch(a){}k=!1}h=k?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}
var da=h,ea=function(a,b){a.prototype=aa(b.prototype);a.prototype.constructor=a;if(da)da(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.mc=b.prototype},fa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)},m="undefined"!=typeof window&&window===this?this:"undefined"!=typeof global&&null!=global?global:
this,ha=function(){ha=function(){};m.Symbol||(m.Symbol=ia)},ia=function(){var a=0;return function(b){return"jscomp_symbol_"+(b||"")+a++}}(),n=function(){ha();var a=m.Symbol.iterator;a||(a=m.Symbol.iterator=m.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&fa(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return ja(this)}});n=function(){}},ja=function(a){var b=0;return ka(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})},ka=function(a){n();a={next:a};a[m.Symbol.iterator]=
function(){return this};return a},la=function(a){n();var b=a[Symbol.iterator];return b?b.call(a):ja(a)},q=this,ma=function(){},r=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==
c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a.call)return"object";return b},u=function(a){var b=r(a);return"array"==b||"object"==b&&"number"==typeof a.length},na="closure_uid_"+(1E9*Math.random()>>>0),oa=0,pa=function(a,b,c){return a.call.apply(a.bind,arguments)},qa=function(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,
2);return function(){var c=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(c,d);return a.apply(b,c)}}return function(){return a.apply(b,arguments)}},v=function(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?v=pa:v=qa;return v.apply(null,arguments)},w=function(a,b){a=a.split(".");var c=q;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?
c=c[d]:c=c[d]={}:c[d]=b},ra=function(a,b){function c(){}c.prototype=b.prototype;a.mc=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.pc=function(a,c,g){for(var d=Array(arguments.length-2),f=2;f<arguments.length;f++)d[f-2]=arguments[f];return b.prototype[c].apply(a,d)}};var chrome=chrome||window.chrome||{};chrome.cast=chrome.cast||{};chrome.cast.media=chrome.cast.media||{};var mojo={};chrome.cast.VERSION=[1,2];w("chrome.cast.VERSION",chrome.cast.VERSION);chrome.cast.oc=!0;w("chrome.cast.usingPresentationApi",chrome.cast.oc);chrome.cast.Error=function(a,b,c){this.code=a;this.description=b||null;this.details=c||null};w("chrome.cast.Error",chrome.cast.Error);chrome.cast.pb=function(a){this.platform=a;this.packageId=this.url=null};w("chrome.cast.SenderApplication",chrome.cast.pb);chrome.cast.Image=function(a){this.url=a;this.width=this.height=null};w("chrome.cast.Image",chrome.cast.Image);
chrome.cast.Volume=function(a,b){this.level=void 0!==a?a:null;this.muted=void 0!==b?b:null};w("chrome.cast.Volume",chrome.cast.Volume);chrome.cast.ha={CUSTOM_CONTROLLER_SCOPED:"custom_controller_scoped",TAB_AND_ORIGIN_SCOPED:"tab_and_origin_scoped",ORIGIN_SCOPED:"origin_scoped",PAGE_SCOPED:"page_scoped"};w("chrome.cast.AutoJoinPolicy",chrome.cast.ha);chrome.cast.ja={CREATE_SESSION:"create_session",CAST_THIS_TAB:"cast_this_tab"};w("chrome.cast.DefaultActionPolicy",chrome.cast.ja);chrome.cast.U={VIDEO_OUT:"video_out",AUDIO_OUT:"audio_out",VIDEO_IN:"video_in",AUDIO_IN:"audio_in",MULTIZONE_GROUP:"multizone_group"};
w("chrome.cast.Capability",chrome.cast.U);chrome.cast.m={CANCEL:"cancel",TIMEOUT:"timeout",API_NOT_INITIALIZED:"api_not_initialized",INVALID_PARAMETER:"invalid_parameter",EXTENSION_NOT_COMPATIBLE:"extension_not_compatible",EXTENSION_MISSING:"extension_missing",RECEIVER_UNAVAILABLE:"receiver_unavailable",SESSION_ERROR:"session_error",CHANNEL_ERROR:"channel_error",LOAD_MEDIA_FAILED:"load_media_failed"};w("chrome.cast.ErrorCode",chrome.cast.m);chrome.cast.M={AVAILABLE:"available",UNAVAILABLE:"unavailable"};
w("chrome.cast.ReceiverAvailability",chrome.cast.M);chrome.cast.qb={CHROME:"chrome",IOS:"ios",ANDROID:"android"};w("chrome.cast.SenderPlatform",chrome.cast.qb);chrome.cast.sa={CAST:"cast",DIAL:"dial",HANGOUT:"hangout",CUSTOM:"custom"};w("chrome.cast.ReceiverType",chrome.cast.sa);chrome.cast.Ra={RUNNING:"running",STOPPED:"stopped",ERROR:"error"};w("chrome.cast.DialAppState",chrome.cast.Ra);chrome.cast.lb={CAST:"cast",STOP:"stop"};w("chrome.cast.ReceiverAction",chrome.cast.lb);
chrome.cast.G={CONNECTED:"connected",DISCONNECTED:"disconnected",STOPPED:"stopped"};w("chrome.cast.SessionStatus",chrome.cast.G);chrome.cast.Bb={ATTENUATION:"attenuation",FIXED:"fixed",MASTER:"master"};w("chrome.cast.VolumeControlType",chrome.cast.Bb);var sa=/&/g,ta=/</g,ua=/>/g,va=/"/g,wa=/'/g,xa=/\x00/g,ya=/[\x00&<>"']/,Aa=function(a){var b={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"'};var c=q.document.createElement("div");return a.replace(za,function(a,f){var d=b[a];if(d)return d;"#"==f.charAt(0)&&(f=Number("0"+f.substr(1)),isNaN(f)||(d=String.fromCharCode(f)));d||(c.innerHTML=a+" ",d=c.firstChild.nodeValue.slice(0,-1));return b[a]=d})},Ba=function(a){return a.replace(/&([^;]+);/g,function(a,c){switch(c){case "amp":return"&";case "lt":return"<";
case "gt":return">";case "quot":return'"';default:return"#"!=c.charAt(0)||(c=Number("0"+c.substr(1)),isNaN(c))?a:String.fromCharCode(c)}})},za=/&([^;\s<&]+);?/g;chrome.cast.Na=function(a,b,c,d,f){this.sessionRequest=a;this.sessionListener=b;this.receiverListener=c;this.autoJoinPolicy=d||chrome.cast.ha.TAB_AND_ORIGIN_SCOPED;this.defaultActionPolicy=f||chrome.cast.ja.CREATE_SESSION;this.customDialLaunchCallback=null;this.invisibleSender=!1;this.additionalSessionRequests=[]};w("chrome.cast.ApiConfig",chrome.cast.Na);chrome.cast.Ua=function(a,b){this.appName=a;this.launchParameter=b||null};w("chrome.cast.DialRequest",chrome.cast.Ua);
chrome.cast.Sa=function(a,b,c){this.receiver=a;this.appState=b;this.extraData=c||null};w("chrome.cast.DialLaunchData",chrome.cast.Sa);chrome.cast.Ta=function(a,b){this.doLaunch=a;this.launchParameter=b||null};w("chrome.cast.DialLaunchResponse",chrome.cast.Ta);chrome.cast.rb=function(a,b,c){this.appId=a;this.capabilities="array"==r(b)?b:[chrome.cast.U.VIDEO_OUT,chrome.cast.U.AUDIO_OUT];this.requestSessionTimeout=c||chrome.cast.timeout.requestSession;this.dialRequest=this.language=null};
w("chrome.cast.SessionRequest",chrome.cast.rb);
chrome.cast.kb=function(a,b,c,d){this.label=a;a=b;ya.test(a)&&(-1!=a.indexOf("&")&&(a=a.replace(sa,"&amp;")),-1!=a.indexOf("<")&&(a=a.replace(ta,"&lt;")),-1!=a.indexOf(">")&&(a=a.replace(ua,"&gt;")),-1!=a.indexOf('"')&&(a=a.replace(va,"&quot;")),-1!=a.indexOf("'")&&(a=a.replace(wa,"&#39;")),-1!=a.indexOf("\x00")&&(a=a.replace(xa,"&#0;")));this.friendlyName=a;this.capabilities=c||[];this.volume=d||null;this.receiverType=chrome.cast.sa.CAST;this.displayStatus=this.isActiveInput=null};
w("chrome.cast.Receiver",chrome.cast.kb);chrome.cast.mb=function(a,b){this.statusText=a;this.appImages=b;this.showStop=null};w("chrome.cast.ReceiverDisplayStatus",chrome.cast.mb);chrome.cast.va=function(){this.requestSession=6E4;this.sendCustomMessage=this.setReceiverVolume=this.stopSession=this.leaveSession=3E3};w("chrome.cast.Timeout",chrome.cast.va);chrome.cast.timeout=new chrome.cast.va;w("chrome.cast.timeout",chrome.cast.timeout);chrome.cast.Ma="auto-join";chrome.cast.fb="cast-session_";chrome.cast.media.ab={PAUSE:"pause",SEEK:"seek",STREAM_VOLUME:"stream_volume",STREAM_MUTE:"stream_mute"};w("chrome.cast.media.MediaCommand",chrome.cast.media.ab);chrome.cast.media.l={GENERIC:0,MOVIE:1,TV_SHOW:2,MUSIC_TRACK:3,PHOTO:4};w("chrome.cast.media.MetadataType",chrome.cast.media.l);chrome.cast.media.F={IDLE:"IDLE",PLAYING:"PLAYING",PAUSED:"PAUSED",BUFFERING:"BUFFERING"};w("chrome.cast.media.PlayerState",chrome.cast.media.F);
chrome.cast.media.V={OFF:"REPEAT_OFF",ALL:"REPEAT_ALL",SINGLE:"REPEAT_SINGLE",ALL_AND_SHUFFLE:"REPEAT_ALL_AND_SHUFFLE"};w("chrome.cast.media.RepeatMode",chrome.cast.media.V);chrome.cast.media.nb={PLAYBACK_START:"PLAYBACK_START",PLAYBACK_PAUSE:"PLAYBACK_PAUSE"};w("chrome.cast.media.ResumeState",chrome.cast.media.nb);chrome.cast.media.ua={BUFFERED:"BUFFERED",LIVE:"LIVE",OTHER:"OTHER"};w("chrome.cast.media.StreamType",chrome.cast.media.ua);
chrome.cast.media.Ya={CANCELLED:"CANCELLED",INTERRUPTED:"INTERRUPTED",FINISHED:"FINISHED",ERROR:"ERROR"};w("chrome.cast.media.IdleReason",chrome.cast.media.Ya);chrome.cast.media.zb={TEXT:"TEXT",AUDIO:"AUDIO",VIDEO:"VIDEO"};w("chrome.cast.media.TrackType",chrome.cast.media.zb);chrome.cast.media.wb={SUBTITLES:"SUBTITLES",CAPTIONS:"CAPTIONS",DESCRIPTIONS:"DESCRIPTIONS",CHAPTERS:"CHAPTERS",METADATA:"METADATA"};w("chrome.cast.media.TextTrackType",chrome.cast.media.wb);
chrome.cast.media.sb={NONE:"NONE",OUTLINE:"OUTLINE",DROP_SHADOW:"DROP_SHADOW",RAISED:"RAISED",DEPRESSED:"DEPRESSED"};w("chrome.cast.media.TextTrackEdgeType",chrome.cast.media.sb);chrome.cast.media.xb={NONE:"NONE",NORMAL:"NORMAL",ROUNDED_CORNERS:"ROUNDED_CORNERS"};w("chrome.cast.media.TextTrackWindowType",chrome.cast.media.xb);
chrome.cast.media.tb={SANS_SERIF:"SANS_SERIF",MONOSPACED_SANS_SERIF:"MONOSPACED_SANS_SERIF",SERIF:"SERIF",MONOSPACED_SERIF:"MONOSPACED_SERIF",CASUAL:"CASUAL",CURSIVE:"CURSIVE",SMALL_CAPITALS:"SMALL_CAPITALS"};w("chrome.cast.media.TextTrackFontGenericFamily",chrome.cast.media.tb);chrome.cast.media.ub={NORMAL:"NORMAL",BOLD:"BOLD",BOLD_ITALIC:"BOLD_ITALIC",ITALIC:"ITALIC"};w("chrome.cast.media.TextTrackFontStyle",chrome.cast.media.ub);chrome.cast.media.ka=function(){this.customData=null};w("chrome.cast.media.GetStatusRequest",chrome.cast.media.ka);chrome.cast.media.la=function(){this.customData=null};w("chrome.cast.media.PauseRequest",chrome.cast.media.la);chrome.cast.media.ma=function(){this.customData=null};w("chrome.cast.media.PlayRequest",chrome.cast.media.ma);chrome.cast.media.ob=function(){this.customData=this.resumeState=this.currentTime=null};w("chrome.cast.media.SeekRequest",chrome.cast.media.ob);
chrome.cast.media.ta=function(){this.customData=null};w("chrome.cast.media.StopRequest",chrome.cast.media.ta);chrome.cast.media.Cb=function(a){this.volume=a;this.customData=null};w("chrome.cast.media.VolumeRequest",chrome.cast.media.Cb);chrome.cast.media.Za=function(a){this.type="LOAD";this.requestId=0;this.sessionId=null;this.media=a;this.activeTrackIds=null;this.autoplay=!0;this.customData=this.currentTime=null};w("chrome.cast.media.LoadRequest",chrome.cast.media.Za);
chrome.cast.media.hb=function(a){this.type="PRECACHE";this.requestId=0;this.precacheData=a};chrome.cast.media.Va=function(a,b){this.requestId=0;this.activeTrackIds=a||null;this.textTrackStyle=b||null};w("chrome.cast.media.EditTracksInfoRequest",chrome.cast.media.Va);chrome.cast.media.Xa=function(){this.metadataType=this.type=chrome.cast.media.l.GENERIC;this.releaseDate=this.releaseYear=this.images=this.subtitle=this.title=null};w("chrome.cast.media.GenericMediaMetadata",chrome.cast.media.Xa);
chrome.cast.media.cb=function(){this.metadataType=this.type=chrome.cast.media.l.MOVIE;this.releaseDate=this.releaseYear=this.images=this.subtitle=this.studio=this.title=null};w("chrome.cast.media.MovieMediaMetadata",chrome.cast.media.cb);chrome.cast.media.Ab=function(){this.metadataType=this.type=chrome.cast.media.l.TV_SHOW;this.originalAirdate=this.releaseYear=this.images=this.episode=this.episodeNumber=this.season=this.seasonNumber=this.episodeTitle=this.title=this.seriesTitle=null};
w("chrome.cast.media.TvShowMediaMetadata",chrome.cast.media.Ab);chrome.cast.media.eb=function(){this.metadataType=this.type=chrome.cast.media.l.MUSIC_TRACK;this.releaseDate=this.releaseYear=this.images=this.discNumber=this.trackNumber=this.artistName=this.songName=this.composer=this.artist=this.albumArtist=this.title=this.albumName=null};w("chrome.cast.media.MusicTrackMediaMetadata",chrome.cast.media.eb);
chrome.cast.media.gb=function(){this.metadataType=this.type=chrome.cast.media.l.PHOTO;this.creationDateTime=this.height=this.width=this.longitude=this.latitude=this.images=this.location=this.artist=this.title=null};w("chrome.cast.media.PhotoMediaMetadata",chrome.cast.media.gb);chrome.cast.media.bb=function(a,b){this.contentId=a;this.streamType=chrome.cast.media.ua.BUFFERED;this.contentType=b;this.customData=this.textTrackStyle=this.tracks=this.duration=this.metadata=null};
w("chrome.cast.media.MediaInfo",chrome.cast.media.bb);chrome.cast.media.oa=function(a){this.itemId=null;this.media=a;this.autoplay=!0;this.startTime=0;this.playbackDuration=null;this.preloadTime=0;this.customData=this.activeTrackIds=null};w("chrome.cast.media.QueueItem",chrome.cast.media.oa);chrome.cast.media.Qa="CC1AD845";w("chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID",chrome.cast.media.Qa);chrome.cast.media.timeout={};chrome.cast.media.timeout.load=0;w("chrome.cast.media.timeout.load",chrome.cast.media.timeout.load);
chrome.cast.media.timeout.O=0;w("chrome.cast.media.timeout.getStatus",chrome.cast.media.timeout.O);chrome.cast.media.timeout.play=0;w("chrome.cast.media.timeout.play",chrome.cast.media.timeout.play);chrome.cast.media.timeout.pause=0;w("chrome.cast.media.timeout.pause",chrome.cast.media.timeout.pause);chrome.cast.media.timeout.seek=0;w("chrome.cast.media.timeout.seek",chrome.cast.media.timeout.seek);chrome.cast.media.timeout.stop=0;w("chrome.cast.media.timeout.stop",chrome.cast.media.timeout.stop);
chrome.cast.media.timeout.S=0;w("chrome.cast.media.timeout.setVolume",chrome.cast.media.timeout.S);chrome.cast.media.timeout.N=0;w("chrome.cast.media.timeout.editTracksInfo",chrome.cast.media.timeout.N);chrome.cast.media.timeout.j=0;w("chrome.cast.media.timeout.queue",chrome.cast.media.timeout.j);chrome.cast.media.yb=function(a,b){this.trackId=a;this.trackContentType=this.trackContentId=null;this.type=b;this.customData=this.subtype=this.language=this.name=null};w("chrome.cast.media.Track",chrome.cast.media.yb);
chrome.cast.media.vb=function(){this.customData=this.fontStyle=this.fontGenericFamily=this.fontFamily=this.fontScale=this.windowRoundedCornerRadius=this.windowColor=this.windowType=this.edgeColor=this.edgeType=this.backgroundColor=this.foregroundColor=null};w("chrome.cast.media.TextTrackStyle",chrome.cast.media.vb);chrome.cast.media.ib=function(a){this.type="QUEUE_LOAD";this.sessionId=this.requestId=null;this.items=a;this.startIndex=0;this.repeatMode=chrome.cast.media.V.OFF;this.customData=null};
w("chrome.cast.media.QueueLoadRequest",chrome.cast.media.ib);chrome.cast.media.na=function(a){this.type="QUEUE_INSERT";this.sessionId=this.requestId=null;this.items=a;this.customData=this.insertBefore=null};w("chrome.cast.media.QueueInsertItemsRequest",chrome.cast.media.na);chrome.cast.media.jb=function(a){this.type="QUEUE_UPDATE";this.sessionId=this.requestId=null;this.items=a;this.customData=null};w("chrome.cast.media.QueueUpdateItemsRequest",chrome.cast.media.jb);
chrome.cast.media.L=function(){this.type="QUEUE_UPDATE";this.customData=this.jump=this.currentItemId=this.sessionId=this.requestId=null};w("chrome.cast.media.QueueJumpRequest",chrome.cast.media.L);chrome.cast.media.ra=function(){this.type="QUEUE_UPDATE";this.customData=this.repeatMode=this.sessionId=this.requestId=null};w("chrome.cast.media.QueueSetPropertiesRequest",chrome.cast.media.ra);
chrome.cast.media.pa=function(a){this.type="QUEUE_REMOVE";this.sessionId=this.requestId=null;this.itemIds=a;this.customData=null};w("chrome.cast.media.QueueRemoveItemsRequest",chrome.cast.media.pa);chrome.cast.media.qa=function(a){this.type="QUEUE_REORDER";this.sessionId=this.requestId=null;this.itemIds=a;this.customData=this.insertBefore=null};w("chrome.cast.media.QueueReorderItemsRequest",chrome.cast.media.qa);var Ca=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,f="string"==typeof a?a.split(""):a,g=0;g<d;g++)g in f&&b.call(c,f[g],g,a)},Da=function(a,b){for(var c=a.length,d="string"==typeof a?a.split(""):a,f=0;f<c;f++)if(f in d&&b.call(void 0,d[f],f,a))return f;return-1};chrome.cast.media.a=function(a,b){this.sessionId=a;this.mediaSessionId=b;this.media=null;this.playbackRate=1;this.playerState=chrome.cast.media.F.IDLE;this.currentTime=0;this.g=-1;this.supportedMediaCommands=[];this.volume=new chrome.cast.Volume;this.items=this.preloadedItemId=this.loadingItemId=this.currentItemId=this.customData=this.activeTrackIds=this.idleReason=null;this.repeatMode=chrome.cast.media.V.OFF;this.f=!1;this.b=[]};w("chrome.cast.media.Media",chrome.cast.media.a);
chrome.cast.media.a.prototype.O=function(a,b,c){a||(a=new chrome.cast.media.ka);x.b(this,"MEDIA_GET_STATUS",a,b,c,chrome.cast.media.timeout.O)};chrome.cast.media.a.prototype.getStatus=chrome.cast.media.a.prototype.O;chrome.cast.media.a.prototype.play=function(a,b,c){this.Aa(x,a,b,c)};chrome.cast.media.a.prototype.play=chrome.cast.media.a.prototype.play;chrome.cast.media.a.prototype.Aa=function(a,b,c,d){b||(b=new chrome.cast.media.ma);a.b(this,"PLAY",b,c,d,chrome.cast.media.timeout.play)};
chrome.cast.media.a.prototype.playWithContext=chrome.cast.media.a.prototype.Aa;chrome.cast.media.a.prototype.pause=function(a,b,c){this.za(x,a,b,c)};chrome.cast.media.a.prototype.pause=chrome.cast.media.a.prototype.pause;chrome.cast.media.a.prototype.za=function(a,b,c,d){b||(b=new chrome.cast.media.la);a.b(this,"PAUSE",b,c,d,chrome.cast.media.timeout.pause)};chrome.cast.media.a.prototype.pauseWithContext=chrome.cast.media.a.prototype.za;
chrome.cast.media.a.prototype.seek=function(a,b,c){x.b(this,"SEEK",a,b,c,chrome.cast.media.timeout.seek)};chrome.cast.media.a.prototype.seek=chrome.cast.media.a.prototype.seek;chrome.cast.media.a.prototype.stop=function(a,b,c){a||(a=new chrome.cast.media.ta);x.b(this,"STOP_MEDIA",a,b,c,chrome.cast.media.timeout.stop)};chrome.cast.media.a.prototype.stop=chrome.cast.media.a.prototype.stop;chrome.cast.media.a.prototype.S=function(a,b,c){x.b(this,"MEDIA_SET_VOLUME",a,b,c,chrome.cast.media.timeout.S)};
chrome.cast.media.a.prototype.setVolume=chrome.cast.media.a.prototype.S;chrome.cast.media.a.prototype.N=function(a,b,c){x.b(this,"EDIT_TRACKS_INFO",a,b,c,chrome.cast.media.timeout.N)};chrome.cast.media.a.prototype.editTracksInfo=chrome.cast.media.a.prototype.N;chrome.cast.media.a.prototype.Sb=function(a,b,c){x.b(this,"QUEUE_INSERT",a,b,c,chrome.cast.media.timeout.j)};chrome.cast.media.a.prototype.queueInsertItems=chrome.cast.media.a.prototype.Sb;
chrome.cast.media.a.prototype.Rb=function(a,b,c){x.b(this,"QUEUE_INSERT",new chrome.cast.media.na([a]),b,c,chrome.cast.media.timeout.j)};chrome.cast.media.a.prototype.queueAppendItem=chrome.cast.media.a.prototype.Rb;chrome.cast.media.a.prototype.cc=function(a,b,c){x.b(this,"QUEUE_UPDATE",a,b,c,chrome.cast.media.timeout.j)};chrome.cast.media.a.prototype.queueUpdateItems=chrome.cast.media.a.prototype.cc;
chrome.cast.media.a.prototype.Xb=function(a,b){var c=new chrome.cast.media.L;c.jump=-1;x.b(this,"QUEUE_UPDATE",c,a,b,chrome.cast.media.timeout.j)};chrome.cast.media.a.prototype.queuePrev=chrome.cast.media.a.prototype.Xb;chrome.cast.media.a.prototype.Wb=function(a,b){var c=new chrome.cast.media.L;c.jump=1;x.b(this,"QUEUE_UPDATE",c,a,b,chrome.cast.media.timeout.j)};chrome.cast.media.a.prototype.queueNext=chrome.cast.media.a.prototype.Wb;
chrome.cast.media.a.prototype.Tb=function(a,b,c){if(!(0>y(this,a))){var d=new chrome.cast.media.L;d.currentItemId=a;x.b(this,"QUEUE_UPDATE",d,b,c,chrome.cast.media.timeout.j)}};chrome.cast.media.a.prototype.queueJumpToItem=chrome.cast.media.a.prototype.Tb;chrome.cast.media.a.prototype.bc=function(a,b,c){var d=new chrome.cast.media.ra;d.repeatMode=a;x.b(this,"QUEUE_UPDATE",d,b,c,chrome.cast.media.timeout.j)};chrome.cast.media.a.prototype.queueSetRepeatMode=chrome.cast.media.a.prototype.bc;
chrome.cast.media.a.prototype.Zb=function(a,b,c){x.b(this,"QUEUE_REMOVE",a,b,c,chrome.cast.media.timeout.j)};chrome.cast.media.a.prototype.queueRemoveItems=chrome.cast.media.a.prototype.Zb;chrome.cast.media.a.prototype.Yb=function(a,b,c){0>y(this,a)||x.b(this,"QUEUE_REMOVE",new chrome.cast.media.pa([a]),b,c,chrome.cast.media.timeout.j)};chrome.cast.media.a.prototype.queueRemoveItem=chrome.cast.media.a.prototype.Yb;chrome.cast.media.a.prototype.ac=function(a,b,c){x.b(this,"QUEUE_REORDER",a,b,c,chrome.cast.media.timeout.j)};
chrome.cast.media.a.prototype.queueReorderItems=chrome.cast.media.a.prototype.ac;chrome.cast.media.a.prototype.Vb=function(a,b,c,d){var f=y(this,a);if(!(0>f))if(0>b)d&&d(new chrome.cast.Error(chrome.cast.m.INVALID_PARAMETER));else if(f==b)c&&c();else{var g=null;b=b>f?b+1:b;b<this.items.length&&(g=this.items[b]);a=new chrome.cast.media.qa([a]);a.insertBefore=g?g.itemId:null;x.b(this,"QUEUE_REORDER",a,c,d,chrome.cast.media.timeout.j)}};chrome.cast.media.a.prototype.queueMoveItemToNewIndex=chrome.cast.media.a.prototype.Vb;
chrome.cast.media.a.prototype.nc=function(a){return-1<this.supportedMediaCommands.indexOf(a)};chrome.cast.media.a.prototype.supportsCommand=chrome.cast.media.a.prototype.nc;chrome.cast.media.a.prototype.Kb=function(){if(this.playerState==chrome.cast.media.F.PLAYING&&0<=this.g){var a=this.currentTime+(Date.now()-this.g)/1E3*this.playbackRate;this.media&&null!=this.media.duration&&a>this.media.duration&&(a=this.media.duration);0>a&&(a=0);return a}return this.currentTime};
chrome.cast.media.a.prototype.getEstimatedTime=chrome.cast.media.a.prototype.Kb;chrome.cast.media.a.prototype.Y=function(a){this.H(x,a)};chrome.cast.media.a.prototype.addUpdateListener=chrome.cast.media.a.prototype.Y;chrome.cast.media.a.prototype.H=function(a,b){a.Fb(this,b)};chrome.cast.media.a.prototype.addUpdateListenerWithContext=chrome.cast.media.a.prototype.H;chrome.cast.media.a.prototype.ba=function(a){this.K(x,a)};chrome.cast.media.a.prototype.removeUpdateListener=chrome.cast.media.a.prototype.ba;
chrome.cast.media.a.prototype.K=function(a,b){x.ec(this,b)};chrome.cast.media.a.prototype.removeUpdateListenerWithContext=chrome.cast.media.a.prototype.K;var y=function(a,b){return Da(a.items,function(a){return a.itemId==b})};var x=null;var Ea=function(a,b,c){this.sessionId=a;this.namespaceName=b;this.message=c};var Fa=function(a,b){this.type="SET_VOLUME";this.requestId=0;this.volume=a;this.expectedVolume=b||null};var Ga=function(a){this.type="STOP";this.requestId=0;this.sessionId=a||null};chrome.cast.c=function(a,b,c,d,f){this.sessionId=a;this.appId=b;this.displayName=c;this.statusText=null;this.appImages=d;this.receiver=f;this.senderApps=[];this.namespaces=[];this.media=[];this.status=chrome.cast.G.CONNECTED;this.transportId=""};w("chrome.cast.Session",chrome.cast.c);chrome.cast.c.prototype.lc=function(a,b,c){this.Ha(x,a,b,c)};chrome.cast.c.prototype.setReceiverVolumeLevel=chrome.cast.c.prototype.lc;
chrome.cast.c.prototype.Ha=function(a,b,c,d){b=new Fa(new chrome.cast.Volume(b,null),this.receiver.volume);a.setReceiverVolume(this.sessionId,b,c,d)};chrome.cast.c.prototype.setReceiverVolumeLevelWithContext=chrome.cast.c.prototype.Ha;chrome.cast.c.prototype.kc=function(a,b,c){this.Ga(x,a,b,c)};chrome.cast.c.prototype.setReceiverMuted=chrome.cast.c.prototype.kc;
chrome.cast.c.prototype.Ga=function(a,b,c,d){a=new Fa(new chrome.cast.Volume(null,b),this.receiver.volume);x.setReceiverVolume(this.sessionId,a,c,d)};chrome.cast.c.prototype.setReceiverMutedWithContext=chrome.cast.c.prototype.Ga;chrome.cast.c.prototype.Mb=function(a,b){x.leaveSession(this.sessionId,a,b)};chrome.cast.c.prototype.leave=chrome.cast.c.prototype.Mb;chrome.cast.c.prototype.stop=function(a,b){this.Ja(x,a,b)};chrome.cast.c.prototype.stop=chrome.cast.c.prototype.stop;
chrome.cast.c.prototype.Ja=function(a,b,c){a.Ea(new Ga(this.sessionId),b,c,chrome.cast.timeout.stopSession)};chrome.cast.c.prototype.stopWithContext=chrome.cast.c.prototype.Ja;chrome.cast.c.prototype.sendMessage=function(a,b,c,d){this.Fa(x,a,b,c,d)};chrome.cast.c.prototype.sendMessage=chrome.cast.c.prototype.sendMessage;chrome.cast.c.prototype.Fa=function(a,b,c,d,f){a.hc(new Ea(this.sessionId,b,c),d,f)};chrome.cast.c.prototype.sendMessageWithContext=chrome.cast.c.prototype.Fa;
chrome.cast.c.prototype.Y=function(a){this.H(x,a)};chrome.cast.c.prototype.addUpdateListener=chrome.cast.c.prototype.Y;chrome.cast.c.prototype.H=function(a,b){a.Hb(this.sessionId,b)};chrome.cast.c.prototype.addUpdateListenerWithContext=chrome.cast.c.prototype.H;chrome.cast.c.prototype.ba=function(a){this.K(x,a)};chrome.cast.c.prototype.removeUpdateListener=chrome.cast.c.prototype.ba;chrome.cast.c.prototype.K=function(a,b){a.gc(this.sessionId,b)};
chrome.cast.c.prototype.removeUpdateListenerWithContext=chrome.cast.c.prototype.K;chrome.cast.c.prototype.Gb=function(a,b){this.xa(x,a,b)};chrome.cast.c.prototype.addMessageListener=chrome.cast.c.prototype.Gb;chrome.cast.c.prototype.xa=function(a,b,c){a.Eb(this.sessionId,b,c)};chrome.cast.c.prototype.addMessageListenerWithContext=chrome.cast.c.prototype.xa;chrome.cast.c.prototype.W=function(a){this.wa(x,a)};chrome.cast.c.prototype.addMediaListener=chrome.cast.c.prototype.W;
chrome.cast.c.prototype.wa=function(a,b){a.W(this.sessionId,b)};chrome.cast.c.prototype.addMediaListenerWithContext=chrome.cast.c.prototype.wa;chrome.cast.c.prototype.Z=function(a){this.Ba(x,a)};chrome.cast.c.prototype.removeMediaListener=chrome.cast.c.prototype.Z;chrome.cast.c.prototype.Ba=function(a,b){a.Z(this.sessionId,b)};chrome.cast.c.prototype.removeMediaListenerWithContext=chrome.cast.c.prototype.Ba;chrome.cast.c.prototype.fc=function(a,b){this.Ca(x,a,b)};
chrome.cast.c.prototype.removeMessageListener=chrome.cast.c.prototype.fc;chrome.cast.c.prototype.Ca=function(a,b,c){a.dc(this.sessionId,b,c)};chrome.cast.c.prototype.removeMessageListenerWithContext=chrome.cast.c.prototype.Ca;chrome.cast.c.prototype.Nb=function(a,b,c){a.sessionId=this.sessionId;x.ia(a,"LOAD",b,c)};chrome.cast.c.prototype.loadMedia=chrome.cast.c.prototype.Nb;chrome.cast.c.prototype.Ub=function(a,b,c){a.sessionId=this.sessionId;x.ia(a,"QUEUE_LOAD",b,c)};
chrome.cast.c.prototype.queueLoad=chrome.cast.c.prototype.Ub;var z="StopIteration"in q?q.StopIteration:{message:"StopIteration",stack:""},A=function(){};A.prototype.next=function(){throw z;};A.prototype.o=function(){return this};
var Ha=function(a){if(a instanceof A)return a;if("function"==typeof a.o)return a.o(!1);if(u(a)){var b=0,c=new A;c.next=function(){for(;;){if(b>=a.length)throw z;if(b in a)return a[b++];b++}};return c}throw Error("Not implemented");},B=function(a,b){if(u(a))try{Ca(a,b,void 0)}catch(c){if(c!==z)throw c;}else{a=Ha(a);try{for(;;)b.call(void 0,a.next(),void 0,a)}catch(c){if(c!==z)throw c;}}};var C=function(a,b){this.b={};this.h=[];this.g=this.f=0;var c=arguments.length;if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a)if(a instanceof C)for(D(a),c=a.h.concat(),d=0;d<c.length;d++)this.set(c[d],a.get(c[d]));else for(d in a)this.set(d,a[d])};C.prototype.I=function(){D(this);for(var a=[],b=0;b<this.h.length;b++)a.push(this.b[this.h[b]]);return a};C.prototype.clear=function(){this.b={};this.g=this.f=this.h.length=0};
C.prototype.remove=function(a){return E(this.b,a)?(delete this.b[a],this.f--,this.g++,this.h.length>2*this.f&&D(this),!0):!1};var D=function(a){if(a.f!=a.h.length){for(var b=0,c=0;b<a.h.length;){var d=a.h[b];E(a.b,d)&&(a.h[c++]=d);b++}a.h.length=c}if(a.f!=a.h.length){var f={};for(c=b=0;b<a.h.length;)d=a.h[b],E(f,d)||(a.h[c++]=d,f[d]=1),b++;a.h.length=c}};C.prototype.get=function(a,b){return E(this.b,a)?this.b[a]:b};
C.prototype.set=function(a,b){E(this.b,a)||(this.f++,this.h.push(a),this.g++);this.b[a]=b};C.prototype.o=function(a){D(this);var b=0,c=this.g,d=this,f=new A;f.next=function(){if(c!=d.g)throw Error("The map has changed since the iterator was created");if(b>=d.h.length)throw z;var f=d.h[b++];return a?f:d.b[f]};return f};var E=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};var F=function(a,b){this.requestId=a;this.i=b;this.Ka=null};F.prototype.f=function(){};var Ia=function(){this.b=new C},Ja=function(a,b){a.b.set(b.requestId,b);b.Ka=setTimeout(function(){a.b.remove(b.requestId);b.f()},b.i)},Ka=function(a,b){var c=a.b.get(b);if(!c)return null;clearTimeout(c.Ka);a.b.remove(b);return c};var G=function(a,b,c,d){F.call(this,a,d||6E5);this.g=b;this.b=c};ea(G,F);G.prototype.f=function(){this.b(new chrome.cast.Error(chrome.cast.m.TIMEOUT))};var H=function(a,b,c,d){this.type=a;this.message=b;this.sequenceNumber=void 0!==c?c:-1;this.timeoutMillis=d||0;this.clientId=""};var I=function(a){var b=Error.call(this);this.message=b.message;"stack"in b&&(this.stack=b.stack);this.name="AssertionError";this.message=void 0===a?"":a;Error.captureStackTrace?Error.captureStackTrace(this,I):this.stack=Error().stack};ea(I,Error);var J=function(a){this.b=a},Ma=function(a){var b=La.get(a);b||(b=new J(a),La.set(a,b));return b};J.prototype.log=function(a,b,c){if(!(1>a)){"function"==typeof b&&(b=b());if("string"!=typeof b)throw new I("Expected message to be a string.");var d={rc:this.b,level:a,time:Date.now(),message:b,qc:c};Na.forEach(function(a){return a(d)})}};J.prototype.error=function(a,b){this.log(3,a,b)};var L=function(a){K.log(1,a,void 0)},Na=[],La=new Map;var M=function(a){this.g=a;this.f=String(Date.now())+String(Math.floor(1E5*Math.random()));this.b=null},Oa=function(a,b){if(!a.b)return N.error("No active session"),"No active session";b.clientId=a.f;b=JSON.stringify(b);if(32768<b.length)return N.error("Message length over limit"),"Message length over limit";N.log(0,"Send "+b,void 0);a.b.send(b);return null};M.prototype.connect=function(a){this.b=a;this.b.onmessage=v(this.i,this);Oa(this,new H("client_connect",this.f))};
M.prototype.disconnect=function(){this.b.close();this.b=null};M.prototype.i=function(a){N.log(0,"Receive "+a.data,void 0);a=JSON.parse(a.data);if(a.clientId==this.f)this.g.onMessage(a)};var N=Ma("mr.cast.ExtensionMessenger");var Pa=function(a,b,c){this.g=a;this.f=b;this.b=c},Qa=function(a){var b="cast-dial:"+a.g,c=new URLSearchParams;a.f&&c.set("dialPostData",a.f);a.b&&c.set("clientId",a.b);(a=c.toString())&&(b+="?"+a);return b};var Ra=function(a,b,c,d,f,g,l,p,t,W){this.w=a;this.b=b||null;this.f=c||null;this.s=d||null;this.u=void 0!==f?f:null;this.v=g||null;this.C=l||null;this.B=p||!1;this.i=t||null;this.g=W||null},Sa=function(a){var b=a.w.map(function(b){var c="cast:"+b.appId,f=new URLSearchParams;b.capabilities&&0<b.capabilities.length&&f.set("capabilities",b.capabilities.join(","));a.b&&f.set("clientId",a.b);a.f&&f.set("autoJoinPolicy",a.f);a.s&&f.set("defaultActionPolicy",a.s);null!=a.u&&f.set("launchTimeout",String(a.u));
a.B&&f.set("invisibleSender","true");a.i&&(f.set("broadcastNamespace",a.i),f.set("broadcastId",String(Math.random())));a.g&&f.set("broadcastMessage",encodeURIComponent(JSON.stringify(a.g)));return c+"?"+f.toString()});a.v&&b.push(Qa(new Pa(a.v,a.C,a.b)));return b};var Ta=function(){this.b={};this.f={}},Ua=function(a,b,c){var d=a.b[b];return d?(d.status=c,d.media.forEach(function(b){delete a.f[b.sessionId+"#"+b.mediaSessionId]}),delete a.b[b],!0):!1},Wa=function(a,b){var c=a.b[b.sessionId];if(c)return c.statusText=b.statusText,c.namespaces=b.namespaces||[],c.receiver.volume=b.receiver.volume,c;c=new chrome.cast.c(b.sessionId,b.appId,b.displayName,b.appImages,b.receiver);for(var d in b)"media"==d?c.media=b.media.map(function(b){b=Va(a,b);b.i=!1;b.f=!0;return b}):
b.hasOwnProperty(d)&&(c[d]=b[d]);return a.b[b.sessionId]=c},Va=function(a,b){var c=b.sessionId+"#"+b.mediaSessionId,d=a.f[c];d||(d=new chrome.cast.media.a(b.sessionId,b.mediaSessionId),a.f[c]=d,(a=a.b[b.sessionId])&&a.media.push(d));a=d;a.currentItemId=null;a.loadingItemId=null;a.preloadedItemId=null;for(var f in b)"items"!=f&&b.hasOwnProperty(f)&&("volume"==f?(a.volume.level=b.volume.level,a.volume.muted=b.volume.muted):a[f]=b[f]);f=la(["idleReason","extendedStatus"]);for(c=f.next();!c.done;c=f.next())c=
c.value,b.hasOwnProperty(c)||(a[c]=null);"currentTime"in b&&(a.g=Date.now());if(a.playerState==chrome.cast.media.F.IDLE&&null==a.loadingItemId)a.currentItemId=null,a.loadingItemId=null,a.preloadedItemId=null,a.items=null;else if(b.hasOwnProperty("items")&&b.items){f=[];var g=a.items;c={};if(g)for(var l=0;l<g.length;l++)c[g[l].itemId]=l;b=la(b.items);for(g=b.next();!g.done;g=b.next()){g=g.value;if(!g.media){l=g.itemId;var p=a.items?a.items[c[l]]:null;p&&p.media?g.media=p.media:l==a.currentItemId&&
a.media&&(g.media=a.media)}f.push(Xa(g))}a.items=f}return d},Ya=function(a,b){delete a.f[b.sessionId+"#"+b.mediaSessionId];if(a=a.b[b.sessionId])b=a.media.indexOf(b),-1!=b&&a.media.splice(b,1)},Xa=function(a){var b=new chrome.cast.media.oa(a.media),c;for(c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b};var Za=function(){};var O;a:{var $a=q.navigator;if($a){var ab=$a.userAgent;if(ab){O=ab;break a}}O=""}var P=function(a){return-1!=O.indexOf(a)};var bb=P("Opera"),cb=P("Gecko")&&!(-1!=O.toLowerCase().indexOf("webkit")&&!P("Edge"))&&!(P("Trident")||P("MSIE"))&&!P("Edge"),db=-1!=O.toLowerCase().indexOf("webkit")&&!P("Edge");var Q=function(a,b,c){this.i=null!=c?v(a,c):a;this.g=b;this.f=v(this.Pb,this);this.b=[]};ra(Q,Za);e=Q.prototype;e.D=!1;e.J=0;e.A=null;e.Jb=function(a){this.b=arguments;this.A||this.J?this.D=!0:R(this)};e.stop=function(){this.A&&(q.clearTimeout(this.A),this.A=null,this.D=!1,this.b=[])};e.pause=function(){this.J++};e.resume=function(){this.J--;this.J||!this.D||this.A||(this.D=!1,R(this))};e.Pb=function(){this.A=null;this.D&&!this.J&&(this.D=!1,R(this))};
var R=function(a){var b=a.f;var c=a.g;if("function"!=r(b))if(b&&"function"==typeof b.handleEvent)b=v(b.handleEvent,b);else throw Error("Invalid listener argument");b=2147483647<Number(c)?-1:q.setTimeout(b,c||0);a.A=b;a.i.apply(null,a.b)};var eb=P("Safari")&&!((P("Chrome")||P("CriOS"))&&!P("Edge")||P("Coast")||P("Opera")||P("Edge")||P("Silk")||P("Android"))&&!(P("iPhone")&&!P("iPod")&&!P("iPad")||P("iPad")||P("iPod"));var S=null,fb=cb||db&&!eb||bb||"function"==typeof q.btoa,gb=function(a){if(fb)var b=q.btoa(a);else{b=[];for(var c=0,d=0;d<a.length;d++){var f=a.charCodeAt(d);255<f&&(b[c++]=f&255,f>>=8);b[c++]=f}if(!S)for(S={},a=0;65>a;a++)S[a]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(a);a=S;c=[];for(d=0;d<b.length;d+=3){var g=b[d],l=(f=d+1<b.length)?b[d+1]:0,p=d+2<b.length,t=p?b[d+2]:0,W=g>>2;g=(g&3)<<4|l>>4;l=(l&15)<<2|t>>6;t&=63;p||(t=64,f||(l=64));c.push(a[W],a[g],a[l],a[t])}b=
c.join("")}return b};var hb=function(a){if(a.I&&"function"==typeof a.I)return a.I();if("string"==typeof a)return a.split("");if(u(a)){for(var b=[],c=a.length,d=0;d<c;d++)b.push(a[d]);return b}b=[];c=0;for(d in a)b[c++]=a[d];return b};var T=function(){this.b=new C},ib=function(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+(a[na]||(a[na]=++oa)):b.substr(0,1)+a};e=T.prototype;e.add=function(a){this.b.set(ib(a),a)};e.removeAll=function(a){a=hb(a);for(var b=a.length,c=0;c<b;c++)this.remove(a[c])};e.remove=function(a){return this.b.remove(ib(a))};e.clear=function(){this.b.clear()};e.contains=function(a){a=ib(a);return E(this.b.b,a)};e.I=function(){return this.b.I()};e.o=function(){return this.b.o(!1)};var U=function(){this.v=new M(this);this.f=null;this.T=new Ta;this.i=0;this.fa=new Ia;this.w=new C;this.ga=!1;this.u=new C;this.C=new C;this.R=[];this.Pa=this.Ib.bind(this);this.g=null;this.B=0;this.s=null;this.Oa=new Q(this.Wa,200,this);this.La=null},jb=function(a){var b=new chrome.cast.Error(chrome.cast.m.INVALID_PARAMETER,"Already requesting session");a&&a(b)},V=function(a,b,c,d){c&&Ja(a.fa,c);void 0!==d?b.sequenceNumber=d:(b.sequenceNumber=a.i,a.i=(a.i+1)%9007199254740992);d=Oa(a.v,b);c&&d&&(a=
Ka(a.fa,b.sequenceNumber),b=new chrome.cast.Error(chrome.cast.m.INVALID_PARAMETER,d),(a=a.b)&&a(b))};
U.prototype.P=function(a,b){var c=this;x=this;this.f||(this.f=a,a.invisibleSender||(a=new PresentationRequest(X(this)),a.getAvailability().then(function(a){a.onchange=function(){c.ga=!!a.value;c.f.receiverListener(a.value?chrome.cast.M.AVAILABLE:chrome.cast.M.UNAVAILABLE)};a.onchange()},function(){c.f.receiverListener(chrome.cast.M.AVAILABLE)}),a.onconnectionavailable=function(a){Y(c,a.connection)},this.La=(q.navigator||null).presentation.defaultRequest=a,a.reconnect(chrome.cast.Ma).then(function(a){Y(c,
a)},ma)));b&&b(void 0)};U.prototype.da=function(a){a.navigator.presentation.defaultRequest=this.La};
var Y=function(a,b,c){c=void 0===c?null:c;b.onclose=function(b){a.g=null;switch(b.reason){case "closed":kb(a,chrome.cast.G.DISCONNECTED);break;case "error":c&&(b=new chrome.cast.Error(chrome.cast.m.SESSION_ERROR),c&&c(b))}};b.onterminate=function(){kb(a,chrome.cast.G.STOPPED)};"connected"==b.state?a.v.connect(b):b.onconnect=function(){a.v.connect(b)}},nb=function(a){var b=Z;lb.has(a.type)?b.ga&&(b.s?(a.sessionId=b.s,mb(b,null,a.type,a,function(){L("Send Broadcast directly succeeded")},function(a){K.error("Send Broadcast directly failed with code "+
a.code)})):b.Oa.Jb(X(b,void 0,"urn:x-cast:com.google.cast.media",a))):K.error("Unsupported broadcast message type - "+a.type)};U.prototype.Wa=function(a){L("Broadcast request "+a);(a=(new PresentationRequest(a)).getAvailability())?a.then(function(){L("Broadcast succeeded")},function(){K.log(2,"Broadcast failed",void 0)}):K.error("presentationRequest.getAvailability return undefined")};
U.prototype.requestSession=function(a,b,c){var d=this;this.g?jb(b):(c=X(this,c),this.g=a,(new PresentationRequest(c)).start().then(function(a){Y(d,a,b)}).catch(function(a){d.g=null;a=new chrome.cast.Error("AbortError"==a.name||"NotAllowedError"==a.name?chrome.cast.m.CANCEL:chrome.cast.m.SESSION_ERROR);b&&b(a)}))};
var X=function(a,b,c,d){var f=null,g=null,l=b||a.f.sessionRequest,p=l.dialRequest;p&&(f=p.appName,(g=p.launchParameter)&&!g.match(ob)&&(g=gb(g)));var t=[];t.push({appId:l.appId,capabilities:l.capabilities});b||Ca(a.f.additionalSessionRequests,function(a){t.push({appId:a.appId,capabilities:a.capabilities})});return Sa(new Ra(t,a.v.f,a.f.autoJoinPolicy,a.f.defaultActionPolicy,l.requestSessionTimeout,f,g,a.f.invisibleSender,c,d))};
U.prototype.ia=function(a,b,c,d){var f=this;this.B++;mb(this,null,b,a,function(a){f.B--;a.f=!0;c&&c(a)},function(a){f.B--;d(a)},chrome.cast.media.timeout.load)};U.prototype.b=function(a,b,c,d,f,g){var l=this;mb(this,a,b,c,function(a){l.ya(a);d&&d(void 0)},f,g)};
var mb=function(a,b,c,d,f,g,l){d.type=c;null!=b&&(d.mediaSessionId=b.mediaSessionId,d.sessionId=b.sessionId);a.Ea(d,function(a){a.status&&1==a.status.length?f&&f(a.status[0]):(a=new chrome.cast.Error(chrome.cast.m.SESSION_ERROR),g&&g(a))},g,l)};e=U.prototype;e.setReceiverVolume=function(a,b,c,d){b.sessionId=a;V(this,new H("v2_message",b,void 0,chrome.cast.timeout.setReceiverVolume),new G(this.i,c,d,chrome.cast.timeout.sendCustomMessage))};
e.ca=function(a){var b=this;(new PresentationRequest(X(this))).reconnect(chrome.cast.fb+a).then(function(a){Y(b,a)},ma)};e.leaveSession=function(a,b,c){V(this,new H("leave_session",a,void 0,chrome.cast.timeout.leaveSession),new G(this.i,b,c,chrome.cast.timeout.leaveSession))};e.hc=function(a,b,c){V(this,new H("app_message",a,void 0,chrome.cast.timeout.sendCustomMessage),new G(this.i,b,c,chrome.cast.timeout.sendCustomMessage))};
e.Ea=function(a,b,c,d){V(this,new H("v2_message",a,void 0,d),new G(this.i,b,c,d))};var pb=function(a,b,c){var d=a.get(b);d||(d=new T,a.set(b,d));d.add(c)};e=U.prototype;e.Hb=function(a,b){pb(this.w,a,b)};e.gc=function(a,b){(a=this.w.get(a))&&a.remove(b)};e.X=function(a){this.R.push(a)};e.aa=function(a){a=this.R.indexOf(a);0<=a&&this.R.splice(a,1)};e.Eb=function(a,b,c){var d=this.u.get(a);d||(d=new C,this.u.set(a,d));a=d.get(b);a||(a=new T,d.set(b,a));a.add(c)};
e.dc=function(a,b,c){(a=this.u.get(a))&&(b=a.get(b))&&b.remove(c)};e.W=function(a,b){pb(this.C,a,b)};e.Z=function(a,b){(a=this.C.get(a))&&a.remove(b)};e.Fb=function(a,b){-1==a.b.indexOf(b)&&a.b.push(b)};e.ec=function(a,b){b=a.b.indexOf(b);-1!=b&&a.b.splice(b,1)};e.ya=function(a){if(a.f){var b=a.playerState!=chrome.cast.media.F.IDLE||null!=a.loadingItemId;a.b.forEach(function(a){a(b)});b||Ya(this.T,a)}else if(!(0<this.B)){a.f=!0;var c=this.C.get(a.sessionId);c&&B(c.o(),function(b){b(a)})}};
e.Ib=function(a){return Va(this.T,a)};var kb=function(a,b){if(a.s){var c=a.s;a.s=null;a.v.disconnect();var d=b!=chrome.cast.G.STOPPED;Ua(a.T,c,b)&&(a.u.remove(c),a.C.remove(c),b=a.w.get(c))&&(a.w.remove(c),B(b.o(),function(a){a(d)}))}};
U.prototype.onMessage=function(a){switch(a.type){case "new_session":case "update_session":a.message=Wa(this.T,a.message);break;case "v2_message":var b=a.message;b&&"MEDIA_STATUS"==b.type&&b.status&&(b.status=b.status.map(this.Pa))}if(b=Ka(this.fa,a.sequenceNumber))"error"==a.type?(b=b.b)&&b(a.message):(b=b.g)&&b(a.message);if(b=a.message)switch(a.type){case "receiver_action":qb(this,b);break;case "new_session":this.s=b.sessionId;this.g?(this.g(b),this.g=null):this.f&&this.f.sessionListener(b);break;
case "update_session":rb(this,b);break;case "app_message":sb(this,b);break;case "v2_message":"MEDIA_STATUS"==b.type&&b.status.forEach(this.ya.bind(this));break;case "custom_dial_launch":tb(this,a.sequenceNumber,b)}};
var rb=function(a,b){(a=a.w.get(b.sessionId))&&B(a.o(),function(a){a(!0)})},qb=function(a,b){a.R.forEach(function(a){a(b.receiver,b.action)})},sb=function(a,b){(a=a.u.get(b.sessionId))&&(a=a.get(b.namespaceName))&&B(a.o(),function(a){a(b.namespaceName,b.message)})},ub=function(a,b,c){V(a,new H("custom_dial_launch",c,void 0,chrome.cast.timeout.sendCustomMessage),null,b)},tb=function(a,b,c){a.f.customDialLaunchCallback?a.f.customDialLaunchCallback(c).then(function(c){ub(a,b,c)},function(){ub(a,b)}):
ub(a,b)},ob=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,lb=new Set(["PRECACHE"]),Z=new U,K=Ma("mr.cast.Api");chrome.cast.P=function(a,b,c){Z.P(a,b,c)};w("chrome.cast.initialize",chrome.cast.P);chrome.cast.Lb=function(a,b,c){var d=new U;d.P(a,b,c);return d};w("chrome.cast.initializeWithContext",chrome.cast.Lb);chrome.cast.da=function(a){Z.da(a)};w("chrome.cast.setPageContext",chrome.cast.da);chrome.cast.requestSession=function(a,b,c){Z.requestSession(a,b,c)};w("chrome.cast.requestSession",chrome.cast.requestSession);chrome.cast.Qb=function(a){nb(new chrome.cast.media.hb(a))};w("chrome.cast.precache",chrome.cast.Qb);
chrome.cast.ca=function(a){chrome.cast.Da(Z,a)};w("chrome.cast.requestSessionById",chrome.cast.ca);chrome.cast.Da=function(a,b){a.ca(b)};w("chrome.cast.requestSessionByIdWithContext",chrome.cast.Da);chrome.cast.X=function(a){Z.X(a)};w("chrome.cast.addReceiverActionListener",chrome.cast.X);chrome.cast.aa=function(a){Z.aa(a)};w("chrome.cast.removeReceiverActionListener",chrome.cast.aa);chrome.cast.Ob=function(){};w("chrome.cast.logMessage",chrome.cast.Ob);chrome.cast.ic=function(a,b){b()};
w("chrome.cast.setCustomReceivers",chrome.cast.ic);chrome.cast.jc=function(a,b){b()};w("chrome.cast.setReceiverDisplayStatus",chrome.cast.jc);chrome.cast.unescape=function(a){return-1!=a.indexOf("&")?"document"in q?Aa(a):Ba(a):a};w("chrome.cast.unescape",chrome.cast.unescape);chrome.cast.isAvailable=!1;w("chrome.cast.isAvailable",chrome.cast.isAvailable);chrome.cast.Ia=!1;
chrome.cast.ea=function(){if(!chrome.cast.Ia){chrome.cast.Ia=!0;chrome.cast.isAvailable=!0;var a=window.__onGCastApiAvailable;a&&"function"==typeof a&&a(!0)}};"complete"==document.readyState?chrome.cast.ea():(window.addEventListener("load",chrome.cast.ea,!1),window.addEventListener("DOMContentLoaded",chrome.cast.ea,!1));}).call(this);
