UNPKG

cplayer

Version:

A beautiful and clean WEB Music Player by HTML5.

1 lines 70.9 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("cplayer-umd",[],t):"object"==typeof exports?exports["cplayer-umd"]=t():e["cplayer-umd"]=t()}(window,(function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(10);function a(e,t,n,o){var i,a=!1;return t.forEach((function(t,n){r.default(t,e)&&(i=n)})),void 0!==i&&(t.splice(i,1),n>i?(n--,a=!1):n===i&&(n=o(n),a=!0)),{playlist:t,nowpoint:n,needupdate:a}}t.baseRemoveMusic=a;var l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,e),this.__playlist=[],this.point=0,this.__playlist=t,this.to(n)}var t,n,r;return t=e,(n=[{key:"next",value:function(){return this.point=this.nextPoint(),this.playlist[this.point]}},{key:"prev",value:function(){return this.point=this.prevPoint(),this.playlist[this.point]}},{key:"now",value:function(){return this.playlist[this.point]}},{key:"nowpoint",value:function(){return this.point}},{key:"to",value:function(e){this.point=Math.max(0,Math.min(e,this.__playlist.length-1))}},{key:"addMusic",value:function(e){this.__playlist.push(e)}},{key:"nextPoint",value:function(){var e=this.point+1;return e>=this.__playlist.length&&(e=0),e}},{key:"prevPoint",value:function(){var e=this.point-1;return e<0&&(e=this.__playlist.length-1),e}},{key:"removeMusic",value:function(e){var t=this,n=a(e,this.__playlist,this.point,(function(e){return Math.max(0,Math.min(e,t.__playlist.length-1))})),o=n.playlist,i=n.nowpoint,r=n.needupdate;return this.__playlist=o,this.point=i,r}},{key:"playlist",get:function(){return this.__playlist}}])&&i(t.prototype,n),r&&i(t,r),e}();t.listloopPlaymode=l},function(e,t){e.exports="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAAiACIDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAcDBAUG/8QALhAAAgEDAwIFAwMFAAAAAAAAAQIDAAQRBRIhE0EGIjFRkRQzYTI1cXOBocHR/8QAGAEAAwEBAAAAAAAAAAAAAAAAAQIDBAX/xAAiEQACAQMCBwAAAAAAAAAAAAAAAQIDETESFAQhIkFRYWL/2gAMAwEAAhEDEQA/AGBo7mOKMEBjgc4rqLaRWXG1fgUttA1qNbnpPdGV5mIRRhkiKgeTjkE5J5/1W9pniH6jVbuPdiO2gJwHG13B5wcc44+a5tPpNM4N3OwlC45RfgVlXMA2t5E/nFVZ/EEaWVlcmJmjuDHnDAdIP6MR3GSBx71Fe37LbSSKylVIyNwyM002IotGc2N7cr6+1FYTXu5iepKcnP66KzF9AoBfQ2LmzgWWJp3L72A8rNt2kY5x/wBrtfD+oSXkQ6k8iQSRuJVjwr78DcATx6YyfYehNcbsttTkayGoiGcPuh3REo2FG0bt2R6e3fvVW2vulYSSMPND9vk46jcA/Ab/ABXTlBSXsCnpvfAydb8TR3eg7bMrGrStB1c8r0wTsP4PDKe/OeRUXiPxFLBojump6fFcTtGFeCTDHaoJyMe5A70uYte+n097Z7eK6EjA4mJCptXAK7SOcE1S1a9jvbqNoYzFCkSIiFtxGBzk9znvQXD81cV1kkMSAWDQRt9bMuVB272OOPTOKKVu4+5+aKO2+gbleC5bfusf9U1ctlB1RYiAYy/Kn0P9qKKtLIkMGfeKBdkAADjgVFcffYdgcD8UUU6JPuR0UUURT//Z"},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var o,i="object"==typeof Reflect?Reflect:null,r=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};o=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function l(){l.init.call(this)}e.exports=l,l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var c=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function p(e){return void 0===e._maxListeners?l.defaultMaxListeners:e._maxListeners}function u(e,t,n,o){var i,r,a,l;if(s(n),void 0===(r=e._events)?(r=e._events=Object.create(null),e._eventsCount=0):(void 0!==r.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),r=e._events),a=r[t]),void 0===a)a=r[t]=n,++e._eventsCount;else if("function"==typeof a?a=r[t]=o?[n,a]:[a,n]:o?a.unshift(n):a.push(n),(i=p(e))>0&&a.length>i&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,l=c,console&&console.warn&&console.warn(l)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var o={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(o);return i.listener=n,o.wrapFn=i,i}function y(e,t,n){var o=e._events;if(void 0===o)return[];var i=o[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):f(i,i.length)}function m(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function f(e,t){for(var n=new Array(t),o=0;o<t;++o)n[o]=e[o];return n}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),l.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},l.prototype.getMaxListeners=function(){return p(this)},l.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)r(c,this,t);else{var s=c.length,p=f(c,s);for(n=0;n<s;++n)r(p[n],this,t)}return!0},l.prototype.addListener=function(e,t){return u(this,e,t,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(e,t){return u(this,e,t,!0)},l.prototype.once=function(e,t){return s(t),this.on(e,h(this,e,t)),this},l.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,h(this,e,t)),this},l.prototype.removeListener=function(e,t){var n,o,i,r,a;if(s(t),void 0===(o=this._events))return this;if(void 0===(n=o[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,r=n.length-1;r>=0;r--)if(n[r]===t||n[r].listener===t){a=n[r].listener,i=r;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(o[e]=n[0]),void 0!==o.removeListener&&this.emit("removeListener",e,a||t)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(e){var t,n,o;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,r=Object.keys(n);for(o=0;o<r.length;++o)"removeListener"!==(i=r[o])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(o=t.length-1;o>=0;o--)this.removeListener(e,t[o]);return this},l.prototype.listeners=function(e){return y(this,e,!0)},l.prototype.rawListeners=function(e){return y(this,e,!1)},l.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},l.prototype.listenerCount=m,l.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]}},function(e,t,n){e.exports=n(5)},function(e,t,n){"use strict";(function(e){function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),n(9);var c=n(0),s=n(3),p=n(11),u=n(12),d=n(13),h=n(14),y=void 0;y=n(15).default;var m={playlist:[],point:0,volume:1,playmode:"listloop",autoplay:!1},f={listloop:c.listloopPlaymode,singlecycle:u.singlecyclePlaymode,listrandom:d.listrandomPlaymode};function v(e){return e.map((function(e,t){var n=Object.assign({},e);return"string"==typeof e.lyric&&e.lyric.replace(/\n+/gi,"\n").trim()&&(n.lyric=p.decodeLyricStr(e.lyric)),"string"==typeof e.sublyric&&e.sublyric.replace(/\n+/gi,"\n").trim()&&(n.sublyric=p.decodeLyricStr(e.sublyric)),n}))}var g=function(t){function n(t){var i;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(i=function(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?a(e):t}(this,r(n).call(this))).__paused=!0,i.playmodeName="listloop",i._volume=0,i.eventHandlers={handlePlay:function(){i.__paused&&i.pause()},handlePlaying:function(){0===i.audioElement.currentTime&&i.emit("started")},handleTimeUpdate:function(){var e=i.audioElement.duration,t=i.audioElement.currentTime;i.emit("timeupdate",t,e)},handleCanPlayThrough:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=i).emit.apply(e,["canplaythrough"].concat(n))},handlePause:function(){i.__paused||i.audioElement.ended||i.play(!0).catch((function(e){console.log(e),i.pause()}))},handleEnded:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=i).emit.apply(e,["ended"].concat(n)),i.__paused||i.next()},handlePlayListChange:function(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];(e=i).emit.apply(e,["playlistchange"].concat(n))},handlePlaymodeChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.mode;i.emit("playmodechange",e)},handleLoadeddata:function(){var e=i.audioElement.duration,t=i.audioElement.currentTime;i.emit("timeupdate",t,e)}},t=Object.assign(Object.assign({},m),t),i.playmode=new f[t.playmode](v(t.playlist),t.point),i.view=new y(a(i),t),h.cplayerMediaSessionPlugin(a(i)),e((function(){i.openAudio(),i.setVolume(t.volume),t.autoplay&&i.playlist.length>0&&i.play(!0).catch((function(e){console.log(e),i.pause()}))})),i}var c,s,p;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(n,t),c=n,(s=[{key:"initializeEventEmitter",value:function(e){var t=e.addEventListener.bind(e),n=this.eventHandlers;t("timeupdate",n.handleTimeUpdate),t("canplaythrough",n.handleCanPlayThrough),t("pause",n.handlePause),t("play",n.handlePlay),t("playing",n.handlePlaying),t("ended",n.handleEnded),t("loadeddata",n.handleLoadeddata)}},{key:"removeEventEmitter",value:function(e){var t=e.removeEventListener.bind(e),n=this.eventHandlers;t("timeupdate",n.handleTimeUpdate),t("canplaythrough",n.handleCanPlayThrough),t("pause",n.handlePause),t("play",n.handlePlay),t("playing",n.handlePlaying),t("ended",n.handleEnded),t("loadeddata",n.handleLoadeddata)}},{key:"setCurrentTime",value:function(e){if("string"==typeof e&&(e.trim(),"%"===e[e.length-1])){var t=parseFloat(e);e=this.duration*(t/100)}this.audioElement&&(this.audioElement.currentTime=parseFloat(e.toString()))}},{key:"isPlaying",value:function(){return!!this.audioElement&&this.audioElement.currentTime>0&&!this.audioElement.paused&&!this.audioElement.ended&&this.audioElement.readyState>2}},{key:"openAudio",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.nowplay;e&&("video"===e.type?"HTMLVideoElement"!==this.audioElementType&&(void 0!==this.audioElement&&(this.removeEventEmitter(this.audioElement),this.audioElement.src=""),this.audioElement=document.createElement("video"),this.audioElement instanceof HTMLVideoElement&&(this.audioElementType="HTMLVideoElement",this.audioElement.loop=!1,this.audioElement.autoplay=!1,this.audioElement.poster=e.poster,this.audioElement.setAttribute("playsinline","true"),this.audioElement.setAttribute("webkit-playsinline","true")),this.initializeEventEmitter(this.audioElement),this.emit("audioelementchange",this.audioElement)):"HTMLAudioElement"!==this.audioElementType&&(void 0!==this.audioElement&&(this.removeEventEmitter(this.audioElement),this.audioElement.src=""),this.audioElement=new Audio,this.audioElementType="HTMLAudioElement",this.audioElement.loop=!1,this.audioElement.autoplay=!1,this.initializeEventEmitter(this.audioElement),this.emit("audioelementchange",this.audioElement)),this.setVolume(this.volume),this.audioElement.src=this.nowplay.src,this.emit("openaudio",e),this.__paused||this.play())}},{key:"toggleMode",value:function(){switch(this.playmodeName){case"listloop":this.setMode("singlecycle");break;case"singlecycle":this.setMode("listrandom");break;case"listrandom":this.setMode("listloop")}}},{key:"setMode",value:function(e){"string"==typeof e&&this.playmodeName!==e&&f[e]&&(this.playmode=new f[e](this.playlist,this.nowplaypoint),this.playmodeName=e,this.eventHandlers.handlePlaymodeChange())}},{key:"getMode",value:function(){return this.mode}},{key:"play",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this.isPlaying();return(!n&&this.playlist.length>0||t)&&(e=this.audioElement.play()),this.__paused&&(this.__paused=!1,this.emit("playstatechange",this.__paused),this.emit("play")),e}},{key:"pause",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.isPlaying();(t&&this.playlist.length>0||e)&&this.audioElement.pause(),this.__paused||(this.__paused=!0,this.emit("playstatechange",this.__paused),this.emit("pause"))}},{key:"to",value:function(e){this.playmode.to(e),this.openAudio()}},{key:"next",value:function(){this.playmode.next(),this.openAudio()}},{key:"prev",value:function(){this.playmode.prev(),this.openAudio()}},{key:"togglePlayState",value:function(){this.__paused?this.play():this.pause()}},{key:"add",value:function(e){e=v([e])[0],this.playmode.addMusic(e),this.eventHandlers.handlePlayListChange(),1===this.playlist.length&&this.to(0)}},{key:"remove",value:function(e){var t=this.playmode.removeMusic(e);this.eventHandlers.handlePlayListChange(),t&&this.openAudio()}},{key:"setVolume",value:function(e){this._volume=parseFloat(e),this.audioElement&&(this.audioElement.volume=Math.max(0,Math.min(1,this._volume))),this.emit("volumechange",this.volume)}},{key:"destroy",value:function(){var e=this;this.audioElement&&(this.audioElement.src=null,this.audioElement.removeEventListener("timeupdate",this.eventHandlers.handleTimeUpdate),this.removeAllListeners()),this.view&&this.view.destroy(),Object.getOwnPropertyNames(this).forEach((function(t){return delete e[t]})),this.__proto__=Object}},{key:"mode",set:function(e){this.setMode(e)},get:function(){return this.playmodeName}},{key:"volume",set:function(e){this.setVolume(e)},get:function(){return this._volume}},{key:"playlist",get:function(){return this.playmode.playlist}},{key:"nowplay",get:function(){return this.playmode&&this.playmode.now()}},{key:"nowplaypoint",get:function(){return this.playmode&&this.playmode.nowpoint()}},{key:"played",get:function(){return!this.__paused}},{key:"paused",get:function(){return this.__paused}},{key:"duration",get:function(){return this.audioElement?this.audioElement.duration:0}},{key:"currentTime",get:function(){return this.audioElement?this.audioElement.currentTime:0}}])&&i(c.prototype,s),p&&i(c,p),n}(s.EventEmitter);t.default=g;window.addEventListener("load",(function(){Array.prototype.forEach.call(document.querySelectorAll("template[cplayer]"),(function(e){e.attributes.getNamedItem("loaded")||new g(Object.assign({generateBeforeElement:!0,deleteElementAfterGenerate:!0,element:e},JSON.parse(e.innerHTML)))}))})),window.cplayer=g}).call(this,n(6).setImmediate)},function(e,t,n){(function(e){var o=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function r(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new r(i.call(setTimeout,o,arguments),clearTimeout)},t.setInterval=function(){return new r(i.call(setInterval,o,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(o,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(7),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(2))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var o,i,r,a,l,c=1,s={},p=!1,u=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?o=function(e){t.nextTick((function(){y(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){y(e.data)},o=function(e){r.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(i=u.documentElement,o=function(e){var t=u.createElement("script");t.onreadystatechange=function(){y(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):o=function(e){setTimeout(y,0,e)}:(a="setImmediate$"+Math.random()+"$",l=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&y(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",l,!1):e.attachEvent("onmessage",l),o=function(t){e.postMessage(a+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return s[c]=i,o(c),c++},d.clearImmediate=h}function h(e){delete s[e]}function y(e){if(p)setTimeout(y,0,e);else{var t=s[e];if(t){p=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{h(e),p=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(2),n(8))},function(e,t){var n,o,i=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(e){if(n===setTimeout)return setTimeout(e,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(e){n=r}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(e){o=a}}();var c,s=[],p=!1,u=-1;function d(){p&&c&&(p=!1,c.length?s=c.concat(s):u=-1,s.length&&h())}function h(){if(!p){var e=l(d);p=!0;for(var t=s.length;t;){for(c=s,s=[];++u<t;)c&&c[u].run();u=-1,t=s.length}c=null,p=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function m(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new y(e,t)),1!==s.length||p||l(h)},y.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=m,i.addListener=m,i.once=m,i.off=m,i.removeListener=m,i.removeAllListeners=m,i.emit=m,i.prependListener=m,i.prependOnceListener=m,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(e,t){"use strict";if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(e),o=1;o<arguments.length;o++){var i=arguments[o];if(null!=i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n},writable:!0,configurable:!0})},function(e,t,n){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.prototype.hasOwnProperty;function r(e,t){return e==t?0!=e||0!=t||1/e==1/t:e!=e&&t!=t}t.default=function(e,t){if(r(e,t))return!0;if("object"!==o(e)||null===e||"object"!==o(t)||null===t)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(var l=0;l<n.length;l++)if(!i.call(t,n[l])||!r(e[n[l]],t[n[l]]))return!1;return!0}},function(e,t,n){"use strict";function o(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.items=[],this.items=t,this.raw=n}var t,n,o;return t=e,(n=[{key:"getLyric",value:function(e){return this.items.reduce((function(t,n){return n.time<e&&(!t||t.time<n.time)?n:t}),void 0)}},{key:"getNextLyric",value:function(e){return this.items.reduce((function(t,n){return n.time>e&&(!t||t.time>n.time)?n:t}),void 0)}},{key:"toString",value:function(){return this.raw}}])&&i(t.prototype,n),o&&i(t,o),e}();function a(e){var t=[],n=e.match(/\[\d+\:[\.\d]+\]/gi),o=/(?:\[\d+\:[\.\d]+\])*(.*)/gi.exec(e)[1].trim();return n&&o&&n.forEach((function(e){var n=/\[(\d+)\:([\.\d]+)\]/gi.exec(e.trim()),i=60*parseInt(n[1])*1e3+1e3*parseFloat(n[2]);t.push({time:i,word:o})})),t}t.Lyric=r,t.decodeLyricStr=function(e,t){if("string"!=typeof e)return e;var n=[];return e.replace(/\n+/gi,"\n").trim().split("\n").forEach((function(e){n.push.apply(n,o(a(e)))})),0!=n.length?new r(n,e):void 0},t.decodeLyricStrItem=a},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,e),this.__playlist=[],this.__playlist=t,this.to(n)}var t,n,a;return t=e,(n=[{key:"next",value:function(){return this.__playlist[this.point]}},{key:"prev",value:function(){return this.__playlist[this.point]}},{key:"now",value:function(){return this.__playlist[this.point]}},{key:"nowpoint",value:function(){return this.point}},{key:"to",value:function(e){this.point=Math.max(0,Math.min(e,this.__playlist.length-1))}},{key:"addMusic",value:function(e){this.__playlist.push(e)}},{key:"removeMusic",value:function(e){var t=this,n=r.baseRemoveMusic(e,this.__playlist,this.point,(function(e){return Math.max(0,Math.min(e,t.__playlist.length-1))})),o=n.playlist,i=n.nowpoint,a=n.needupdate;return this.__playlist=o,this.point=i,a}},{key:"playlist",get:function(){return this.__playlist}}])&&i(t.prototype,n),a&&i(t,a),e}();t.singlecyclePlaymode=a},function(e,t,n){"use strict";function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),a=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,e),this.__playlist=[],this.point=0,this.__playlist=t,this.to(n)}var t,n,a;return t=e,(n=[{key:"next",value:function(){return this.point=this.randomPoint(),this.__playlist[this.point]}},{key:"prev",value:function(){return this.point=this.randomPoint(),this.__playlist[this.point]}},{key:"now",value:function(){return this.__playlist[this.point]}},{key:"nowpoint",value:function(){return this.point}},{key:"to",value:function(e){this.point=Math.max(0,Math.min(e,this.__playlist.length-1))}},{key:"addMusic",value:function(e){this.__playlist.push(e)}},{key:"randomPoint",value:function(){if(this.__playlist.length>1){var e=Math.floor(this.__playlist.length*Math.random());return e===this.point?this.randomPoint():e}return 0}},{key:"removeMusic",value:function(e){var t=this,n=r.baseRemoveMusic(e,this.__playlist,this.point,(function(e){return t.randomPoint()})),o=n.playlist,i=n.nowpoint,a=n.needupdate;return this.__playlist=o,this.point=i,a}},{key:"playlist",get:function(){return this.__playlist}}])&&i(t.prototype,n),a&&i(t,a),e}();t.listrandomPlaymode=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(1);function i(e){return new MediaMetadata({title:e.name,artist:e.artist,album:e.album,artwork:[{sizes:"720x720",src:e.poster||o}]})}t.cplayerMediaSessionPlugin=function(e){"mediaSession"in navigator&&(e.nowplay&&(navigator.mediaSession.metadata=i(e.nowplay)),navigator.mediaSession.setActionHandler("play",(function(){return e.play()})),navigator.mediaSession.setActionHandler("pause",(function(){return e.pause()})),navigator.mediaSession.setActionHandler("previoustrack",(function(){return e.prev()})),navigator.mediaSession.setActionHandler("nexttrack",(function(){return e.next()})),e.on("openaudio",(function(){navigator.mediaSession.metadata=i(e.nowplay)})))},t.mediaMetadata=i},function(e,t,n){"use strict";function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function l(e,t){return(l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}Object.defineProperty(t,"__esModule",{value:!0});var c=n(16),s=n(3),p=n(1),u=n(17),d=n(18),h=n(19);function y(e){for(var t="",n=!1,o=0;o<e.length;o++){var i=e.charAt(o),r=/[ぁ-んァ-ン]/.test(i);r&&!n&&(t+='<span class="cp-lyric-text-zoomout">',n=!0),!r&&n&&(t+="</span>",n=!1),t+=i}return n&&(t+="</span>"),t}function m(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(n?y(e):e)+(t?'<span class="cp-lyric-text-sub">'.concat(t,"</span>"):"")}function f(e){return parseInt((e/60).toString()).toString().padStart(2,"0")+":"+parseInt((e%60).toString()).toString().padStart(2,"0")}var v={element:document.body,generateBeforeElement:!1,deleteElementAfterGenerate:!1,zoomOutKana:!1,showPlaylist:!1,showPlaylistButton:!0,dropDownMenuMode:"bottom",width:"",size:"12px",style:"",shadowDom:!0};function g(e){var t=document.createElement("style");return t.id="cplayer-style",t.innerHTML=e,t}var b=function(e){function t(e,n){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(o=r(this,a(t).call(this))).elementLinks=c.default(o.getElementLinks),o.dropDownMenuShowInfo=!0,o.__OldVolume=1,o.__OldLyric="",o.__OldTotalTime=0,o.handlePlaylistchange=function(){o.updatePlaylist()},o.handleClickListButton=function(){o.toggleDropDownMenu()},o.handleClickModeButton=function(){o.player.toggleMode()},o.handleClickPlayList=function(e,t){o.player.nowplaypoint!==e&&(o.player.to(e),o.player.play())},o.handleClickPlayButton=function(){o.player.togglePlayState()},o.handleClickVolumeButton=function(){o.toggleVolumeControllerKeepShow()},o.handleOpenAudio=function(e){"video"!==e.type?o.setPoster(e.poster||p):o.setPoster("none"),o.setProgress(0,0,0),o.elementLinks.title.innerText=e.name,o.elementLinks.artist.innerText=e.artist||"",o.updateLyric(),o.updatePlaylist()},o.handleModeChange=function(e){o.setMode(e)},o.handleVolumeChange=function(e){o.setVolume(e)},o.handleTimeUpdate=function(e,t){o.setProgress(e/t,e,t),o.updateLyric(e)},o.handleClickPrevButton=function(){o.player.prev(),o.player.play()},o.handleClickNextButton=function(){o.player.next(),o.player.play()},o.handlePlayStateChange=function(e){o.setPlayIcon(e)},o.handleMouseVolumeController=function(e){if(o.removeVolumeControllerKeepShow(),1===e.buttons||void 0===e.buttons&&1===e.which){var t=Math.max(0,Math.min(1,(e.clientX-o.elementLinks.volumeController.getBoundingClientRect().left)/o.elementLinks.volumeController.clientWidth));o.player.setVolume(t),o.setVolume(t)}},o.handleTouchVolumeController=function(e){o.removeVolumeControllerKeepShow();var t=Math.max(0,Math.min(1,(e.targetTouches[0].clientX-o.elementLinks.volumeController.getBoundingClientRect().left)/o.elementLinks.volumeController.clientWidth));o.player.setVolume(t),o.setVolume(t)},o.handleAudioElementChange=function(e){e instanceof HTMLVideoElement?o.elementLinks.poster.appendChild(e):o.elementLinks.poster.innerHTML=""},o.handleMouseProgress=function(e){if(1===e.buttons||void 0===e.buttons&&1===e.which){var t=Math.max(0,Math.min(1,(e.clientX-o.elementLinks.progress.getBoundingClientRect().left)/o.elementLinks.progress.clientWidth));o.player.setCurrentTime(100*t+"%")}},o.handleTouchProgress=function(e){var t=Math.max(0,Math.min(1,(e.targetTouches[0].clientX-o.elementLinks.progress.getBoundingClientRect().left)/o.elementLinks.progress.clientWidth));o.player.setCurrentTime(100*t+"%")},o.options=Object.assign(Object.assign({},v),n),o.player=e,o.options.generateBeforeElement?o.options.element.createShadowRoot&&!1!==n.shadowDom?o.rootElement=function(e,t,n){var o=document.createElement("div"),i=o.createShadowRoot();return i.innerHTML=t,i.appendChild(g(n)),e.parentNode.insertBefore(o,e),i.firstChild}(o.options.element,u,h+o.options.style):o.rootElement=function(e,t,n){var o=document.createElement("div");return o.innerHTML=t,e.parentNode.insertBefore(o,e),document.getElementById("cplayer-style")||document.body.appendChild(g(n)),o.firstChild}(o.options.element,u,h+o.options.style):o.options.element.createShadowRoot&&!1!==n.shadowDom?o.rootElement=function(e,t,n){var o=e.createShadowRoot();return o.innerHTML=t,o.appendChild(g(n)),o.firstChild}(o.options.element,u,h+o.options.style):o.rootElement=function(e,t,n){return e.innerHTML=t,document.getElementById("cplayer-style")||document.body.appendChild(g(n)),e.firstChild}(o.options.element,u,h+o.options.style),n.deleteElementAfterGenerate&&n.element.parentElement.removeChild(n.element),o.rootElement.style.width=o.options.width,o.rootElement.style.fontSize=o.options.size,o.elementLinks=o.getElementLinks(),o.injectEventListener(),o.setPlayIcon(o.player.paused),o.dropDownMenuShowInfo=!o.options.showPlaylist,o.dropDownMenuShowInfo?o.showInfo():o.showPlaylist(),o.options.showPlaylistButton?o.elementLinks.button.list.style.display="":o.elementLinks.button.list.style.display="none",o.elementLinks.dropDownMenu.classList.add("cp-drop-down-menu-"+o.options.dropDownMenuMode),o.options.dark&&o.dark(),o.options.big&&o.big(),o.setProgress(o.player.currentTime/o.player.duration,o.player.currentTime,o.player.duration),o.updateLyric(),o.updatePlaylist(),o}var n,o,s;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&l(e,t)}(t,e),n=t,(o=[{key:"getRootElement",value:function(){return this.rootElement}},{key:"dark",value:function(){this.rootElement.classList.add("cp-dark")}},{key:"big",value:function(){this.rootElement.classList.add("cp-big")}},{key:"getPlayListLinks",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.rootElement;return e.querySelectorAll(".cp-playlist li")}},{key:"getElementLinks",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.rootElement,t=function(t){return e.getElementsByClassName(t)[0]};return{icon:{play:t("cp-play-icon"),mode:t("cp-mode-icon")},button:{prev:t("cp-prev-button"),play:t("cp-play-button"),next:t("cp-next-button"),volume:t("cp-volume-icon"),list:t("cp-list-button"),mode:t("cp-mode-button")},progress:t("cp-progress"),progressFill:t("cp-progress-fill"),progressButton:t("cp-progress-button"),progressDuration:t("cp-progress-duration"),progressCurrentTime:t("cp-progress-current-time"),poster:t("cp-poster"),title:t("cp-audio-title"),artist:t("cp-audio-artist"),lyric:t("cp-lyric-text"),lyricContainer:t("cp-lyric"),volumeController:t("cp-volume-controller"),volumeFill:t("cp-volume-fill"),volumeControllerButton:t("cp-volume-controller-button"),volumeControllerContainer:t("cp-volume-container"),dropDownMenu:t("cp-drop-down-menu"),playlist:t("cp-playlist"),playlistItems:this.getPlayListLinks(e)}}},{key:"setPlayIcon",value:function(e){e?this.elementLinks.icon.play.classList.add("cp-play-icon-paused"):this.elementLinks.icon.play.classList.remove("cp-play-icon-paused")}},{key:"setProgress",value:function(e,t,n){this.elementLinks.progressFill.style.width="".concat(100*e,"%"),this.elementLinks.progressButton.style.right=100*(1-e)+"%",this.elementLinks.progressCurrentTime.innerText=f(t),this.elementLinks.progressDuration.innerText=f(n)}},{key:"setPoster",value:function(e){this.elementLinks.poster.style.backgroundImage='url("'.concat(e,'")')}},{key:"setVolume",value:function(e){this.__OldVolume!==e&&(this.elementLinks.volumeFill.style.width="".concat(100*e,"%"),this.elementLinks.volumeControllerButton.style.right=100*(1-e)+"%",this.__OldVolume=e)}},{key:"setMode",value:function(e){var t=document.createAttribute("data-mode");t.value=e,this.elementLinks.button.mode.attributes.setNamedItem(t)}},{key:"showInfo",value:function(){var e=this.elementLinks.dropDownMenu;e.style.height="",e.classList.remove("cp-drop-down-menu-playlist"),e.classList.add("cp-drop-down-menu-info"),this.dropDownMenuShowInfo=!0}},{key:"showPlaylist",value:function(){var e=this.elementLinks.dropDownMenu;e.style.height=2.08333*this.player.playlist.length+"em",e.classList.remove("cp-drop-down-menu-info"),e.classList.add("cp-drop-down-menu-playlist"),this.dropDownMenuShowInfo=!1}},{key:"toggleDropDownMenu",value:function(){this.dropDownMenuShowInfo?this.showPlaylist():this.showInfo()}},{key:"setVolumeControllerKeepShow",value:function(){this.elementLinks.volumeControllerContainer.classList.add("cp-volume-container-show")}},{key:"toggleVolumeControllerKeepShow",value:function(){this.elementLinks.volumeControllerContainer.classList.toggle("cp-volume-container-show")}},{key:"removeVolumeControllerKeepShow",value:function(){this.elementLinks.volumeControllerContainer.classList.remove("cp-volume-container-show")}},{key:"setLyric",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(this.__OldLyric!==e||this.__OldTotalTime!==n){if(this.elementLinks.lyric.innerHTML=e,this.elementLinks.lyric.style.transition="",this.elementLinks.lyric.style.transform="",0!==n){var o=this.elementLinks.lyric.clientWidth,i=this.elementLinks.lyricContainer.clientWidth;if(o>i){var r=n-t,a=o-i,l=i/o*r,c=Math.min(.6*l,r),s=r-l;this.elementLinks.lyric.style.transition="transform ".concat(s,"ms linear ").concat(c,"ms"),this.elementLinks.lyric.style.transform="translateX(-".concat(a,"px)")}}this.__OldLyric=e,this.__OldTotalTime=n}}},{key:"updatePlaylist",value:function(){var e=this,t=this.player.playlist.map((function(t,n){var o=document.createElement("li");return o.innerHTML="\n ".concat(n===e.player.nowplaypoint?d:'<span class="cp-play-icon"></span>',"\n <span>").concat(t.name,"</span><span class='cp-playlist-artist'>").concat(t.artist?" - "+t.artist:"","</span>\n "),o}));this.elementLinks.playlist.innerHTML="",t.forEach((function(t){e.elementLinks.playlist.appendChild(t)})),this.elementLinks.playlistItems=this.getPlayListLinks(),this.injectPlayListEventListener(),this.dropDownMenuShowInfo||(this.elementLinks.dropDownMenu.style.height=2.08333*this.player.playlist.length+"em")}},{key:"injectPlayListEventListener",value:function(){var e=this;Array.prototype.forEach.call(this.elementLinks.playlistItems,(function(t,n){t.addEventListener("click",(function(t){e.handleClickPlayList(n,t)}))}))}},{key:"injectEventListener",value:function(){this.elementLinks.button.play.addEventListener("click",this.handleClickPlayButton),this.elementLinks.button.prev.addEventListener("click",this.handleClickPrevButton),this.elementLinks.button.next.addEventListener("click",this.handleClickNextButton),this.elementLinks.button.volume.addEventListener("click",this.handleClickVolumeButton),this.elementLinks.button.list.addEventListener("click",this.handleClickListButton),this.elementLinks.button.mode.addEventListener("click",this.handleClickModeButton),this.elementLinks.volumeController.addEventListener("mousemove",this.handleMouseVolumeController),this.elementLinks.volumeController.addEventListener("mousedown",this.handleMouseVolumeController),this.elementLinks.volumeController.addEventListener("touchmove",this.handleTouchVolumeController,{passive:!0}),this.elementLinks.progress.addEventListener("mousemove",this.handleMouseProgress),this.elementLinks.progress.addEventListener("mousedown",this.handleMouseProgress),this.elementLinks.progress.addEventListener("touchmove",this.handleTouchProgress,{passive:!0}),this.player.addListener("playstatechange",this.handlePlayStateChange),this.player.addListener("timeupdate",this.handleTimeUpdate),this.player.addListener("openaudio",this.handleOpenAudio),this.player.addListener("volumechange",this.handleVolumeChange),this.player.addListener("playmodechange",this.handleModeChange),this.player.addListener("playlistchange",this.handlePlaylistchange),this.player.addListener("audioelementchange",this.handleAudioElementChange),this.injectPlayListEventListener()}},{key:"updateLyric",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.player.nowplay)if(this.player.nowplay.lyric&&"string"!=typeof this.player.nowplay.lyric&&this.player.played){var t,n=this.player.nowplay.lyric.getLyric(1e3*e),o=this.player.nowplay.lyric.getNextLyric(1e3*e);if(n)if(this.player.nowplay.sublyric&&"string"!=typeof this.player.nowplay.sublyric&&(t=this.player.nowplay.sublyric.getLyric(1e3*e)),o){var i=o.time-n.time,r=1e3*e-n.time;this.setLyric(m(n.word,t?t.word:void 0,this.options.zoomOutKana),r,i)}else{var a=this.player.duration-n.time,l=1e3*e-n.time;this.setLyric(m(n.word,t?t.word:void 0,this.options.zoomOutKana),l,a)}else this.setLyric(m(this.player.nowplay.name,this.player.nowplay.artist,!1),1e3*e,o.time)}else this.setLyric(m(this.player.nowplay.name,this.player.nowplay.artist,!1));else this.setLyric(null)}},{key:"destroy",value:function(){this.rootElement.parentElement.removeChild(this.rootElement)}}])&&i(n.prototype,o),s&&i(n,s),t}(s.EventEmitter);t.default=b},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return{}}},function(e,t){e.exports='<c-player loaded> <div class=cp-mainbody> <div class=cp-poster> </div> <div class=cp-center-container> <div class=cp-controls> <a class=cp-prev-button> <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink class=cp-prev-icon viewBox="0 0 1024 1024" version=1.1> <path d="M943.705 11.8c10.321 5.183 17.325 15.601 17.534 27.675l-0.004 938.318c-0.167 12.186-7.229 22.684-17.457 27.782-4.857 2.548-10.527 4.026-16.543 4.026a35.75 35.75 0 0 1-18.217-4.955l-716.617-469c-9.689-5.299-16.151-15.421-16.151-27.053 0-11.63 6.462-21.753 15.991-26.972L909.186 12.666c5.177-3.048 11.404-4.848 18.052-4.848a35.878 35.878 0 0 1 16.665 4.077z"/> <path d="M228.435 77.809v868.712c-3.889 42.573-39.416 75.664-82.673 75.664s-78.784-33.091-82.649-75.34l-0.024-869.036C65.9 34.259 101.911 0 145.924 0s80.024 34.259 82.822 77.564z"/> </svg> </a> <a class=cp-play-button> <span class="cp-play-icon cp-play-icon-paused"> <div class=cp-play-icon-left></div> <div class=cp-play-icon-right></div> <div class=cp-play-icon-triangle-1></div> <div class=cp-play-icon-triangle-2></div> </span> </a> <a class=cp-next-button> <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink class=cp-next-icon viewBox="0 0 1024 1024" version=1.1> <path d="M943.705 11.8c10.321 5.183 17.325 15.601 17.534 27.675l-0.004 938.318c-0.167 12.186-7.229 22.684-17.457 27.782-4.857 2.548-10.527 4.026-16.543 4.026a35.75 35.75 0 0 1-18.217-4.955l-716.617-469c-9.689-5.299-16.151-15.421-16.151-27.053 0-11.63 6.462-21.753 15.991-26.972L909.186 12.666c5.177-3.048 11.404-4.848 18.052-4.848a35.878 35.878 0 0 1 16.665 4.077z"/> <path d="M228.435 77.809v868.712c-3.889 42.573-39.416 75.664-82.673 75.664s-78.784-33.091-82.649-75.34l-0.024-869.036C65.9 34.259 101.911 0 145.924 0s80.024 34.259 82.822 77.564z"/> </svg> </a> </div> <div class=cp-lyric> <span class=cp-lyric-text></span> </div> </div> <a class=cp-volume-button> <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink class="cp-volume-icon cp-icon-dark" viewBox="0 200 1024 650" version=1.1> <path d="M607.869008 364.026176l-49.340512 49.340528c25.412064 25.160448 41.150352 60.055392 41.150352 98.637648 0 38.573568-15.738288 73.477184-41.150352 98.62896l49.340512 49.340512c37.836112-37.888176 61.244-90.195872 61.244-147.969488 0-57.782272-23.407888-110.081328-61.244-147.978176z"/> <path d="M807.937968 512c0-96.086912-39.050752-183.055296-102.134064-245.904368L656.95792 314.9416c50.398992 50.45104 81.563248 120.1108 81.563248 197.0584 0 76.938912-31.172944 146.598672-81.563248 197.0584l48.845984 48.845968C768.887216 695.055296 807.937968 608.086896 807.937968 512z"/> <path d="M946.780288 512.004336c0-134.434896-54.598176-256.107376-142.807248-344.082192l-49.088912 49.088896c75.65488 75.411952 122.470672 179.732384 122.470672 294.993296 0 115.252224-46.815792 219.581328-122.470672 294.984608l49.088912 49.088912c88.209072-87.966144 142.807248-209.647312 142.807248-344.07352z"/> <path d="M247.605111 659.304938 458.566804 854.551527 458.566804 169.448479 251.58222 364.704275 53.490893 364.704275 53.490893 659.304938Z"/> </svg> <div class=cp-volume-container> <div> <span class=cp-volume-controller> <span class=cp-volume-fill></span> <span class=cp-volume-controller-button></span> </span> </div> </div> </a> <a class=cp-list-button> <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink class="cp-list-icon cp-icon-dark" viewBox="0 0 1024 1024" version=1.1> <path d="M168.57 820.6c0 14.34-9.56 23.89-23.89 23.89H96.89c-14.34 0-23.89-9.55-23.89-23.89v-47.79c0-14.34 9.56-23.89 23.89-23.89h47.79c14.34 0 23.89 9.56 23.89 23.89z m0-284.33c0 14.34-9.56 23.89-23.89 23.89H96.89c-14.34 0-23.89-9.56-23.89-23.89v-47.79c0-14.34 9.56-23.89 23.89-23.89h47.79c14.34 0 23.89 9.56 23.89 23.89z m0-286.72c0 14.34-9.56 23.89-23.89 23.89H96.89c-14.34 0-23.89-9.56-23.89-23.89v-47.79c0-14.34 9.56-23.89 23.89-23.89h47.79c14.34 0 23.89 9.56 23.89 23.89zM969 820.6c0 14.34-7.17 23.89-21.5 23.89H314.32c-14.34 0-23.89-9.56-23.89-23.89v-47.79c0-14.34 9.56-23.89 23.89-23.89H945.1c14.34 0 23.89 9.56 23.89 23.89z m0-284.33c0 14.34-7.17 23.89-21.5 23.89H314.32c-14.34 0-23.89-9.56-23.89-23.89v-47.79c0-14.34 9.56-23.89 23.89-23.89H945.1c14.34 0 23.89 9.56 23.89 23.89z m0-286.72c0 14.34-7.17 23.89-21.5 23.89H314.32c-14.34 0-23.89-9.56-23.89-23.89v-47.79c0-14.34 9.56-23.89 23.89-23.89H945.1c14.34 0 23.89 9.56 23.89 23.89z"/> </svg> </a> <a class=cp-mode-button data-mode=listloop> <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink class="cp-loop-icon cp-icon-dark" viewBox="0 0 1024 1024" version=1.1> <path d="M157 624c17.3-4.8 27.4-22.7 22.6-40-5.4-19.4-8.1-39.5-8.1-59.9 0-123.1 100.1-223.2 223.2-223.2h302.4v57.6c0 18.5 12.9 25.6 28.6 15.9l138.6-85.8c15.7-9.7 15.9-25.9 0.3-35.9l-139.2-89.9c-15.5-10-28.2-3.1-28.2 15.4V236H394.7c-77 0-149.3 30-203.8 84.4-54.4 54.4-84.4 126.8-84.4 203.8 0 26.2 3.5 52.2 10.5 77.3 4 14.4 17.1 23.8 31.3 23.8 2.9-0.1 5.8-0.4 8.7-1.3z m748.7-202.1c-4-14.4-17.1-23.8-31.3-23.8-2.9 0-5.8 0.4-8.7 1.2-17.3 4.8-27.4 22.7-22.6 40 5.4 19.4 8.1 39.5 8.1 59.9 0 123.1-100.1 223.2-223.2 223.2H325.5v-57.6c0-18.5-12.9-25.6-28.6-15.9l-138.6 85.8c-15.7 9.7-15.9 25.9-0.3 35.9l139.2 89.9c15.5 10 28.2 3.1 28.2-15.4v-57.9h302.4c77 0 149.3-30 203.8-84.4C886 648.4 916 576 916 499c0.1-26-3.4-52-10.3-77.1z"/> </svg> <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink class="cp-single-icon cp-icon-dark" viewBox="0 0 1024 1024" version=1.1> <path d="M102.5 653.9c17.3-4.8 27.4-22.7 22.6-40-5.4-19.4-8.1-43.4-8.1-63.8C117 427 217.1 323 340.2 323h132.3c1.4-20 5.4-40 11.7-60h-144c-77 0-149.4 31.4-203.8 85.8C82 403.2 52 476.3 52 553.3c0 26.2 3.5 52.6 10.5 77.6 4 14.4 17.1 24 31.3 24 2.9 0 5.8-0.2 8.7-1z m471 109.1H272v-68.3c0-18.5-13.3-25.6-29-15.9l-138.8 85.8c-15.7 9.7-16 25.9-0.5 35.9l139.7 89.9c15.5 10 28.7 3.1 28.7-15.4v-52h301.5c77 0 149.4-32.9 203.8-87.3 34.7-34.7 59.5-78.2 72.9-124-24 9-49.6 19.4-76.2 21.5-36.5 74-112.7 129.8-200.6 129.8zM752 127.9c-121.5 0-220 98.5-220 220s98.5 220 220 220 220-98.5 220-220-98.5-220-220-220zM792 463h-40V298.7c-20 14-36.2 24.5-60 31.3v-41.8c11.5-2.9 23.8-10.4 36.7-17.6 13-7.9 23.8-7.7 32.4-27.7H792V463z"/> </svg> <svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink class="cp-random-icon cp-icon-dark" viewBox="0 0 1024 1024" version=1.1> <path d="M112 405.2h218.2c7.1 0 21 5.8 26 10.8l38 38.6c13.6 13.8 35.7 13.9 49.5 0.4 13.8-13.6 13.9-35.7 0.4-49.5l-38-38.6c-18.1-18.4-50-31.7-75.8-31.7H112c-19.3 0-35 15.7-35 35 0 19.4 15.7 35 35 35z m623.2 0h62.4v42.6c0 10.9 7.5 15 16.7 8.8l125.8-83.9c9.3-6.2 9.2-16.2 0-22.4l-125.8-83.9c-9.3-6.2-16.7-2.2-16.7 8.8v60h-62.4c-53.5 0-123.5 29.3-161 67.4L393.9 585.7c-24.3 24.7-76.4 46.5-111.1 46.5H112c-19.3 0-35 15.7-35 35s15.7 35 35 35h170.7c53.5 0 123.5-29.3 161-67.4L624 451.7c24.4-24.7 76.4-46.5 111.2-46.5z m79.1 161.2c-9.3-6.2-16.7-2.2-16.7 8.8v57H681.9c-6.9 0-20.2-5.6-25-10.4l-37.3-37.9c-13.6-13.8-35.7-13.9-49.5-0.4-13.8 13.6-13.9 35.7-0.4 49.5l37