UNPKG

radiant.js

Version:

Browser-side JS library Extending GMusic.js For Radiant Player

2 lines 40 kB
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.Radiant=e()}}(function(){return function e(t,n,r){function o(a,u){if(!n[a]){if(!t[a]){var s="function"==typeof require&&require;if(!u&&s)return s(a,!0);if(i)return i(a,!0);throw new Error("Cannot find module '"+a+"'")}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=e("assert"),u=r(a),s=function(){function e(t,n){o(this,e),this.emit=t,this.on=n,this.prototype={}}return i(e,[{key:"_mapSelectors",value:function(e){var t=this;Object.keys(e).forEach(function(n){Object.defineProperty(t,"_"+n+"El",{get:function(){var r=document.querySelector(e[n]);return(0,u["default"])(r,"Failed to find "+n+" element for "+t.constructor+': "'+e[n]+'"'),r}})})}},{key:"addMethod",value:function(e){this.prototype[e]=this[e].bind(this)}},{key:"addMethods",value:function(e){var t=this;e.forEach(function(e){return t.addMethod(e)})}},{key:"getPrototype",value:function(){return this.prototype}}]),e}();n["default"]=s},{assert:11}],2:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.songSelectors={SongID:".song-row.currently-playing",SongAlbumID:".player-album",SongArtist:"player-artist",SongTitle:"currently-playing-title",SongAlbum:".player-album",SongAlbumBuyLink:"buy-button-player",SongYouTubeID:"youtubeId",SongYouTubeSection:".now-playing-actions",playPause:'[data-id="play-pause"]'},n.controlsSelectors={playPause:'[data-id="play-pause"]',repeat:'[data-id="repeat"]',rewind:'[data-id="rewind"]',forward:'[data-id="forward"]',play:'[data-id="play"]',materialcard:".material-card"},n.playbackSelectors={progress:"#material-player-progress"},n.nowPlayingSelectors={albumArt:"#playerBarArt",albumName:".player-album",artistName:"#player-artist",nowPlayingContainer:"#playerSongInfo",infoWrapper:".now-playing-info-wrapper",title:"#currently-playing-title"}},{}],3:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}var o=e("./radiant"),i=r(o),a=e("./RadiantNamespace"),u=r(a),s=e("./structs/Song"),l=r(s),c=e("./structs/Artwork"),f=r(c),d=e("./structs/Share"),p=r(d);i["default"].RadiantNamespace=u["default"],i["default"].Song=l["default"],i["default"].Artwork=f["default"],i["default"].Share=p["default"],t.exports=i["default"]},{"./RadiantNamespace":1,"./radiant":7,"./structs/Artwork":8,"./structs/Share":9,"./structs/Song":10}],4:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e("../RadiantNamespace"),l=r(s),c=e("./LanguageNamespace"),f=r(c),d=function(e){function t(){var e;o(this,t);for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];var u=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return u.addMethods(["create","Replace","hasClass","has","Retry","trigger","getID","FakeClick","FakeMenuClick","Playing","Volume","IMFL","getYoutubeID","RollDice","Observe","_textContent"]),u.language=new f["default"],u}return a(t,e),u(t,[{key:"create",value:function(e){var t=document.createDocumentFragment(),n=document.createElement("div");for(n.innerHTML=e;n.firstChild;)t.appendChild(n.firstChild);return t}},{key:"Replace",value:function(e,t,n){return null!==e&&e.replace(new RegExp(t,"g"),n)}},{key:"hasClass",value:function(e,t){return null!==e&&(" "+e.className+" ").includes(" "+t+" ")}},{key:"has",value:function(e,t){for(var n in e)if(e[n]===t)return!0;return!1}},{key:"Retry",value:function(e,t){var n=0,r=50,o=!1,i=window.setInterval(function(){e()&&(window.clearInterval(i),t(o)),n++>r&&(window.clearInterval(i),o=!0,t(o))},10)}},{key:"trigger",value:function(e,t){var n=document.createEvent("MouseEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}},{key:"getID",value:function(e){var t=e.split(/[\\\/]/)[5].match(/\S[^?]*(?:\?+|$)/g)[0].slice(0,-1);return t.match("t=")?this.language.NoSongID():t}},{key:"FakeClick",value:function(){this.Retry(function(){return document.querySelector('[id="queue-overlay"]').style.opacity=0,document.querySelector('[data-id="queue"]').click(),document.querySelector('[id="queue-overlay"]').style.width="0px",document.querySelector("#queue-overlay").close(),!1},function(e){e&&(document.querySelector('[id="queue-overlay"]').style.width=null,document.querySelector('[id="queue-overlay"]').style.opacity=null,document.querySelector("body").click())})}},{key:"FakeMenuClick",value:function(){document.body.contains(document.querySelector(".song-menu"))&&this.Playing()&&null!==document.querySelector('[data-id="now-playing-menu"]')&&(document.querySelector('[data-id="now-playing-menu"]').click(),this.trigger(document.querySelector('[data-id="now-playing-menu"]'),"mousedown"),this.trigger(document.querySelector('[data-id="now-playing-menu"]'),"mouseup"),this.trigger(document.querySelector(".song-menu"),"mouseover"),this.trigger(document.querySelector('.song-menu .goog-menuitem[id*=":f"]'),"mouseover"),this.trigger(document.querySelector('.song-menu .goog-menuitem[id*=":f"]'),"mousedown"),this.trigger(document.querySelector('.song-menu .goog-menuitem[id*=":f"]'),"mouseup"),document.querySelector('[class*="get-link"]').style.opacity=0,window.RadiantState.SongID=this.getID(document.querySelector('[class*="get-link"] #labelAndInputContainer input').value),this.trigger(document.querySelector("body"),"mousedown"),document.querySelector('[class*="get-link"]').parentNode.removeChild(document.querySelector('[class*="get-link"]')))}},{key:"Playing",value:function(){return this.hasClass(document.querySelector('[id="player-bar-play-pause"]'),"playing")}},{key:"Volume",value:function(){return null===window.RadiantState.volume_state?100:gmusic.volume.getVolume()}},{key:"IMFL",value:function(){var e=this.create('<div class="material-card" data-type="imfl" style="display:none"></div><div class="ad-preroll-container ad-preroll-container-hidden" style="display:none"><div class=ad-preroll-video-container><div style=position:absolute><iframe allowfullscreen src=https://imasdk.googleapis.com/js/core/bridge3.166.0_en.html#goog_855622984 style=border:0;opacity:0;margin:0;padding:0;position:relative></iframe></div></div><div class=ad-preroll-message-container><div class=ad-preroll-message-text>Subscribe for all of the music on-demand and offline with none of the ads</div><div><paper-button animated=""aria-disabled=false class="paper-button-0 upsell-button x-scope"data-id=upgrade elevation=0 role=button tabindex=0>SUBSCRIBE</paper-button></div></div><div class=ad-preroll-companion-container></div></div>'),t=setInterval(function(){"complete"===document.readyState&&(document.body.insertBefore(e,document.body.childNodes[0]),clearInterval(t))},10)}},{key:"getYoutubeID",value:function(){return window.RadiantState.SongYouTubeID}},{key:"RollDice",value:function(){document.querySelector('[data-type="imfl"]').click()}},{key:"Observe",value:function(){var e=setInterval(function(){"undefined"!=typeof gmusic&&(window.RadiantState.ready=!0,clearInterval(e))},10)}},{key:"_textContent",value:function(e,t){return e?e.textContent||t:t}}]),t}(l["default"]);n["default"]=d},{"../RadiantNamespace":1,"./LanguageNamespace":6}],5:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e("../RadiantNamespace"),l=r(s),c=e("../structs/Artwork"),f=r(c),d=e("../structs/Song"),p=r(d),g=e("../structs/Share"),y=r(g),h=e("./FunctionsNamespace"),m=r(h),v=e("./LanguageNamespace"),S=r(v),b=e("../constants/selectors"),w=function(e){function t(){var e;o(this,t);for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];var u=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return u.language=new S["default"],u.fn=new m["default"],u.startUp(u.fn),u._mapSelectors(b.playbackSelectors),u.addMethods(["replayBack","replayFor","getVolume","Region","SongAlbumArt","Song","hasYoutube","Share","getPlaybackState","adState","RadiantHandler"]),u._hookEvents(),u}return a(t,e),u(t,[{key:"replayBack",value:function(){return gmusic.playback.rewindTen()}},{key:"replayFor",value:function(){return gmusic.playback.forwardThirty()}},{key:"getVolume",value:function(){return this.fn.Volume()}},{key:"Region",value:function(){return window.gbar.hasOwnProperty("_CONFIG")?0===window.gbar._CONFIG[0][0][19].length?this.language.NoGeo():window.gbar._CONFIG[0][0][19]:this.language.NoConfig()}},{key:"SongAlbumArt",value:function(){var e=new f["default"]({Full:this.fn.Replace(document.querySelector(b.nowPlayingSelectors.albumArt).getAttribute("src"),"s90","s0"),Large:this.fn.Replace(document.querySelector(b.nowPlayingSelectors.albumArt).getAttribute("src"),"s90","s800"),Medium:this.fn.Replace(document.querySelector(b.nowPlayingSelectors.albumArt).getAttribute("src"),"s90","s500"),Small:this.fn.Replace(document.querySelector(b.nowPlayingSelectors.albumArt).getAttribute("src"),"s90","s300"),Mini:document.querySelector(b.nowPlayingSelectors.albumArt).getAttribute("src")});return window.RadiantState.Artwork=e,e}},{key:"Song",value:function(){var e=document.querySelector(b.nowPlayingSelectors.nowPlayingContainer),t=null!==document.querySelector(b.songSelectors.SongAlbumID)?document.querySelector(b.songSelectors.SongAlbumID).getAttribute("data-id"):"album/";this.fn.FakeClick(),this.fn.FakeMenuClick();var n=new p["default"]({SongID:window.RadiantState.SongID,SongAlbumID:null!==document.querySelector(b.songSelectors.SongAlbumID)?document.querySelector(b.songSelectors.SongAlbumID).getAttribute("data-id").substring(0,t.indexOf("/")):"Unknown Album ID",SongTitle:this.fn._textContent(e.querySelector(b.nowPlayingSelectors.title),"Unknown Title"),SongArtist:this.fn._textContent(e.querySelector(b.nowPlayingSelectors.artistName),"Unknown Artist"),SongAlbum:null!==document.querySelector(b.songSelectors.SongAlbum)?this.fn._textContent(e.querySelector(b.nowPlayingSelectors.albumName),"Unknown Album"):"Unknown Album",SongAlbumBuyLink:null!==document.querySelector(b.songSelectors.SongAlbumBuyLink)?this.fn._textContent(document.querySelector(b.songSelectors.SongAlbumBuyLink).querySelector("a").getAttribute("href").replace(/\s+/g,""),this.language.Not()):this.language.Not(),SongYouTubeID:this.hasYoutube()&&null!==document.querySelector(b.songSelectors.SongID)?document.querySelector(b.songSelectors.SongID).dataset[b.songSelectors.SongYouTubeID]:this.language.NoYouTube()});return window.RadiantState.Song=n,window.RadiantState.SongYouTubeID=n.SongYouTubeID,window.RadiantState.volume_state=this.fn.Volume(),n}},{key:"getPlaybackState",value:function(){var e=document.querySelector(b.controlsSelectors.playPause);return e.classList.contains("playing")?t.ENUMS.PlaybackStatus.PLAYING:e.disabled?t.ENUMS.PlaybackStatus.STOPPED:"av:pause-circle-filled"===e.__data__.icon?t.ENUMS.PlaybackStatus.PLAYING:t.ENUMS.PlaybackStatus.PAUSED}},{key:"adState",value:function(){var e=null!==document.querySelector(".ad-preroll-container")?document.querySelector(".ad-preroll-container"):null;if(null!==e){if("ad-preroll-container"===e.className)return t.ENUMS.AdsStatus.PLAYING;if("ad-preroll-container ad-preroll-container-hidden"===e.className)return t.ENUMS.AdsStatus.STOPPED}return t.ENUMS.AdsStatus.STOPPED}},{key:"Share",value:function(){var e="https://play.google.com/music/m/"+window.RadiantState.SongID+"?utm_medium=organic_share&utm_source=facebook&redirect_uri=https://play.google.com/music/returnfromshare",t="https://play.google.com/music/m/"+window.RadiantState.SongID+"?utm_medium=organic_share&utm_source=twitter",n="https://www.facebook.com/dialog/share?app_id=1618370355114238&display=popup&href="+encodeURIComponent(n),r="https://twitter.com/intent/tweet?url="+encodeURIComponent(r),o="https://play.google.com/music/m/"+window.RadiantState.SongID,i=new y["default"]({Facebook_type:e,Twitter_type:t,Facebook:n,Twitter:r,Normal:o});return window.RadiantState.Share.Types.F=e,window.RadiantState.Share.Types.T=t,window.RadiantState.Share.Services.Normal="https://play.google.com/music/m/"+window.RadiantState.SongID,window.RadiantState.Share.Services.Facebook="https://www.facebook.com/dialog/share?app_id=1618370355114238&display=popup&href="+encodeURIComponent(n),window.RadiantState.Share.Services.Twitter="https://twitter.com/intent/tweet?url="+encodeURIComponent(r),i}},{key:"hasYoutube",value:function(){return this.fn.hasClass(document.querySelector(b.songSelectors.SongYouTubeSection),"has-youtube")}},{key:"RadiantHandler",value:function(e,t,n,r,o){"playRow"===o&&null!==document.querySelector(".song-row .column-content [data-id='play']")&&document.querySelector(".song-row .column-content [data-id='play']").addEventListener("click",this.RadiantHandler(e,t,n,r,""),!1),"playMcard"===o&&null!==document.querySelector(".material-card .play-button")&&document.querySelector(".material-card .play-button").addEventListener("click",this.RadiantHandler(e,t,n,r,""),!1);document.querySelector("[data-id='play-pause']").classList.contains("playing"),this.fn;this.fn.Retry(function(){return!1},function(e){})}},{key:"_hookEvents",value:function(){var e=this,t=void 0,n=void 0,r=void 0;new MutationObserver(function(o){o.forEach(function(o){for(var i=0;i<o.addedNodes.length;i++){var a=o.addedNodes[i];if(a.classList&&a.classList.contains("now-playing-info-wrapper")){var u=e.Song(),s=e.SongAlbumArt(),l=e.Share();if(!u.equals(t)){e.emit("change:radiant",{song:u,art:s,share:l}),t=u,n=s,r=l;document.querySelector(b.controlsSelectors.forward).addEventListener("click",e.RadiantHandler(u,s,l,e.language,""),!1),document.querySelector(b.controlsSelectors.rewind).addEventListener("click",e.RadiantHandler(u,s,l,e.language,""),!1),document.querySelector(b.controlsSelectors.play).addEventListener("click",e.RadiantHandler(u,s,l,e.language,""),!1);if(null!==document.querySelector(b.controlsSelectors.materialcard)){document.querySelector(b.controlsSelectors.materialcard).addEventListener("mouseover",e.RadiantHandler(u,s,l,e.language,"playMcard"),!1)}}}}})}).observe(document.querySelector(b.nowPlayingSelectors.nowPlayingContainer),{childList:!0,subtree:!0});var o=void 0;new MutationObserver(function(t){t.forEach(function(t){if("play-pause"===t.target.dataset.id){var n=e.getPlaybackState();n!==o&&(e.emit("change:radiant-playback",n),0===n&&(window.RadiantState.SongYouTubeID=e.language.NoYouTube(),window.RadiantState.SongID=e.language.NoSong(),window.RadiantState.Song=e.language.NoSong(),window.RadiantState.Artwork=e.language.NoSong(),window.RadiantState.Ads=e.language.NoAds(),window.RadiantState.Share.Services.Facebook=null,window.RadiantState.Share.Services.Twitter=null,window.RadiantState.Share.Services.Normal=null,window.RadiantState.Share.Types.F=null,window.RadiantState.Share.Types.T=null,window.RadiantState.Share.Types.Normal=null),2!==n&&1!==n||(e.Song(),e.SongAlbumArt(),e.Share(),window.RadiantState.volume_state=e.fn.Volume()),o=n)}})}).observe(document.querySelector(b.controlsSelectors.playPause),{attributes:!0});var i=setInterval(function(){if("complete"===document.readyState){var t=void 0;new MutationObserver(function(n){n.forEach(function(n){var r=e.adState();"ad-preroll-container ad-preroll-container-hidden"===n.target.className?r!==t&&(0===r&&(e.emit("change:ad",e.language.NoAds()),window.RadiantState.Ads=e.language.NoAds()),2===r&&(e.emit("change:ad",e.language.AdPlaying()),window.RadiantState.Ads=e.language.AdPlaying()),t=r):r!==t&&(0===r&&(e.emit("change:ad",e.language.NoAds()),window.RadiantState.Ads=e.language.NoAds()),2===r&&(e.emit("change:ad",e.language.AdPlaying()),window.RadiantState.Ads=e.language.AdPlaying()),t=r)})}).observe(document.querySelector(".ad-preroll-container"),{childList:!0,subtree:!0,attributes:!0}),clearInterval(i)}},10);this.fn.Retry(function(){return!1},function(e){e&&window.RadiantState.ready})}},{key:"startUp",value:function(e){e.Observe(),e.IMFL(),window.RadiantState.volume_state=e.Volume(),console.log("RadiantTools has been loaded!!")}}]),t}(l["default"]);w.ENUMS={PlaybackStatus:{STOPPED:0,PAUSED:1,PLAYING:2},AdsStatus:{STOPPED:0,PLAYING:2}},n["default"]=w},{"../RadiantNamespace":1,"../constants/selectors":2,"../structs/Artwork":8,"../structs/Share":9,"../structs/Song":10,"./FunctionsNamespace":4,"./LanguageNamespace":6}],6:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e("../RadiantNamespace"),l=r(s),c=function(e){function t(){var e;o(this,t);for(var n=arguments.length,r=Array(n),a=0;a<n;a++)r[a]=arguments[a];var u=i(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(r)));return u.addMethods(["Not","NoSong","NoSongID","NoYouTube","NoAds","AdPlaying","NoConfig","NoGeo"]),u}return a(t,e),u(t,[{key:"Not",value:function(){return"You either own this item or you're not playing the radio / an non-owned item"}},{key:"NoSong",value:function(){return"No song is playing"}},{key:"NoSongID",value:function(){return"No song ID found"}},{key:"NoYouTube",value:function(){return"No YouTube video found"}},{key:"NoAds",value:function(){return"No Ads Playing"}},{key:"AdPlaying",value:function(){return"Ad is playing"}},{key:"NoConfig",value:function(){return"_CONFIG Not found :("}},{key:"NoGeo",value:function(){return"No Geo Data"}}]),t}(l["default"]);n["default"]=c},{"../RadiantNamespace":1}],7:[function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(n,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=e("events"),l=r(s),c=e("./namespaces/LanguageNamespace"),f=r(c),d=e("./namespaces/FunctionsNamespace"),p=r(d),g=e("./namespaces/HelpersNamespace"),y=r(g),h=e("./constants/selectors"),m={};window.RadiantState={ready:!1,volume_state:null,SongID:null,SongYouTubeID:null,Ads:null,Share:{Types:{F:!1,T:!1,Normal:!1},Services:{Facebook:"",Twitter:""}}};var v=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return Object.keys(m).forEach(function(e){var t=m[e];t.forEach(function(t){var r=new t(n.emit.bind(n),n.on.bind(n));n[e]=Object.assign(n[e]||{},r.getPrototype())})}),n}return a(t,e),u(t,null,[{key:"addNamespace",value:function(e,n){m[e]=m[e]||[],m[e].push(n),Object.assign(t,n.ENUMS||{})}}]),t}(l["default"]);v.SELECTORS={songSelectors:h.songSelectors,playbackSelectors:h.playbackSelectors,nowPlayingSelectors:h.nowPlayingSelectors},v.addNamespace("languages",f["default"]),v.addNamespace("fn",p["default"]),v.addNamespace("Helpers",y["default"]),n["default"]=v},{"./constants/selectors":2,"./namespaces/FunctionsNamespace":4,"./namespaces/HelpersNamespace":5,"./namespaces/LanguageNamespace":6,events:12}],8:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){var n=t.Full,o=t.Large,i=t.Medium,a=t.Small,u=t.Mini;r(this,e),this.Full=n,this.Large=o,this.Medium=i,this.Small=a,this.Mini=u}return o(e,[{key:"equals",value:function(e){return!!e&&(this.Full===e.Full&&this.Large===e.Large&&this.Medium===e.Medium&&this.Small===e.Small&&this.Mini===e.Mini)}}]),e}();i.fromArtworkArray=function(e,t){return new i({Full:e[0],Large:e[1],Medium:e[2],Small:e[3],Mini:e[4]})},n["default"]=i},{}],9:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){var n=t.Facebook_type,o=t.Twitter_type,i=t.Facebook,a=t.Twitter,u=t.Normal;r(this,e),this.Facebook_type=n,this.Twitter_type=o,this.Facebook=i,this.Twitter=a,this.Normal=u}return o(e,[{key:"equals",value:function(e){return!!e&&(this.Facebook_type===e.Facebook_type&&this.Twitter_type===e.Twitter_type&&this.Facebook===e.Facebook&&this.Twitter===e.Twitter&&this.Normal===e.Normal)}}]),e}();i.fromShareArray=function(e,t){return new i({Facebook_type:e[0],Twitter_type:e[1],Facebook:e[2],Twitter:e[3],Normal:e[4]})},n["default"]=i},{}],10:[function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(t){var n=t.SongID,o=t.SongAlbumID,i=t.SongTitle,a=t.SongArtist,u=t.SongAlbum,s=t.SongAlbumBuyLink,l=t.SongYouTubeID;r(this,e),this.SongID=n,this.SongAlbumID=o,this.SongTitle=i,this.SongArtist=a,this.SongAlbum=u,this.SongAlbumBuyLink=s,this.SongYouTubeID=l}return o(e,[{key:"equals",value:function(e){return!!e&&(this.SongID===e.SongID&&this.SongAlbumID===e.SongAlbumID&&this.SongTitle===e.SongTitle&&this.SongArtist===e.SongArtist&&this.SongAlbum===e.SongAlbum&&this.SongAlbumBuyLink===e.SongAlbumBuyLink&&this.SongYouTubeID===e.SongYouTubeID)}}]),e}();i.fromSongArray=function(e,t){return new i({SongID:e[0],SongAlbumID:e[1],SongTitle:e[2],SongArtist:e[3],SongAlbum:e[4],SongAlbumBuyLink:e[5],SongYouTubeID:e[6]})},n["default"]=i},{}],11:[function(e,t,n){function r(e,t){return p.isUndefined(t)?""+t:!p.isNumber(t)||!isNaN(t)&&isFinite(t)?p.isFunction(t)||p.isRegExp(t)?t.toString():t:t.toString()}function o(e,t){return p.isString(e)?e.length<t?e:e.slice(0,t):e}function i(e){return o(JSON.stringify(e.actual,r),128)+" "+e.operator+" "+o(JSON.stringify(e.expected,r),128)}function a(e,t,n,r,o){throw new h.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:o})}function u(e,t){e||a(e,!0,t,"==",h.ok)}function s(e,t){if(e===t)return!0;if(p.isBuffer(e)&&p.isBuffer(t)){if(e.length!=t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return p.isDate(e)&&p.isDate(t)?e.getTime()===t.getTime():p.isRegExp(e)&&p.isRegExp(t)?e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase:p.isObject(e)||p.isObject(t)?c(e,t):e==t}function l(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function c(e,t){if(p.isNullOrUndefined(e)||p.isNullOrUndefined(t))return!1;if(e.prototype!==t.prototype)return!1;if(l(e))return!!l(t)&&(e=g.call(e),t=g.call(t),s(e,t));try{var n,r,o=m(e),i=m(t)}catch(a){return!1}if(o.length!=i.length)return!1;for(o.sort(),i.sort(),r=o.length-1;r>=0;r--)if(o[r]!=i[r])return!1;for(r=o.length-1;r>=0;r--)if(n=o[r],!s(e[n],t[n]))return!1;return!0}function f(e,t){return!(!e||!t)&&("[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t||t.call({},e)===!0)}function d(e,t,n,r){var o;p.isString(n)&&(r=n,n=null);try{t()}catch(i){o=i}if(r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&a(o,n,"Missing expected exception"+r),!e&&f(o,n)&&a(o,n,"Got unwanted exception"+r),e&&o&&n&&!f(o,n)||!e&&o)throw o}var p=e("util/"),g=Array.prototype.slice,y=Object.prototype.hasOwnProperty,h=t.exports=u;h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=i(this),this.generatedMessage=!0);var t=e.stackStartFunction||a;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,o=t.name,u=r.indexOf("\n"+o);if(u>=0){var s=r.indexOf("\n",u+1);r=r.substring(s+1)}this.stack=r}}},p.inherits(h.AssertionError,Error),h.fail=a,h.ok=u,h.equal=function(e,t,n){e!=t&&a(e,t,n,"==",h.equal)},h.notEqual=function(e,t,n){e==t&&a(e,t,n,"!=",h.notEqual)},h.deepEqual=function(e,t,n){s(e,t)||a(e,t,n,"deepEqual",h.deepEqual)},h.notDeepEqual=function(e,t,n){s(e,t)&&a(e,t,n,"notDeepEqual",h.notDeepEqual)},h.strictEqual=function(e,t,n){e!==t&&a(e,t,n,"===",h.strictEqual)},h.notStrictEqual=function(e,t,n){e===t&&a(e,t,n,"!==",h.notStrictEqual)},h["throws"]=function(e,t,n){d.apply(this,[!0].concat(g.call(arguments)))},h.doesNotThrow=function(e,t){d.apply(this,[!1].concat(g.call(arguments)))},h.ifError=function(e){if(e)throw e};var m=Object.keys||function(e){var t=[];for(var n in e)y.call(e,n)&&t.push(n);return t}},{"util/":16}],12:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function o(e){return"function"==typeof e}function i(e){return"number"==typeof e}function a(e){return"object"==typeof e&&null!==e}function u(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,i,s,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],u(n))return!1;if(o(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,i=new Array(r-1),s=1;s<r;s++)i[s-1]=arguments[s];n.apply(this,i)}else if(a(n)){for(r=arguments.length,i=new Array(r-1),s=1;s<r;s++)i[s-1]=arguments[s];for(l=n.slice(),r=l.length,s=0;s<r;s++)l[s].apply(this,i)}return!0},r.prototype.addListener=function(e,t){var n;if(!o(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,o(t.listener)?t.listener:t),this._events[e]?a(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,a(this._events[e])&&!this._events[e].warned){var n;n=u(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!o(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,i,u;if(!o(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],i=n.length,r=-1,n===t||o(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(n)){for(u=i;u-- >0;)if(n[u]===t||n[u].listener&&n[u].listener===t){r=u;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],o(n))this.removeListener(e,n);else for(;n.length;)this.removeListener(e,n[n.length-1]); return delete this._events[e],this},r.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?o(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?o(e._events[t])?1:e._events[t].length:0}},{}],13:[function(e,t,n){function r(){}var o=t.exports={};o.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),o.title="browser",o.browser=!0,o.env={},o.argv=[],o.on=r,o.addListener=r,o.once=r,o.off=r,o.removeListener=r,o.removeAllListeners=r,o.emit=r,o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")}},{}],14:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],15:[function(e,t,n){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],16:[function(e,t,n){(function(t,r){function o(e,t){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),y(t)?r.showHidden=t:t&&n._extend(r,t),w(r.showHidden)&&(r.showHidden=!1),w(r.depth)&&(r.depth=2),w(r.colors)&&(r.colors=!1),w(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=i),s(r,e,r.depth)}function i(e,t){var n=o.styles[t];return n?"["+o.colors[n][0]+"m"+e+"["+o.colors[n][1]+"m":e}function a(e,t){return e}function u(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function s(e,t,r){if(e.customInspect&&t&&E(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(r,e);return S(o)||(o=s(e,o,r)),o}var i=l(e,t);if(i)return i;var a=Object.keys(t),y=u(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),N(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return c(t);if(0===a.length){if(E(t)){var h=t.name?": "+t.name:"";return e.stylize("[Function"+h+"]","special")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(A(t))return e.stylize(Date.prototype.toString.call(t),"date");if(N(t))return c(t)}var m="",v=!1,b=["{","}"];if(g(t)&&(v=!0,b=["[","]"]),E(t)){var w=t.name?": "+t.name:"";m=" [Function"+w+"]"}if(_(t)&&(m=" "+RegExp.prototype.toString.call(t)),A(t)&&(m=" "+Date.prototype.toUTCString.call(t)),N(t)&&(m=" "+c(t)),0===a.length&&(!v||0==t.length))return b[0]+m+b[1];if(r<0)return _(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var k;return k=v?f(e,t,r,y,a):a.map(function(n){return d(e,t,r,y,n,v)}),e.seen.pop(),p(k,m,b)}function l(e,t){if(w(t))return e.stylize("undefined","undefined");if(S(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return v(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):h(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,n,r,o){for(var i=[],a=0,u=t.length;a<u;++a)I(t,String(a))?i.push(d(e,t,n,r,String(a),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(d(e,t,n,r,o,!0))}),i}function d(e,t,n,r,o,i){var a,u,l;if(l=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]},l.get?u=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(u=e.stylize("[Setter]","special")),I(r,o)||(a="["+o+"]"),u||(e.seen.indexOf(l.value)<0?(u=h(n)?s(e,l.value,null):s(e,l.value,n-1),u.indexOf("\n")>-1&&(u=i?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n"))):u=e.stylize("[Circular]","special")),w(a)){if(i&&o.match(/^\d+$/))return u;a=JSON.stringify(""+o),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+u}function p(e,t,n){var r=0,o=e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function g(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function h(e){return null===e}function m(e){return null==e}function v(e){return"number"==typeof e}function S(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function w(e){return void 0===e}function _(e){return k(e)&&"[object RegExp]"===P(e)}function k(e){return"object"==typeof e&&null!==e}function A(e){return k(e)&&"[object Date]"===P(e)}function N(e){return k(e)&&("[object Error]"===P(e)||e instanceof Error)}function E(e){return"function"==typeof e}function O(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function P(e){return Object.prototype.toString.call(e)}function R(e){return e<10?"0"+e.toString(10):e.toString(10)}function q(){var e=new Date,t=[R(e.getHours()),R(e.getMinutes()),R(e.getSeconds())].join(":");return[e.getDate(),L[e.getMonth()],t].join(" ")}function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var T=/%[sdj%]/g;n.format=function(e){if(!S(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(o(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,i=r.length,a=String(e).replace(T,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return e}}),u=r[n];n<i;u=r[++n])a+=h(u)||!k(u)?" "+u:" "+o(u);return a},n.deprecate=function(e,o){function i(){if(!a){if(t.throwDeprecation)throw new Error(o);t.traceDeprecation?console.trace(o):console.error(o),a=!0}return e.apply(this,arguments)}if(w(r.process))return function(){return n.deprecate(e,o).apply(this,arguments)};if(t.noDeprecation===!0)return e;var a=!1;return i};var D,j={};n.debuglog=function(e){if(w(D)&&(D=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!j[e])if(new RegExp("\\b"+e+"\\b","i").test(D)){var r=t.pid;j[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else j[e]=function(){};return j[e]},n.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=g,n.isBoolean=y,n.isNull=h,n.isNullOrUndefined=m,n.isNumber=v,n.isString=S,n.isSymbol=b,n.isUndefined=w,n.isRegExp=_,n.isObject=k,n.isDate=A,n.isError=N,n.isFunction=E,n.isPrimitive=O,n.isBuffer=e("./support/isBuffer");var L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",q(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!k(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e("pBGvAp"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":15,inherits:14,pBGvAp:13}]},{},[3])(3)});