PageSourceSearch

https://www.food-service.de/assets/e064064c900dd3a5449ba3d31c5e1c21.js

js food-service.de collected 2026-09-24 20:02:48 UTC 500,063 bytes, 13,998 lines download raw bytes

vendor: 33,966 bytes, lines 1-4
1/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
2!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=ma(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=na(b);function qa(){}qa.prototype=d.filters=d.pseudos,d.setFilters=new qa,g=ga.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?ga.error(a):z(a,i).slice(0)};function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;
3
4return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;
vendor: 5,438 bytes, line 4
4return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{}
vendor: 1,726 bytes, line 4
4,e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>
vendor: 11,646 bytes, line 4
4=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==ca()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===ca()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?aa:ba):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:ba,isPropagationStopped:ba,isImmediatePropagationStopped:ba,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=aa,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=aa,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=aa,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=ba;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=ba),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function da(a){var b=ea.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var ea="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fa=/ jQuery\d+="(?:null|\d+)"/g,ga=new RegExp("<(?:"+ea+")[\\s/>]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/<tbody/i,la=/<|&#?\w+;/,ma=/<(?:script|style|link)/i,na=/checked\s*(?:[^=]|=\s*.checked.)/i,oa=/^$|\/(?:java|ecma)script/i,pa=/^true\/(.*)/,qa=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ra={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?"<table>"!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if
vendor: 14,046 bytes, lines 4-5
4(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Ca[0].contentWindow||Ca[0].contentDocument).document,b.write(),b.close(),c=Ea(a,b),Ca.detach()),Da[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Ga=/^margin/,Ha=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ia,Ja,Ka=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ia=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Ha.test(g)&&Ga.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ia=function(a){return a.currentStyle},Ja=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ia(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Ha.test(g)&&!Ka.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function La(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Ma=/alpha\([^)]*\)/i,Na=/opacity\s*=\s*([^)]*)/,Oa=/^(none|table(?!-c[ea]).+)/,Pa=new RegExp("^("+S+")(.*)$","i"),Qa=new RegExp("^([+-])=("+S+")","i"),Ra={position:"absolute",visibility:"hidden",display:"block"},Sa={letterSpacing:"0",fontWeight:"400"},Ta=["Webkit","O","Moz","ms"];function Ua(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Ta.length;while(e--)if(b=Ta[e]+c,b in a)return b;return d}function Va(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fa(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wa(a,b,c){var d=Pa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Ya(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ia(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Ja(a,b,f),(0>e||null==e)&&(e=a.style[b]),Ha.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xa(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Ja(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ua(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qa.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ua(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Ja(a,b,d)),"normal"===f&&b in Sa&&(f=Sa[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Oa.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Ra,function(){return Ya(a,b,d)}):Ya(a,b,d):void 0},set:function(a,c,d){var e=d&&Ia(a);return Wa(a,c,d?Xa(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Na.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Ma,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Ma.test(f)?f.replace(Ma,e):f+" "+e)}}),m.cssHooks.marginRight=La(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Ja,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Ga.test(a)||(m.cssHooks[a+b].set=Wa)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ia(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Va(this,!0)},hide:function(){return Va(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Za(a,b,c,d,e){
5return new Za.prototype.init(a,b,c,d,e)}m.Tween=Za,Za.prototype={constructor:Za,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")},cur:function(){var a=Za.propHooks[this.prop];return a&&a.get?a.get(this):Za.propHooks._default.get(this)},run:function(a){var b,c=Za.propHooks[this.prop];return this.options.duration?this.pos=b=m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Za.propHooks._default.set(this),this}},Za.prototype.init.prototype=Za.prototype,Za.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Za.propHooks.scrollTop=Za.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Za.prototype.init,m.fx.step={};var $a,_a,ab=/^(?:toggle|show|hide)$/,bb=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cb=/queueHooks$/,db=[ib],eb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bb.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bb.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fa(a.nodeName):j,"inline"===l&&"n
vendor: 4,347 bytes, line 5
5one"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fa(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ab.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fa(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hb(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$a||fb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$a||fb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jb(k,j.opts.specialEasing);g>f;f++)if(d=db[f].call(j,a,k,j.opts))return d;return m.map(k,hb,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kb,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],eb[c]=eb[c]||[],eb[c].unshift(b)},prefilter:function(a,b){b?db.unshift(a):db.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kb(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gb(b,!0),a,d,e)}}),m.each({slideDown:gb("show"),slideUp:gb("hide"),slideToggle:gb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}}
vendor: 9,859 bytes, line 5
5,function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($a=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$a=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_a||(_a=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_a),_a=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lb=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lb,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mb,nb,ob=m.expr.attrHandle,pb=/^(?:checked|selected)$/i,qb=k.getSetAttribute,rb=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nb:mb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rb&&qb||!pb.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qb?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nb={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rb&&qb||!pb.test(c)?a.setAttribute(!qb&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=ob[b]||m.find.attr;ob[b]=rb&&qb||!pb.test(b)?function(a,b,d){var e,f;return d||(f=ob[b],ob[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,ob[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rb&&qb||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mb&&mb.set(a,b,c)}}),qb||(mb={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},ob.id=ob.name=ob.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mb.set},m.attrHooks.contenteditable={set:function(a,b,c){mb.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sb=/^(?:input|select|textarea|button|object)$/i,tb=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sb.test(a.nodeName)||tb.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var ub=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ub," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ub," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vb=m.now(),wb=/\?/,xb=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xb,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yb,zb,Ab=/#.*$/,Bb=/([?&])_=[^&]*/,Cb=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Db=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Eb=/^(?:GET|HEAD)$/,Fb=/^\/\//,Gb=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hb={},Ib={},Jb="*/".concat("*");try{zb=location.href}catch(Kb){zb=y.createElement("a"),zb.href="",zb=zb.href}yb=Gb.exec(zb.toLowerCase())||[];
vendor: 4,387 bytes, line 5
5function Lb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mb(a,b,c,d){var e={},f=a===Ib;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nb(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Ob(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zb,type:"GET",isLocal:Db.test(yb[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nb(Nb(a,m.ajaxSettings),b):Nb(m.ajaxSettings,a)},ajaxPrefilter:Lb(Hb),ajaxTransport:Lb(Ib),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cb.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zb)+"").replace(Ab,"").replace(Fb,yb[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gb.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yb[1]&&c[2]===yb[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yb[3]||("http:"===yb[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mb(Hb,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Eb.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wb.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bb.test(e)?e.replace(Bb,"$1_="+vb++):e+(wb.test(e)?"&":"?")+"_="+vb++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jb+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);
vendor: 10,546 bytes, lines 5-6
5if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mb(Ib,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Ob(k,v,c)),u=Pb(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qb=/%20/g,Rb=/\[\]$/,Sb=/\r?\n/g,Tb=/^(?:submit|button|image|reset|file)$/i,Ub=/^(?:input|select|textarea|keygen)/i;function Vb(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rb.test(a)?d(a,e):Vb(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vb(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vb(c,a[c],b,e);return d.join("&").replace(Qb,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Ub.test(this.nodeName)&&!Tb.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sb,"\r\n")}}):{name:b.name,value:c.replace(Sb,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zb()||$b()}:Zb;var Wb=0,Xb={},Yb=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xb)Xb[a](void 0,!0)}),k.cors=!!Yb&&"withCredentials"in Yb,Yb=k.ajax=!!Yb,Yb&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wb;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xb[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xb[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zb(){try{return new a.XMLHttpRequest}catch(b){}}function $b(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _b=[],ac=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_b.pop()||m.expando+"_"+vb++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ac.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ac.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ac,"$1"+e):b.jsonp!==!1&&(b.url+=(wb.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_b.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bc=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bc)return bc.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cc=a.document.documentElement;function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dc(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cc;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cc})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dc(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=La(k.pixelPosition,function(a,c){return c?(c=Ja(a,b),Ha.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ec=a.jQuery,fc=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fc),b&&a.jQuery===m&&(a.jQuery=ec),m},typeof b===K&&(a.jQuery=a.$=m),m});
6//# 
6
7var dfv_helper = (function() {
8  var o = {};
9  
10  o.flexslider_init = function(carousel_options, slider_options, pixelname, adoptions) {
11
12      $(document).ready(function() { 
13        var create_car = Object.getOwnPropertyNames(slider_options).length > 1;
14        var cs = 1, opos = {'ad': -1, 'at': -1};
15        adoptions = adoptions || {"adid": -1, "numpics": -1};
16        function ad_p (c) { return c > 0 && (++cs % c) === 0;}
17        function save_state(slider) {opos['ad'] = slider.animatingTo; opos['at'] = slider.animatingTo;}
18        function ad (slider, adid) {
19          if (adid === -1) return;
20          if (typeof ADTECH === "undefined") return;
21
22          save_state(slider);
23          var n = $(slider.slides[slider.animatingTo]);
24          n.children().hide();
25          n.append("<div class='gad' id='" + adid + "'></div>");          
26          $(".slider-subtitle").css("opacity","0");          
27          if (slider.currentSlide < slider.animatingTo) {
28            slider.currentSlide--;
29            slider.animatingTo--;
30          } else {
31            slider.currentSlide++;
32            slider.animatingTo++;
33          }
34          ADTECH.enqueueAd(adid);
35          
36        }
37        function rm (slider) {
38          var n = $(slider.slides[opos['ad']]);
39          n.children(".gad").remove();
40          $(".slider-subtitle").css("opacity","1");
41          n.children().show();
42          opos['ad'] = -1;
43        }
44        function ad_ad(slider) {
45          opos['ad'] > -1 && rm(slider);
46          ad_p(adoptions.numpics + 1) && ad(slider, adoptions.adid);
47        }
48
49        function getbefore (pixelname, fn) {
50            
51          if (pixelname && fn) {
52            return function(slider) {
53              fn(slider);
54            };
55          } else if (pixelname) {
56            return function(slider) {
57            };
58          } else if (fn) {
59            return function(slider) {
60              fn(slider);
61            };
62          } else {
63            return function(slider) {
64              ; //nothing
65            };
66          }
67        }
68        
69        function reloadAds(){
70          if (typeof ADTECH !== "undefined") {     
71            $.each( $(".banner"), function( key, value ) {
72              ADTECH.enqueueAd(parseInt($(value).attr("id")));
73            });
74            ADTECH.executeQueue();
75          }
76        }
77
78
79        if (create_car)
80        { 
81          var before_fn;
82          if (adoptions.adid !== -1 && slider_options.before) {
83            before_fn = function(slider) { ad_ad(slider); slider_options.before(slider); reloadAds(); };
84          } else if (adoptions.adid !== -1) {
85            before_fn = function(slider) { ad_ad(slider); reloadAds(); };
86          } else if (slider_options.before) {
87            before_fn = slider_options.before;
88          }
89            $(carousel_options.asNavFor).flexslider({
90                animation: "slide",
91                animationLoop: false,
92                controlNav: false,
93                prevText:' <i class="icon icon-chevron-left"></i>',
94                nextText:'<i class="icon icon-chevron-right"></i>',
95                multipleKeyboard: true,
96                slideshow: false,
97                itemWidth: slider_options.hasOwnProperty('itemWidth') ? slider_options.itemWidth : 0,
98                itemMargin: slider_options.hasOwnProperty('itemMargin') ? slider_options.itemMargin : 0,
99                move: slider_options.hasOwnProperty('move') ? slider_options.move : 0,
100                sync: slider_options.hasOwnProperty('sync') ? slider_options.sync : '',
101                start: slider_options.hasOwnProperty('start') ? slider_options.start : function(){},
102                after: slider_options.hasOwnProperty('after') ? slider_options.after : function(slider) { },
103                before: getbefore(pixelname, before_fn)
104            });
105        }
106
107        $(slider_options.sync).flexslider({
108                  animation: 'slide',
109                  animationLoop:  carousel_options.hasOwnProperty('animationLoop') ? carousel_options.animationLoop : false,
110                  controlNav: false,
111                  prevText:' <i class="icon icon-chevron-left"></i>',
112                  nextText:'<i class="icon icon-chevron-right"></i>',
113                  slideshow: carousel_options.hasOwnProperty('slideshow') ? carousel_options.slideshow : false,
114                  slideshowSpeed: carousel_options.hasOwnProperty('slideshowSpeed') ? carousel_options.slideshowSpeed : 7000,
115                  directionNav: carousel_options.hasOwnProperty('directionNav') ? carousel_options.directionNav : true,
116                  itemWidth: carousel_options.hasOwnProperty('itemWidth') ? carousel_options.itemWidth : 0,
117                  itemMargin: carousel_options.hasOwnProperty('itemMargin') ? carousel_options.itemMargin : 0,
118                  asNavFor: carousel_options.hasOwnProperty('asNavFor') ? carousel_options.asNavFor : '',
119                  after: carousel_options.hasOwnProperty('after') ? carousel_options.after() : function(){},
120                  before: create_car ? function(){} : getbefore(pixelname)
121                });
122    });
123  };
124  
125  function has_nodename(elm, name) {
126    if (elm.nodeName === name) return true;
127    var n = elm.parentNode;
128    while (n) {
129      if (n.nodeName === "FORM") return false;
130      if (n.nodeName === "BUTTON") return true;
131      n = n.parentNode;
132    }
133    return false;
134  }
135  
136  o.newsletter_arena_setup = function() {
137     if ($('#nl_order_form').length == 0) {
138       return;
139     }
140
141      // Check Form-Fields
142      $('#nl_order_form').on('click', function( event ) {
143
144        if (event.target.name === 'OKverify' || !has_nodename(event.target, 'BUTTON'))
145        {
146            return true;
147        }
148
149        event.preventDefault();
150        if($('#nl_form_error').length){
151          $('#nl_form_error').remove();
152        }
153        var self = $(this);
154        $.ajax({
155            url: self.attr("action"),
156            type: 'POST',
157            data: self.serialize(),
158            dataType: 'json',
159            success: function(data) {
160              var err_msg_nl = [];
161              $.each(data.error, function( key, val ) {
162                err_msg_nl.push(val);
163              });
164               dfv_iom_rpl();
165              var fo_send = {
166                'hitType': 'event',
167                'eventCategory': 'Newsletter-Bühne',
168                'eventAction': 'send',
169                'eventLabel': 'Success',
170                'page': window.location.pathname,
171                'location': window.location.href
172              };
173              if(err_msg_nl.length === 0) {
174                $('#nl_order_form').empty();
175                $('#nl_order_form').html(data.content);
176                dfv_ga_repl(fo_send);
177                
178              } else {
179                $("#i_us_csrf").val(data.csrf);
180                fo_send.eventLabel = "Error";
181                dfv_ga_repl(fo_send);
182                $('.newsletter.stage-publisher').append('<div id="nl_form_error"></div>');
183                $('#nl_form_error').html(err_msg_nl.join("<br/><br/>"));
184              }
185              
186            }
187          });
188      });
189
190  };
191  
192  o.popup_nl_arena_setup = function() {
193      var $form = $('#popup_nl_form');
194      if ($form.length == 0) {
195        return;
196      }
197      $($form).submit(function(event) {
198        var $this = $(this);
199        var $msg = $('#popup_nl_msg'); 
200        var errclass = 'err-ppp';
201        event.preventDefault();
202        if ($msg.hasClass(errclass)) {
203          $msg.removeClass(errclass);
204        }
205        $msg.empty();
206        $.ajax({
207          url: $this.attr("action"),
208          type: 'POST',
209          data: $this.serialize(),
210          dataType: 'json',
211          async: true,
212          success: function(data) {
213            var fo_subscribe = {
214              'hitType': 'event',
215              'eventCategory': 'newsletterbox',
216              'eventAction': 'subscribe',
217              'eventLabel': $("#popup_nl").attr("data-label"),
218              'page': window.location.pathname,
219              'location': window.location.href
220            };
221            $msg.css('padding-top', '2em');
222            if (data[0]) {
223              $this.remove();
224              dfv_ga_repl(fo_subscribe);
225            } else {
226              $msg.addClass('err-ppp');
227            }
228            $msg.html(data[1]);
229          }            
230        });
231      });
232  };
233  
234  o.storecheckcarousel_init = function(adoptions) {  
235    
236    $(document).ready(function() {
237        $( "section.storecheck .cs-item" ).hover(function() {
238          $( "img", this ).css( "opacity", "1" );
239        });
240        var options = {};
241        if($('#covercarousel').length){
242          $('#covercarousel').covercarousel(options);
243          $('#covercarousel').covercarousel.api.setAddAdVars(adoptions.adid,adoptions.numpics);
244
245          // Initialer Aufbau mit nur einem Bild
246          $.ajax({
247            url:  '/gallery/ajaxactions.php',
248            type: 'POST',
249            data: { action: 'loadgallery',
250                    i_news_id: $(".cover-nav span:first").attr('data-id'),
251                    i_gallery_id: $(".cover-nav span:nth-child(2)").attr('data-id'),
252                    i_special_id: $(".cover-nav span:nth-child(3)").attr('data-id')
253                  },
254            dataType: 'json',
255            success: function(covers) {
256              if (covers.length > 0){
257                $('#covercarousel').covercarousel.api.loadfirstCover(covers);
258                $(".cover-nav .cs-item:first").addClass("active");
259              } 
260              if (covers.length == 1) {
261                $(".cs_start").remove();
262              }
263            }
264          });
265          // Text der related News
266          $.ajax({
267            url:  '/gallery/ajaxactions.php',
268            type: 'POST',
269            data: { action: 'loadnews',
270                    i_news_id: $(".cover-nav span:first").attr('data-id'),
271                    i_special_id: $(".cover-nav span:nth-child(3)").attr('data-id')
272                  },
273            dataType: 'json',
274            success: function(text) { 
275              if(text.length > 0){  
276                $('.covertext').append("<a href=\""+text[0]['link']+"\" data-te=\"news"+text[0]['items_id']+"\"><div class=\"tagline\">"
277                                        +text[0]['kicker']+"</div>\n\
278                                       <h3 class=\"post-title x-large serif\">"+text[0]['title']+"</h3><p class=\"excerpt\">"+text[0]['shorttext']+" <span class=\"read-more\">Mehr&nbsp;›</span></p>\n\
279                                       </a>");
280                if(text[0]['special']){
281                  $('.covertext a:first').append('<p class="storecheck-hint"><img src="/img/storecheck.png" alt="360°-Tour starten" /> 360°-Tour starten ></p>');
282                }
283              }
284            }
285          });
286        }
287        // Covershow-Selektion, nachladen der Galerie-Bilder
288        $(".cover-nav .cs-item").on("click", function(event){
289          
290            $('#covercarousel').covercarousel.api.setAddAdVars(adoptions.adid,adoptions.numpics);
291          
292            $(".cover-nav .cs-item.active").removeClass("active");
293            $(this).addClass("active");
294            $.ajax({
295               url:  '/gallery/ajaxactions.php',
296               type: 'POST',
297               data: { action: 'loadgallery',
298                       i_news_id: $(":first", this).attr('data-id'),
299                       i_gallery_id: $(":nth-child(2)", this).attr('data-id'),
300                       i_special_id: $(":nth-child(3)", this).attr('data-id'),
301                     },
302               dataType: 'json',
303               success: function(covers) { 
304                 if (covers.length > 0){ 
305                   $(".cs_start").remove();
306                   $(".storecheck .cevents .nextcover").show();
307                   $('#covercarousel').covercarousel.api.loadCovers(covers);
308                   $(".cover-nav .cs-item").css("border-top", "");
309                   $(".cover-nav .cs-item").css("padding-top", "");
310                 } 
311                 if (covers.length == 1) {
312                   $(".storecheck .cevents .nextcover").hide();
313                   $(".cs_start").remove();
314                 }
315               }
316             });
317          // Text der related News
318          $.ajax({
319            url:  '/gallery/ajaxactions.php',
320            type: 'POST',
321            data: { action: 'loadnews',
322                    i_news_id: $(":first", this).attr('data-id'),
323                    i_special_id: $(":nth-child(3)", this).attr('data-id'),
324                  },
325            dataType: 'json',
326            success: function(text) {
327              if(text.length > 0){
328               $('.covertext').empty();
329               $('.covertext').css('display', 'block');
330               $('.covertext').append("<a href=\""+text[0]['link']+"\" data-te=\"news"+text[0]['items_id']+"\"><div class=\"tagline\">"+text[0]['kicker']+"</div><h3 class=\"post-title x-large serif\">"+text[0]['title']+"</h3><p class=\"excerpt\">"+text[0]['shorttext']+" <span class=\"read-more\">Mehr&nbsp;›</span></p></a>");
331               if(text[0]['special']){
332                  $('.covertext a:first').append('<p class="storecheck-hint"><img src="/img/storecheck.png" alt="360°-Tour starten" /> 360°-Tour starten ></p>');
333                }
334              }
335            }
336          });
337
338        });
339        
340        // Button zum Covershow-Start
341        $("body").on("click",".cs_start", function(){
342            $(".cs_start").remove();
343
344            $.ajax({
345               url:  '/gallery/ajaxactions.php',
346               type: 'POST',
347               data: { action: 'loadgallery',
348                       i_news_id: $(".cover-nav span:first").attr('data-id'),
349                       i_gallery_id: $(".cover-nav span:nth-child(2)").attr('data-id'),
350                       i_special_id: $(".cover-nav span:nth-child(3)").attr('data-id')
351                     },
352               dataType: 'json',
353               success: function(covers) {
354                 if(covers.length > 0){
355                   $('#covercarousel').covercarousel.api.loadCovers(covers);
356                   $(".cover-nav .cs-item").css("border-top", "");
357                   $(".cover-nav .cs-item").css("padding-top", "");
358                   $('#covercarousel').covercarousel.api.nextCover();
359                 }
360               }
361             });
362        });
363        
364      /* Touch Gesten für Storecheck Bühne */
365      var touchPos, touchMove;      
366      $("#covercarousel").on("touchstart", ".cover-inner, .sad", function(e){
367        touchPos = e.originalEvent.touches[0].pageX;
368      });
369      
370      $("#covercarousel").on("touchmove", ".cover-inner, .sad", function(e){  
371       e.preventDefault();
372       touchMove = e.originalEvent.touches[0].pageX;
373       // Zieh-Effekt darstellen
374       var margin = touchMove - touchPos;
375       $(this).css("margin-left", margin);
376       
377      });
378      
379      $("#covercarousel").on("touchend", ".cover-inner, .sad", function(e){
380        $(this).css("margin-left", 0);
381        var touchDiff = touchPos - touchMove;         
382
383          if(touchDiff < -80){
384            // vorheriges Bild
385            console.log("prev");
386            
387            // Nicht beim ersten Bild
388            if(!$(this).is($("#covercarousel .coverbox .cover-inner").first())){
389              $('#covercarousel').covercarousel.api.prevCover();
390            }
391          }
392          else if(touchDiff > 80){
393            if($("#covercarousel .coverbox .cover-inner").length == 1){
394              console.log("start");
395              $(".cs_start").click();
396            }
397            else{            
398              // nächstes Bild
399              console.log("next");
400              $('#covercarousel').covercarousel.api.nextCover();
401            }
402          }
403      });
404      
405      
406    
407    });
408  };  
409  
410  o.newsletter_single_arena_setup = function() {
411    if ($('#nl_order_single_form').length == 0) {
412      return;
413    }
414    // Check Form-Fields
415    $('#nl_order_single_form').on('click', function( event ) {
416
417        if (event.target.name === 'OKverify' || !has_nodename(event.target, 'BUTTON')) {
418          return true;
419        }
420        event.preventDefault();
421        var arena_title  = $('#nl_order_single_form [name=i_nlsingle_title]').val();
422
423        var self = $(this);
424        var url = self.attr("action");
425
426        $.ajax({
427          url: self.attr("action"),
428          type: 'POST',
429          data: self.serialize(),
430          dataType: 'json',
431          async: true,
432          success: function(data) {
433            var err_msg_nl = [];
434            if (data.error){
435              $.each(data.error, function( key, val ) {
436                err_msg_nl.push(val);
437              });
438            }
439            dfv_iom_rpl();
440            var fo_send = {
441              'hitType': 'event',
442              'eventCategory': 'Newsletter-Single-Bühne '+ arena_title,
443              'eventAction': 'send',
444              'eventLabel': 'Success',
445              'page': window.location.pathname,
446              'location': window.location.href
447            };
448            if (err_msg_nl.length === 0) {
449              $('#nl_order_single_form').empty();
450              $('#nl_order_single_form').html(data.content);
451              dfv_ga_repl(fo_send);
452            } else {
453              $("#i_us_csrf").val(data.csrf);
454              fo_send.eventLabel = "Error";
455              dfv_ga_repl(fo_send);
456            }
457            $('#nl_single_form_error').html(err_msg_nl.join("<br /><br />")).css('display', 'block');
458          }
459        });
460    });
461
462    };
463    
464  o.youtube_ga_events = function(event, category, label) {
465        let state = event.data;
466        if(state === YT.PlayerState.PLAYING){
467          var fo_play = {
468            'hitType': 'event',
469            'eventCategory': category,
470            'eventAction': 'play',
471            'eventLabel': label,
472            'page': window.location.pathname,
473            'location': window.location.href
474            }; 
475          dfv_ga_repl(fo_play);
476        }
477        if(state === YT.PlayerState.PAUSED){
478          var fo_pause = {
479            'hitType': 'event',
480            'eventCategory': category,
481            'eventAction': 'pause',
482            'eventLabel': label,
483            'page': window.location.pathname,
484            'location': window.location.href
485            }; 
486          dfv_ga_repl(fo_pause);
487        }
488        if(state === YT.PlayerState.ENDED){
489          var fo_complete = {
490            'hitType': 'event',
491            'eventCategory': category,
492            'eventAction': 'complete',
493            'eventLabel': label,
494            'page': window.location.pathname,
495            'location': window.location.href
496            }; 
497          dfv_ga_repl(fo_complete);
498        }
499  };
500  
501  return o;
502})();
503
504(function webpackUniversalModuleDefinition(root, factory) {
505	if(typeof exports === 'object' && typeof module === 'object')
506		module.exports = factory();
507	else if(typeof define === 'function' && define.amd)
508		define("Amplitude", [], factory);
509	else if(typeof exports === 'object')
510		exports["Amplitude"] = factory();
511	else
512		root["Amplitude"] = factory();
513})(this, function() {
514return /******/ (function(modules) { // webpackBootstrap
515/******/ 	// The module cache
516/******/ 	var installedModules = {};
517/******/
518/******/ 	// The require function
519/******/ 	function __webpack_require__(moduleId) {
520/******/
521/******/ 		// Check if module is in cache
522/******/ 		if(installedModules[moduleId]) {
523/******/ 			return installedModules[moduleId].exports;
524/******/ 		}
525/******/ 		// Create a new module (and put it into the cache)
526/******/ 		var module = installedModules[moduleId] = {
527/******/ 			i: moduleId,
528/******/ 			l: false,
529/******/ 			exports: {}
530/******/ 		};
531/******/
532/******/ 		// Execute the module function
533/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
534/******/
535/******/ 		// Flag the module as loaded
vendor: 4,320 bytes, lines 536-700
536/******/ 		module.l = true;
537/******/
538/******/ 		// Return the exports of the module
539/******/ 		return module.exports;
540/******/ 	}
541/******/
542/******/
543/******/ 	// expose the modules object (__webpack_modules__)
544/******/ 	__webpack_require__.m = modules;
545/******/
546/******/ 	// expose the module cache
547/******/ 	__webpack_require__.c = installedModules;
548/******/
549/******/ 	// identity function for calling harmony imports with the correct context
550/******/ 	__webpack_require__.i = function(value) { return value; };
551/******/
552/******/ 	// define getter function for harmony exports
553/******/ 	__webpack_require__.d = function(exports, name, getter) {
554/******/ 		if(!__webpack_require__.o(exports, name)) {
555/******/ 			Object.defineProperty(exports, name, {
556/******/ 				configurable: false,
557/******/ 				enumerable: true,
558/******/ 				get: getter
559/******/ 			});
560/******/ 		}
561/******/ 	};
562/******/
563/******/ 	// getDefaultExport function for compatibility with non-harmony modules
564/******/ 	__webpack_require__.n = function(module) {
565/******/ 		var getter = module && module.__esModule ?
566/******/ 			function getDefault() { return module['default']; } :
567/******/ 			function getModuleExports() { return module; };
568/******/ 		__webpack_require__.d(getter, 'a', getter);
569/******/ 		return getter;
570/******/ 	};
571/******/
572/******/ 	// Object.prototype.hasOwnProperty.call
573/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
574/******/
575/******/ 	// __webpack_public_path__
576/******/ 	__webpack_require__.p = "";
577/******/
578/******/ 	// Load entry module and return exports
579/******/ 	return __webpack_require__(__webpack_require__.s = 47);
580/******/ })
581/************************************************************************/
582/******/ ([
583/* 0 */
584/***/ (function(module, exports, __webpack_require__) {
585
586"use strict";
587
588
589var _package = __webpack_require__(59);
590
591module.exports = {
592  version: _package.version,
593
594  audio: new Audio(),
595
596  active_metadata: {},
597
598  active_album: "",
599
600  active_index: 0,
601
602  active_playlist: null,
603
604  playback_speed: 1.0,
605
606  callbacks: {},
607
608  songs: [],
609
610  playlists: {},
611
612  start_song: "",
613
614  starting_playlist: "",
615
616  starting_playlist_song: "",
617
618  repeat: false,
619
620  repeat_song: false,
621
622  shuffle_list: {},
623
624  shuffle_on: false,
625
626  default_album_art: "",
627
628  default_playlist_art: "",
629
630  debug: false,
631
632  volume: 0.5,
633
634  pre_mute_volume: 0.5,
635
636  volume_increment: 5,
637
638  volume_decrement: 5,
639
640  soundcloud_client: "",
641
642  soundcloud_use_art: false,
643
644  soundcloud_song_count: 0,
645
646  soundcloud_songs_ready: 0,
647
648  is_touch_moving: false,
649
650  buffered: 0,
651
652  bindings: {},
653
654  continue_next: true,
655
656  delay: 0,
657
658  player_state: "stopped",
659
660  web_audio_api_available: false,
661
662  context: null,
663
664  source: null,
665
666  analyser: null,
667
668  visualizations: {
669    available: [],
670
671    active: [],
672
673    backup: ""
674  },
675
676  waveforms: {
677    sample_rate: 100,
678
679    built: []
680  }
681}; /**
682    * These variables make Amplitude run. The config is the most important
683    * containing active settings and parameters.
684    *
685    * The config JSON is the global settings for ALL of Amplitude functions.
686    * This is global and contains all of the user preferences. The default
687    * settings are set, and the user overwrites them when they initialize
688    * Amplitude.
689    *
690    * @module config
691    * @type {object}
692    * @property {string}  	config.version          				- The current version of AmplitudeJS.
693    * @property {object} 	config.audio 		 								-	Handles all of the audio.
694    * @property {object} 	config.active_metadata					- Contains the active metadata for the song.
695    * @property {string} 	config.active_album							- Holds the active album name. Used to check and see if the album changed and run the album changed callback.
696    * @property {number} 	config.active_index							- Contains the index of the actively playing song.
697    * @property {string} 	config.active_playlist					- Contains the key to the active playlist index.
698    * @property {number} 	config.playback_speed						- Sets the initial playback speed of the song. The values for this can be 1.0, 1.5, 2.0
699    * @property {object} 	config.callbacks								- The user can pass a JSON object with a key => value store of callbacks to be run at certain events.
700    * @property {array}
700 		config.songs										- Contains all of the songs the user has passed to Amplitude to use.
701    * @property {object} 	config.playlists								- Contains all of the playlists the user created.
702    * @property {object} 	config.start_song 							- The index of the song that AmplitudeJS should start with.
703    * @property {string} 	config.starting_playlist 				- The starting playlist the player will intiialize to.
704    * @property {string} 	config.starting_playlist_song 	- The index of the song in the playlist that should be started.
705    * @property {boolean} 	config.repeat 									- When repeat is on, when the song ends the song will replay itself.
706    * @property {object} 	config.shuffle_list							- When shuffled, gets populated with the songs the user provided in a random order.
707    * @property {boolean} 	config.shuffle_on								- When on, gets set to true so when traversing through songs, AmplitudeJS knows whether or not to use the songs object or the shuffle_list
708    * @property {string}		config.default_album_art 				- The user can set default album art to be displayed if the song they set doesn't contain album art.
709    * @property {string} 	config.default_playlist_art 		- The user can set default playlist art to be displayed if the playlist they are setting meta data for doesn't contain an art picture.
710    * @property {boolean} 	config.debug										- When set to true, AmplitudeJS will print to the console any errors providing helpful feedback to the user.
711    * @property {number} 	config.volume 									- The user can set the initial volume to a number between 0 and 1 over-riding the default of .5
712    * @property {number} 	config.pre_mute_volume 					- This is set on mute so that when a user un-mutes AmplitudeJS knows what to restore the volume to.
713    * @property {number}		config.volume_increment 				- The default values are an integer between 1 and 100 for how much the volume should increase when the user presses the volume up button.
714    * @property {number}		config.volume_decrement 				- The default values are an integer between 1 and 100 for how much the volume should decrease when the user presses the volume down button.
715    * @property {string} 	config.soundcloud_client 				- When using SoundCloud, the user will have to provide their API Client ID
716    * @property {boolean} 	config.soundcloud_use_art 			- The user can set this to true and AmplitudeJS will use the album art for the song returned from the Soundcloud API
717    * @property {number} 	config.soundcloud_song_count 		- Used on config to count how many songs are from Soundcloud and compare it to how many are ready for when to move to the rest of the configuration
718    * @property {number} 	config.soundcloud_songs_ready 	- Used on config to count how many songs are ready so when we get all of the data from the SoundCloud API that we need this should match the SoundCloud song count meaning we can move to the rest of the config.
719    * @property {integer}	config.is_touch_moving 					- Flag for if the user is moving the screen.
720    * @property {boolean}	config.buffered									- How much of the song is buffered.
721    * @property {object} 	config.bindings									- Array of bindings to certain key events.
722    * @property {boolean} 	config.continue_next 						- Determines when a song ends, we should continue to the next song.
723    * @property {number}   config.delay 										- Sets the delay between songs in MS.
724    * @property {boolean}  config.use_web_audio_api 				- Flag that determines if the user wants to use Web Audio API Components.
725    * @property {boolean}  config.web_audio_api_available  - Flag that determines if the Web Audio API is available.
726    * @property {object}  	config.context 									- Web Audio API Context
727    * @property {object}		config.source 									- Web Audio API Source
728    * @property {object} 	config.analyser 								- Web Audio API Analyser
729    * @property {string}		config.player_state 						- The current state of the player.
730    */
731
732/***/ }),
733/* 1 */
734/***/ (function(module, exports, __webpack_require__) {
735
736"use strict";
737
738
739Object.defineProperty(exports, "__esModule", {
740  value: true
741});
742
743var _config = __webpack_require__(0);
744
745var _config2 = _interopRequireDefault(_config);
746
747var _checks = __webpack_require__(5);
748
749var _checks2 = _interopRequireDefault(_checks);
750
751var _audioNavigation = __webpack_require__(3);
752
753var _audioNavigation2 = _interopRequireDefault(_audioNavigation);
754
755var _playPauseElements = __webpack_require__(2);
756
757var _playPauseElements2 = _interopRequireDefault(_playPauseElements);
758
759var _metaDataElements = __webpack_require__(8);
760
761var _metaDataElements2 = _interopRequireDefault(_metaDataElements);
762
763var _callbacks = __webpack_require__(7);
764
765var _callbacks2 = _interopRequireDefault(_callbacks);
766
767var _debug = __webpack_require__(4);
768
769var _debug2 = _interopRequireDefault(_debug);
770
771var _visualizations = __webpack_require__(16);
772
773var _visualizations2 = _interopRequireDefault(_visualizations);
774
775function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
776
777/**
778 * Interacts directly with native functions of the Audio element. Logic
779 * leading up to these methods are handled by click handlers which call
780 * helpers and visual synchronizers. These are the core functions of AmplitudeJS.
781 * Every other function that leads to these prepare the information to be
782 * acted upon by these functions.
783 *
784 * @module core/Core
785 */
786
787
788/**
789 * Imports AmplitudeJS Debug Utility
790 * @module utilities/debug
791 */
792
793
794/**
795 * Imports the Meta Data Visual Elements module.
796 * @module visual/metaDataElements
797 */
798
799
800/**
801 * Imports the Audio Navigation module.
802 * @module utilities/audioNavigation
803 */
804/**
805 * Imports the config module
806 * @module config
807 */
808var Core = function () {
809  /**
810   * Plays the active song. If the current song is live, it reconnects
811   * the stream before playing.
812   *
813   * Public Accessor: Amplitude.play()
814   *
815   * @access public
816   */
817  function play() {
818    _visualizations2.default.stop();
819    _visualizations2.default.run();
820
821    /*
822    If the audio is live we re-conenct the stream.
823    */
824    if (_config2.default.active_metadata.live) {
825      reconnectStream();
826    }
827
828    /*
829    Mobile remote sources need to be reconnected on play. I think this is
830    because mobile browsers are optimized not to load all resources
831    for speed reasons. We only do this if mobile and the paused button
832    is not clicked. If the pause button was clicked then we don't reconnect
833    or the user will lose their place in the stream.
834    */
835    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) && !_config2.default.paused) {
836      reconnectStream();
837    }
838
839    /*
840    Play the song and set the playback rate to the playback
841    speed.
842    */
vendor: 26,871 bytes, lines 843-1834
843    var playPromise = _config2.default.audio.play();
844
845    if (playPromise !== undefined) {
846      playPromise.then(function (_) {}).catch(function (error) {});
847    }
848    _config2.default.audio.play();
849    _config2.default.audio.playbackRate = _config2.default.playback_speed;
850  }
851
852  /**
853   * Pauses the active song. If it's live, it disconnects the stream.
854   *
855   * Public Accessor: Amplitude.pause()
856   *
857   * @access public
858   */
859  function pause() {
860    _visualizations2.default.stop();
861
862    /*
863    Pause the active song.
864    */
865    _config2.default.audio.pause();
866
867    /*
868    Flag that pause button was clicked.
869    */
870    _config2.default.paused = true;
871
872    /*
873    If the song is live, we disconnect the stream so we aren't
874    saving it to memory.
875    */
876    if (_config2.default.active_metadata.live) {
877      disconnectStream();
878    }
879  }
880
881  /**
882   * Stops the active song by setting the current song time to 0.
883   * When the user resumes, it will be from the beginning.
884   * If it's a live stream it disconnects.
885   *
886   * Public Accessor: Amplitude.stop()
887   *
888   * @access public
889   */
890  function stop() {
891    _visualizations2.default.stop();
892
893    /*
894    Set the current time of the song to 0 which will reset the song.
895    */
896    if (_config2.default.audio.currentTime != 0) {
897      _config2.default.audio.currentTime = 0;
898    }
899
900    /*
901    Run pause so the song will stop
902    */
903    _config2.default.audio.pause();
904
905    /*
906    If the song is live, disconnect the stream.
907    */
908    if (_config2.default.active_metadata.live) {
909      disconnectStream();
910    }
911
912    /*
913    Run the stop callback
914    */
915    _callbacks2.default.run("stop");
916  }
917
918  /**
919   * Sets the song volume.
920   *
921   * Public Accessor: Amplitude.setVolume( volumeLevel )
922   *
923   * @access public
924   * @param {number} volumeLevel - A number between 1 and 100 as a percentage of
925   * min to max for a volume level.
926   */
927  function setVolume(volumeLevel) {
928    /*
929    If the volume is set to mute somewhere else, we sync the display.
930    */
931    if (volumeLevel == 0) {
932      _config2.default.audio.muted = true;
933    } else {
934      _config2.default.audio.muted = false;
935    }
936
937    /*
938    Sets the volume in the config so we can reference it later on.
939    */
940    _config2.default.volume = volumeLevel;
941
942    /*
943    Set the volume of the active song.
944    */
945    _config2.default.audio.volume = volumeLevel / 100;
946  }
947
948  /**
949   * Sets the song percentage. If it's a live song, we ignore this because
950   * we can't skip ahead. This is an issue if you have a playlist with
951   * a live source.
952   *
953   * Public Accessor: Amplitude.setSongLocation( songPercentage )
954   *
955   * @access public
956   * @param {number} songPercentage - A number between 1 and 100 as a percentage of song completion.
957   */
958  function setSongLocation(songPercentage) {
959    /*
960    As long as the song is not live, we can set the current time of the
961    song to the percentage the user passed in.
962    */
963    if (!_config2.default.active_metadata.live) {
964      _config2.default.audio.currentTime = _config2.default.audio.duration * (songPercentage / 100);
965    }
966  }
967
968  /**
969   * Skips to a location in a song
970   *
971   * Public Accessor: Amplitude.skipToLocation( seconds )
972   *
973   * @access public
974   * @param {number} seconds - An integer containing the seconds to skip to
975   */
976  function skipToLocation(seconds) {
977    /*
978    When the active song can be played through, we can check to
979    see if the seconds will work. We only bind the event handler
980    once and remove it once it's fired.
981    */
982    _config2.default.audio.addEventListener("canplaythrough", function () {
983      /*
984      If the active song duration is greater than or equal to the
985      amount of seconds the user wants to skip to and the seconds
986      is greater than 0, we skip to the seconds defined.
987      */
988      if (_config2.default.audio.duration >= seconds && seconds > 0) {
989        _config2.default.audio.currentTime = seconds;
990      } else {
991        _debug2.default.writeMessage("Amplitude can't skip to a location greater than the duration of the audio or less than 0");
992      }
993    }, { once: true });
994  }
995
996  /**
997   * Disconnects the live stream
998   *
999   * Public Accessor: Amplitude.disconnectStream()
1000   *
1001   * @access public
1002   */
1003  function disconnectStream() {
1004    _config2.default.audio.src = "";
1005    _config2.default.audio.load();
1006  }
1007
1008  /**
1009   * Reconnects the live stream
1010   *
1011   * Public Accessor: Amplitude.reconnectStream()
1012   *
1013   * @access public\
1014   */
1015  function reconnectStream() {
1016    _config2.default.audio.src = _config2.default.active_metadata.url;
1017    _config2.default.audio.load();
1018  }
1019
1020  /**
1021   * Sets the playback speed for the song.
1022   *
1023   * @param {number} playbackSpeed The speed we want the song to play back at.
1024   */
1025  function setPlaybackSpeed(playbackSpeed) {
1026    /*
1027    Set the config playback speed.
1028    */
1029    _config2.default.playback_speed = playbackSpeed;
1030
1031    /*
1032    Set the active song playback rate.
1033    */
1034    _config2.default.audio.playbackRate = _config2.default.playback_speed;
1035  }
1036
1037  /*
1038  Return publically facing functions
1039  */
1040  return {
1041    play: play,
1042    pause: pause,
1043    stop: stop,
1044    setVolume: setVolume,
1045    setSongLocation: setSongLocation,
1046    skipToLocation: skipToLocation,
1047    disconnectStream: disconnectStream,
1048    reconnectStream: reconnectStream,
1049    setPlaybackSpeed: setPlaybackSpeed
1050  };
1051}();
1052
1053/**
1054 * Import the Visualizations from the FX module.
1055 * @module fx/visualizations
1056 */
1057
1058
1059/**
1060 * Imports AmplitudeJS Callback Utility
1061 * @module utilities/callbacks
1062 */
1063
1064
1065/**
1066 * Imports the Play/Pause Visual Elements module.
1067 * @module visual/playPauseElements
1068 */
1069
1070
1071/**
1072 * Imports the Checks module.
1073 * @module utilities/checks
1074 */
1075exports.default = Core;
1076module.exports = exports["default"];
1077
1078/***/ }),
1079/* 2 */
1080/***/ (function(module, exports, __webpack_require__) {
1081
1082"use strict";
1083
1084
1085Object.defineProperty(exports, "__esModule", {
1086  value: true
1087});
1088
1089var _config = __webpack_require__(0);
1090
1091var _config2 = _interopRequireDefault(_config);
1092
1093function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1094
1095/**
1096 * Defines the visual representation of AmplitudeJS play pause elements.
1097 * @module visual/PlayPauseElements
1098 */
1099var PlayPauseElements = function () {
1100  /**
1101   * Syncs all play pause elements.
1102   *
1103   * @access public
1104   */
1105  function sync() {
1106    syncGlobal();
1107    syncPlaylist();
1108    syncSong();
1109    syncSongInPlaylist();
1110  }
1111
1112  /**
1113   * Syncs the global play pause buttons to the state of the active song.
1114   *
1115   * @access public
1116   */
1117  function syncGlobal() {
1118    /*
1119      Get the active song state.
1120    */
1121    var state = _config2.default.audio.paused ? "paused" : "playing";
1122
1123    /*
1124      Get all play pause buttons.
1125    */
1126    var playPauseElements = document.querySelectorAll(".amplitude-play-pause");
1127
1128    /*
1129      Iterate over all of the play pause elements syncing the
1130      display visually.
1131    */
1132    for (var i = 0; i < playPauseElements.length; i++) {
1133      /*
1134        Grab the playlist and song attributes from the element.
1135      */
1136      var playlist = playPauseElements[i].getAttribute("data-amplitude-playlist");
1137      var song = playPauseElements[i].getAttribute("data-amplitude-song-index");
1138
1139      /*
1140        This method is responsible for only the global elements,
1141        so we make sure there are no playlist or songs defined on
1142        the element.
1143      */
1144      if (playlist == null && song == null) {
1145        /*
1146          Determines what classes we should add and remove
1147          from the elements.
1148        */
1149        switch (state) {
1150          case "playing":
1151            setElementPlay(playPauseElements[i]);
1152            break;
1153          case "paused":
1154            setElementPause(playPauseElements[i]);
1155            break;
1156        }
1157      }
1158    }
1159  }
1160
1161  /**
1162   * Syncs the main playlist play pause buttons to the state of the active song.
1163   *
1164   * @access public
1165   */
1166  function syncPlaylist() {
1167    var state = _config2.default.audio.paused ? "paused" : "playing";
1168
1169    /*
1170      Get all of the main playlist play pause elements
1171    */
1172    var playlistPlayPauseElements = document.querySelectorAll('.amplitude-play-pause[data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
1173
1174    /*
1175      Iterate over the play pause elements, syncing the state accordingly.
1176    */
1177    for (var i = 0; i < playlistPlayPauseElements.length; i++) {
1178      /*
1179        Grab the song attributes from the element.
1180      */
1181      var song = playlistPlayPauseElements[i].getAttribute("data-amplitude-song-index");
1182
1183      /*
1184        We want only the play pause elements for the main on a
1185        playlist nothing else. We have another method for the
1186        song in playlist play pause method.
1187      */
1188      if (song == null) {
1189        /*
1190          Determines what classes we should add and remove
1191          from the elements.
1192        */
1193        switch (state) {
1194          case "playing":
1195            setElementPlay(playlistPlayPauseElements[i]);
1196            break;
1197          case "paused":
1198            setElementPause(playlistPlayPauseElements[i]);
1199            break;
1200        }
1201      }
1202    }
1203  }
1204
1205  /**
1206   * Syncs the song play pause buttons to the state of the active song.
1207   *
1208   * @access public
1209   */
1210  function syncSong() {
1211    var state = _config2.default.audio.paused ? "paused" : "playing";
1212
1213    /*
1214      Get all of the individual song play pause buttons. These have an
1215      amplitude-song-index that matches the active index attribute.
1216    */
1217    var songPlayPauseElements = document.querySelectorAll('.amplitude-play-pause[data-amplitude-song-index="' + _config2.default.active_index + '"]');
1218
1219    /*
1220      Iterate over all of the song play pause elements
1221    */
1222    for (var i = 0; i < songPlayPauseElements.length; i++) {
1223      /*
1224        Grab the playlist attributes from the element.
1225      */
1226      var playlist = songPlayPauseElements[i].getAttribute("data-amplitude-playlist");
1227
1228      /*
1229        We want only the song play pause buttons, not ones scoped in a playlist.
1230      */
1231      if (playlist == null) {
1232        /*
1233          Determines what classes we should add and remove
1234          from the elements.
1235        */
1236        switch (state) {
1237          case "playing":
1238            setElementPlay(songPlayPauseElements[i]);
1239            break;
1240          case "paused":
1241            setElementPause(songPlayPauseElements[i]);
1242            break;
1243        }
1244      }
1245    }
1246  }
1247
1248  /**
1249   * Syncs the song in playlist play pause buttons to the state of
1250   * the active song.
1251   *
1252   * @access public
1253   */
1254  function syncSongInPlaylist() {
1255    var state = _config2.default.audio.paused ? "paused" : "playing";
1256
1257    var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null;
1258
1259    /*
1260      Get all of the individual song play pause buttons. These have an
1261      amplitude-song-index attribute. Some have amplitude-playlist which
1262      means they are individual songs within a playlist.
1263    */
1264    var songInPlaylistPlayPauseElements = document.querySelectorAll('.amplitude-play-pause[data-amplitude-song-index="' + activePlaylistIndex + '"][data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
1265
1266    /*
1267      Iterate over all of the individual play pause elements for songs inspect
1268      a playlist.
1269    */
1270    for (var i = 0; i < songInPlaylistPlayPauseElements.length; i++) {
1271      /*
1272        Determines what classes we should add and remove
1273        from the elements.
1274      */
1275      switch (state) {
1276        case "playing":
1277          setElementPlay(songInPlaylistPlayPauseElements[i]);
1278          break;
1279        case "paused":
1280          setElementPause(songInPlaylistPlayPauseElements[i]);
1281          break;
1282      }
1283    }
1284  }
1285
1286  /**
1287   * Sets all of the play pause buttons to paused.
1288   *
1289   * @access public
1290   */
1291  function syncToPause() {
1292    /*
1293      Gets all of the play pause elements
1294    */
1295    var playPauseElements = document.querySelectorAll(".amplitude-play-pause");
1296
1297    /*
1298      Sets all of the elements to pause
1299    */
1300    for (var i = 0; i < playPauseElements.length; i++) {
1301      setElementPause(playPauseElements[i]);
1302    }
1303  }
1304
1305  /**
1306   * Sets an element to be playing by removing the 'amplitude-paused' class
1307   * and adding the 'amplitude-playing' class
1308   *
1309   * @access public
1310   * @param {element} element 	- The element getting the playing class added.
1311   */
1312  function setElementPlay(element) {
1313    element.classList.add("amplitude-playing");
1314    element.classList.remove("amplitude-paused");
1315  }
1316
1317  /**
1318   * Sets an element to be paused by adding the 'amplitude-paused' class
1319   * and removing the 'amplitude-playing' class
1320   *
1321   * @access public
1322   * @param {element} element 	- The element getting the paused class added.
1323   */
1324  function setElementPause(element) {
1325    element.classList.remove("amplitude-playing");
1326    element.classList.add("amplitude-paused");
1327  }
1328
1329  /**
1330   * Returns the public facing methods
1331   */
1332  return {
1333    sync: sync,
1334    syncGlobal: syncGlobal,
1335    syncPlaylist: syncPlaylist,
1336    syncSong: syncSong,
1337    syncSongInPlaylist: syncSongInPlaylist,
1338    syncToPause: syncToPause
1339  };
1340}(); /**
1341      * Imports the config module
1342      * @module config
1343      */
1344exports.default = PlayPauseElements;
1345module.exports = exports["default"];
1346
1347/***/ }),
1348/* 3 */
1349/***/ (function(module, exports, __webpack_require__) {
1350
1351"use strict";
1352
1353
1354Object.defineProperty(exports, "__esModule", {
1355  value: true
1356});
1357
1358var _config = __webpack_require__(0);
1359
1360var _config2 = _interopRequireDefault(_config);
1361
1362var _core = __webpack_require__(1);
1363
1364var _core2 = _interopRequireDefault(_core);
1365
1366var _callbacks = __webpack_require__(7);
1367
1368var _callbacks2 = _interopRequireDefault(_callbacks);
1369
1370var _checks = __webpack_require__(5);
1371
1372var _checks2 = _interopRequireDefault(_checks);
1373
1374var _playPauseElements = __webpack_require__(2);
1375
1376var _playPauseElements2 = _interopRequireDefault(_playPauseElements);
1377
1378var _songSliderElements = __webpack_require__(14);
1379
1380var _songSliderElements2 = _interopRequireDefault(_songSliderElements);
1381
1382var _songPlayedProgressElements = __webpack_require__(20);
1383
1384var _songPlayedProgressElements2 = _interopRequireDefault(_songPlayedProgressElements);
1385
1386var _timeElements = __webpack_require__(15);
1387
1388var _timeElements2 = _interopRequireDefault(_timeElements);
1389
1390var _metaDataElements = __webpack_require__(8);
1391
1392var _metaDataElements2 = _interopRequireDefault(_metaDataElements);
1393
1394var _containerElements = __webpack_require__(49);
1395
1396var _containerElements2 = _interopRequireDefault(_containerElements);
1397
1398function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1399
1400/**
1401 * AmplitudeJS Audio Navigation Utility.
1402 *
1403 * @module utilities/AudioNavigation
1404 */
1405
1406
1407/**
1408 * Meta Data Elements Module
1409 *
1410 * @module visual/MetaDataElements
1411 */
1412
1413
1414/**
1415 * Imports the Song Played Progress Elements Module
1416 *
1417 * @module visual/SongPlayedProgressElements
1418 */
1419
1420
1421/**
1422 * Imports the Play Pause Elements Module
1423 *
1424 * @module visual/PlayPauseElements
1425 */
1426
1427
1428/**
1429 * Imports the Callbacks Module
1430 *
1431 * @module utilities/Callbacks
1432 */
1433/**
1434 * Imports the config module
1435 * @module config
1436 */
1437var AudioNavigation = function () {
1438  /**
1439   * Sets the next song
1440   *
1441   * @access public
1442   * @param {boolean} [songEnded=false] If the song ended, this is set to true
1443   * so we take into effect the repeat setting.
1444   */
1445  function setNext() {
1446    var songEnded = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1447
1448    /*
1449      Initializes the next index variable. This will be the
1450      index of the song that is next.
1451    */
1452    var nextIndex = null;
1453    var nextSong = {};
1454
1455    /*
1456      Ensure we don't loop in the playlist if config.repeat is not true
1457    */
1458    var endOfList = false;
1459
1460    /*
1461      Determines if we are repeating the song or not. If we are repeating,
1462      the next song will be the same song index.
1463    */
1464    if (_config2.default.repeat_song) {
1465      /*
1466        If the playlist is shuffled, get the now playing index.
1467      */
1468      if (_config2.default.shuffle_on) {
1469        nextIndex = _config2.default.shuffle_list[_config2.default.active_index].index;
1470        nextSong = _config2.default.shuffle_list[nextIndex];
1471      } else {
1472        nextIndex = _config2.default.active_index;
1473        nextSong = _config2.default.songs[nextIndex];
1474      }
1475    } else {
1476      /*
1477        If the shuffle is on, we use the shuffled list of
1478        songs to determine our next song.
1479      */
1480      if (_config2.default.shuffle_on) {
1481        /*
1482          If the active shuffle index + 1 is less than the length, then
1483          we use the next shuffle otherwise we go to the beginning
1484          of the shuffle list.
1485        */
1486        if (parseInt(_config2.default.active_index) + 1 < _config2.default.shuffle_list.length) {
1487          /*
1488            Set the next index to be the index of the song in the shuffle list.
1489          */
1490          nextIndex = parseInt(_config2.default.active_index) + 1;
1491        } else {
1492          nextIndex = 0;
1493          endOfList = true;
1494        }
1495
1496        nextSong = _config2.default.shuffle_list[nextIndex];
1497      } else {
1498        /*
1499          If the active index + 1 is less than the length of the songs, then
1500          we use the next song otherwise we go to the beginning of the
1501          song list.
1502        */
1503        if (parseInt(_config2.default.active_index) + 1 < _config2.default.songs.length) {
1504          nextIndex = parseInt(_config2.default.active_index) + 1;
1505        } else {
1506          nextIndex = 0;
1507          endOfList = true;
1508        }
1509
1510        /*
1511          Sets the next index.
1512        */
1513        nextSong = _config2.default.songs[nextIndex];
1514      }
1515    }
1516
1517    /*
1518      Change the song after the next button has been pressed.
1519    */
1520    changeSong(nextSong, nextIndex);
1521
1522    /*
1523    	If it's the end of the list and repeat is not on, do nothing.
1524    */
1525    if (endOfList && !_config2.default.repeat) {} else {
1526      /*
1527      If the song has ended and repeat is on, play the song.
1528      */
1529      if (!(songEnded && !_config2.default.repeat && endOfList)) {
1530        _core2.default.play();
1531      }
1532    }
1533
1534    /*
1535      Sync the play pause elements and run the
1536      after next callback.
1537    */
1538    _playPauseElements2.default.sync();
1539    _callbacks2.default.run("next");
1540
1541    /*
1542      If we repeated the song, run the repeat song callback.
1543    */
1544    if (_config2.default.repeat_song) {
1545      _callbacks2.default.run("song_repeated");
1546    }
1547  }
1548
1549  /**
1550   * Sets the next song in a playlist
1551   *
1552   * @param {string} playlist - The playlist being shuffled
1553   * @param {boolean} [songEnded=false] - If the song ended, this is set to true
1554   * so we take into effect the repeat setting.
1555   */
1556  function setNextPlaylist(playlist) {
1557    var songEnded = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1558
1559    /*
1560      Initializes the next index
1561    */
1562    var nextIndex = null;
1563    var nextSong = {};
1564
1565    /*
1566      Ensure we don't loop in the playlist if config.repeat is not true
1567    */
1568    var endOfList = false;
1569
1570    /*
1571      If we are repeating the song, then we just start the song over.
1572    */
1573    if (_config2.default.repeat_song) {
1574      /*
1575        If the playlist is shuffled, get the now playing index.
1576      */
1577      if (_config2.default.playlists[playlist].shuffle) {
1578        nextIndex = _config2.default.playlists[playlist].active_index;
1579        nextSong = _config2.default.playlists[playlist].shuffle_list[nextIndex];
1580      } else {
1581        nextIndex = _config2.default.playlists[playlist].active_index;
1582        nextSong = _config2.default.playlists[playlist].songs[nextIndex];
1583      }
1584    } else {
1585      /*
1586        If the playlist is shuffled we get the next index of the playlist.
1587      */
1588      if (_config2.default.playlists[playlist].shuffle) {
1589        /*
1590          If the active shuffle index + 1 is less than the length of the shuffle list,
1591          then we use the next shuffle otherwise we go to the beginning of the shuffle list.
1592        */
1593        if (parseInt(_config2.default.playlists[playlist].active_index) + 1 < _config2.default.playlists[playlist].shuffle_list.length) {
1594          /*
1595            Set the next index to be the index of the song in the shuffle list.
1596          */
1597          nextIndex = _config2.default.playlists[playlist].active_index + 1;
1598        } else {
1599          nextIndex = 0;
1600          endOfList = true;
1601        }
1602
1603        nextSong = _config2.default.playlists[playlist].shuffle_list[nextIndex];
1604      } else {
1605        /*
1606          If the active index +1 is less than the length of the songs in the playlist,
1607          then we use the next song otherwise we go to the beginning of the playlist.
1608        */
1609        if (parseInt(_config2.default.playlists[playlist].active_index) + 1 < _config2.default.playlists[playlist].songs.length) {
1610          nextIndex = parseInt(_config2.default.playlists[playlist].active_index) + 1;
1611        } else {
1612          nextIndex = 0;
1613          endOfList = true;
1614        }
1615
1616        /*
1617          Sets the next song.
1618        */
1619        nextSong = _config2.default.playlists[playlist].songs[nextIndex];
1620      }
1621    }
1622
1623    /*
1624      Sets the active playlist to the playlist we are on.
1625    */
1626    setActivePlaylist(playlist);
1627
1628    /*
1629      Change the song within the playlist.
1630    */
1631    changeSongPlaylist(playlist, nextSong, nextIndex);
1632
1633    /*
1634      If it's the end of the playlist and we aren't repeating, do nothing.
1635    */
1636    if (endOfList && !_config2.default.repeat) {} else {
1637      if (!(songEnded && !_config2.default.repeat && endOfList)) {
1638        _core2.default.play();
1639      }
1640    }
1641
1642    /*
1643      Sync the play pause buttons.
1644    */
1645    _playPauseElements2.default.sync();
1646    _callbacks2.default.run("next");
1647
1648    /*
1649      Repeat the song.
1650    */
1651    if (_config2.default.repeat_song) {
1652      _callbacks2.default.run("song_repeated");
1653    }
1654  }
1655
1656  /**
1657   * Sets the previous song on the global songs array.
1658   *
1659   * @access private
1660   */
1661  function setPrevious() {
1662    /*
1663      Initializes the previous index
1664    */
1665    var previousIndex = null;
1666    var previousSong = {};
1667
1668    /*
1669      If we are repeating the song, then we just start the song over.
1670    */
1671    if (_config2.default.repeat_song) {
1672      /*
1673        If the config is shuffled, get the now playing index.
1674      */
1675      if (_config2.default.shuffle_on) {
1676        previousIndex = _config2.default.active_index;
1677        previousSong = _config2.default.shuffle_list[previousIndex];
1678      } else {
1679        previousIndex = _config2.default.active_index;
1680        previousSong = _config2.default.songs[previousIndex];
1681      }
1682    } else {
1683      /*
1684        Get the previous index. If the previous index will be less than 0, get the
1685        last song of the array and continue.
1686      */
1687      if (parseInt(_config2.default.active_index) - 1 >= 0) {
1688        previousIndex = parseInt(_config2.default.active_index - 1);
1689      } else {
1690        previousIndex = parseInt(_config2.default.songs.length - 1);
1691      }
1692
1693      /*
1694        If the config is shuffled, we grab the song from the shuffle list
1695      */
1696      if (_config2.default.shuffle_on) {
1697        /*
1698          Grab song from the shuffle list
1699        */
1700        previousSong = _config2.default.shuffle_list[previousIndex];
1701      } else {
1702        /*
1703          Grab song from the songs array
1704        */
1705        previousSong = _config2.default.songs[previousIndex];
1706      }
1707    }
1708    /*
1709      Change the song after the next button has been pressed.
1710    */
1711    changeSong(previousSong, previousIndex);
1712
1713    /*
1714      Play the newest song.
1715    */
1716    _core2.default.play();
1717
1718    /*
1719      Sync the play pause elements and run the
1720      after next callback.
1721    */
1722    _playPauseElements2.default.sync();
1723    _callbacks2.default.run("prev");
1724
1725    /*
1726      If we repeated the song, run the repeat song callback.
1727    */
1728    if (_config2.default.repeat_song) {
1729      _callbacks2.default.run("song_repeated");
1730    }
1731  }
1732
1733  /**
1734   * Sets the previous playlist song.
1735   *
1736   * @access private
1737   *
1738   * @prop {string} playlist  - The playlist we are navigating in.
1739   */
1740  function setPreviousPlaylist(playlist) {
1741    /*
1742      Initializes the previous index
1743    */
1744    var previousIndex = null;
1745    var previousSong = {};
1746
1747    /*
1748      If we are repeating the song, then we just start the song over.
1749    */
1750    if (_config2.default.repeat_song) {
1751      /*
1752        If the playlist is shuffled, get the now playing index.
1753      */
1754      if (_config2.default.playlists[playlist].shuffle) {
1755        previousIndex = _config2.default.playlists[playlist].active_index;
1756        previousSong = _config2.default.playlists[playlist].shuffle_list[previousIndex];
1757      } else {
1758        previousIndex = _config2.default.playlists[playlist].active_index;
1759        previousSong = _config2.default.playlists[playlist].songs[previousIndex];
1760      }
1761    } else {
1762      /*
1763        Get the previous index. If the previous index will be less than 0, get the
1764        last song of the array and continue.
1765      */
1766      if (parseInt(_config2.default.playlists[playlist].active_index) - 1 >= 0) {
1767        previousIndex = parseInt(_config2.default.playlists[playlist].active_index - 1);
1768      } else {
1769        previousIndex = parseInt(_config2.default.playlists[playlist].songs.length - 1);
1770      }
1771
1772      /*
1773        If the playlist is shuffled, we grab the song from the shuffle list
1774      */
1775      if (_config2.default.playlists[playlist].shuffle) {
1776        /*
1777          Grab song from the shuffle list
1778        */
1779        previousSong = _config2.default.playlists[playlist].shuffle_list[previousIndex];
1780      } else {
1781        /*
1782          Grab song from the songs array
1783        */
1784        previousSong = _config2.default.playlists[playlist].songs[previousIndex];
1785      }
1786    }
1787
1788    /*
1789      Sets the active playlist to the playlist we are on.
1790    */
1791    setActivePlaylist(playlist);
1792
1793    /*
1794      Change the song within the playlist.
1795    */
1796    changeSongPlaylist(playlist, previousSong, previousIndex);
1797
1798    /*
1799      Plays the song
1800    */
1801    _core2.default.play();
1802
1803    /*
1804      Sync the play pause buttons.
1805    */
1806    _playPauseElements2.default.sync();
1807    _callbacks2.default.run("prev");
1808
1809    /*
1810      Repeat the song.
1811    */
1812    if (_config2.default.repeat_song) {
1813      _callbacks2.default.run("song_repeated");
1814    }
1815  }
1816
1817  /**
1818   * Change song in the songs array.
1819   *
1820   * @access private
1821   * @prop {object} song  - The song we are changing to.
1822   * @prop {number} index - The index we are changing to.
1823   */
1824  function changeSong(song, index) {
1825    /*
1826      Prepare the song change.
1827    */
1828    prepareSongChange(song);
1829
1830    /*
1831      Change the song.
1832    */
1833    _config2.default.audio.src = song.url;
1834    _config2.default.active_metadata = song;
1835    _config2.default.active_album = song.album;
1836
1837    _config2.default.active_index = parseInt(index);
1838
1839    /*
1840      Set new information now that the song has changed.
1841    */
1842    afterSongChange();
1843  }
1844
1845  /**
1846   * Handles a song change in the playlist
1847   *
1848   * @access private
1849   * @prop {string} playlist - The playlist we are changing the song on.
1850   * @prop {object} song     - The song we are changing to in the playlist.
1851   * @prop {number} index    - The inded of the song we are changing to in the playlist.
1852   */
1853  function changeSongPlaylist(playlist, song, index) {
1854    /*
1855      Prepare the song change.
1856    */
1857    prepareSongChange(song);
1858
1859    /*
1860      Change the song.
1861    */
1862    _config2.default.audio.src = song.url;
1863    _config2.default.active_metadata = song;
1864    _config2.default.active_album = song.album;
1865    _config2.default.active_index = null;
1866
1867    _config2.default.playlists[playlist].active_index = parseInt(index);
1868
1869    /*
1870      Set new information now that the song has changed.
1871    */
1872    afterSongChange();
1873  }
1874
1875  /**
1876   *  Prepares a song change
1877   *
1878   * @access private
1879   * @prop {object} song  - The song we change to.
1880   */
1881  function prepareSongChange(song) {
1882    /*
1883      Stop the current song.
1884    */
1885    _core2.default.stop();
1886
1887    /*
1888      Sync all of the elements to a stopped song.
1889    */
1890    _playPauseElements2.default.syncToPause();
1891    _songSliderElements2.default.resetElements();
1892    _songPlayedProgressElements2.default.resetElements();
1893    _timeElements2.default.resetCurrentTimes();
1894
1895    /*
1896      If an album changes, fire an album change.
1897    */
1898    if (_checks2.default.newAlbum(song)) {
1899      _callbacks2.default.run("album_change");
1900    }
1901  }
1902
1903  /**
1904   * Updates data on the display after a song has changed.
1905   *
1906   * @access private
1907   */
1908  function afterSongChange() {
1909    _metaDataElements2.default.displayMetaData();
1910    _containerElements2.default.setActive(
vendor: 10,130 bytes, lines 1910-2313
1910);
1911    _timeElements2.default.resetDurationTimes();
1912
1913    /*
1914      Run the song change callback.
1915    */
1916    _callbacks2.default.run("song_change");
1917  }
1918
1919  /**
1920   * Sets the active playlist
1921   *
1922   * @access public
1923   * @param {string} playlist - The string of the playlist being set to active.
1924   */
1925  function setActivePlaylist(playlist) {
1926    /*
1927      If the active playlist is different than the playlist being set,
1928      we run the `playlist_changed` callback.
1929    */
1930    if (_config2.default.active_playlist != playlist) {
1931      _callbacks2.default.run("playlist_changed");
1932      /*
1933        Set the active playlist to the playlist parameter. Only need to
1934        set if it's different.
1935      */
1936      _config2.default.active_playlist = playlist;
1937
1938      if (playlist != null) {
1939        _config2.default.playlists[playlist].active_index = 0;
1940      }
1941    }
1942  }
1943
1944  /*
1945    Return the publically facing methods
1946  */
1947  return {
1948    setNext: setNext,
1949    setNextPlaylist: setNextPlaylist,
1950    setPrevious: setPrevious,
1951    setPreviousPlaylist: setPreviousPlaylist,
1952    changeSong: changeSong,
1953    changeSongPlaylist: changeSongPlaylist,
1954    setActivePlaylist: setActivePlaylist
1955  };
1956}();
1957
1958/**
1959 * Container Elements Module
1960 *
1961 * @module visual/ContainerElements
1962 */
1963
1964
1965/**
1966 * Imports the Time Elements Module
1967 *
1968 * @module visual/TimeElements
1969 */
1970
1971
1972/**
1973 * Imports the Song Slider Elements Module
1974 *
1975 * @module visual/SongSliderElements
1976 */
1977
1978
1979/**
1980 * Imports the Checks Module
1981 *
1982 * @module utilities/Checks
1983 */
1984
1985
1986/**
1987 * Imports the Core Module
1988 *
1989 * @module core/Core
1990 */
1991exports.default = AudioNavigation;
1992module.exports = exports["default"];
1993
1994/***/ }),
1995/* 4 */
1996/***/ (function(module, exports, __webpack_require__) {
1997
1998"use strict";
1999
2000
2001Object.defineProperty(exports, "__esModule", {
2002  value: true
2003});
2004
2005var _config = __webpack_require__(0);
2006
2007var _config2 = _interopRequireDefault(_config);
2008
2009function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2010
2011/**
2012 * Handles the debugging of AmplitudeJS
2013 * @module utilities/Debug
2014 */
2015var Debug = function () {
2016  /**
2017   * Writes out debug message to the console if enabled.
2018   *
2019   * Public Accessor: Debug.writeMessage( message )
2020   *
2021   * @access public
2022   * @param {string} message - The string that gets printed to alert the user of a debugging error.
2023   */
2024  function writeMessage(message) {
2025    /*
2026      If the user has flagged AmplitudeJS to debug, we print out a message
2027      to the console.
2028    */
2029    if (_config2.default.debug) {
2030      console.log(message);
2031    }
2032  }
2033
2034  /*
2035    Returns the public facing methods
2036  */
2037  return {
2038    writeMessage: writeMessage
2039  };
2040}(); /**
2041      * Imports the config module
2042      * @module config
2043      */
2044exports.default = Debug;
2045module.exports = exports["default"];
2046
2047/***/ }),
2048/* 5 */
2049/***/ (function(module, exports, __webpack_require__) {
2050
2051"use strict";
2052
2053
2054Object.defineProperty(exports, "__esModule", {
2055  value: true
2056});
2057
2058var _config = __webpack_require__(0);
2059
2060var _config2 = _interopRequireDefault(_config);
2061
2062function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2063
2064/**
2065 * AmplitudeJS Checks Module. Checks for new songs, albums, and playlists
2066 *
2067 * @module utilities/Checks
2068 */
2069var Checks = function () {
2070  /**
2071   * Checks to see if the new song to be played is different than the song
2072   * that is currently playing. To be true, the user would have selected
2073   * play on a new song with a new index. To be false, the user would have
2074   * clicked play/pause on the song that was playing.
2075   *
2076   * Public Accessor: Checks.newSong( playlist, songIndex )
2077   * @access public
2078   * @param {string} playlist - The playlist we are checking the new song for. Could be null
2079   * @param {number} songIndex - The index of the new song to be played.
2080   * @returns {boolean} True if we are setting a new song, false if we are not setting a new song.
2081   */
2082  function newSong(playlist, songIndex) {
2083    /*
2084      If the playlists don't match, then it's definitely a new song.
2085    */
2086    if (_config2.default.active_playlist != playlist) {
2087      return true;
2088    } else {
2089      /*
2090        If we aren't in a playlist, we check the active index.
2091      */
2092      if (_config2.default.active_playlist == null && playlist == null) {
2093        /*
2094          If the active indexes don't match, then it's a new song.
2095        */
2096        if (_config2.default.active_index != songIndex) {
2097          return true;
2098        } else {
2099          return false;
2100        }
2101      } else {
2102        /*
2103          If we are in a playlist, then we check to see if the
2104          new song index matches the active index.
2105        */
2106        if (_config2.default.active_playlist == playlist && _config2.default.playlists[playlist].active_index != songIndex) {
2107          return true;
2108        } else {
2109          return false;
2110        }
2111      }
2112    }
2113  }
2114
2115  /**
2116   * Checks to see if there is a new album
2117   *
2118   * Public Accessor: Checks.newAlbum( album )
2119   *
2120   * @access public
2121   * @param {string} album - Checks to see if the new song will have a new album.
2122   * @returns {boolean} True if there is a new album, false if there is not a new ablum.
2123   */
2124  function newAlbum(album) {
2125    if (_config2.default.active_album != album) {
2126      return true;
2127    } else {
2128      return false;
2129    }
2130  }
2131
2132  /**
2133   * Checks to see if there is a new playlist
2134   *
2135   * Public Accessor: Checks.newPlaylist( playlist )
2136   *
2137   * @access public
2138   * @param {string} playlist - The playlist passed in to check against the active playlist.
2139   * @returns {boolean} True if there is a new playlist, false if there is not a new playlist.
2140   */
2141  function newPlaylist(playlist) {
2142    if (_config2.default.active_playlist != playlist) {
2143      return true;
2144    } else {
2145      return false;
2146    }
2147  }
2148
2149  /**
2150   * Determines if the string passed in is a URL or not
2151   *
2152   * Public Accessor: AmplitudeHelpers.isURL( url )
2153   *
2154   * @access public
2155   * @param {string} url - The string we are testing to see if it's a URL.
2156   * @returns {boolean} True if the string is a url, false if it is not.
2157   */
2158  function isURL(url) {
2159    /*
2160    Test the string against the URL pattern and return if it matches
2161    */
2162    var pattern = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/;
2163
2164    return pattern.test(url);
2165  }
2166
2167  /**
2168   * Determines if what is passed in is an integer or not.
2169   *
2170   * Public Accessor: AmplitudeHelpers.isInt( int )
2171   *
2172   * @access public
2173   * @param {string|number} int - The variable we are testing to see is an integer or not.
2174   * @returns {boolean} If the variable is an integer or not.
2175   */
2176  function isInt(int) {
2177    return !isNaN(int) && parseInt(Number(int)) == int && !isNaN(parseInt(int, 10));
2178  }
2179
2180  /**
2181   * Returns public facing methods
2182   */
2183  return {
2184    newSong: newSong,
2185    newAlbum: newAlbum,
2186    newPlaylist: newPlaylist,
2187    isURL: isURL,
2188    isInt: isInt
2189  };
2190}(); /**
2191      * Imports the config module
2192      * @module config
2193      */
2194exports.default = Checks;
2195module.exports = exports["default"];
2196
2197/***/ }),
2198/* 6 */
2199/***/ (function(module, exports, __webpack_require__) {
2200
2201"use strict";
2202
2203
2204Object.defineProperty(exports, "__esModule", {
2205  value: true
2206});
2207
2208var _config = __webpack_require__(0);
2209
2210var _config2 = _interopRequireDefault(_config);
2211
2212function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2213
2214/**
2215 * Handles the state of the config object.
2216 *
2217 * @module utilities/ConfigState
2218 */
2219var ConfigState = function () {
2220  /**
2221   * Resets the config to the default state. This is called on initialize
2222   * to ensure the user's config is what matters.
2223   *
2224   * Public Accessor: AmplitudeHelpers.resetConfig()
2225   *
2226   * @access public
2227   */
2228  function resetConfig() {
2229    _config2.default.audio = new Audio();
2230    _config2.default.active_metadata = {};
2231    _config2.default.active_album = "";
2232    _config2.default.active_index = 0;
2233    _config2.default.active_playlist = null;
2234    _config2.default.playback_speed = 1.0;
2235    _config2.default.callbacks = {};
2236    _config2.default.songs = [];
2237    _config2.default.playlists = {};
2238    _config2.default.start_song = "";
2239    _config2.default.starting_playlist = "";
2240    _config2.default.starting_playlist_song = "";
2241    _config2.default.repeat = false;
2242    _config2.default.shuffle_list = {};
2243    _config2.default.shuffle_on = false;
2244    _config2.default.default_album_art = "";
2245    _config2.default.default_playlist_art = "";
2246    _config2.default.debug = false;
2247    _config2.default.volume = 0.5;
2248    _config2.default.pre_mute_volume = 0.5;
2249    _config2.default.volume_increment = 5;
2250    _config2.default.volume_decrement = 5;
2251    _config2.default.soundcloud_client = "";
2252    _config2.default.soundcloud_use_art = false;
2253    _config2.default.soundcloud_song_count = 0;
2254    _config2.default.soundcloud_songs_ready = 0;
2255    _config2.default.continue_next = true;
2256  }
2257
2258  /**
2259   * Sets the state of the player.
2260   */
2261  function setPlayerState() {
2262    /*
2263      If paused and the current time is 0 the player is stopped.
2264    */
2265    if (_config2.default.audio.paused && _config2.default.audio.currentTime == 0) {
2266      _config2.default.player_state = "stopped";
2267    }
2268
2269    /*
2270      If paused and the current time is greater than 0 the player is
2271      paused.
2272    */
2273    if (_config2.default.audio.paused && _config2.default.audio.currentTime > 0) {
2274      _config2.default.player_state = "paused";
2275    }
2276
2277    /*
2278      If playing, the current state is playing.
2279    */
2280    if (!_config2.default.audio.paused) {
2281      _config2.default.player_state = "playing";
2282    }
2283  }
2284
2285  /*
2286  Returns the public facing methods
2287  */
2288  return {
2289    resetConfig: resetConfig,
2290    setPlayerState: setPlayerState
2291  };
2292}(); /**
2293      * Imports the config module
2294      * @module config
2295      */
2296exports.default = ConfigState;
2297module.exports = exports["default"];
2298
2299/***/ }),
2300/* 7 */
2301/***/ (function(module, exports, __webpack_require__) {
2302
2303"use strict";
2304
2305
2306Object.defineProperty(exports, "__esModule", {
2307  value: true
2308});
2309
2310var _config = __webpack_require__(0);
2311
2312var _config2 = _interopRequireDefault(_config);
2313
2314var _debug = __webpack_require__(4);
2315
2316var _debug2 = _interopRequireDefault(_debug);
2317
2318function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2319
2320/**
2321 * AmplitudeJS Callback Utility
2322 *
2323 * @module utilities/callbacks
2324 */
2325/**
2326 * Imports the config module
2327 * @module config
2328 */
2329var Callbacks = function () {
2330  /**
2331   * Initializes the callbacks for the player.
2332   */
2333  function initialize() {
2334    /*
2335      Event: abort
2336      https://www.w3schools.com/tags/av_event_abort.asp
2337    */
2338    _config2.default.audio.addEventListener("abort", function () {
2339      run("abort");
2340    });
2341
2342    /*
2343      Event: error
2344      https://www.w3schools.com/tags/av_event_error.asp
2345    */
2346    _config2.default.audio.addEventListener("error", function () {
2347      run("error");
2348    });
2349
2350    /*
2351      Event: loadeddata
2352      https://www.w3schools.com/tags/av_event_loadeddata.asp
2353    */
2354    _config2.default.audio.addEventListener("loadeddata", function () {
2355      run("loadeddata");
2356    });
2357
2358    /*
2359      Event: loadedmetadata
2360      https://www.w3schools.com/tags/av_event_loadedmetadata.asp
2361    */
2362    _config2.default.audio.addEventListener("loadedmetadata", function () {
2363      run("loadedmetadata");
2364    });
2365
2366    /*
2367      Event: loadstart
2368      https://www.w3schools.com/tags/av_event_loadstart.asp
2369    */
2370    _config2.default.audio.addEventListener("loadstart", function () {
2371      run("loadstart");
2372    });
2373
2374    /*
2375      Event: pause
2376      https://www.w3schools.com/tags/av_event_pause.asp
2377    */
2378    _config2.default.audio.addEventListener("pause", function () {
2379      run("pause");
2380    });
2381
2382    /*
2383      Event: playing
2384      https://www.w3schools.com/tags/av_event_playing.asp
2385    */
2386    _config2.default.audio.addEventListener("playing", function () {
2387      run("playing");
2388    });
2389
2390    /*
2391      Event: play
2392      https://www.w3schools.com/tags/av_event_play.asp
2393    */
2394    _config2.default.audio.addEventListener("play", function () {
2395      run("play");
2396    });
2397
2398    /*
2399      Event: progress
2400      https://www.w3schools.com/tags/av_event_progress.asp
2401    */
2402    _config2.default.audio.addEventListener("progress", function () {
2403      run("progress");
2404    });
2405
2406    /*
2407      Event: ratechange
2408      https://www.w3schools.com/tags/av_event_ratechange.asp
2409    */
2410    _config2.default.audio.addEventListener("ratechange", function () {
2411      run("ratechange");
2412    });
2413
2414    /*
2415      Event: seeked
2416      https://www.w3schools.com/tags/av_event_seeked.asp
2417    */
2418    _config2.default.audio.addEventListener("seeked", function () {
2419      run("seeked");
2420    });
2421
2422    /*
2423      Event: seeking
2424      https://www.w3schools.com/tags/av_event_seeking.asp
2425    */
2426    _config2.default.audio.addEventListener("seeking", function () {
2427      run("seeking");
2428    });
2429
2430    /*
2431      Event: stalled
2432      https://www.w3schools.com/tags/av_event_stalled.asp
2433    */
2434    _config2.default.audio.addEventListener("stalled", function () {
2435      run("stalled");
2436    });
2437
2438    /*
2439      Event: suspend
2440      https://www.w3schools.com/tags/av_event_suspend.asp
2441    */
2442    _config2.default.audio.addEventListener("suspend", function () {
2443      run("suspend");
2444    });
2445
2446    /*
2447      Event: timeupdate
2448      https://www.w3schools.com/tags/av_event_timeupdate.asp
2449    */
2450    _config2.default.audio.addEventListener("timeupdate", function () {
2451      run("timeupdate");
2452    });
2453
2454    /*
2455      Event: volumechange
2456      https://www.w3schools.com/tags/av_event_volumechange.asp
2457    */
2458    _config2.default.audio.addEventListener("volumechange", function () {
2459      run("volumechange");
2460    });
2461
2462    /*
2463      Event: waiting
2464      https://www.w3schools.com/tags/av_event_waiting.asp
2465    */
2466    _config2.default.audio.addEventListener("waiting", function () {
2467      run("waiting");
2468    });
2469
2470    /*
2471      Event: canplay
2472      https://www.w3schools.com/tags/av_event_canplay.asp
2473    */
2474    _config2.default.audio.addEventListener("canplay", function () {
2475      run("canplay");
2476    });
2477
2478    /*
2479      Event: canplaythrough
2480      https://www.w3schools.com/tags/av_event_canplaythrough.asp
2481    */
2482    _config2.default.audio.addEventListener("canplaythrough", function () {
2483      run("canplaythrough");
2484    });
2485
2486    /*
2487      Event: durationchange
2488      https://www.w3schools.com/tags/av_event_durationchange.asp
2489    */
2490    _config2.default.audio.addEventListener("durationchange", function () {
2491      run("durationchange");
2492    });
2493
2494    /*
2495      Event: ended
2496      https://www.w3schools.com/tags/av_event_ended.asp
2497    */
2498    _config2.default.audio.addEventListener("ended", function () {
2499      run("ended");
2500    });
2501  }
2502
2503  /**
2504   * Runs a user defined callback method
2505   *
2506   * Public Accessor: Callbacks.run( callbackName )
2507   *
2508   * @access public
2509   * @param {string} callbackName - The name of the callback we are going to run.
2510   */
2511  function run(callbackName) {
2512    /*
2513      Checks to see if a user defined a callback method for the
2514      callback we are running.
2515    */
2516    if (_config2.default.callbacks[callbackName]) {
2517      /*
2518        Build the callback function
2519      */
2520      var callbackFunction = _config2.default.callbacks[callbackName];
2521
2522      /*
2523        Write a debug message stating the callback we are running
2524      */
2525      _debug2.default.writeMessage("Running Callback: " + callbackName);
2526
2527      /*
2528        Run the callback function and catch any errors
2529      */
vendor: 15,302 bytes, lines 2530-2995
2530      try {
2531        callbackFunction();
2532      } catch (error) {
2533        if (error.message == "CANCEL EVENT") {
2534          throw error;
2535        } else {
2536          _debug2.default.writeMessage("Callback error: " + error.message);
2537        }
2538      }
2539    }
2540  }
2541
2542  return {
2543    initialize: initialize,
2544    run: run
2545  };
2546}();
2547
2548/**
2549 * Imports the debug module
2550 * @module utilities/debug
2551 */
2552exports.default = Callbacks;
2553module.exports = exports["default"];
2554
2555/***/ }),
2556/* 8 */
2557/***/ (function(module, exports, __webpack_require__) {
2558
2559"use strict";
2560
2561
2562Object.defineProperty(exports, "__esModule", {
2563  value: true
2564});
2565
2566var _config = __webpack_require__(0);
2567
2568var _config2 = _interopRequireDefault(_config);
2569
2570function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2571
2572/**
2573 * These methods help display the audio's meta data
2574 *
2575 * @module visual/MetaDataElements
2576 */
2577var MetaDataElements = function () {
2578  /**
2579   * Displays the active song's metadata. This is called after a song has
2580   * been changed. This method takes the active song and displays the
2581   * metadata. So once the new active song is set, we update all of the
2582   * screen elements.
2583   *
2584   * @access public
2585   */
2586  function displayMetaData() {
2587    /*
2588    Define the image meta data keys. These are managed separately
2589    since we aren't actually changing the inner HTML of these elements.
2590    */
2591    var imageMetaDataKeys = ["cover_art_url", "station_art_url", "podcast_episode_cover_art_url"];
2592
2593    /*
2594    Get all of the song info elements
2595    */
2596    var songInfoElements = document.querySelectorAll("[data-amplitude-song-info]");
2597
2598    /*
2599    Iterate over all of the song info elements. We will either
2600    set these to the new values, or clear them if the active song
2601    doesn't have the info set.
2602    */
2603    for (var i = 0; i < songInfoElements.length; i++) {
2604      /*
2605      Get the info so we can check if the active meta data has the
2606      key.
2607      */
2608      var info = songInfoElements[i].getAttribute("data-amplitude-song-info");
2609
2610      /*
2611      Grab the playlist and song index.
2612      */
2613      var playlist = songInfoElements[i].getAttribute("data-amplitude-playlist");
2614      var songIndex = songInfoElements[i].getAttribute("data-amplitude-song-index");
2615
2616      /*
2617      Ensure that we don't set any individual elements now. We set this with the
2618      sync meta data method. The reason we don't set them here is because
2619      all individual songs would get the now playing artwork. If the playlists
2620      match or the element is a main element meaning it doesn't
2621      belong to a playlist or a song, then we set the song info.
2622      */
2623      if (songIndex == null && (_config2.default.active_playlist == playlist || playlist == null && songIndex == null)) {
2624        /*
2625        If the active metadata has the key, then we set it,
2626        otherwise we clear it. If it's an image element then
2627        we default it to the default info if needed.
2628        */
2629        var val = _config2.default.active_metadata[info] != undefined ? _config2.default.active_metadata[info] : null;
2630        if (imageMetaDataKeys.indexOf(info) >= 0) {
2631          val = val || _config2.default.default_album_art;
2632          songInfoElements[i].setAttribute("src", val);
2633        } else {
2634          val = val || "";
2635          songInfoElements[i].innerHTML = val;
2636        }
2637      }
2638    }
2639  }
2640
2641  /**
2642   * Displays the playlist meta data.
2643   */
2644  function displayPlaylistMetaData() {
2645    /*
2646    Define the image meta data keys. These are managed separately
2647    since we aren't actually changing the inner HTML of these elements.
2648    */
2649    var imageMetaDataKeys = ["image_url"];
2650
2651    /*
2652    Get all of the playlist info elements
2653    */
2654    var playlistInfoElements = document.querySelectorAll("[data-amplitude-playlist-info]");
2655
2656    /*
2657    Iterate over all of the playlist info elements. We will either
2658    set these to the new values, or clear them if the active song
2659    doesn't have the info set.
2660    */
2661    for (var i = 0; i < playlistInfoElements.length; i++) {
2662      /*
2663      Get the info so we can check if the active meta data has the
2664      key.
2665      */
2666      var info = playlistInfoElements[i].getAttribute("data-amplitude-playlist-info");
2667      var playlist = playlistInfoElements[i].getAttribute("data-amplitude-playlist");
2668
2669      if (_config2.default.playlists[playlist][info] != undefined) {
2670        if (imageMetaDataKeys.indexOf(info) >= 0) {
2671          playlistInfoElements[i].setAttribute("src", _config2.default.playlists[playlist][info]);
2672        } else {
2673          playlistInfoElements[i].innerHTML = _config2.default.playlists[playlist][info];
2674        }
2675      } else {
2676        /*
2677        We look for the default album art because
2678        the actual key didn't exist. If the default album
2679        art doesn't exist then we set the src attribute
2680        to null.
2681        */
2682        if (imageMetaDataKeys.indexOf(info) >= 0) {
2683          if (_config2.default.default_playlist_art != "") {
2684            playlistInfoElements[i].setAttribute("src", _config2.default.default_playlist_art);
2685          } else {
2686            playlistInfoElements[i].setAttribute("src", "");
2687          }
2688        } else {
2689          playlistInfoElements[i].innerHTML = "";
2690        }
2691      }
2692    }
2693  }
2694
2695  /**
2696   * Sets the first song in the playlist. This is used to fill in the meta
2697   * data in the playlist
2698   *
2699   * @param {object} song 			- The song we are setting to be the first song in the playlist
2700   * @param {string} playlist 	- Key of the playlist we are setting the first song in
2701   */
2702  function setFirstSongInPlaylist(song, playlist) {
2703    /*
2704      Define the image meta data keys. These are managed separately
2705      since we aren't actually changing the inner HTML of these elements.
2706    */
2707    var imageMetaDataKeys = ["cover_art_url", "station_art_url", "podcast_episode_cover_art_url"];
2708
2709    /*
2710      Get all of the song info elements
2711    */
2712    var songInfoElements = document.querySelectorAll('[data-amplitude-song-info][data-amplitude-playlist="' + playlist + '"]');
2713
2714    /*
2715      Iterate over all of the song info elements. We will either
2716      set these to the new values, or clear them if the active song
2717      doesn't have the info set.
2718    */
2719    for (var i = 0; i < songInfoElements.length; i++) {
2720      /*
2721        Get the info so we can check if the active meta data has the
2722        key.
2723      */
2724      var info = songInfoElements[i].getAttribute("data-amplitude-song-info");
2725
2726      /*
2727        Get the song info element playlist.
2728      */
2729      var elementPlaylist = songInfoElements[i].getAttribute("data-amplitude-playlist");
2730
2731      /*
2732        If the playlists match or the element is a main element, then
2733        we set the song info.
2734      */
2735      if (elementPlaylist == playlist) {
2736        /*
2737          If the active metadata has the key, then we set it,
2738          otherwise we clear it. If it's an image element then
2739          we default it to the default info if needed.
2740        */
2741        if (song[info] != undefined) {
2742          if (imageMetaDataKeys.indexOf(info) >= 0) {
2743            songInfoElements[i].setAttribute("src", song[info]);
2744          } else {
2745            songInfoElements[i].innerHTML = song[info];
2746          }
2747        } else {
2748          /*
2749            We look for the default album art because
2750            the actual key didn't exist. If the default album
2751            art doesn't exist then we set the src attribute
2752            to null.
2753          */
2754          if (imageMetaDataKeys.indexOf(info) >= 0) {
2755            if (song.default_album_art != "") {
2756              songInfoElements[i].setAttribute("src", song.default_album_art);
2757            } else {
2758              songInfoElements[i].setAttribute("src", "");
2759            }
2760          } else {
2761            songInfoElements[i].innerHTML = "";
2762          }
2763        }
2764      }
2765    }
2766  }
2767
2768  /**
2769   * Sets the meta data for songs loaded in the songs array
2770   */
2771  function syncMetaData() {
2772    /*
2773    Define the image meta data keys. These are managed separately
2774    since we aren't actually changing the inner HTML of these elements.
2775    */
2776    var imageMetaDataKeys = ["cover_art_url", "station_art_url", "podcast_episode_cover_art_url"];
2777
2778    /*
2779    Get all of the song info elements
2780    */
2781    var songInfoElements = document.querySelectorAll("[data-amplitude-song-info]");
2782
2783    /*
2784    Iterate over all of the song info elements. We will either
2785    set these to the new values, or clear them if the active song
2786    doesn't have the info set.
2787    */
2788    for (var i = 0; i < songInfoElements.length; i++) {
2789      var songIndex = songInfoElements[i].getAttribute("data-amplitude-song-index");
2790      var playlist = songInfoElements[i].getAttribute("data-amplitude-playlist");
2791
2792      if (songIndex != null && playlist == null) {
2793        var info = songInfoElements[i].getAttribute("data-amplitude-song-info");
2794
2795        /*
2796         Get the song info value referenced on the element.  Depending on the type of
2797         element, we may need to fallback to another value when the direct value
2798         we want isn't found.
2799         i.e.
2800            data-amplitude-song-info="cover_art_url" defaults to using the value
2801            of "default_album_art" when "cover_art_url" is missing on the song.
2802        */
2803        var val = _config2.default.songs[songIndex][info] != undefined ? _config2.default.songs[songIndex][info] : null;
2804        /*
2805         If it's an image meta data key, then we set the src attribute of
2806         the element. Otherwise we set the inner HTML of the element.
2807        */
2808        if (imageMetaDataKeys.indexOf(info) >= 0) {
2809          /*
2810           If this is an image meta data key and the individual song doesn't
2811           have the key, use the default_album_art
2812           */
2813          val = val || _config2.default.default_album_art;
2814          songInfoElements[i].setAttribute("src", val);
2815        } else {
2816          songInfoElements[i].innerHTML = val;
2817        }
2818      }
2819
2820      /*
2821        If the song index and playlist are not null, continue.
2822      */
2823      if (songIndex != null && playlist != null) {
2824        /*
2825          Get the info we are displaying.
2826        */
2827        var _info = songInfoElements[i].getAttribute("data-amplitude-song-info");
2828
2829        /*
2830          Set the meta data accordingly.
2831        */
2832        if (_config2.default.playlists[playlist].songs[songIndex][_info] != undefined) {
2833          if (imageMetaDataKeys.indexOf(_info) >= 0) {
2834            songInfoElements[i].setAttribute("src", _config2.default.playlists[playlist].songs[songIndex][_info]);
2835          } else {
2836            songInfoElements[i].innerHTML = _config2.default.playlists[playlist].songs[songIndex][_info];
2837          }
2838        }
2839      }
2840    }
2841
2842    /*
2843      Display the playlist meta data.
2844    */
2845    displayPlaylistMetaData();
2846  }
2847
2848  /**
2849   * Returns publically facing methods
2850   */
2851  return {
2852    displayMetaData: displayMetaData,
2853    setFirstSongInPlaylist: setFirstSongInPlaylist,
2854    syncMetaData: syncMetaData,
2855    displayPlaylistMetaData: displayPlaylistMetaData
2856  };
2857}(); /**
2858      * Imports the config module
2859      * @module config
2860      */
2861exports.default = MetaDataElements;
2862module.exports = exports["default"];
2863
2864/***/ }),
2865/* 9 */
2866/***/ (function(module, exports, __webpack_require__) {
2867
2868"use strict";
2869
2870
2871Object.defineProperty(exports, "__esModule", {
2872  value: true
2873});
2874
2875var _config = __webpack_require__(0);
2876
2877var _config2 = _interopRequireDefault(_config);
2878
2879function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2880
2881/**
2882 * Handles all of the visual syncing to the state of the config for the repeat
2883 * elements.
2884 *
2885 * @module visual/RepeatElements
2886 */
2887var RepeatElements = function () {
2888  /**
2889   * Syncs repeat for all of the repeat buttons. Users
2890   * can apply styles to the 'amplitude-repeat-on' and
2891   * 'amplitude-repeat-off' classes. They represent the state
2892   * of the player.
2893   */
2894  function syncRepeat() {
2895    /*
2896    Gets all of the repeat classes
2897    */
2898    var repeatClasses = document.getElementsByClassName("amplitude-repeat");
2899
2900    /*
2901    Iterate over all of the repeat classes. If repeat is on,
2902    then add the 'amplitude-repeat-on' class and remove the
2903    'amplitude-repeat-off' class. If it's off, then do the
2904    opposite.
2905    */
2906    for (var i = 0; i < repeatClasses.length; i++) {
2907      if (_config2.default.repeat) {
2908        repeatClasses[i].classList.add("amplitude-repeat-on");
2909        repeatClasses[i].classList.remove("amplitude-repeat-off");
2910      } else {
2911        repeatClasses[i].classList.remove("amplitude-repeat-on");
2912        repeatClasses[i].classList.add("amplitude-repeat-off");
2913      }
2914    }
2915  }
2916
2917  /**
2918   * Syncs repeat for all of the playlist repeat buttons. Users
2919   * can apply styles to the `amplitude-repeat-on` and `amplitude-repeat-off`
2920   * classes. They repreent the state of the playlist in the player.
2921   */
2922  function syncRepeatPlaylist(playlist) {
2923    /*
2924    Gets all of the repeat buttons.
2925    */
2926    var repeatButtons = document.getElementsByClassName("amplitude-repeat");
2927
2928    /*
2929    Iterate over all of the repeat buttons
2930    */
2931    for (var i = 0; i < repeatButtons.length; i++) {
2932      /*
2933      Ensure that the repeat button belongs to matches the
2934      playlist we are syncing the state for.
2935      */
2936      if (repeatButtons[i].getAttribute("data-amplitude-playlist") == playlist) {
2937        /*
2938        If the state of the playlist is shuffled on, true, then
2939        we add the 'amplitude-repeat-on' class and remove the
2940        'amplitude-repeat-off' class. If the player is not shuffled
2941        then we do the opposite.
2942        */
2943        if (_config2.default.playlists[playlist].repeat) {
2944          repeatButtons[i].classList.add("amplitude-repeat-on");
2945          repeatButtons[i].classList.remove("amplitude-repeat-off");
2946        } else {
2947          repeatButtons[i].classList.add("amplitude-repeat-off");
2948          repeatButtons[i].classList.remove("amplitude-repeat-on");
2949        }
2950      }
2951    }
2952  }
2953
2954  /**
2955   * Syncs repeat for all of the repeat song buttons. Users
2956   * can apply styles to the 'amplitude-repeat-song-on' and
2957   * 'amplitude-repeat-song-off' classes. They represent the state
2958   * of the player.
2959   */
2960  function syncRepeatSong() {
2961    /*
2962    Gets all of the repeat song classes
2963    */
2964    var repeatSongClasses = document.getElementsByClassName("amplitude-repeat-song");
2965
2966    /*
2967    Iterate over all of the repeat song classes. If repeat is on,
2968    then add the 'amplitude-repeat-song-on' class and remove the
2969    'amplitude-repeat-song-off' class. If it's off, then do the
2970    opposite.
2971    */
2972    for (var i = 0; i < repeatSongClasses.length; i++) {
2973      if (_config2.default.repeat_song) {
2974        repeatSongClasses[i].classList.add("amplitude-repeat-song-on");
2975        repeatSongClasses[i].classList.remove("amplitude-repeat-song-off");
2976      } else {
2977        repeatSongClasses[i].classList.remove("amplitude-repeat-song-on");
2978        repeatSongClasses[i].classList.add("amplitude-repeat-song-off");
2979      }
2980    }
2981  }
2982
2983  /*
2984    Returns the publically available methods.
2985  */
2986  return {
2987    syncRepeat: syncRepeat,
2988    syncRepeatPlaylist: syncRepeatPlaylist,
2989    syncRepeatSong: syncRepeatSong
2990  };
2991}(); /**
2992      * Imports the config module
2993      * @module config
2994      */
2995exports.default = RepeatElement
vendor: 36,478 bytes, lines 2995-4162
2995s;
2996module.exports = exports["default"];
2997
2998/***/ }),
2999/* 10 */
3000/***/ (function(module, exports, __webpack_require__) {
3001
3002"use strict";
3003
3004
3005Object.defineProperty(exports, "__esModule", {
3006  value: true
3007});
3008/**
3009 * Handles the visual state for all of the mute elements.
3010 *
3011 * @module visual/MuteElements
3012 */
3013var MuteElements = function () {
3014  /**
3015   * Syncs mute for all of the mute buttons. This represents the
3016   * state of the player if it's muted or not.
3017   *
3018   * @access public
3019   * @param {string} state 	- The muted state of the player.
3020   */
3021  function setMuted(state) {
3022    /*
3023    Get all of the mute buttons.
3024    */
3025    var muteClasses = document.getElementsByClassName("amplitude-mute");
3026
3027    /*
3028    Iterate over all of the mute classes. If the state of the player
3029    is not-muted then we add the amplitude-not-muted classe and remove
3030    the amplitude muted class otherwise we do the opposite.
3031    */
3032    for (var i = 0; i < muteClasses.length; i++) {
3033      if (!state) {
3034        muteClasses[i].classList.add("amplitude-not-muted");
3035        muteClasses[i].classList.remove("amplitude-muted");
3036      } else {
3037        muteClasses[i].classList.remove("amplitude-not-muted");
3038        muteClasses[i].classList.add("amplitude-muted");
3039      }
3040    }
3041  }
3042
3043  return {
3044    setMuted: setMuted
3045  };
3046}();
3047
3048exports.default = MuteElements;
3049module.exports = exports["default"];
3050
3051/***/ }),
3052/* 11 */
3053/***/ (function(module, exports, __webpack_require__) {
3054
3055"use strict";
3056
3057
3058Object.defineProperty(exports, "__esModule", {
3059  value: true
3060});
3061
3062var _config = __webpack_require__(0);
3063
3064var _config2 = _interopRequireDefault(_config);
3065
3066function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3067
3068/**
3069 * Keeps the volume slider elements in sync.
3070 * @module visual/VolumeSliderElements
3071 */
3072var VolumeSliderElements = function () {
3073  /**
3074   * Visually syncs the volume sliders so they are all the same if there
3075   * are more than one.
3076   *
3077   * @access public
3078   */
3079  function sync() {
3080    var volumeSliders = document.getElementsByClassName("amplitude-volume-slider");
3081
3082    /*
3083    Iterates over all of the volume sliders for the song, setting the value
3084    to the config value.
3085    */
3086    for (var i = 0; i < volumeSliders.length; i++) {
3087      volumeSliders[i].value = _config2.default.audio.volume * 100;
3088    }
3089  }
3090
3091  /**
3092   * Returns the public facing methods
3093   */
3094  return {
3095    sync: sync
3096  };
3097}(); /**
3098      * Imports the config module
3099      * @module config
3100      */
3101exports.default = VolumeSliderElements;
3102module.exports = exports["default"];
3103
3104/***/ }),
3105/* 12 */
3106/***/ (function(module, exports, __webpack_require__) {
3107
3108"use strict";
3109
3110
3111Object.defineProperty(exports, "__esModule", {
3112  value: true
3113});
3114
3115var _config = __webpack_require__(0);
3116
3117var _config2 = _interopRequireDefault(_config);
3118
3119function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3120
3121/**
3122 * AmplitudeJS Repeater utility. Handles setting the repeat for all scenarios.
3123 *
3124 * @module utilities/Repeater
3125 */
3126var Repeater = function () {
3127  /**
3128   * Sets the state of the repeat for a song.
3129   *
3130   * @access public
3131   * @param {boolean} repeat - A boolean representing whether the repeat should be on or off
3132   */
3133  function setRepeat(repeat) {
3134    /*
3135      Set the global repeat to be toggled
3136    */
3137    _config2.default.repeat = repeat;
3138  }
3139
3140  /**
3141   * Sets the state of the repeat for a playlist.
3142   *
3143   * @access public
3144   * @param {boolean} repeat - A boolean representing whether the repeat should be on or off
3145   * @param {string} playlist - The key of the playlist for repeating
3146   */
3147  function setRepeatPlaylist(repeat, playlist) {
3148    /*
3149      Set the playlist repeat to be toggled.
3150    */
3151    _config2.default.playlists[playlist].repeat = repeat;
3152  }
3153
3154  /**
3155   * Sets the state of the repeat song
3156   *
3157   * @access public
3158   * @param {boolean} repeat - A boolean representing whether the repeat shoudl be on or off for the song.
3159   */
3160  function setRepeatSong(repeat) {
3161    _config2.default.repeat_song = repeat;
3162  }
3163
3164  /*
3165    Returns the public facing methods
3166  */
3167  return {
3168    setRepeat: setRepeat,
3169    setRepeatPlaylist: setRepeatPlaylist,
3170    setRepeatSong: setRepeatSong
3171  };
3172}(); /**
3173      * Imports the config module
3174      * @module config
3175      */
3176exports.default = Repeater;
3177module.exports = exports["default"];
3178
3179/***/ }),
3180/* 13 */
3181/***/ (function(module, exports, __webpack_require__) {
3182
3183"use strict";
3184
3185
3186Object.defineProperty(exports, "__esModule", {
3187  value: true
3188});
3189
3190var _config = __webpack_require__(0);
3191
3192var _config2 = _interopRequireDefault(_config);
3193
3194function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3195
3196/**
3197 * AmplitudeJS Shuffle Module. Handles all of the shuffling functionality for
3198 * AmplitudeJS
3199 *
3200 * @module utilities/Shuffler
3201 */
3202var Shuffler = function () {
3203  /**
3204   * Sets the shuffle state globally
3205   *
3206   * @access public
3207   * @param {boolean} shuffle   - True when we are shuffling, false when we turn it off.
3208   */
3209  function setShuffle(shuffle) {
3210    _config2.default.shuffle_on = shuffle;
3211
3212    if (shuffle) {
3213      shuffleSongs();
3214    } else {
3215      _config2.default.shuffle_list = [];
3216    }
3217  }
3218
3219  /**
3220   * Toggles the shuffle status globally.
3221   *
3222   * @access public
3223   */
3224  function toggleShuffle() {
3225    /*
3226      If shuffle is on, we toggle it off. If shuffle is off, we
3227      toggle on.
3228    */
3229    if (_config2.default.shuffle_on) {
3230      _config2.default.shuffle_on = false;
3231      _config2.default.shuffle_list = [];
3232    } else {
3233      _config2.default.shuffle_on = true;
3234      shuffleSongs();
3235    }
3236  }
3237
3238  /**
3239   * Sets the shuffle state for a playlist
3240   *
3241   * @access public
3242   * @param {string} playlist   The key of the playlist we are shuffling.
3243   * @param {boolean} shuffle   True when we are shuffling the playlist, false when we turn off shuffle.
3244   */
3245  function setShufflePlaylist(playlist, shuffle) {
3246    _config2.default.playlists[playlist].shuffle = shuffle;
3247
3248    if (_config2.default.playlists[playlist].shuffle) {
3249      shufflePlaylistSongs(playlist);
3250    } else {
3251      _config2.default.playlists[playlist].shuffle_list = [];
3252    }
3253  }
3254
3255  /**
3256   * Sets the shuffle state for a playlist
3257   *
3258   * @access public
3259   * @param {string} playlist   The key of the playlist we are shuffling.
3260   */
3261  function toggleShufflePlaylist(playlist) {
3262    /*
3263      If the playlist shuffled is on, we toggle it off. If the
3264      playlist shuffled is off, we toggle it on.
3265    */
3266    if (_config2.default.playlists[playlist].shuffle) {
3267      _config2.default.playlists[playlist].shuffle = false;
3268      _config2.default.playlists[playlist].shuffle_list = [];
3269    } else {
3270      _config2.default.playlists[playlist].shuffle = true;
3271      shufflePlaylistSongs(playlist);
3272    }
3273  }
3274
3275  /**
3276   * Shuffles individual songs in the config
3277   * Based off of: http://www.codinghorror.com/blog/2007/12/the-danger-of-naivete.html
3278   *
3279   * Public Accessor: Shuffle.shuffleSongs()
3280   *
3281   * @access public
3282   */
3283  function shuffleSongs() {
3284    /*
3285    Builds a temporary array with the length of the config.
3286    */
3287    var shuffleTemp = new Array(_config2.default.songs.length);
3288
3289    /*
3290    Set the temporary array equal to the songs array.
3291    */
3292    for (var i = 0; i < _config2.default.songs.length; i++) {
3293      shuffleTemp[i] = _config2.default.songs[i];
3294    }
3295
3296    /*
3297    Iterate ove rthe songs and generate random numbers to
3298    swap the indexes of the shuffle array.
3299    */
3300    for (var _i = _config2.default.songs.length - 1; _i > 0; _i--) {
3301      var randNum = Math.floor(Math.random() * _config2.default.songs.length + 1);
3302      shuffleSwap(shuffleTemp, _i, randNum - 1);
3303    }
3304
3305    /*
3306    Set the shuffle list to the shuffle temp.
3307    */
3308    _config2.default.shuffle_list = shuffleTemp;
3309  }
3310
3311  /**
3312   * Shuffle songs in a playlist
3313   *
3314   * Public Accessor: Shuffle.shufflePlaylistSongs( playlist )
3315   *
3316   * @access public
3317   * @param {string} playlist - The playlist we are shuffling.
3318   */
3319  function shufflePlaylistSongs(playlist) {
3320    /*
3321      Builds a temporary array with the length of the playlist songs.
3322    */
3323    var shuffleTemp = new Array(_config2.default.playlists[playlist].songs.length);
3324
3325    /*
3326      Set the temporary array equal to the playlist array.
3327    */
3328    for (var i = 0; i < _config2.default.playlists[playlist].songs.length; i++) {
3329      shuffleTemp[i] = _config2.default.playlists[playlist].songs[i];
3330    }
3331
3332    /*
3333      Iterate ove rthe songs and generate random numbers to
3334      swap the indexes of the shuffle array.
3335    */
3336    for (var _i2 = _config2.default.playlists[playlist].songs.length - 1; _i2 > 0; _i2--) {
3337      var randNum = Math.floor(Math.random() * _config2.default.playlists[playlist].songs.length + 1);
3338      shuffleSwap(shuffleTemp, _i2, randNum - 1);
3339    }
3340
3341    /*
3342      Set the shuffle list to the shuffle temp.
3343    */
3344    _config2.default.playlists[playlist].shuffle_list = shuffleTemp;
3345  }
3346
3347  /**
3348   * Swaps and randomizes the song shuffle.
3349   *
3350   * @access private
3351   * @param {object} shuffleList 	- The list of songs that is going to be shuffled
3352   * @param {number} original 		- The original index of he song in the songs array
3353   * @param {number} random 			- The randomized index that will be the new index of the song in the shuffle array.
3354   */
3355  function shuffleSwap(shuffleList, original, random) {
3356    var temp = shuffleList[original];
3357    shuffleList[original] = shuffleList[random];
3358    shuffleList[random] = temp;
3359  }
3360
3361  /**
3362   * Returns public facing methods
3363   */
3364  return {
3365    setShuffle: setShuffle,
3366    toggleShuffle: toggleShuffle,
3367    setShufflePlaylist: setShufflePlaylist,
3368    toggleShufflePlaylist: toggleShufflePlaylist,
3369    shuffleSongs: shuffleSongs,
3370    shufflePlaylistSongs: shufflePlaylistSongs
3371  };
3372}(); /**
3373      * Imports the config module
3374      * @module config
3375      */
3376exports.default = Shuffler;
3377module.exports = exports["default"];
3378
3379/***/ }),
3380/* 14 */
3381/***/ (function(module, exports, __webpack_require__) {
3382
3383"use strict";
3384
3385
3386Object.defineProperty(exports, "__esModule", {
3387  value: true
3388});
3389
3390var _config = __webpack_require__(0);
3391
3392var _config2 = _interopRequireDefault(_config);
3393
3394function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3395
3396/**
3397 * Defines the visual representation of AmplitudeJS song slider elements.
3398 * @module visual/SongSliderElements
3399 */
3400var SongSliderElements = function () {
3401  /**
3402   * Syncs all of the song slider elements.
3403   *
3404   * @access public
3405   * @param {number} location 	- The location of the song as a percentage.
3406   * @param {string} playlist 	- The playlist we are setting the song slider for.
3407   * @param {number} songIndex 	- The index of the song we are adjusting the song slider for.
3408   */
3409  function sync(location, playlist, songIndex) {
3410    syncMain(location);
3411    syncPlaylist(location, playlist);
3412    syncSong(location, songIndex);
3413    syncSongInPlaylist(location, playlist);
3414  }
3415
3416  /**
3417   * Syncs the main slider location
3418   *
3419   * @access public
3420   * @param {number} location 	- The location of the song as a percentage.
3421   */
3422  function syncMain(location) {
3423    /*
3424    Ensure we have a location that's a number
3425    */
3426    location = !isNaN(location) ? location : 0;
3427
3428    /*
3429    Gets the main song sliders
3430    */
3431    var mainSongSliders = document.querySelectorAll(".amplitude-song-slider");
3432
3433    /*
3434    Iterates over all of the main sliders and sets the value to the
3435    percentage of the song played.
3436    */
3437    for (var i = 0; i < mainSongSliders.length; i++) {
3438      /*
3439        Grab the playlist and song attributes from the element.
3440      */
3441      var playlist = mainSongSliders[i].getAttribute("data-amplitude-playlist");
3442      var song = mainSongSliders[i].getAttribute("data-amplitude-song-index");
3443
3444      /*
3445        This method is responsible for only the global elements,
3446        so we make sure there are no playlist or songs defined on
3447        the element.
3448      */
3449      if (playlist == null && song == null) {
3450        mainSongSliders[i].value = location;
3451      }
3452    }
3453  }
3454
3455  /**
3456   * Syncs playlist song slider locations
3457   *
3458   * @access public
3459   * @param {number} location 	- The location of the song as a percentage.
3460   * @param {string} playlist 	- The playlist we are setting the song slider for.
3461   */
3462  function syncPlaylist(location, playlist) {
3463    /*
3464    Ensure we have a location that's a number
3465    */
3466    location = !isNaN(location) ? location : 0;
3467
3468    /*
3469    Gets the playlist song sliders
3470    */
3471    var playlistSongSliders = document.querySelectorAll('.amplitude-song-slider[data-amplitude-playlist="' + playlist + '"]');
3472
3473    /*
3474    Iterates over all of the playlist sliders and sets the value to the
3475    percentage of the song played.
3476    */
3477    for (var i = 0; i < playlistSongSliders.length; i++) {
3478      /*
3479        Grab the playlist and song attributes from the element.
3480      */
3481      var playlistAttribute = playlistSongSliders[i].getAttribute("data-amplitude-playlist");
3482      var songAttribute = playlistSongSliders[i].getAttribute("data-amplitude-song-index");
3483
3484      /*
3485      This method is responsible for only the playlist elements,
3486      so we make sure the playlist attribute matches what is passed
3487      in.
3488      */
3489      if (playlistAttribute == playlist && songAttribute == null) {
3490        playlistSongSliders[i].value = location;
3491      }
3492    }
3493  }
3494
3495  /**
3496   * Syncs individual song slider locations
3497   *
3498   * @access public
3499   * @param {number} location 	- The location of the song as a percentage.
3500   * @param {number} songIndex 	- The index of the song we are adjusting the song slider for.
3501   */
3502  function syncSong(location, songIndex) {
3503    /*
3504    We only want to sync song sliders if the playlist is null.
3505    */
3506    if (_config2.default.active_playlist == null) {
3507      /*
3508      Ensure we have a location that's a number
3509      */
3510      location = !isNaN(location) ? location : 0;
3511
3512      /*
3513      Gets the individual song sliders
3514      */
3515      var songSliders = document.querySelectorAll('.amplitude-song-slider[data-amplitude-song-index="' + songIndex + '"]');
3516
3517      /*
3518      Iterates over all of the individual song sliders and sets the value
3519      to the percentage of the song played.
3520      */
3521      for (var i = 0; i < songSliders.length; i++) {
3522        /*
3523         Grab the playlist and song attributes from the element.
3524        */
3525        var playlistAttribute = songSliders[i].getAttribute("data-amplitude-playlist");
3526        var songAttribute = songSliders[i].getAttribute("data-amplitude-song-index");
3527
3528        /*
3529        This method is responsible for only the playlist elements,
3530        so we make sure the playlist attribute matches what is passed
3531        in.
3532        */
3533        if (playlistAttribute == null && songAttribute == songIndex) {
3534          songSliders[i].value = location;
3535        }
3536      }
3537    }
3538  }
3539
3540  /**
3541   * Syncs individual song slider locations
3542   *
3543   * @access public
3544   * @param {number} location 	- The location of the song as a percentage.
3545   * @param {string} playlist 	- The playlist we are setting the song slider for.
3546   */
3547  function syncSongInPlaylist(location, playlist) {
3548    /*
3549    Ensure we have a location that's a number
3550    */
3551    location = !isNaN(location) ? location : 0;
3552
3553    var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null;
3554
3555    /*
3556    Gets the song in playlist sliders
3557    */
3558    var songInPlaylistSliders = document.querySelectorAll('.amplitude-song-slider[data-amplitude-playlist="' + playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]');
3559
3560    /*
3561    Iterates over all of the song in playlist sliders and sets the value
3562    to the percentage of the song played.
3563    */
3564    for (var i = 0; i < songInPlaylistSliders.length; i++) {
3565      songInPlaylistSliders[i].value = location;
3566    }
3567  }
3568
3569  /**
3570   * Visually syncs the song sliders back to 0. This usually happens when
3571   * a song has changed, we ensure that all song sliders get reset.
3572   *
3573   * @access public
3574   */
3575  function resetElements() {
3576    var songSliders = document.getElementsByClassName("amplitude-song-slider");
3577
3578    /*
3579    Iterate over all of the song sliders and set them to
3580    0 essentially resetting them.
3581    */
3582    for (var i = 0; i < songSliders.length; i++) {
3583      songSliders[i].value = 0;
3584    }
3585  }
3586
3587  /**
3588   * Returns the public facing methods
3589   */
3590  return {
3591    sync: sync,
3592    syncMain: syncMain,
3593    syncPlaylist: syncPlaylist,
3594    syncSong: syncSong,
3595    syncSongInPlaylist: syncSongInPlaylist,
3596    resetElements: resetElements
3597  };
3598}(); /**
3599      * Imports the config module
3600      * @module config
3601      */
3602exports.default = SongSliderElements;
3603module.exports = exports["default"];
3604
3605/***/ }),
3606/* 15 */
3607/***/ (function(module, exports, __webpack_require__) {
3608
3609"use strict";
3610
3611
3612Object.defineProperty(exports, "__esModule", {
3613  value: true
3614});
3615
3616var _currentTimeElements = __webpack_require__(53);
3617
3618var _currentTimeElements2 = _interopRequireDefault(_currentTimeElements);
3619
3620var _currentHourElements = __webpack_require__(50);
3621
3622var _currentHourElements2 = _interopRequireDefault(_currentHourElements);
3623
3624var _currentMinuteElements = __webpack_require__(51);
3625
3626var _currentMinuteElements2 = _interopRequireDefault(_currentMinuteElements);
3627
3628var _currentSecondElements = __webpack_require__(52);
3629
3630var _currentSecondElements2 = _interopRequireDefault(_currentSecondElements);
3631
3632var _durationCountDownTimeElements = __webpack_require__(54);
3633
3634var _durationCountDownTimeElements2 = _interopRequireDefault(_durationCountDownTimeElements);
3635
3636var _durationHourElements = __webpack_require__(55);
3637
3638var _durationHourElements2 = _interopRequireDefault(_durationHourElements);
3639
3640var _durationMinuteElements = __webpack_require__(56);
3641
3642var _durationMinuteElements2 = _interopRequireDefault(_durationMinuteElements);
3643
3644var _durationSecondElements = __webpack_require__(57);
3645
3646var _durationSecondElements2 = _interopRequireDefault(_durationSecondElements);
3647
3648var _durationTimeElements = __webpack_require__(58);
3649
3650var _durationTimeElements2 = _interopRequireDefault(_durationTimeElements);
3651
3652function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3653
3654/**
3655 * Time Elements Interface. This allows us to update all of the sub time elements
3656 * through one central point.
3657 * @module visual/TimeElements
3658 */
3659
3660
3661/**
3662 * Imports the AmplitudeJS Duration Second Elements
3663 * @module visual/time/DurationSecondElements
3664 */
3665
3666
3667/**
3668 * Imports the AmplitudeJS Duration Hour Elements
3669 * @module visual/time/DurationHourElements
3670 */
3671
3672
3673/**
3674 * Imports the AmplitudeJS Current Second Elements
3675 * @module visual/time/CurrentTimeElements
3676 */
3677
3678
3679/**
3680 * Imports the AmplitudeJS Current Hour Elements
3681 * @module visual/time/CurrentHourElements
3682 */
3683var TimeElements = function () {
3684  /**
3685   * Resets the current times.
3686   */
3687  function resetCurrentTimes() {
3688    _currentTimeElements2.default.resetTimes();
3689    _currentHourElements2.default.resetTimes();
3690    _currentMinuteElements2.default.resetTimes();
3691    _currentSecondElements2.default.resetTimes();
3692  }
3693
3694  /**
3695   * Syncs the current time elements to the time provided.
3696   *
3697   * @param {Object} currentTime - An object representing the current time of the audio.
3698   */
3699  function syncCurrentTimes(currentTime) {
3700    _currentTimeElements2.default.sync(currentTime);
3701    _currentHourElements2.default.sync(currentTime.hours);
3702    _currentMinuteElements2.default.sync(currentTime.minutes);
3703    _currentSecondElements2.default.sync(currentTime.seconds);
3704  }
3705
3706  /**
3707   * Resets the duration times.
3708   */
3709  function resetDurationTimes() {
3710    _durationCountDownTimeElements2.default.resetTimes();
3711    _durationHourElements2.default.resetTimes();
3712    _durationMinuteElements2.default.resetTimes();
3713    _durationSecondElements2.default.resetTimes();
3714    _durationTimeElements2.default.resetTimes();
3715  }
3716
3717  /**
3718   * Syncs the duration times to the times provided.
3719   *
3720   * @param {Object} currentTime - An object representing the current time of the audio.
3721   * @param {Object} songDuration - An object representing the duration of the audio
3722   */
3723  function syncDurationTimes(currentTime, songDuration) {
3724    _durationCountDownTimeElements2.default.sync(currentTime, songDuration);
3725    _durationTimeElements2.default.sync(songDuration);
3726    _durationHourElements2.default.sync(songDuration.hours);
3727    _durationMinuteElements2.default.sync(songDuration.minutes);
3728    _durationSecondElements2.default.sync(songDuration.seconds);
3729  }
3730
3731  /**
3732   * Returns the publically accessible methods.
3733   */
3734  return {
3735    resetCurrentTimes: resetCurrentTimes,
3736    syncCurrentTimes: syncCurrentTimes,
3737    resetDurationTimes: resetDurationTimes,
3738    syncDurationTimes: syncDurationTimes
3739  };
3740}();
3741
3742/**
3743 * Imports the AmplitudeJS Duration Time Elements
3744 * @module visual/time/DurationTimeElements
3745 */
3746
3747
3748/**
3749 * Imports the AmplitudeJS Duration Minute Elements
3750 * @module visual/time/DurationMinuteElements
3751 */
3752
3753
3754/**
3755 * Imports the AmplitudeJS Duration Count Down Time Elements
3756 * @module visual/time/DurationCountDownTimeElements
3757 */
3758
3759
3760/**
3761 * Imports the AmplitudeJS Current Minute Elements
3762 * @module visual/time/CurrentMinuteElements
3763 */
3764/**
3765 * Imports the AmplitudeJS Current Time
3766 * @module visual/time/CurrentTimeElements
3767 */
3768exports.default = TimeElements;
3769module.exports = exports["default"];
3770
3771/***/ }),
3772/* 16 */
3773/***/ (function(module, exports, __webpack_require__) {
3774
3775"use strict";
3776
3777
3778Object.defineProperty(exports, "__esModule", {
3779  value: true
3780});
3781
3782var _config = __webpack_require__(0);
3783
3784var _config2 = _interopRequireDefault(_config);
3785
3786var _debug = __webpack_require__(4);
3787
3788var _debug2 = _interopRequireDefault(_debug);
3789
3790function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3791
3792/**
3793 * Handles the visualizations elements.
3794 *
3795 * @module Visualizations
3796 */
3797/**
3798 * Imports the config module
3799 * @module config
3800 */
3801var Visualizations = function () {
3802  /**
3803   * Runs all of the visualizations on the screen.
3804   */
3805  function run() {
3806    /*
3807      Get all of the visualization elements on the page
3808    */
3809    var visualizationElements = document.querySelectorAll(".amplitude-visualization");
3810
3811    /*
3812      If the web audio API is available, we display the visualizations.
3813    */
3814    if (_config2.default.web_audio_api_available) {
3815      /*
3816        If the visualization has not started, there are visualizations available,
3817        and we have at least one visualization element, then we continue.
3818      */
3819      if (Object.keys(_config2.default.visualizations.available).length > 0 && visualizationElements.length > 0) {
3820        /*
3821            Iterate over all of the visualizations on the page and activate the
3822            ones we need.
3823          */
3824        for (var i = 0; i < visualizationElements.length; i++) {
3825          /*
3826              Grab the playlist and song attributes from the visualization to
3827              determine which one we run.
3828            */
3829          var playlist = visualizationElements[i].getAttribute("data-amplitude-playlist");
3830          var song = visualizationElements[i].getAttribute("data-amplitude-song-index");
3831
3832          /*
3833              If the playlist and song are null, it's a global visualization element.
3834            */
3835          if (playlist == null && song == null) {
3836            runGlobalVisualization(visualizationElements[i]);
3837          }
3838
3839          /*
3840              if the playlist is not null and the song is null it's a playlist visualization
3841              element.
3842            */
3843          if (playlist != null && song == null) {
3844            runPlaylistVisualization(visualizationElements[i], playlist);
3845          }
3846
3847          /*
3848              If the playlist is null and the song is not null it's a song visualization element.
3849            */
3850          if (playlist == null && song != null) {
3851            runSongVisualization(visualizationElements[i], song);
3852          }
3853
3854          /*
3855              If the playlist and song are not null then it's a song in playlist visualization
3856              element.
3857            */
3858          if (playlist != null && song != null) {
3859            runSongInPlaylistVisualization(visualizationElements[i], playlist, song);
3860          }
3861        }
3862      }
3863    } else {
3864      displayBackups();
3865    }
3866  }
3867
3868  /**
3869   * Runs a global visualization
3870   *
3871   * @param {Node} element  The container element that handles the visualization.
3872   */
3873  function runGlobalVisualization(element) {
3874    /*
3875      Gets the global visualization index and the active song visualization indexes
3876      so we know which visualization to use. The song will override the global
3877    */
3878    var globalVisualizationIndex = _config2.default.visualization;
3879    var activeSongVisualizationIndex = _config2.default.active_index != null ? _config2.default.songs[_config2.default.active_index].visualization : _config2.default.playlists[_config2.default.active_playlist].songs[_config2.default.playlists[_config2.default.active_playlist].active_index].visualization;
3880
3881    /*
3882      If the active song visualization is defined and the visualization exists,
3883      use that visualization.
3884    */
3885    if (activeSongVisualizationIndex != undefined && _config2.default.visualizations.available[activeSongVisualizationIndex] != undefined) {
3886      addToActiveVisualizations(activeSongVisualizationIndex, element);
3887
3888      /*
3889      If the user defined a global visualization, use that one.
3890      */
3891    } else if (globalVisualizationIndex != undefined && _config2.default.visualizations.available[globalVisualizationIndex] != undefined) {
3892      addToActiveVisualizations(globalVisualizationIndex, element);
3893
3894      /*
3895      If the user didn't define a global visualization, use the first visualization
3896      registered if there is one.
3897      */
3898    } else {
3899      /*
3900        Grab the first registered visualization. If it exists, use that one.
3901      */
3902      var firstVisualization = Object.keys(_config2.default.visualizations.available).length > 0 ? Object.keys(_config2.default.visualizations.available)[0] : null;
3903
3904      if (firstVisualization != null) {
3905        addToActiveVisualizations(firstVisualization, element);
3906      }
3907    }
3908  }
3909
3910  /**
3911   * Run a specific playlist visualization.
3912   *
3913   * @param {Node} element  The container element that handles the visualization.
3914   * @param {string} playlist The key of the playlist we are running the visualization for.
3915   */
3916  function runPlaylistVisualization(element, playlist) {
3917    /*
3918      If the playlist is equal to the active playlist, then we continue.
3919    */
3920    if (playlist == _config2.default.active_playlist) {
3921      /*
3922        Checks if the song has a visualization and that visualization exists,
3923        run that visualization.
3924      */
3925      var activeSongVisualizationIndex = _config2.default.playlists[_config2.default.active_playlist].songs[_config2.default.playlists[_config2.default.active_playlist].active_index].visualization;
3926      var activePlaylistVisualizationIndex = _config2.default.playlists[_config2.default.active_playlist].visualization;
3927      var globalVisualizationIndex = _config2.default.visualization;
3928
3929      /*
3930        If the actual song has a visualization, we run that.
3931      */
3932      if (activeSongVisualizationIndex != undefined && _config2.default.visualizations.available[activeSongVisualizationIndex] != undefined) {
3933        addToActiveVisualizations(activeSongVisualizationIndex, element);
3934
3935        /*
3936        If the actual playlist has a visualization, run that.
3937        */
3938      } else if (activePlaylistVisualizationIndex != undefined && _config2.default.visualizations.available[activePlaylistVisualizationIndex] != undefined) {
3939        addToActiveVisualizations(activePlaylistVisualizationIndex, element);
3940
3941        /*
3942        If a global visualization is defined, run that.
3943        */
3944      } else if (globalVisualizationIndex != undefined && _config2.default.visualizations.available[globalVisualizationIndex] != undefined) {
3945        addToActiveVisualizations(globalVisualizationIndex, element);
3946      } else {
3947        /*
3948          Grab the first registered visualization. If it exists, use that one.
3949        */
3950        var firstVisualization = Object.keys(_config2.default.visualizations.available).length > 0 ? Object.keys(_config2.default.visualizations.available)[0] : null;
3951
3952        if (firstVisualization != null) {
3953          addToActiveVisualizations(firstVisualization, element);
3954        }
3955      }
3956    }
3957  }
3958
3959  /**
3960   * Run a song specific visualization.
3961   *
3962   * @param {Node} element The container element that handles the visualization.
3963   * @param {string} song The song index that we are running the visualization for.
3964   */
3965  function runSongVisualization(element, song) {
3966    /*
3967      If the song is equal to the active song, then we continue.
3968    */
3969    if (song == _config2.default.active_index) {
3970      /*
3971        Get the indexes of the song
3972      */
3973      var activeSongVisualizationIndex = _config2.default.songs[_config2.default.active_index].visualization;
3974      var globalVisualizationIndex = _config2.default.visualization;
3975
3976      /*
3977        If the song has a visualization, run that.
3978      */
3979      if (activeSongVisualizationIndex != undefined && _config2.default.visualizations.available[activeSongVisualizationIndex] != undefined) {
3980        addToActiveVisualizations(activeSongVisualizationIndex, element);
3981
3982        /*
3983        If the global visualization is set, use that.
3984        */
3985      } else if (globalVisualizationIndex != undefined && _config2.default.visualizations.available[globalVisualizationIndex] != undefined) {
3986        addToActiveVisualizations(globalVisualizationIndex, element);
3987      } else {
3988        /*
3989          Grab the first registered visualization. If it exists, use that one.
3990        */
3991        var firstVisualization = Object.keys(_config2.default.visualizations.available).length > 0 ? Object.keys(_config2.default.visualizations.available)[0] : null;
3992
3993        if (firstVisualization != null) {
3994          addToActiveVisualizations(firstVisualization, element);
3995        }
3996      }
3997    }
3998  }
3999
4000  /**
4001   * Run a song in playlist visualization.
4002   *
4003   * @param {Node} element - The element containing the visualization.
4004   * @param {string} playlist - The string of the playlist key.
4005   * @param {index} song - The index of the song in the playlist.
4006   */
4007  function runSongInPlaylistVisualization(element, playlist, song) {
4008    /*
4009      If the playlist is the same as the active playlist and the active
4010      index of the song is the same as the song, then we continue.
4011    */
4012    if (playlist == _config2.default.active_playlist && _config2.default.playlists[playlist].active_index == song) {
4013      /*
4014        Checks if the song has a visualization and that visualization exists,
4015        run that visualization.
4016      */
4017      var activeSongVisualizationIndex = _config2.default.playlists[_config2.default.active_playlist].songs[_config2.default.playlists[_config2.default.active_playlist].active_index].visualization;
4018      var activePlaylistVisualizationIndex = _config2.default.playlists[_config2.default.active_playlist].visualization;
4019      var globalVisualizationIndex = _config2.default.visualization;
4020
4021      /*
4022        If the active song has a visualization, we use that.
4023      */
4024      if (activeSongVisualizationIndex != undefined && _config2.default.visualizations.available[activeSongVisualizationIndex] != undefined) {
4025        addToActiveVisualizations(activeSongVisualizationIndex, element);
4026
4027        /*
4028        If the active playlist has a visualization, we use that.
4029        */
4030      } else if (activePlaylistVisualizationIndex != undefined && _config2.default.visualizations.available[activePlaylistVisualizationIndex] != undefined) {
4031        addToActiveVisualizations(activePlaylistVisualizationIndex, element);
4032
4033        /*
4034        If the global visualization has been set, we use that.
4035        */
4036      } else if (globalVisualizationIndex != undefined && _config2.default.visualizations.available[globalVisualizationIndex] != undefined) {
4037        addToActiveVisualizations(globalVisualizationIndex, element);
4038      } else {
4039        /*
4040          Grab the first registered visualization. If it exists, use that one.
4041        */
4042        var firstVisualization = Object.keys(_config2.default.visualizations.available).length > 0 ? Object.keys(_config2.default.visualizations.available)[0] : null;
4043
4044        if (firstVisualization != null) {
4045          addToActiveVisualizations(firstVisualization, element);
4046        }
4047      }
4048    }
4049  }
4050
4051  /**
4052   * Add a visualization to the array of active visualizations.
4053   *
4054   * @param {string} key - The key of the active visualization.
4055   * @param {Node} element - The element that the visualization will be applied to.
4056   */
4057  function addToActiveVisualizations(key, element) {
4058    var visualization = new _config2.default.visualizations.available[key]["object"]();
4059    visualization.setPreferences(_config2.default.visualizations.available[key]["preferences"]);
4060    visualization.startVisualization(element);
4061    _config2.default.visualizations.active.push(visualization);
4062  }
4063
4064  /**
4065   * Stops all active visualizations.
4066   */
4067  function stop() {
4068    /*
4069      Iterates over all of the visualizations and stop the visualization.
4070    */
4071    for (var i = 0; i < _config2.default.visualizations.active.length; i++) {
4072      _config2.default.visualizations.active[i].stopVisualization();
4073    }
4074
4075    /*
4076      Clear the active visualizations.
4077    */
4078    _config2.default.visualizations.active = [];
4079  }
4080
4081  /**
4082   * Registers any visualization we can use.
4083   *
4084   * @param {object} visualization The visualization object itself
4085   * @param {object} preferences User preferences overrides.
4086   */
4087  function register(visualization, preferences) {
4088    /*
4089      Initialize the new visualization.
4090    */
4091    var newVisualization = new visualization();
4092
4093    /*
4094     Adds the visualization to the global config so it knows
4095     it can be used when playing songs.
4096      getID is a public function for getting a visualization's id.
4097     It becomes the key to access the visualization.
4098    */
4099    _config2.default.visualizations.available[newVisualization.getID()] = new Array();
4100    _config2.default.visualizations.available[newVisualization.getID()]["object"] = visualization;
4101    _config2.default.visualizations.available[newVisualization.getID()]["preferences"] = preferences;
4102  }
4103
4104  /**
4105   * Displays the backups for the visualizations.
4106   */
4107  function displayBackups() {
4108    /*
4109      Get all of the visualization elements on the page
4110    */
4111    var visualizationElements = document.querySelectorAll(".amplitude-visualization");
4112
4113    if (visualizationElements.length > 0) {
4114      for (var x = 0; x < visualizationElements.length; x++) {
4115        /*
4116          Grab the playlist and song attributes from the visualization to
4117          determine which one we run.
4118        */
4119        var playlist = visualizationElements[x].getAttribute("data-amplitude-playlist");
4120        var song = visualizationElements[x].getAttribute("data-amplitude-song-index");
4121
4122        /*
4123          If the playlist and song are null, it's a global visualization element.
4124        */
4125        if (playlist == null && song == null) {
4126          displayGlobalBackup(visualizationElements[x]);
4127        }
4128
4129        /*
4130          if the playlist is not null and the song is null it's a playlist visualization
4131          element.
4132        */
4133        if (playlist != null && song == null) {
4134          displayPlaylistBackup(visualizationElements[x], playlist);
4135        }
4136
4137        /*
4138          If the playlist is null and the song is not null it's a song visualization element.
4139        */
4140        if (playlist == null && song != null) {
4141          displaySongBackup(visualizationElements[x], song);
4142        }
4143
4144        /*
4145          If the playlist and song are not null then it's a song in playlist visualization
4146          element.
4147        */
4148        if (playlist != null && song != null) {
4149          displaySongInPlaylistBackup(visualizationElements[x], playlist, song);
4150        }
4151      }
4152    }
4153  }
4154
4155  /**
4156   * Displays the global backup which is the cover art of the image in the
4157   * visualization container.
4158   *
4159   * @param {node} element  - The element we are adding the background image to.
4160   */
4161  function displayGlobalBackup(element) {
4162    element.style.backgroundImage = "url("
4162/news/core/assets/bower_components/amplitudejs/dist/ + _config2.default.active_metadata.cover_art_url + ")";
4163  }
4164
4165  /**
4166   * Displays the playlist backup which is the cover art of the image in the
4167   * visualization container.
4168   *
4169   * @param {node} element  - The element we are adding the background image to.
4170   */
4171  function displayPlaylistBackup(element, playlist) {
4172    if (_config2.default.active_playlist == playlist) {
4173      element.style.backgroundImage = "url("/news/core/assets/bower_components/amplitudejs/dist/ + _config2.default.active_metadata.cover_art_url + ")";
4174    }
4175  }
4176
4177  /**
4178   * Displays the song backup which is the cover art of the image in the
4179   * visualization container.
4180   *
4181   * @param {node} element  - The element we are adding the background image to.
4182   */
4183  function displaySongBackup(element, song) {
4184    if (_config2.default.active_index == song) {
4185      element.style.backgroundImage = "url("/news/core/assets/bower_components/amplitudejs/dist/ + _config2.default.active_metadata.cover_art_url + ")";
4186    }
4187  }
4188
4189  /**
4190   * Displays the song in playlist backup which is the cover art of the image in the
4191   * visualization container.
4192   *
4193   * @param {node} element  - The element we are adding the background image to.
4194   */
4195  function displaySongInPlaylistBackup(element, playlist, song) {
4196    if (_config2.default.active_playlist == playlist && _config2.default.playlists[active_playlist].active_index == song) {
4197      element.style.backgroundImage = "url("/news/core/assets/bower_components/
vendor: 26,522 bytes, lines 4197-5115
4197amplitudejs/dist/ + _config2.default.active_metadata.cover_art_url + ")";
4198    }
4199  }
4200
4201  /*
4202    Returns the public facing methods
4203  */
4204  return {
4205    run: run,
4206    stop: stop,
4207    register: register
4208  };
4209}();
4210
4211/**
4212 * Imports the debug module
4213 * @module utilities/Debug
4214 */
4215exports.default = Visualizations;
4216module.exports = exports["default"];
4217
4218/***/ }),
4219/* 17 */
4220/***/ (function(module, exports, __webpack_require__) {
4221
4222"use strict";
4223
4224
4225Object.defineProperty(exports, "__esModule", {
4226  value: true
4227});
4228
4229var _config = __webpack_require__(0);
4230
4231var _config2 = _interopRequireDefault(_config);
4232
4233var _init = __webpack_require__(21);
4234
4235var _init2 = _interopRequireDefault(_init);
4236
4237function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4238
4239/**
4240 * These helpers wrap around the basic methods of the Soundcloud API
4241 * and get the information we need from SoundCloud to make the songs
4242 * streamable through Amplitude
4243 *
4244 * @module soundcloud/SoundCloud
4245 */
4246/**
4247 * Imports the config module
4248 * @module config
4249 */
4250var SoundCloud = function () {
4251  /**
4252   * Defines the temporary user config used while we configure soundcloud
4253   * @type {object}
4254   */
4255  var tempUserConfig = {};
4256
4257  /**
4258   * Loads the soundcloud SDK for use with Amplitude so the user doesn't have
4259   * to load it themselves.
4260   * With help from: http://stackoverflow.com/questions/950087/include-a-javascript-file-in-another-javascript-file
4261   *
4262   * @access public
4263   * @param {object} userConfig 	- The config defined by the user for AmplitudeJS
4264   */
4265  function loadSoundCloud(userConfig) {
4266    /*
4267    Sets the temporary config to the config passed by the user so we can make changes
4268    and not break the actual config.
4269    */
4270    tempUserConfig = userConfig;
4271
4272    /*
4273    Gets the head tag for the document and create a script element.
4274    */
4275    var head = document.getElementsByTagName("head")[0];
4276    var script = document.createElement("script");
4277
4278    script.type = "text/javascript";
4279
4280    /*
4281    URL to the remote soundcloud SDK
4282    */
4283    script.src = "https://connect.soundcloud.com/sdk.js";
4284    script.onreadystatechange = initSoundcloud;
4285    script.onload = initSoundcloud;
4286
4287    /*
4288    Add the script to the head of the document.
4289    */
4290    head.appendChild(script);
4291  }
4292
4293  /**
4294   * Initializes soundcloud with the key provided.
4295   *
4296   * @access private
4297   */
4298  function initSoundcloud() {
4299    /*
4300    Calls the SoundCloud initialize function
4301    from their API and sends it the client_id
4302    that the user passed in.
4303    */
4304    SC.initialize({
4305      client_id: _config2.default.soundcloud_client
4306    });
4307
4308    /*
4309    Gets the streamable URLs to run through Amplitue. This is
4310    VERY important since Amplitude can't stream the copy and pasted
4311    link from the SoundCloud page, but can resolve the streaming
4312    URLs from the link.
4313    */
4314    getStreamableURLs();
4315  }
4316
4317  /**
4318   * Gets the streamable URL from the URL provided for
4319   * all of the soundcloud links.  This will loop through
4320   * and set all of the information for the soundcloud
4321   * urls.
4322   *
4323   * @access private
4324   */
4325  function getStreamableURLs() {
4326    /*
4327    Define the regex to find the soundcloud URLs
4328    */
4329    var soundcloud_regex = /^https?:\/\/(soundcloud.com|snd.sc)\/(.*)$/;
4330
4331    for (var i = 0; i < _config2.default.songs.length; i++) {
4332      /*
4333      If the URL matches soundcloud, we grab
4334      that url and get the streamable link
4335      if there is one.
4336      */
4337      if (_config2.default.songs[i].url.match(soundcloud_regex)) {
4338        _config2.default.soundcloud_song_count++;
4339        resolveStreamable(_config2.default.songs[i].url, i);
4340      }
4341    }
4342  }
4343
4344  /**
4345   * Resolves an individual streamable URL.
4346   *
4347   * @param {string} url - The URL of the SoundCloud song to get the streamable URL from.
4348   * @param {string} playlist - The playlist we are getting the streamable URL for.
4349   * @param {Integer} index - The index of the song in the playlist or the songs array.
4350   * @param {boolean} addToShuffleList - Whether we add to the shuffle list for the songs or playlist.
4351   *
4352   */
4353  function resolveIndividualStreamableURL(url, playlist, index) {
4354    var addToShuffleList = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
4355
4356    SC.get("/resolve/?url=" + url, function (sound) {
4357      /*
4358        If streamable we get the url and bind the client ID to the end
4359        so Amplitude can just stream the song normally. We then overwrite
4360        the url the user provided with the streamable URL.
4361      */
4362      if (sound.streamable) {
4363        if (playlist != null) {
4364          _config2.default.playlists[playlist].songs[index].url = sound.stream_url + "?client_id=" + _config2.default.soundcloud_client;
4365
4366          if (addToShuffleList) {
4367            _config2.default.playlists[playlist].shuffle_list[index].url = sound.stream_url + "?client_id=" + _config2.default.soundcloud_client;
4368          }
4369          /*
4370            If the user want's to use soundcloud art, we overwrite the
4371            cover_art_url with the soundcloud artwork url.
4372          */
4373          if (_config2.default.soundcloud_use_art) {
4374            _config2.default.playlists[playlist].songs[index].cover_art_url = sound.artwork_url;
4375
4376            if (addToShuffleList) {
4377              _config2.default.playlists[playlist].shuffle_list[index].cover_art_url = sound.artwork_url;
4378            }
4379          }
4380
4381          /*
4382            Grab the extra metadata from soundcloud and bind it to the
4383            song.  The user can get this through the public function:
4384            getActiveSongMetadata
4385          */
4386          _config2.default.playlists[playlist].songs[index].soundcloud_data = sound;
4387
4388          if (addToShuffleList) {
4389            _config2.default.playlists[playlist].shuffle_list[index].soundcloud_data = sound;
4390          }
4391        } else {
4392          _config2.default.songs[index].url = sound.stream_url + "?client_id=" + _config2.default.soundcloud_client;
4393
4394          if (addToShuffleList) {
4395            _config2.default.shuffle_list[index].stream_url + "?client_id=" + _config2.default.soundcloud_client;
4396          }
4397
4398          /*
4399            If the user want's to use soundcloud art, we overwrite the
4400            cover_art_url with the soundcloud artwork url.
4401          */
4402          if (_config2.default.soundcloud_use_art) {
4403            _config2.default.songs[index].cover_art_url = sound.artwork_url;
4404
4405            if (addToShuffleList) {
4406              _config2.default.shuffle_list[index].cover_art_url = sound.artwork_url;
4407            }
4408          }
4409
4410          /*
4411            Grab the extra metadata from soundcloud and bind it to the
4412            song.  The user can get this through the public function:
4413            getActiveSongMetadata
4414          */
4415          _config2.default.songs[index].soundcloud_data = sound;
4416
4417          if (addToShuffleList) {
4418            _config2.default.shuffle_list[index].soundcloud_data = sound;
4419          }
4420        }
4421      } else {
4422        if (playlist != null) {
4423          AmplitudeHelpers.writeDebugMessage(_config2.default.playlists[playlist].songs[index].name + " by " + _config2.default.playlists[playlist].songs[index].artist + " is not streamable by the Soundcloud API");
4424        } else {
4425          /*
4426            If not streamable, then we print a message to the user stating
4427            that the song with name X and artist X is not streamable. This
4428            gets printed ONLY if they have debug turned on.
4429          */
4430          AmplitudeHelpers.writeDebugMessage(_config2.default.songs[index].name + " by " + _config2.default.songs[index].artist + " is not streamable by the Soundcloud API");
4431        }
4432      }
4433    });
4434  }
4435
4436  /**
4437   * Due to Soundcloud SDK being asynchronous, we need to scope the
4438   * index of the song in another function. The privateGetSoundcloudStreamableURLs
4439   * function does the actual iteration and scoping.
4440   *
4441   * @access private
4442   * @param {string} url 		- URL of the soundcloud song
4443   * @param {number} index 	- The index of the soundcloud song in the songs array.
4444   */
4445  function resolveStreamable(url, index) {
4446    SC.get("/resolve/?url=" + url, function (sound) {
4447      /*
4448      If streamable we get the url and bind the client ID to the end
4449      so Amplitude can just stream the song normally. We then overwrite
4450      the url the user provided with the streamable URL.
4451      */
4452      if (sound.streamable) {
4453        _config2.default.songs[index].url = sound.stream_url + "?client_id=" + _config2.default.soundcloud_client;
4454
4455        /*
4456        If the user want's to use soundcloud art, we overwrite the
4457        cover_art_url with the soundcloud artwork url.
4458        */
4459        if (_config2.default.soundcloud_use_art) {
4460          _config2.default.songs[index].cover_art_url = sound.artwork_url;
4461        }
4462
4463        /*
4464        Grab the extra metadata from soundcloud and bind it to the
4465        song.  The user can get this through the public function:
4466        getActiveSongMetadata
4467        */
4468        _config2.default.songs[index].soundcloud_data = sound;
4469      } else {
4470        /*
4471        If not streamable, then we print a message to the user stating
4472        that the song with name X and artist X is not streamable. This
4473        gets printed ONLY if they have debug turned on.
4474        */
4475        AmplitudeHelpers.writeDebugMessage(_config2.default.songs[index].name + " by " + _config2.default.songs[index].artist + " is not streamable by the Soundcloud API");
4476      }
4477      /*
4478      Increments the song ready counter.
4479      */
4480      _config2.default.soundcloud_songs_ready++;
4481
4482      /*
4483      When all songs are accounted for, then amplitude is ready
4484      to rock and we set the rest of the config.
4485      */
4486      if (_config2.default.soundcloud_songs_ready == _config2.default.soundcloud_song_count) {
4487        _init2.default.setConfig(tempUserConfig);
4488      }
4489    });
4490  }
4491
4492  /**
4493   * Determines if a given URL is a SoundCloud URL.
4494   *
4495   * @param {string} url - The URL to test if it's a SoundCloud URL.
4496   */
4497  function isSoundCloudURL(url) {
4498    var soundcloud_regex = /^https?:\/\/(soundcloud.com|snd.sc)\/(.*)$/;
4499
4500    return url.match(soundcloud_regex);
4501  }
4502
4503  /*
4504  Returns the publically accessible methods
4505  */
4506  return {
4507    loadSoundCloud: loadSoundCloud,
4508    resolveIndividualStreamableURL: resolveIndividualStreamableURL,
4509    isSoundCloudURL: isSoundCloudURL
4510  };
4511}();
4512
4513/**
4514 * Imports the initializer
4515 * @module init/AmplitudeInitializer
4516 */
4517exports.default = SoundCloud;
4518module.exports = exports["default"];
4519
4520/***/ }),
4521/* 18 */
4522/***/ (function(module, exports, __webpack_require__) {
4523
4524"use strict";
4525
4526
4527Object.defineProperty(exports, "__esModule", {
4528  value: true
4529});
4530
4531var _config = __webpack_require__(0);
4532
4533var _config2 = _interopRequireDefault(_config);
4534
4535function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4536
4537/**
4538 * Defines the Playback Speed Visual Elements Handler
4539 * @module visual/PlaybackSpeedElements
4540 */
4541var PlaybackSpeedElements = function () {
4542  /**
4543   * Sets all of the visual playback speed buttons to have the right class
4544   * to display the background image that represents the current playback
4545   * speed.
4546   *
4547   * @access public
4548   */
4549  function sync() {
4550    /*
4551    Gets all of the playback speed classes.
4552    */
4553    var playbackSpeedClasses = document.getElementsByClassName("amplitude-playback-speed");
4554
4555    /*
4556    Iterates over all of the playback speed classes
4557    applying the right speed class for visual purposes.
4558    */
4559    for (var i = 0; i < playbackSpeedClasses.length; i++) {
4560      /*
4561      Removes all of the old playback speed classes.
4562      */
4563      playbackSpeedClasses[i].classList.remove("amplitude-playback-speed-10");
4564      playbackSpeedClasses[i].classList.remove("amplitude-playback-speed-15");
4565      playbackSpeedClasses[i].classList.remove("amplitude-playback-speed-20");
4566
4567      /*
4568      Switch the current playback speed and apply the appropriate
4569      speed class.
4570      */
4571      switch (_config2.default.playback_speed) {
4572        case 1:
4573          playbackSpeedClasses[i].classList.add("amplitude-playback-speed-10");
4574          break;
4575        case 1.5:
4576          playbackSpeedClasses[i].classList.add("amplitude-playback-speed-15");
4577          break;
4578        case 2:
4579          playbackSpeedClasses[i].classList.add("amplitude-playback-speed-20");
4580          break;
4581      }
4582    }
4583  }
4584
4585  /**
4586   * Returns the public facing methods
4587   */
4588  return {
4589    sync: sync
4590  };
4591}(); /**
4592      * Imports the config module
4593      * @module config
4594      */
4595exports.default = PlaybackSpeedElements;
4596module.exports = exports["default"];
4597
4598/***/ }),
4599/* 19 */
4600/***/ (function(module, exports, __webpack_require__) {
4601
4602"use strict";
4603
4604
4605Object.defineProperty(exports, "__esModule", {
4606  value: true
4607});
4608
4609var _config = __webpack_require__(0);
4610
4611var _config2 = _interopRequireDefault(_config);
4612
4613function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4614
4615/**
4616 * Handles all of the shuffle elements
4617 * @module visual/ShuffleElements
4618 */
4619var ShuffleElements = function () {
4620  /**
4621   * Syncs the global shuffle button visual state.
4622   *
4623   * @access public
4624   */
4625  function syncMain() {
4626    /*
4627    Gets the shuffle buttons.
4628    */
4629    var shuffleButtons = document.getElementsByClassName("amplitude-shuffle");
4630
4631    /*
4632    Iterate over all of the shuffle buttons.
4633    */
4634    for (var i = 0; i < shuffleButtons.length; i++) {
4635      /*
4636      Ensure the shuffle button doesn't belong to a playlist. We have
4637      a separate method for that.
4638      */
4639      if (shuffleButtons[i].getAttribute("data-amplitude-playlist") == null) {
4640        /*
4641        If the state of the player is shuffled on, true, then
4642        we add the 'amplitude-shuffle-on' class and remove the
4643        'amplitude-shuffle-off' class. If the player is not shuffled
4644        then we do the opposite.
4645        */
4646        if (_config2.default.shuffle_on) {
4647          shuffleButtons[i].classList.add("amplitude-shuffle-on");
4648          shuffleButtons[i].classList.remove("amplitude-shuffle-off");
4649        } else {
4650          shuffleButtons[i].classList.add("amplitude-shuffle-off");
4651          shuffleButtons[i].classList.remove("amplitude-shuffle-on");
4652        }
4653      }
4654    }
4655  }
4656
4657  /**
4658   * Syncs the playlist shuffle button visual state.
4659   *
4660   * @access public
4661   * @param {string} playlist - The playlist string the shuffle button belongs to.
4662   */
4663  function syncPlaylist(playlist) {
4664    /*
4665    Gets all of the shuffle buttons.
4666    */
4667    var shuffleButtons = document.querySelectorAll('.amplitude-shuffle[data-amplitude-playlist="' + playlist + '"]');
4668
4669    /*
4670    Iterate over all of the shuffle buttons
4671    */
4672    for (var i = 0; i < shuffleButtons.length; i++) {
4673      /*
4674      If the state of the playlist is shuffled on, true, then
4675      we add the 'amplitude-shuffle-on' class and remove the
4676      'amplitude-shuffle-off' class. If the player is not shuffled
4677      then we do the opposite.
4678      */
4679      if (_config2.default.playlists[playlist].shuffle) {
4680        shuffleButtons[i].classList.add("amplitude-shuffle-on");
4681        shuffleButtons[i].classList.remove("amplitude-shuffle-off");
4682      } else {
4683        shuffleButtons[i].classList.add("amplitude-shuffle-off");
4684        shuffleButtons[i].classList.remove("amplitude-shuffle-on");
4685      }
4686    }
4687  }
4688
4689  /**
4690   * Returns public facing methods
4691   */
4692  return {
4693    syncMain: syncMain,
4694    syncPlaylist: syncPlaylist
4695  };
4696}(); /**
4697      * Imports the config module
4698      * @module config
4699      */
4700exports.default = ShuffleElements;
4701module.exports = exports["default"];
4702
4703/***/ }),
4704/* 20 */
4705/***/ (function(module, exports, __webpack_require__) {
4706
4707"use strict";
4708
4709
4710Object.defineProperty(exports, "__esModule", {
4711  value: true
4712});
4713
4714var _config = __webpack_require__(0);
4715
4716var _config2 = _interopRequireDefault(_config);
4717
4718function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4719
4720/**
4721 * Handles the syncing of the song played progress elements.
4722 *
4723 * @module visual/SongPlayedProgressElements
4724 */
4725var SongPlayedProgressElements = function () {
4726  /**
4727   * Syncs the song played progress bars. These are HTML5 progress elements.
4728   *
4729   * @access private
4730   * @param {number} songPlayedPercentage  	- The percentage of the song that has been played.
4731   */
4732  function sync(songPlayedPercentage) {
4733    syncGlobal(songPlayedPercentage);
4734    syncPlaylist(songPlayedPercentage);
4735    syncSong(songPlayedPercentage);
4736    syncSongInPlaylist(songPlayedPercentage);
4737  }
4738
4739  /**
4740   * Sync how much has been played with a progress bar. This is the global progress bar.
4741   *
4742   * @access private
4743   * @param {number} songPlayedPercentage 	- The percent of the song completed.
4744   */
4745  function syncGlobal(percentage) {
4746    /*
4747    Ensure that the song completion percentage is a number
4748    */
4749    if (!isNaN(percentage)) {
4750      /*
4751      Get all of the song progress bars
4752      */
4753      var songPlayedProgressBars = document.querySelectorAll(".amplitude-song-played-progress");
4754
4755      for (var i = 0; i < songPlayedProgressBars.length; i++) {
4756        var playlist = songPlayedProgressBars[i].getAttribute("data-amplitude-playlist");
4757        var songIndex = songPlayedProgressBars[i].getAttribute("data-amplitude-song-index");
4758
4759        if (playlist == null && songIndex == null) {
4760          var max = songPlayedProgressBars[i].max;
4761
4762          songPlayedProgressBars[i].value = percentage / 100 * max;
4763        }
4764      }
4765    }
4766  }
4767
4768  /**
4769   * Sync how much has been played with a progress bar. This is the playlist progress bar.
4770   *
4771   * @access public
4772   * @param {number} songPlayedPercentage 	- The percent of the song completed.
4773   */
4774  function syncPlaylist(percentage) {
4775    /*
4776    Ensure that the song completion percentage is a number
4777    */
4778    if (!isNaN(percentage)) {
4779      /*
4780      Get all of the song progress bars
4781      */
4782      var songPlayedProgressBars = document.querySelectorAll('.amplitude-song-played-progress[data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
4783
4784      for (var i = 0; i < songPlayedProgressBars.length; i++) {
4785        var song = songPlayedProgressBars[i].getAttribute("data-amplitude-song-index");
4786
4787        if (song == null) {
4788          var max = songPlayedProgressBars[i].max;
4789
4790          songPlayedProgressBars[i].value = percentage / 100 * max;
4791        }
4792      }
4793    }
4794  }
4795
4796  /**
4797   * Sync how much has been played with a progress bar. This is for an individual song.
4798   *
4799   * @access private
4800   * @param {number} songPlayedPercentage 	- The percent of the song completed.
4801   */
4802  function syncSong(percentage) {
4803    if (_config2.default.active_playlist == null) {
4804      /*
4805      Ensure that the song completion percentage is a number
4806      */
4807      if (!isNaN(percentage)) {
4808        /*
4809        Get all of the song progress bars
4810        */
4811        var songPlayedProgressBars = document.querySelectorAll('.amplitude-song-played-progress[data-amplitude-song-index="' + _config2.default.active_index + '"]');
4812
4813        for (var i = 0; i < songPlayedProgressBars.length; i++) {
4814          var playlist = songPlayedProgressBars[i].getAttribute("data-amplitude-playlist");
4815
4816          if (playlist == null) {
4817            var max = songPlayedProgressBars[i].max;
4818
4819            songPlayedProgressBars[i].value = percentage / 100 * max;
4820          }
4821        }
4822      }
4823    }
4824  }
4825
4826  /**
4827   * Sync how much has been played with a progress bar. This is for an individual song in playlist.
4828   *
4829   * @access private
4830   * @param {number} songPlayedPercentage 	- The percent of the song completed.
4831   */
4832  function syncSongInPlaylist(percentage) {
4833    /*
4834    Ensure that the song completion percentage is a number
4835    */
4836    if (!isNaN(percentage)) {
4837      var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null;
4838
4839      /*
4840      Get all of the song progress bars
4841      */
4842      var songPlayedProgressBars = document.querySelectorAll('.amplitude-song-played-progress[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]');
4843
4844      /*
4845        Iterates over all of the song played progress elements
4846        and sets them accordingly.
4847      */
4848      for (var i = 0; i < songPlayedProgressBars.length; i++) {
4849        var playlist = songPlayedProgressBars[i].getAttribute("data-amplitude-playlist");
4850        var songIndex = songPlayedProgressBars[i].getAttribute("data-amplitude-song-index");
4851
4852        if (playlist != null && songIndex != null) {
4853          var max = songPlayedProgressBars[i].max;
4854
4855          songPlayedProgressBars[i].value = percentage / 100 * max;
4856        }
4857      }
4858    }
4859  }
4860
4861  /**
4862   * Sets all of the song played progress bars to 0
4863   *
4864   * @access public
4865   */
4866  function resetElements() {
4867    var songPlayedProgressBars = document.getElementsByClassName("amplitude-song-played-progress");
4868
4869    for (var i = 0; i < songPlayedProgressBars.length; i++) {
4870      songPlayedProgressBars[i].value = 0;
4871    }
4872  }
4873
4874  return {
4875    sync: sync,
4876    resetElements: resetElements
4877  };
4878}(); /**
4879      * Imports the config module
4880      * @module config
4881      */
4882exports.default = SongPlayedProgressElements;
4883module.exports = exports["default"];
4884
4885/***/ }),
4886/* 21 */
4887/***/ (function(module, exports, __webpack_require__) {
4888
4889"use strict";
4890
4891
4892Object.defineProperty(exports, "__esModule", {
4893  value: true
4894});
4895
4896var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; /**
4897                                                                                                                                                                                                                                                                               * Imports the config module
4898                                                                                                                                                                                                                                                                               * @module config
4899                                                                                                                                                                                                                                                                               */
4900
4901
4902/**
4903 * AmplitudeJS Core Module
4904 * @module core/Core
4905 */
4906
4907
4908/**
4909 * AmplitudeJS SoundCloud Module
4910 * @module soundcloud/SoundCloud
4911 */
4912
4913
4914/**
4915 * Imports the utilities used by the main module.
4916 */
4917/**
4918 * AmplitudeJS Config State Module
4919 * @module utilities/ConfigState
4920 */
4921
4922
4923/**
4924 * AmplitudeJS Debug Module
4925 * @module utilities/Debug
4926 */
4927
4928
4929/**
4930 * AmplitudeJS Checks Module
4931 * @module utilities/Checks
4932 */
4933
4934
4935/**
4936 * AmplitudeJS Shuffler Module
4937 * @module utilities/Shuffler
4938 */
4939
4940
4941/**
4942 * AmplitudeJS Events Module
4943 * @module events/Events
4944 */
4945
4946
4947/**
4948 * AmplitudeJS FX Module
4949 * @module fx/Fx
4950 */
4951
4952
4953/**
4954 * AmplitudeJS Visualizations Module
4955 * @module fx/Visualizations
4956 */
4957
4958
4959/**
4960 * AmplitudeJS WaveForm Module
4961 * @module fx/WaveForm
4962 */
4963
4964
4965/**
4966 * AmplitudeJS Audio Navigation Module.
4967 * @module utilities/AudioNavigation
4968 */
4969
4970
4971/**
4972 * AmplitudeJS Callbacks Module
4973 * @module utilities/Callbacks
4974 */
4975
4976
4977/**
4978 * AmplitudeJS Playlists Initializer Module
4979 * @module init/Playlists
4980 */
4981
4982
4983/**
4984 * Imports the AmplitudeJS Shuffle Elements
4985 * @module visual/ShuffleElements
4986 */
4987
4988
4989/**
4990 * Imports the AmplitudeJS Mute Elements
4991 * @module visual/MuteElements
4992 */
4993
4994
4995/**
4996 * Imports the AmplitudeJS Volume Slider
4997 * @module visual/VolumeSliderElements
4998 */
4999
5000
5001/**
5002 * Imports the AmplitudeJS Time Elements
5003 * @module visual/TimeElements
5004 */
5005
5006
5007/**
5008 * Imports the AmplitudeJS Play/Pause Elements Module.
5009 * @module visual/PlayPauseElements
5010 */
5011
5012
5013/**
5014 * Imports the AmplitudeJS MetaData Elements Module.
5015 * @module visual/MetaDataElements
5016 */
5017
5018
5019/**
5020 * Imports the AmplitudeJS PlaybackSpeedElements Module.
5021 * @module visual/PlayBackSpeedElements
5022 */
5023
5024
5025/**
5026 * Imports the AmplitudeJS Repeat Element
5027 * @module visual/RepeatElements
5028 */
5029
5030
5031var _config = __webpack_require__(0);
5032
5033var _config2 = _interopRequireDefault(_config);
5034
5035var _core = __webpack_require__(1);
5036
5037var _core2 = _interopRequireDefault(_core);
5038
5039var _soundcloud = __webpack_require__(17);
5040
5041var _soundcloud2 = _interopRequireDefault(_soundcloud);
5042
5043var _configState = __webpack_require__(6);
5044
5045var _configState2 = _interopRequireDefault(_configState);
5046
5047var _debug = __webpack_require__(4);
5048
5049var _debug2 = _interopRequireDefault(_debug);
5050
5051var _checks = __webpack_require__(5);
5052
5053var _checks2 = _interopRequireDefault(_checks);
5054
5055var _shuffler = __webpack_require__(13);
5056
5057var _shuffler2 = _interopRequireDefault(_shuffler);
5058
5059var _events = __webpack_require__(26);
5060
5061var _events2 = _interopRequireDefault(_events);
5062
5063var _fx = __webpack_require__(46);
5064
5065var _fx2 = _interopRequireDefault(_fx);
5066
5067var _visualizations = __webpack_require__(16);
5068
5069var _visualizations2 = _interopRequireDefault(_visualizations);
5070
5071var _waveform = __webpack_require__(22);
5072
5073var _waveform2 = _interopRequireDefault(_waveform);
5074
5075var _audioNavigation = __webpack_require__(3);
5076
5077var _audioNavigation2 = _interopRequireDefault(_audioNavigation);
5078
5079var _callbacks = __webpack_require__(7);
5080
5081var _callbacks2 = _interopRequireDefault(_callbacks);
5082
5083var _playlists = __webpack_require__(48);
5084
5085var _playlists2 = _interopRequireDefault(_playlists);
5086
5087var _shuffleElements = __webpack_require__(19);
5088
5089var _shuffleElements2 = _interopRequireDefault(_shuffleElements);
5090
5091var _muteElements = __webpack_require__(10);
5092
5093var _muteElements2 = _interopRequireDefault(_muteElements);
5094
5095var _volumeSliderElements = __webpack_require__(11);
5096
5097var _volumeSliderElements2 = _interopRequireDefault(_volumeSliderElements);
5098
5099var _timeElements = __webpack_require__(15);
5100
5101var _timeElements2 = _interopRequireDefault(_timeElements);
5102
5103var _playPauseElements = __webpack_require__(2);
5104
5105var _playPauseElements2 = _interopRequireDefault(_playPauseElements);
5106
5107var _metaDataElements = __webpack_require__(8);
5108
5109var _metaDataElements2 = _interopRequireDefault(_metaDataElements);
5110
5111var _playbackSpeedElements = __webpack_require__(18);
5112
5113var _playbackSpeedElements2 = _interopRequireDefault(_playbackSpeedElements);
5114
5115var _repeatElements = __webpack_require__(9
vendor: 2,757 bytes, lines 5115-5207
5115);
5116
5117var _repeatElements2 = _interopRequireDefault(_repeatElements);
5118
5119function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5120
5121/**
5122 * AmplitudeJS Initializer Module. Helps with the handling of all of the
5123 * initialization for AmplitudeJS.
5124 *
5125 * @module init/Initializer
5126 */
5127var Initializer = function () {
5128  /**
5129   * The main init function.  The user will call this through
5130   * Amplitude.init({}) and pass in their settings.
5131   *
5132   * Public Accessor: Amplitude.init( user_config_json )
5133   * @access public
5134   * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.
5135   */
5136  function initialize(userConfig) {
5137    var ready = false;
5138
5139    /*
5140    Reset the config on init so we have a clean slate. This is if the
5141    user has to re-init.
5142    */
5143    _configState2.default.resetConfig();
5144
5145    /*
5146    Initialize event handlers on init. This will clear any old
5147    event handlers on the amplitude element and re-bind what is
5148    necessary.
5149    */
5150    _events2.default.initialize();
5151
5152    /*
5153      Initialize the callbacks we listen to for the audio object.
5154    */
5155    _callbacks2.default.initialize();
5156
5157    /*
5158    Initializes debugging right away so we can use it for the rest
5159    of the configuration.
5160    */
5161    _config2.default.debug = userConfig.debug != undefined ? userConfig.debug : false;
5162
5163    /*
5164      Set default artwork, if specified.
5165    */
5166    setArt(userConfig);
5167
5168    /*
5169    Checks to see if the user has songs defined.
5170    */
5171    if (userConfig.songs) {
5172      /*
5173      Checks to see if the user has some songs in the songs array.
5174      */
5175      if (userConfig.songs.length != 0) {
5176        /*
5177        Copies over the user defined songs. and prepares
5178        Amplitude for the rest of the configuration.
5179        */
5180        _config2.default.songs = userConfig.songs;
5181        /*
5182        Flag amplitude as ready.
5183        */
5184        ready = true;
5185      } else {
5186        _debug2.default.writeMessage("Please add some songs, to your songs object!");
5187      }
5188    } else {
5189      _debug2.default.writeMessage("Please provide a songs object for AmplitudeJS to run!");
5190    }
5191
5192    /*
5193    Initializes the audio context. In this method it checks to see if the
5194    user wants to use visualizations or not before proceeding.
5195    */
5196    if (_fx2.default.webAudioAPIAvailable()) {
5197      if (_fx2.default.determineUsingAnyFX()) {
5198        /*
5199          Configure the Web Audio API If It's available.
5200        */
5201        _fx2.default.configureWebAudioAPI();
5202
5203        /*
5204            Activates the audio context after an event for the user.
5205        */
5206        document.documentElement.addEventListener("mousedown", function () {
5207          if (_config2.default.context.state !== 
vendor: 4,915 bytes, lines 5207-5354
5207'running') {
5208            _config2.default.context.resume();
5209          }
5210        });
5211
5212        document.documentElement.addEventListener("keydown", function () {
5213          if (_config2.default.context.state !== 'running') {
5214            _config2.default.context.resume();
5215          }
5216        });
5217
5218        document.documentElement.addEventListener("keyup", function () {
5219          if (_config2.default.context.state !== 'running') {
5220            _config2.default.context.resume();
5221          }
5222        });
5223
5224        /*
5225          Set the user waveform settings if provided.
5226        */
5227        if (userConfig.waveforms != undefined && userConfig.waveforms.sample_rate != undefined) {
5228          _config2.default.waveforms.sample_rate = userConfig.waveforms.sample_rate;
5229        }
5230
5231        /*
5232          Initialize the waveform.
5233        */
5234        _waveform2.default.init();
5235
5236        /*
5237          If the user is registering visualizations on init,
5238          we set them right away.
5239        */
5240        if (userConfig.visualizations != undefined && userConfig.visualizations.length > 0) {
5241          /*
5242                Iterate over all of the visualizations and
5243                register them in our player.
5244              */
5245          for (var i = 0; i < userConfig.visualizations.length; i++) {
5246            _visualizations2.default.register(userConfig.visualizations[i].object, userConfig.visualizations[i].params);
5247          }
5248        }
5249      }
5250    } else {
5251      _debug2.default.writeMessage("The Web Audio API is not available on this platform. We are using your defined backups!");
5252    }
5253
5254    /*
5255      Initialize default live settings
5256    */
5257    initializeDefaultLiveSettings();
5258
5259    /*
5260      Initialize default song indexes
5261    */
5262    initializeDefaultSongIndexes();
5263
5264    /*
5265    When the preliminary config is ready, we are ready to proceed.
5266    */
5267    if (ready) {
5268      /*
5269      Copies over the soundcloud information to the global config
5270      which will determine where we go from there.
5271      */
5272      _config2.default.soundcloud_client = userConfig.soundcloud_client != undefined ? userConfig.soundcloud_client : "";
5273
5274      /*
5275      Checks if we want to use the art loaded from soundcloud.
5276      */
5277      _config2.default.soundcloud_use_art = userConfig.soundcloud_use_art != undefined ? userConfig.soundcloud_use_art : "";
5278
5279      /*
5280      If the user provides a soundcloud client then we assume that
5281      there are URLs in their songs that will reference SoundCloud.
5282      We then copy over the user config they provided to the
5283      temp_user_config so we don't mess up the global or their configs
5284      and load the soundcloud information.
5285      */
5286      var tempUserConfig = {};
5287
5288      /*
5289        If there's a soundcloud_client key set, we load the SoundCloud data
5290        for all of the songs in the array.
5291      */
5292      if (_config2.default.soundcloud_client != "") {
5293        tempUserConfig = userConfig;
5294
5295        /*
5296        Load up SoundCloud for use with AmplitudeJS.
5297        */
5298        _soundcloud2.default.loadSoundCloud(tempUserConfig);
5299      } else {
5300        /*
5301        The user is not using Soundcloud with Amplitude at this point
5302        so we just finish the configuration with the users's preferences.
5303        */
5304        setConfig(userConfig);
5305      }
5306    }
5307
5308    /*
5309    Debug out what was initialized with AmplitudeJS.
5310    */
5311    _debug2.default.writeMessage("Initialized With: ");
5312    _debug2.default.writeMessage(_config2.default);
5313  }
5314
5315  /**
5316   * Rebinds all of the elements in the display.
5317   *
5318   * Public Accessor: Amplitude.rebindDisplay()
5319   * @access public
5320   */
5321  function rebindDisplay() {
5322    _events2.default.initialize();
5323    _metaDataElements2.default.displayMetaData();
5324  }
5325
5326  /**
5327   * Finishes the initalization of the config. Takes all of the user defined
5328   * parameters and makes sure they override the defaults. The important
5329   * config information is assigned in the publicInit() function.
5330   *
5331   * This function can be called from 2 different locations:
5332   * 	1. Right away on init after the important settings are defined.
5333   *
5334   * 	2. After all of the Soundcloud URLs are resolved properly and
5335   *	 	soundcloud is configured.  We will need the proper URLs from Soundcloud
5336   * 		to stream through Amplitude so we get those right away before we
5337   * 		set the information and the active song
5338   *
5339   * @access public
5340   * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.
5341   */
5342  function setConfig(userConfig) {
5343    /*
5344      Checks if the user has any playlists defined. If they do
5345      we have to initialize the functionality for the playlists.
5346    */
5347    if (userConfig.playlists && countPlaylists(userConfig.playlists) > 0) {
5348      _playlists2.default.initialize(userConfig.playlists);
5349    }
5350
5351    /*
5352    Check to see if the user entered a start song
5353    */
5354    if (userConfig.start_song != undefined && 
vendor: 9,069 bytes, lines 5354-5635
5354userConfig.starting_playlist) {
5355      /*
5356      Ensure what has been entered is an integer.
5357      */
5358      if (_checks2.default.isInt(userConfig.start_song)) {
5359        _audioNavigation2.default.changeSong(_config2.default.songs[userConfig.start_song], userConfig.start_song);
5360      } else {
5361        _debug2.default.writeMessage("You must enter an integer index for the start song.");
5362      }
5363    } else {
5364      _audioNavigation2.default.changeSong(_config2.default.songs[0], 0);
5365    }
5366
5367    /*
5368      If the shuffle is on by default, shuffle the songs and
5369      switch to the shuffled song.
5370    */
5371    if (userConfig.shuffle_on != undefined && userConfig.shuffle_on) {
5372      _config2.default.shuffle_on = true;
5373      _shuffler2.default.shuffleSongs();
5374
5375      _audioNavigation2.default.changeSong(_config2.default.shuffle_list[0], 0);
5376    }
5377
5378    /*
5379    Allows the user to set whether they want to continue to the next song
5380    when the current song finishes or not. In any scenario that's not a playlist,
5381    contining to the next song may not be desired.
5382    */
5383    _config2.default.continue_next = userConfig.continue_next != undefined ? userConfig.continue_next : true;
5384
5385    /*
5386    If the user defined a playback speed, we copy over their
5387    preference here, otherwise we default to normal playback
5388    speed of 1.0.
5389    */
5390    _config2.default.playback_speed = userConfig.playback_speed != undefined ? userConfig.playback_speed : 1.0;
5391
5392    /*
5393    Sets the audio playback speed.
5394    */
5395    _core2.default.setPlaybackSpeed(_config2.default.playback_speed);
5396
5397    /*
5398    If the user wants the song to be pre-loaded for instant
5399    playback, they set it to true. By default it's set to just
5400    load the metadata.
5401    */
5402    _config2.default.audio.preload = userConfig.preload != undefined ? userConfig.preload : "auto";
5403
5404    /*
5405    Initializes the user defined callbacks. This should be a JSON
5406    object that contains a key->value store of the callback name
5407    and the name of the function the user needs to call.
5408    */
5409    _config2.default.callbacks = userConfig.callbacks != undefined ? userConfig.callbacks : {};
5410
5411    /*
5412    Initializes the user defined key bindings. This should be a JSON
5413    object that contains a key->value store of the key event number
5414    pressed and the method to be run.
5415    */
5416    _config2.default.bindings = userConfig.bindings != undefined ? userConfig.bindings : {};
5417
5418    /*
5419    The user can define a starting volume in a range of 0-100 with
5420    0 being muted and 100 being the loudest. After the config is set
5421    Amplitude sets the active song's volume to the volume defined
5422    by the user.
5423    */
5424    _config2.default.volume = userConfig.volume != undefined ? userConfig.volume : 50;
5425
5426    /*
5427    Sets the delay between songs if the user has it set. This should be in MS.
5428    */
5429    _config2.default.delay = userConfig.delay != undefined ? userConfig.delay : 0;
5430
5431    /*
5432    The user can set the volume increment and decrement values between 1 and 100
5433    for when the volume up or down button is pressed.  The default is an increase
5434    or decrease of 5.
5435    */
5436    _config2.default.volume_increment = userConfig.volume_increment != undefined ? userConfig.volume_increment : 5;
5437
5438    _config2.default.volume_decrement = userConfig.volume_decrement != undefined ? userConfig.volume_decrement : 5;
5439
5440    /*
5441    Set the volume to what is defined in the config. The user can define this,
5442    so we should set it up that way.
5443    */
5444    _core2.default.setVolume(_config2.default.volume);
5445
5446    /*
5447     Set default artwork, if specified
5448     */
5449    setArt(userConfig);
5450
5451    /*
5452      Initialize the visual elements
5453    */
5454    initializeElements();
5455
5456    /*
5457    If the user has selected a starting playlist, we need to set the starting playlist
5458    and sync the visuals
5459    */
5460    if (userConfig.starting_playlist != undefined && userConfig.starting_playlist != "") {
5461      /*
5462      Set the active playlist to the starting playlist by the user
5463      */
5464      _config2.default.active_playlist = userConfig.starting_playlist;
5465
5466      /*
5467      Check if the user defined a song to start with in the playlist.
5468      */
5469      if (userConfig.starting_playlist_song != undefined && userConfig.starting_playlist_song != "") {
5470        /*
5471        Ensure the song is a valid index.
5472        */
5473        if (_typeof(userConfig.playlists[userConfig.starting_playlist].songs[parseInt(userConfig.starting_playlist_song)]) != undefined) {
5474          /*
5475          Set the player to the song defined by the user.
5476          */
5477          _audioNavigation2.default.changeSongPlaylist(_config2.default.active_playlist, userConfig.playlists[userConfig.starting_playlist].songs[parseInt(userConfig.starting_playlist_song)], parseInt(userConfig.starting_playlist_song));
5478        } else {
5479          /*
5480          Set the player to the first song in the playlist
5481          */
5482          _audioNavigation2.default.changeSongPlaylist(_config2.default.active_playlist, userConfig.playlists[userConfig.starting_playlist].songs[0], 0);
5483          /*
5484          Debug that the song index doesn't exist
5485          */
5486          _debug2.default.writeMessage("The index of " + userConfig.starting_playlist_song + " does not exist in the playlist " + userConfig.starting_playlist);
5487        }
5488      } else {
5489        /*
5490        Set the player to the first song in the playlist
5491        */
5492        _audioNavigation2.default.changeSong(_config2.default.active_playlist, userConfig.playlists[userConfig.starting_playlist].songs[0], 0);
5493      }
5494
5495      /*
5496      Sync the main and song play pause buttons.
5497      */
5498      _playPauseElements2.default.sync();
5499    }
5500
5501    /*
5502    Run after init callback
5503    */
5504    _callbacks2.default.run("initialized");
5505  }
5506
5507  /**
5508   * Sets the default_album_art and default_playlist_art from the
5509   * user supplied configuration.
5510   *
5511   * @access public
5512   * @param {object} userConfig - A JSON object of user defined values that help configure and initialize AmplitudeJS.
5513   */
5514  function setArt(userConfig) {
5515    /*
5516      If the user defines default album art, this image will display if the active
5517      song doesn't have album art defined.
5518    */
5519    if (userConfig.default_album_art != undefined) {
5520      _config2.default.default_album_art = userConfig.default_album_art;
5521    } else {
5522      _config2.default.default_album_art = "";
5523    }
5524
5525    /*
5526    If the user defines default playlist art, this image will display if the user
5527    tries to set up a playlist meta data image tag but doesn't have one defined.
5528    */
5529    if (userConfig.default_playlist_art != undefined) {
5530      _config2.default.default_playlist_art = userConfig.default_playlist_art;
5531    } else {
5532      _config2.default.default_playlist_art = "";
5533    }
5534  }
5535
5536  /**
5537   * Initializes all of the elements on the page to the default starting point
5538   * to build from there.
5539   *
5540   * @access private
5541   */
5542  function initializeElements() {
5543    /*
5544    Visually sync the shuffle statuses
5545    */
5546    _shuffleElements2.default.syncMain();
5547
5548    /*
5549    Sync Mute Elements.
5550    */
5551    _muteElements2.default.setMuted(_config2.default.volume == 0 ? true : false);
5552
5553    /*
5554    Sync Volume Slider Elements
5555    */
5556    _volumeSliderElements2.default.sync();
5557
5558    /*
5559    Syncs all of the playback speed elements.
5560    */
5561    _playbackSpeedElements2.default.sync();
5562
5563    /*
5564    Syncs all of the visual time elements to 00.
5565    */
5566    _timeElements2.default.resetCurrentTimes();
5567
5568    /*
5569    Sets all of the play pause buttons to pause.
5570    */
5571    _playPauseElements2.default.syncToPause();
5572
5573    /*
5574    Sets the meta data for the songs automatically.
5575    */
5576    _metaDataElements2.default.syncMetaData();
5577
5578    /*
5579    Sets the repeat buttons automatically.
5580    */
5581    _repeatElements2.default.syncRepeatSong();
5582  }
5583
5584  /**
5585   * Counts the number of playlists the user has configured. This ensures
5586   * that the user has at least 1 playlist so we can validate the songs
5587   * defined in the playlist are correct and they didn't enter an invalid
5588   * ID.
5589   *
5590   * @access private
5591   * @param {object} playlists 	-
5592   */
5593  function countPlaylists(playlists) {
5594    /*
5595    Initialize the placeholders to iterate through the playlists
5596    and find out how many we have to account for.
5597    */
5598    var size = 0,
5599        key = void 0;
5600
5601    /*
5602    Iterate over playlists and if the user has the playlist defined,
5603    increment the size of playlists.
5604    */
5605    for (key in playlists) {
5606      if (playlists.hasOwnProperty(key)) {
5607        size++;
5608      }
5609    }
5610
5611    /*
5612    Debug how many playlists are in the config.
5613    */
5614    _debug2.default.writeMessage("You have " + size + " playlist(s) in your config");
5615
5616    /*
5617    Return the number of playlists in the config.
5618    */
5619    return size;
5620  }
5621
5622  /**
5623   * Intializes the default live settings for all of the songs.
5624   *
5625   * @access private
5626   */
5627  function initializeDefaultLiveSettings() {
5628    for (var i = 0; i < _config2.default.songs.length; i++) {
5629      if (_config2.default.songs[i].live == undefined) {
5630        _config2.default.songs[i].live = false;
5631      }
5632    }
5633  }
5634
5635  /**
5635 
5636   * Initializes the index of the song in the songs array so
5637   * we can reference it if needed
5638   * 
5639   * @access private
5640   */
5641  function initializeDefaultSongIndexes() {
5642    for (var i = 0; i < _config2.default.songs.length; i++) {
5643      _config2.default.songs[i].index = i;
5644    }
5645  }
5646
5647  /*
5648  Returns the publicly accessible methods
5649  */
5650  return {
5651    initialize: initialize,
5652    setConfig: setConfig,
5653    rebindDisplay: rebindDisplay
5654  };
5655}();
5656
5657exports.default = Initializer;
5658module.exports = exports["default"];
5659
5660/***/ }),
5661/* 22 */
5662/***/ (function(module, exports, __webpack_require__) {
5663
5664"use strict";
5665
5666
5667Object.defineProperty(exports, "__esModule", {
5668  value: true
5669});
5670
5671var _config = __webpack_require__(0);
5672
5673var _config2 = _interopRequireDefault(_config);
5674
5675function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
5676
5677/**
5678 * Builds a waveform for the current audio.
5679 * Help from: https://robots.thoughtbot.com/javascript-audio-api
5680 * https://stackoverflow.com/questions/21347833/html-svg-not-drawing-works-in-other-pages
5681 */
5682var WaveForm = function () {
5683  /*
5684    Initialize the local variables used in the Waveform.
5685  */
5686  var buffer = "";
5687  var sampleRate = _config2.default.waveforms.sample_rate;
5688  var peaks = "";
5689
5690  function init() {
vendor: 17,987 bytes, lines 5690-6335
5690
5691    /*
5692      Grabs all of the waveform elements on the page.
5693    */
5694    var waveforms = document.querySelectorAll(".amplitude-wave-form");
5695
5696    /*
5697      If there are waveforms, we iterate over them and set them up to display
5698      properly.
5699    */
5700    if (waveforms.length > 0) {
5701      /*
5702        Iterate over all of the waveforms and build the SVG parts.
5703      */
5704      for (var i = 0; i < waveforms.length; i++) {
5705        /*
5706          Clear the inner HTML of the element if we are replacing the waveform.
5707        */
5708        waveforms[i].innerHTML = "";
5709
5710        /*
5711          Inserts an SVG into the element.
5712        */
5713        var svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
5714        svg.setAttribute("viewBox", "0 -1 " + sampleRate + " 2");
5715        svg.setAttribute("preserveAspectRatio", "none");
5716
5717        /*
5718          Add a g component to the SVG
5719        */
5720        var g = document.createElementNS("http://www.w3.org/2000/svg", "g");
5721        svg.appendChild(g);
5722
5723        /*
5724          Add a path component to the g
5725        */
5726        var path = document.createElementNS("http://www.w3.org/2000/svg", "path");
5727        path.setAttribute("d", "");
5728        path.setAttribute("id", "waveform");
5729
5730        g.appendChild(path);
5731
5732        /*
5733          Append the SVG to the waveform.
5734        */
5735        waveforms[i].appendChild(svg);
5736      }
5737    }
5738  }
5739
5740  /**
5741   * Builds each waveform for the page.
5742   */
5743  function build() {
5744    if (_config2.default.web_audio_api_available) {
5745      /*
5746        If we don't have the wave form built, we need to build the waveform by loading
5747        the src with an array buffer.
5748      */
5749      if (_config2.default.waveforms.built[Math.abs(_config2.default.audio.src.split("").reduce(function (a, b) {
5750        a = (a << 5) - a + b.charCodeAt(0);
5751        return a & a;
5752      }, 0))] == undefined) {
5753        /*
5754          Initializes a new XML Http Request.
5755        */
5756        var req = new XMLHttpRequest();
5757
5758        /*
5759          Opens the src parameter for the audio file to read in.
5760        */
5761        req.open("GET", _config2.default.audio.src, true);
5762        req.responseType = "arraybuffer";
5763
5764        /*
5765          When the ready state changes, check to see if we can render the
5766          wave form.
5767        */
5768        req.onreadystatechange = function (e) {
5769          /*
5770            When the request is complete, then we begin decoding the
5771            audio to build the waveform.
5772          */
5773          if (req.readyState == 4) {
5774            /*
5775              If the status is 200 means the response is a success and
5776              we decode the audio data.
5777            */
5778            if (req.status == 200) {
5779              /*
5780                Decode the audio data and process the waveform.
5781              */
5782              _config2.default.context.decodeAudioData(req.response, function (bufferedAudio) {
5783                /*
5784                  Set the buffer to the audio returned.
5785                */
5786                buffer = bufferedAudio;
5787
5788                /*
5789                  Get the peaks in the audio.
5790                */
5791                peaks = getPeaks(sampleRate, buffer);
5792
5793                /*
5794                  Build the SVG
5795                */
5796                process(sampleRate, buffer, peaks);
5797              });
5798            }
5799          }
5800        };
5801        req.send();
5802      } else {
5803        /*
5804          If we already have a waveform, we grab the waveform that
5805          was created for the song and display it. We do a simple hash
5806          of the song URL so it's already unique.
5807        */
5808        displayWaveForms(_config2.default.waveforms.built[Math.abs(_config2.default.audio.src.split("").reduce(function (a, b) {
5809          a = (a << 5) - a + b.charCodeAt(0);
5810          return a & a;
5811        }, 0))]);
5812      }
5813    }
5814  }
5815
5816  /**
5817   * Processes the audio and generates the waveform.
5818   *
5819   * @param {sampleRate} sampleRate - The rate we should sample the audio.
5820   * @param {arraybuffer} buffer - The Web Audio API
5821   * @param {array} peaks - The peaks in the audio.
5822   */
5823  function process(sampleRate, buffer, peaks) {
5824    /*
5825      If we have a buffer, we find the peaks in the audio.
5826    */
5827    if (buffer) {
5828      /*
5829        Get the total peaks in the song.
5830      */
5831      var totalPeaks = peaks.length;
5832
5833      /*
5834        Figure out the depth of the peak.
5835      */
5836      var d = "";
5837      for (var peakNumber = 0; peakNumber < totalPeaks; peakNumber++) {
5838        if (peakNumber % 2 === 0) {
5839          d += " M" + ~~(peakNumber / 2) + ", " + peaks.shift();
5840        } else {
5841          d += " L" + ~~(peakNumber / 2) + ", " + peaks.shift();
5842        }
5843      }
5844
5845      /*
5846        Add the waveform to the built waveforms array.
5847      */
5848      _config2.default.waveforms.built[Math.abs(_config2.default.audio.src.split("").reduce(function (a, b) {
5849        a = (a << 5) - a + b.charCodeAt(0);
5850        return a & a;
5851      }, 0))] = d;
5852
5853      /*
5854        Display the waveform.
5855      */
5856      displayWaveForms(_config2.default.waveforms.built[Math.abs(_config2.default.audio.src.split("").reduce(function (a, b) {
5857        a = (a << 5) - a + b.charCodeAt(0);
5858        return a & a;
5859      }, 0))]);
5860    }
5861  }
5862
5863  /**
5864   * Get the peaks of the audio for the waveform.
5865   *
5866   * @param {number} length - The sample size of the audio.
5867   * @param {array} buffer - The array buffer used to find the peaks in the audio.
5868   */
5869  function getPeaks(length, buffer) {
5870    /*
5871      Set the parameters needed to build the SVG.
5872    */
5873    var sampleSize = buffer.length / length;
5874    var sampleStep = ~~(sampleSize / 10) || 1;
5875    var numberOfChannels = buffer.numberOfChannels;
5876    var mergedPeaks = [];
5877
5878    /*
5879      Iterate over the channels and find the peaks.
5880    */
5881    for (var channelNumber = 0; channelNumber < numberOfChannels; channelNumber++) {
5882      /*
5883        Initialize the peaks array and set the channel data to what
5884        the buffer has in its channel data.
5885      */
5886      var _peaks = [];
5887      var channelData = buffer.getChannelData(channelNumber);
5888
5889      /*
5890        Iterate over peaks with respect to the sample size.
5891      */
5892      for (var peakNumber = 0; peakNumber < length; peakNumber++) {
5893        /*
5894          Gt the start and end peak.
5895        */
5896        var start = ~~(peakNumber * sampleSize);
5897        var end = ~~(start + sampleSize);
5898
5899        /*
5900          Set min and max to the channel data first peak.
5901        */
5902        var min = channelData[0];
5903        var max = channelData[0];
5904
5905        /*
5906          Iterate over the parts of the song starting to the
5907          ending to display the waveform.
5908        */
5909        for (var sampleIndex = start; sampleIndex < end; sampleIndex += sampleStep) {
5910          var value = channelData[sampleIndex];
5911
5912          if (value > max) {
5913            max = value;
5914          }
5915          if (value < min) {
5916            min = value;
5917          }
5918        }
5919
5920        /*
5921          Set the max and min for the peak.
5922        */
5923        _peaks[2 * peakNumber] = max;
5924        _peaks[2 * peakNumber + 1] = min;
5925
5926        /*
5927          Merge the peaks
5928        */
5929        if (channelNumber === 0 || max > mergedPeaks[2 * peakNumber]) {
5930          mergedPeaks[2 * peakNumber] = max;
5931        }
5932
5933        if (channelNumber === 0 || min < mergedPeaks[2 * peakNumber + 1]) {
5934          mergedPeaks[2 * peakNumber + 1] = min;
5935        }
5936      }
5937    }
5938
5939    /*
5940      Returns the merged peaks.
5941    */
5942    return mergedPeaks;
5943  }
5944
5945  /**
5946   * Displays all of the waveforms necessary.
5947   *
5948   * @param {path} svg - The drawing of the waveform.
5949   */
5950  function displayWaveForms(svg) {
5951    var waveformElements = document.querySelectorAll(".amplitude-wave-form");
5952
5953    /*
5954      Iterate over all of the waveform elements and
5955      display the waveform.
5956    */
5957    for (var i = 0; i < waveformElements.length; i++) {
5958      /*
5959        Get the playlist attribute of the waveform element.
5960      */
5961      var playlist = waveformElements[i].getAttribute("data-amplitude-playlist");
5962
5963      /*
5964        Get the song index attribute of the waveform element.
5965      */
5966      var song = waveformElements[i].getAttribute("data-amplitude-song-index");
5967
5968      /*
5969        If the playlist is null and the song is null it's a global element.
5970      */
5971      if (playlist == null && song == null) {
5972        displayGlobalWaveform(waveformElements[i], svg);
5973      }
5974
5975      /*
5976        If the playlist is defined but the song is null it's a playlist element.
5977      */
5978      if (playlist != null && song == null) {
5979        displayPlaylistWaveform(waveformElements[i], svg, playlist);
5980      }
5981
5982      /*
5983        If the playlist is not defined and the song is not null it's a song
5984        element.
5985      */
5986      if (playlist == null && song != null) {
5987        displaySongWaveform(waveformElements[i], svg, song);
5988      }
5989
5990      /*
5991        If the playlist and song are defined it's a song in the playlist element.
5992      */
5993      if (playlist != null && song != null) {
5994        displaySongInPlaylistWaveform(waveformElements[i], svg, playlist, song);
5995      }
5996    }
5997  }
5998
5999  /**
6000   * Displays a global wave form.
6001   *
6002   * @param {Node} element - Element to display the waveform in.
6003   * @param {SVG} svg - The waveform path.
6004   */
6005  function displayGlobalWaveform(element, svg) {
6006    var waveformPath = element.querySelector("svg g path");
6007
6008    waveformPath.setAttribute("d", svg);
6009  }
6010
6011  /**
6012   * Displays a playlist wave form.
6013   *
6014   * @param {Node} element - Element to display the waveform in.
6015   * @param {SVG} svg - The waveform path.
6016   * @param {string} playlist - The playlist we are displaying the waveform for.
6017   */
6018  function displayPlaylistWaveform(element, svg, playlist) {
6019    /*
6020      Ensure the playlist is the active playlist.
6021    */
6022    if (_config2.default.active_playlist == playlist) {
6023      var waveformPath = element.querySelector("svg g path");
6024
6025      waveformPath.setAttribute("d", svg);
6026    }
6027  }
6028
6029  /**
6030   * Displays a song wave form.
6031   *
6032   * @param {Node} element - Element to display the waveform in.
6033   * @param {SVG} svg - The waveform path.
6034   * @param {Integer} song - The index of the song we are displaying the
6035   * waveform for.
6036   */
6037  function displaySongWaveform(element, svg, song) {
6038    /*
6039      Ensure it's the active song being displayed.
6040    */
6041    if (_config2.default.active_index == song) {
6042      var waveformPath = element.querySelector("svg g path");
6043
6044      waveformPath.setAttribute("d", svg);
6045    }
6046  }
6047
6048  /**
6049   * Displays a song in playlist waveform.
6050   *
6051   * @param {Node} element - Element to display the waveform in.
6052   * @param {SVG} svg - The waveform path.
6053   * @param {String} playlist - The playlist the waveform is in.
6054   * @param {Integer} song - The index of the song we are displaying the waveform for.
6055   */
6056  function displaySongInPlaylistWaveform(element, svg, playlist, song) {
6057    /*
6058      Ensure it's the active song in the active playlist.
6059    */
6060    if (_config2.default.active_playlist == playlist && _config2.default.playlists[_config2.default.active_playlist].active_index == song) {
6061      var waveformPath = element.querySelector("svg g path");
6062
6063      waveformPath.setAttribute("d", svg);
6064    }
6065  }
6066
6067  /**
6068   * Determines if the user is using waveforms
6069   */
6070  function determineIfUsingWaveforms() {
6071    var waveforms = document.querySelectorAll(".amplitude-wave-form");
6072
6073    if (waveforms.length > 0) {
6074      return true;
6075    } else {
6076      return false;
6077    }
6078  }
6079
6080  /*
6081    Return the public methods.
6082  */
6083  return {
6084    init: init,
6085    build: build,
6086    determineIfUsingWaveforms: determineIfUsingWaveforms
6087  };
6088}(); /**
6089      * Imports the config module
6090      * @module config
6091      */
6092exports.default = WaveForm;
6093module.exports = exports["default"];
6094
6095/***/ }),
6096/* 23 */
6097/***/ (function(module, exports, __webpack_require__) {
6098
6099"use strict";
6100
6101
6102Object.defineProperty(exports, "__esModule", {
6103  value: true
6104});
6105
6106var _config = __webpack_require__(0);
6107
6108var _config2 = _interopRequireDefault(_config);
6109
6110function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6111
6112/**
6113 * The utility to handle the computation of time in AmplitudeJS.
6114 * @module utilities/Time
6115 */
6116var Time = function () {
6117  /**
6118   * Computes the current song time. Breaks down where the song is into
6119   * hours, minutes, seconds and formats it to be displayed to the user.
6120   *
6121   * @access public
6122   */
6123  function computeCurrentTimes() {
6124    /*
6125    Initialize the current time object that will be returned.
6126    */
6127    var currentTime = {};
6128
6129    /*
6130    Computes the current seconds for the song.
6131    */
6132    var currentSeconds = (Math.floor(_config2.default.audio.currentTime % 60) < 10 ? "0" : "") + Math.floor(_config2.default.audio.currentTime % 60);
6133
6134    /*
6135    Computes the current minutes for the song.
6136    */
6137    var currentMinutes = Math.floor(_config2.default.audio.currentTime / 60);
6138
6139    /*
6140    Initialize the current hours variable.
6141    */
6142    var currentHours = "00";
6143
6144    /*
6145    If the current minutes is less than 10, we add a leading 0.
6146    */
6147    if (currentMinutes < 10) {
6148      currentMinutes = "0" + currentMinutes;
6149    }
6150
6151    /*
6152    If the user is more than 60 minutes into the song, then
6153    we extract the hours.
6154    */
6155    if (currentMinutes >= 60) {
6156      currentHours = Math.floor(currentMinutes / 60);
6157      currentMinutes = currentMinutes % 60;
6158
6159      /*
6160      If the user is less than 10 minutes in, we append the
6161      additional 0 to the minutes.
6162      */
6163      if (currentMinutes < 10) {
6164        currentMinutes = "0" + currentMinutes;
6165      }
6166    }
6167
6168    /*
6169    Build a clean current time object and send back the appropriate information.
6170    */
6171    currentTime.seconds = currentSeconds;
6172    currentTime.minutes = currentMinutes;
6173    currentTime.hours = currentHours;
6174
6175    return currentTime;
6176  }
6177
6178  /**
6179   * Computes the current song duration. Breaks down where the song is into
6180   * hours, minutes, seconds and formats it to be displayed to the user.
6181   *
6182   * @access public
6183   */
6184  function computeSongDuration() {
6185    /*
6186    Initialize the song duration object that will be returned.
6187    */
6188    var songDuration = {};
6189
6190    /*
6191    Computes the duration of the song's seconds.
6192    */
6193    var songDurationSeconds = (Math.floor(_config2.default.audio.duration % 60) < 10 ? "0" : "") + Math.floor(_config2.default.audio.duration % 60);
6194
6195    /*
6196    Computes the duration of the song's minutes.
6197    */
6198    var songDurationMinutes = Math.floor(_config2.default.audio.duration / 60);
6199
6200    /*
6201    Initialize the hours duration variable.
6202    */
6203    var songDurationHours = "00";
6204
6205    /*
6206    If the song duration minutes is less than 10, we add a leading 0.
6207    */
6208    if (songDurationMinutes < 10) {
6209      songDurationMinutes = "0" + songDurationMinutes;
6210    }
6211
6212    /*
6213    If there is more than 60 minutes in the song, then we
6214    extract the hours.
6215    */
6216    if (songDurationMinutes >= 60) {
6217      songDurationHours = Math.floor(songDurationMinutes / 60);
6218      songDurationMinutes = songDurationMinutes % 60;
6219
6220      /*
6221      If the song duration minutes is less than 10 we append
6222      the additional 0.
6223      */
6224      if (songDurationMinutes < 10) {
6225        songDurationMinutes = "0" + songDurationMinutes;
6226      }
6227    }
6228
6229    /*
6230    Build a clean song duration object and send back the appropriate information.
6231    */
6232    songDuration.seconds = isNaN(songDurationSeconds) ? "00" : songDurationSeconds;
6233    songDuration.minutes = isNaN(songDurationMinutes) ? "00" : songDurationMinutes;
6234    songDuration.hours = isNaN(songDurationHours) ? "00" : songDurationHours.toString();
6235
6236    return songDuration;
6237  }
6238
6239  /**
6240   * Computes the song completion percentage.
6241   *
6242   * @access public
6243   */
6244  function computeSongCompletionPercentage() {
6245    return _config2.default.audio.currentTime / _config2.default.audio.duration * 100;
6246  }
6247
6248  /**
6249   * Sets the current time for the audio.
6250   *
6251   * @access public
6252   */
6253  function setCurrentTime(time) {
6254    /*
6255      If the song is not live, we can set the current time.
6256    */
6257    if (!_config2.default.active_metadata.live) {
6258      /*
6259        Makes sure the number is finite to set the time.
6260      */
6261      if (isFinite(time)) {
6262        _config2.default.audio.currentTime = time;
6263      }
6264    }
6265  }
6266
6267  /**
6268   * Defines what is returned by the module
6269   */
6270  return {
6271    computeCurrentTimes: computeCurrentTimes,
6272    computeSongDuration: computeSongDuration,
6273    computeSongCompletionPercentage: computeSongCompletionPercentage,
6274    setCurrentTime: setCurrentTime
6275  };
6276}(); /**
6277      * Imports the config module
6278      * @module config
6279      */
6280exports.default = Time;
6281module.exports = exports["default"];
6282
6283/***/ }),
6284/* 24 */
6285/***/ (function(module, exports, __webpack_require__) {
6286
6287"use strict";
6288
6289
6290Object.defineProperty(exports, "__esModule", {
6291  value: true
6292});
6293
6294var _config = __webpack_require__(0);
6295
6296var _config2 = _interopRequireDefault(_config);
6297
6298function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6299
6300/**
6301 * AmplitudeJS Visual Handler for Buffered Progress Elements
6302 *
6303 * @module visual/BufferedProgressElements
6304 */
6305var BufferedProgressElements = function () {
6306  /**
6307   * Syncs the buffered progress bars to the current percentage in the config
6308   *
6309   * @access public
6310   */
6311  function sync() {
6312    syncGlobal();
6313    syncPlaylist();
6314    syncSong();
6315    syncSongInPlaylist();
6316  }
6317
6318  /**
6319   * Sync the global song buffered progress elements.
6320   */
6321  function syncGlobal() {
6322    /*
6323    Gets all of the song buffered progress bars.
6324    */
6325    var songBufferedProgressBars = document.getElementsByClassName("amplitude-buffered-progress");
6326
6327    /*
6328    Iterate over all of the song buffered progress bar and
6329    set them to 0 which is like re-setting them.
6330    */
6331    for (var i = 0; i < songBufferedProgressBars.length; i++) {
6332      var playlist = songBufferedProgressBars[i].getAttribute("data-amplitude-playlist");
6333      var song = songBufferedProgressBars[i].getAttribute("data-amplitude-song-index");
6334
6335      if (playlist == null && song == null
vendor: 5,872 bytes, lines 6335-6552
6335) {
6336        songBufferedProgressBars[i].value = parseFloat(parseFloat(_config2.default.buffered) / 100);
6337      }
6338    }
6339  }
6340
6341  /**
6342   * Sync the playlist song buffered progress elements.
6343   */
6344  function syncPlaylist() {
6345    /*
6346    Gets all of the song buffered progress bars.
6347    */
6348    var songBufferedProgressBarsPlaylist = document.querySelectorAll('.amplitude-buffered-progress[data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
6349
6350    /*
6351    Iterate over all of the song buffered progress bar and
6352    set them to 0 which is like re-setting them.
6353    */
6354    for (var i = 0; i < songBufferedProgressBarsPlaylist.length; i++) {
6355      var song = songBufferedProgressBarsPlaylist[i].getAttribute("data-amplitude-song-index");
6356
6357      if (song == null) {
6358        songBufferedProgressBarsPlaylist[i].value = parseFloat(parseFloat(_config2.default.buffered) / 100);
6359      }
6360    }
6361  }
6362
6363  /**
6364   * Sync the song song buffered progress elements.
6365   */
6366  function syncSong() {
6367    /*
6368    Gets all of the song buffered progress bars.
6369    */
6370    var songBufferedProgressBarsSongs = document.querySelectorAll('.amplitude-buffered-progress[data-amplitude-song-index="' + _config2.default.active_index + '"]');
6371
6372    /*
6373    Iterate over all of the song buffered progress bar and
6374    set them to 0 which is like re-setting them.
6375    */
6376    for (var i = 0; i < songBufferedProgressBarsSongs.length; i++) {
6377      var playlist = songBufferedProgressBarsSongs[i].getAttribute("data-amplitude-playlist");
6378
6379      if (playlist == null) {
6380        songBufferedProgressBarsSongs[i].value = parseFloat(parseFloat(_config2.default.buffered) / 100);
6381      }
6382    }
6383  }
6384
6385  /**
6386   * Sync the song in playlist song buffered progress elements.
6387   */
6388  function syncSongInPlaylist() {
6389    var activePlaylistIndex = _config2.default.active_playlist != null && _config2.default.active_playlist != "" ? _config2.default.playlists[_config2.default.active_playlist].active_index : null;
6390
6391    /*
6392    Gets all of the song buffered progress bars.
6393    */
6394    var songBufferedProgressBarsSongsInPlaylist = document.querySelectorAll('.amplitude-buffered-progress[data-amplitude-song-index="' + activePlaylistIndex + '"][data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
6395
6396    /*
6397    Iterate over all of the song buffered progress bar and
6398    set them to 0 which is like re-setting them.
6399    */
6400    for (var i = 0; i < songBufferedProgressBarsSongsInPlaylist.length; i++) {
6401      songBufferedProgressBarsSongsInPlaylist[i].value = parseFloat(parseFloat(_config2.default.buffered) / 100);
6402    }
6403  }
6404
6405  /**
6406   * Sets all of the song buffered progress bars to 0
6407   *
6408   * @access public
6409   */
6410  function reset() {
6411    /*
6412    Gets all of the song buffered progress bars.
6413    */
6414    var songBufferedProgressBars = document.getElementsByClassName("amplitude-buffered-progress");
6415
6416    /*
6417    Iterate over all of the song buffered progress bar and
6418    set them to 0 which is like re-setting them.
6419    */
6420    for (var i = 0; i < songBufferedProgressBars.length; i++) {
6421      songBufferedProgressBars[i].value = 0;
6422    }
6423  }
6424
6425  /**
6426   * Returns the public facing methods
6427   */
6428  return {
6429    sync: sync,
6430    reset: reset
6431  };
6432}(); /**
6433      * Imports the config module
6434      * @module config
6435      */
6436exports.default = BufferedProgressElements;
6437module.exports = exports["default"];
6438
6439/***/ }),
6440/* 25 */
6441/***/ (function(module, exports, __webpack_require__) {
6442
6443"use strict";
6444
6445
6446Object.defineProperty(exports, "__esModule", {
6447  value: true
6448});
6449
6450var _config = __webpack_require__(0);
6451
6452var _config2 = _interopRequireDefault(_config);
6453
6454var _audioNavigation = __webpack_require__(3);
6455
6456var _audioNavigation2 = _interopRequireDefault(_audioNavigation);
6457
6458var _callbacks = __webpack_require__(7);
6459
6460var _callbacks2 = _interopRequireDefault(_callbacks);
6461
6462var _core = __webpack_require__(1);
6463
6464var _core2 = _interopRequireDefault(_core);
6465
6466var _playPauseElements = __webpack_require__(2);
6467
6468var _playPauseElements2 = _interopRequireDefault(_playPauseElements);
6469
6470function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6471
6472/**
6473 * AmplitudeJS Ended Module. Handles the ended event on the audio.
6474 *
6475 * @module events/Ended
6476 */
6477
6478
6479/**
6480 * Imports the AmplitudeJS Core Methods
6481 * @module core/Core
6482 */
6483
6484
6485/**
6486 * Imports the Audio Navigation Utility
6487 * @module utilities/AudioNavigation
6488 */
6489var Ended = function () {
6490  /**
6491   * When the song has ended, handles what to do next
6492   *
6493   * HANDLER FOR: ended
6494   *
6495   * @access public
6496   */
6497  function handle() {
6498    /*
6499      Sets the time out for song ended. This determines if
6500      we should go to the next song or delay between songs.
6501    */
6502    setTimeout(function () {
6503      /*
6504        If we continue next, we should move to the next song in the playlist.
6505      */
6506      if (_config2.default.continue_next) {
6507        /*
6508        If the active playlist is not set, we set the
6509        next song that's in the songs array.
6510        */
6511        if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) {
6512          _audioNavigation2.default.setNext(true);
6513        } else {
6514          _audioNavigation2.default.setNextPlaylist(_config2.default.active_playlist, true);
6515        }
6516      } else {
6517        if (!_config2.default.is_touch_moving) {
6518          /*
6519          Stops the active song.
6520          */
6521          AmplitudeCore.stop();
6522
6523          /*
6524            Sync the play pause elements.
6525          */
6526          _playPauseElements2.default.sync();
6527        }
6528      }
6529    }, _config2.default.delay);
6530  }
6531
6532  /*
6533    Returns the public facing methods.
6534  */
6535  return {
6536    handle: handle
6537  };
6538}();
6539
6540/**
6541 * Imports the AmplitudeJS Play Pause Elements
6542 * @module visual/PlayPauseElements
6543 */
6544
6545
6546/**
6547 * Imports the Callback Utility
6548 * @module utilities/callbacks
6549 */
6550/**
6551 * Imports the config module
6552 * @module config
vendor: 29,060 bytes, lines 6552-7447
6552
6553 */
6554exports.default = Ended;
6555module.exports = exports["default"];
6556
6557/***/ }),
6558/* 26 */
6559/***/ (function(module, exports, __webpack_require__) {
6560
6561"use strict";
6562
6563
6564Object.defineProperty(exports, "__esModule", {
6565  value: true
6566});
6567
6568var _config = __webpack_require__(0);
6569
6570var _config2 = _interopRequireDefault(_config);
6571
6572var _keydown = __webpack_require__(27);
6573
6574var _keydown2 = _interopRequireDefault(_keydown);
6575
6576var _timeUpdate = __webpack_require__(42);
6577
6578var _timeUpdate2 = _interopRequireDefault(_timeUpdate);
6579
6580var _ended = __webpack_require__(25);
6581
6582var _ended2 = _interopRequireDefault(_ended);
6583
6584var _progress = __webpack_require__(35);
6585
6586var _progress2 = _interopRequireDefault(_progress);
6587
6588var _play = __webpack_require__(31);
6589
6590var _play2 = _interopRequireDefault(_play);
6591
6592var _pause = __webpack_require__(30);
6593
6594var _pause2 = _interopRequireDefault(_pause);
6595
6596var _playPause = __webpack_require__(32);
6597
6598var _playPause2 = _interopRequireDefault(_playPause);
6599
6600var _stop = __webpack_require__(41);
6601
6602var _stop2 = _interopRequireDefault(_stop);
6603
6604var _mute = __webpack_require__(28);
6605
6606var _mute2 = _interopRequireDefault(_mute);
6607
6608var _volumeUp = __webpack_require__(45);
6609
6610var _volumeUp2 = _interopRequireDefault(_volumeUp);
6611
6612var _volumeDown = __webpack_require__(43);
6613
6614var _volumeDown2 = _interopRequireDefault(_volumeDown);
6615
6616var _songSlider = __webpack_require__(40);
6617
6618var _songSlider2 = _interopRequireDefault(_songSlider);
6619
6620var _volumeSlider = __webpack_require__(44);
6621
6622var _volumeSlider2 = _interopRequireDefault(_volumeSlider);
6623
6624var _next = __webpack_require__(29);
6625
6626var _next2 = _interopRequireDefault(_next);
6627
6628var _prev = __webpack_require__(34);
6629
6630var _prev2 = _interopRequireDefault(_prev);
6631
6632var _repeat = __webpack_require__(36);
6633
6634var _repeat2 = _interopRequireDefault(_repeat);
6635
6636var _repeatSong = __webpack_require__(37);
6637
6638var _repeatSong2 = _interopRequireDefault(_repeatSong);
6639
6640var _playbackSpeed = __webpack_require__(33);
6641
6642var _playbackSpeed2 = _interopRequireDefault(_playbackSpeed);
6643
6644var _shuffle = __webpack_require__(38);
6645
6646var _shuffle2 = _interopRequireDefault(_shuffle);
6647
6648var _skipTo = __webpack_require__(39);
6649
6650var _skipTo2 = _interopRequireDefault(_skipTo);
6651
6652var _waveform = __webpack_require__(22);
6653
6654var _waveform2 = _interopRequireDefault(_waveform);
6655
6656var _debug = __webpack_require__(4);
6657
6658var _debug2 = _interopRequireDefault(_debug);
6659
6660function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6661
6662/**
6663 * AmplitudeJS Events Module. Handles all of the events we listen to in
6664 * AmplitudeJS.
6665 *
6666 * @module events/Events
6667 */
6668
6669
6670/**
6671 * Imports all of the handler objects used by the events.
6672 */
6673var Events = function () {
6674  /**
6675   * Initializes the handlers for the events listened to by Amplitude
6676   *
6677   * @access public
6678   */
6679  function initialize() {
6680    /*
6681    Write out debug message
6682    */
6683    _debug2.default.writeMessage("Beginning initialization of event handlers..");
6684
6685    /*
6686    Sets flag that the screen is moving and not a tap
6687    */
6688    document.addEventListener("touchmove", function () {
6689      _config2.default.is_touch_moving = true;
6690    });
6691
6692    /*
6693    On touch end if it was a touch move event, set moving to
6694    false
6695    */
6696    document.addEventListener("touchend", function () {
6697      if (_config2.default.is_touch_moving) {
6698        _config2.default.is_touch_moving = false;
6699      }
6700    });
6701
6702    /*
6703    On time update for the audio element, update visual displays that
6704    represent the time on either a visualized element or time display.
6705    */
6706    bindTimeUpdate();
6707
6708    /*
6709    Binds key down event handlers for matching key codes to functions.
6710    */
6711    bindKeyDownEventHandlers();
6712
6713    /*
6714    When the audio element has ended playing, we handle the song
6715    ending. In a single song or multiple modular song instance,
6716    this just synchronizes the visuals for time and song time
6717    visualization, but for a playlist it determines whether
6718    it should play the next song or not.
6719    */
6720    bindSongEnded();
6721
6722    /*
6723    Binds progress event so we can see how much of the song is loaded.
6724    */
6725    bindProgress();
6726
6727    /*
6728    Binds 'amplitude-play' event handlers
6729    */
6730    bindPlay();
6731
6732    /*
6733    Binds 'amplitude-pause' event handlers.
6734    */
6735    bindPause();
6736
6737    /*
6738    Binds 'amplitude-play-pause' event handlers.
6739    */
6740    bindPlayPause();
6741
6742    /*
6743    Binds 'amplitude-stop' event handlers.
6744    */
6745    bindStop();
6746
6747    /*
6748    Binds 'amplitude-mute' event handlers.
6749    */
6750    bindMute();
6751
6752    /*
6753    Binds 'amplitude-volume-up' event handlers
6754    */
6755    bindVolumeUp();
6756
6757    /*
6758    Binds 'amplitude-volume-down' event handlers
6759    */
6760    bindVolumeDown();
6761
6762    /*
6763    Binds 'amplitude-song-slider' event handlers
6764    */
6765    bindSongSlider();
6766
6767    /*
6768    Binds 'amplitude-volume-slider' event handlers.
6769    */
6770    bindVolumeSlider();
6771
6772    /*
6773    Binds 'amplitude-next' event handlers.
6774    */
6775    bindNext();
6776
6777    /*
6778    Binds 'amplitude-prev' event handlers.
6779    */
6780    bindPrev();
6781
6782    /*
6783    Binds 'amplitude-shuffle' event handlers.
6784    */
6785    bindShuffle();
6786
6787    /*
6788    Binds 'amplitude-repeat' event handlers.
6789    */
6790    bindRepeat();
6791
6792    /*
6793    Binds 'amplitude-repeat-song' event handlers.
6794    */
6795    bindRepeatSong();
6796
6797    /*
6798    Binds 'amplitude-playback-speed' event handlers.
6799    */
6800    bindPlaybackSpeed();
6801
6802    /*
6803    Binds 'amplitude-skip-to' event handlers.
6804    */
6805    bindSkipTo();
6806
6807    /*
6808    Binds `canplaythrough` event to build the waveform.
6809    */
6810    bindCanPlayThrough();
6811  }
6812
6813  /**
6814   * On time update for the audio element, update visual displays that
6815   * represent the time on either a visualized element or time display.
6816   *
6817   * @access private
6818   */
6819  function bindTimeUpdate() {
6820    /*
6821    Bind for time update
6822    */
6823    _config2.default.audio.removeEventListener("timeupdate", _timeUpdate2.default.handle);
6824    _config2.default.audio.addEventListener("timeupdate", _timeUpdate2.default.handle);
6825
6826    /*
6827    Bind for duration change
6828    */
6829    _config2.default.audio.removeEventListener("durationchange", _timeUpdate2.default.handle);
6830    _config2.default.audio.addEventListener("durationchange", _timeUpdate2.default.handle);
6831  }
6832
6833  /**
6834   * On keydown, we listen to what key got pressed so we can map the key to
6835   * a function. This allows the user to map pause and play, next, etc. to key
6836   * presses.
6837   *
6838   * @access private
6839   */
6840  function bindKeyDownEventHandlers() {
6841    document.removeEventListener("keydown", _keydown2.default.handle);
6842    document.addEventListener("keydown", _keydown2.default.handle);
6843  }
6844
6845  /**
6846   * When the audio element has ended playing, we handle the song
6847   * ending. In a single song or multiple modular song instance,
6848   * this just synchronizes the visuals for time and song time
6849   * visualization, but for a playlist it determines whether
6850   * it should play the next song or not.
6851   *
6852   * @access private
6853   */
6854  function bindSongEnded() {
6855    _config2.default.audio.removeEventListener("ended", _ended2.default.handle);
6856    _config2.default.audio.addEventListener("ended", _ended2.default.handle);
6857  }
6858
6859  /**
6860   * As the audio is loaded, the progress event gets fired. We bind into this
6861   * to grab the buffered percentage of the song. We can then add more elements
6862   * to show the buffered amount.
6863   *
6864   * @access private
6865   */
6866  function bindProgress() {
6867    _config2.default.audio.removeEventListener("progress", _progress2.default.handle);
6868    _config2.default.audio.addEventListener("progress", _progress2.default.handle);
6869  }
6870
6871  /**
6872   * Binds click and touchend events for AmplitudeJS play buttons
6873   *
6874   * @access private
6875   */
6876  function bindPlay() {
6877    /*
6878    Gets all of the elements with the class amplitude-play
6879    */
6880    var play_classes = document.getElementsByClassName("amplitude-play");
6881
6882    /*
6883    Iterates over all of the play classes and binds the event interaction
6884    method to the element. If the browser is mobile, then the event is touchend
6885    otherwise it is click.
6886    */
6887    for (var i = 0; i < play_classes.length; i++) {
6888      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
6889        play_classes[i].removeEventListener("touchend", _play2.default.handle);
6890        play_classes[i].addEventListener("touchend", _play2.default.handle);
6891      } else {
6892        play_classes[i].removeEventListener("click", _play2.default.handle);
6893        play_classes[i].addEventListener("click", _play2.default.handle);
6894      }
6895    }
6896  }
6897
6898  /**
6899   * Binds click and touchend events for AmplitudeJS pause buttons.
6900   *
6901   * @access private
6902   */
6903  function bindPause() {
6904    /*
6905    Gets all of the elements with the class amplitude-pause
6906    */
6907    var pause_classes = document.getElementsByClassName("amplitude-pause");
6908
6909    /*
6910    Iterates over all of the pause classes and binds the event interaction
6911    method to the element. If the browser is mobile, then the event is touchend
6912    otherwise it is click.
6913    */
6914    for (var i = 0; i < pause_classes.length; i++) {
6915      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
6916        pause_classes[i].removeEventListener("touchend", _pause2.default.handle);
6917        pause_classes[i].addEventListener("touchend", _pause2.default.handle);
6918      } else {
6919        pause_classes[i].removeEventListener("click", _pause2.default.handle);
6920        pause_classes[i].addEventListener("click", _pause2.default.handle);
6921      }
6922    }
6923  }
6924
6925  /**
6926   * Binds click and touchend events for AmplitudeJS play pause buttons
6927   *
6928   * @access private
6929   */
6930  function bindPlayPause() {
6931    /*
6932    Gets all of the elements with the class amplitude-play-pause
6933    */
6934    var play_pause_classes = document.getElementsByClassName("amplitude-play-pause");
6935
6936    /*
6937    Iterates over all of the play/pause classes and binds the event interaction
6938    method to the element. If the browser is mobile, then the event is touchend
6939    otherwise it is click.
6940    */
6941    for (var i = 0; i < play_pause_classes.length; i++) {
6942      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
6943        play_pause_classes[i].removeEventListener("touchend", _playPause2.default.handle);
6944        play_pause_classes[i].addEventListener("touchend", _playPause2.default.handle);
6945      } else {
6946        play_pause_classes[i].removeEventListener("click", _playPause2.default.handle);
6947        play_pause_classes[i].addEventListener("click", _playPause2.default.handle);
6948      }
6949    }
6950  }
6951
6952  /**
6953   * Binds click and touchend events for AmplitudeJS stop buttons
6954   *
6955   * @access private
6956   */
6957  function bindStop() {
6958    /*
6959    Gets all of the elements with the class amplitude-stop
6960    */
6961    var stop_classes = document.getElementsByClassName("amplitude-stop");
6962
6963    /*
6964    Iterates over all of the stop classes and binds the event interaction
6965    method to the element.  If the browser is mobile, then the event is touchend
6966    otherwise it is click.
6967    */
6968    for (var i = 0; i < stop_classes.length; i++) {
6969      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
6970        stop_classes[i].removeEventListener("touchend", _stop2.default.handle);
6971        stop_classes[i].addEventListener("touchend", _stop2.default.handle);
6972      } else {
6973        stop_classes[i].removeEventListener("click", _stop2.default.handle);
6974        stop_classes[i].addEventListener("click", _stop2.default.handle);
6975      }
6976    }
6977  }
6978
6979  /**
6980   * Binds click and touchend events for AmplitudeJS mute buttons
6981   *
6982   * @access private
6983   */
6984  function bindMute() {
6985    /*
6986    Gets all of the elements with the class amplitue-mute
6987    */
6988    var mute_classes = document.getElementsByClassName("amplitude-mute");
6989
6990    /*
6991    Iterates over all of the mute classes and binds the event interaction
6992    method to the element. If the browser is mobile, then the event is touchend
6993    otherwise it is click.
6994    */
6995    for (var i = 0; i < mute_classes.length; i++) {
6996      /*
6997      WARNING: If iOS, we don't do anything because iOS does not allow the
6998      volume to be adjusted through anything except the buttons on the side of
6999      the device.
7000      */
7001      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
7002        /*
7003        Checks for an iOS device and displays an error message if debugging
7004        is turned on.
7005        */
7006        if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
7007          _debug2.default.writeMessage("iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4");
7008        } else {
7009          mute_classes[i].removeEventListener("touchend", _mute2.default.handle);
7010          mute_classes[i].addEventListener("touchend", _mute2.default.handle);
7011        }
7012      } else {
7013        mute_classes[i].removeEventListener("click", _mute2.default.handle);
7014        mute_classes[i].addEventListener("click", _mute2.default.handle);
7015      }
7016    }
7017  }
7018
7019  /**
7020   * Binds click and touchend events for AmplitudeJS Volume Up Buttons
7021   *
7022   * @access private
7023   */
7024  function bindVolumeUp() {
7025    /*
7026    Gets all of the elements with the class amplitude-volume-up
7027    */
7028    var volume_up_classes = document.getElementsByClassName("amplitude-volume-up");
7029
7030    /*
7031    Iterates over all of the volume up classes and binds the event interaction
7032    methods to the element. If the browser is mobile, then the event is touchend
7033    otherwise it is click.
7034    */
7035    for (var i = 0; i < volume_up_classes.length; i++) {
7036      /*
7037      WARNING: If iOS, we don't do anything because iOS does not allow the
7038      volume to be adjusted through anything except the buttons on the side of
7039      the device.
7040      */
7041      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
7042        /*
7043        Checks for an iOS device and displays an error message if debugging
7044        is turned on.
7045        */
7046        if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
7047          _debug2.default.writeMessage("iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4");
7048        } else {
7049          volume_up_classes[i].removeEventListener("touchend", _volumeUp2.default.handle);
7050          volume_up_classes[i].addEventListener("touchend", _volumeUp2.default.handle);
7051        }
7052      } else {
7053        volume_up_classes[i].removeEventListener("click", _volumeUp2.default.handle);
7054        volume_up_classes[i].addEventListener("click", _volumeUp2.default.handle);
7055      }
7056    }
7057  }
7058
7059  /**
7060   * Binds click and touchend events for AmplitudeJS Volume Down Buttons
7061   *
7062   * @access private
7063   */
7064  function bindVolumeDown() {
7065    /*
7066    Gets all of the elements with the class amplitude-volume-down
7067    */
7068    var volume_down_classes = document.getElementsByClassName("amplitude-volume-down");
7069
7070    /*
7071    Iterates over all of the volume down classes and binds the event interaction
7072    methods to the element. If the browser is mobile, then the event is touchend
7073    otherwise it is click.
7074    */
7075    for (var i = 0; i < volume_down_classes.length; i++) {
7076      /*
7077      WARNING: If iOS, we don't do anything because iOS does not allow the
7078      volume to be adjusted through anything except the buttons on the side of
7079      the device.
7080      */
7081      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
7082        /*
7083        Checks for an iOS device and displays an error message if debugging
7084        is turned on.
7085        */
7086        if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
7087          _debug2.default.writeMessage("iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4");
7088        } else {
7089          volume_down_classes[i].removeEventListener("touchend", _volumeDown2.default.handle);
7090          volume_down_classes[i].addEventListener("touchend", _volumeDown2.default.handle);
7091        }
7092      } else {
7093        volume_down_classes[i].removeEventListener("click", _volumeDown2.default.handle);
7094        volume_down_classes[i].addEventListener("click", _volumeDown2.default.handle);
7095      }
7096    }
7097  }
7098
7099  /**
7100   * Binds change and input events for AmplitudeJS Song Slider Inputs
7101   *
7102   * @access private
7103   */
7104  function bindSongSlider() {
7105    /*
7106    Gets browser so if we need to apply overrides, like we usually
7107    have to do for anything cool in IE, we can do that.
7108    */
7109    var ua = window.navigator.userAgent;
7110    var msie = ua.indexOf("MSIE ");
7111
7112    /*
7113    Gets all of the elements with the class amplitude-song-slider
7114    */
7115    var song_sliders = document.getElementsByClassName("amplitude-song-slider");
7116
7117    /*
7118    Iterates over all of the song slider classes and binds the event interaction
7119    methods to the element. If the browser is IE we listen to the change event
7120    where if it is anything else, it's the input method.
7121    */
7122    for (var i = 0; i < song_sliders.length; i++) {
7123      if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
7124        song_sliders[i].removeEventListener("change", _songSlider2.default.handle);
7125        song_sliders[i].addEventListener("change", _songSlider2.default.handle);
7126      } else {
7127        song_sliders[i].removeEventListener("input", _songSlider2.default.handle);
7128        song_sliders[i].addEventListener("input", _songSlider2.default.handle);
7129      }
7130    }
7131  }
7132
7133  /**
7134   * Binds change and input events fro AmplitudeJS Volume Slider inputs
7135   *
7136   * @access private
7137   */
7138  function bindVolumeSlider() {
7139    /*
7140    Gets browser so if we need to apply overrides, like we usually
7141    have to do for anything cool in IE, we can do that.
7142    */
7143    var ua = window.navigator.userAgent;
7144    var msie = ua.indexOf("MSIE ");
7145
7146    /*
7147    Gets all of the elements with the class amplitude-volume-slider
7148        */
7149    var volume_sliders = document.getElementsByClassName("amplitude-volume-slider");
7150
7151    /*
7152    Iterates over all of the volume slider classes and binds the event interaction
7153    methods to the element. If the browser is IE we listen to the change event
7154    where if it is anything else, it's the input method.
7155    */
7156    for (var i = 0; i < volume_sliders.length; i++) {
7157      /*
7158      WARNING: If iOS, we don't do anything because iOS does not allow the
7159      volume to be adjusted through anything except the buttons on the side of
7160      the device.
7161      */
7162      if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
7163        _debug2.default.writeMessage("iOS does NOT allow volume to be set through javascript: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW4");
7164      } else {
7165        if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
7166          volume_sliders[i].removeEventListener("change", _volumeSlider2.default.handle);
7167          volume_sliders[i].addEventListener("change", _volumeSlider2.default.handle);
7168        } else {
7169          volume_sliders[i].removeEventListener("input", _volumeSlider2.default.handle);
7170          volume_sliders[i].addEventListener("input", _volumeSlider2.default.handle);
7171        }
7172      }
7173    }
7174  }
7175
7176  /**
7177   * Binds click and touchend events fro AmplitudeJS Next buttons
7178   *
7179   * @access private
7180   */
7181  function bindNext() {
7182    /*
7183    Gets all of the elements with the class amplitude-next
7184        */
7185    var next_classes = document.getElementsByClassName("amplitude-next");
7186
7187    /*
7188    Iterates over all of the next classes and binds the event interaction
7189    methods to the element. If the browser is mobile, then the event is touchend
7190    otherwise it is click.
7191    */
7192    for (var i = 0; i < next_classes.length; i++) {
7193      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
7194        next_classes[i].removeEventListener("touchend", _next2.default.handle);
7195        next_classes[i].addEventListener("touchend", _next2.default.handle);
7196      } else {
7197        next_classes[i].removeEventListener("click", _next2.default.handle);
7198        next_classes[i].addEventListener("click", _next2.default.handle);
7199      }
7200    }
7201  }
7202
7203  /**
7204   * Binds click and touchend events for AmplitudeJS prev buttons.
7205   *
7206   * @access private
7207   */
7208  function bindPrev() {
7209    /*
7210    Gets all of the elements with the class amplitude-prev
7211    */
7212    var prev_classes = document.getElementsByClassName("amplitude-prev");
7213
7214    /*
7215    Iterates over all of the prev classes and binds the event interaction
7216    methods to the element. If the browser is mobile, then the event is touchend
7217    otherwise it is click.
7218    */
7219    for (var i = 0; i < prev_classes.length; i++) {
7220      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
7221        prev_classes[i].removeEventListener("touchend", _prev2.default.handle);
7222        prev_classes[i].addEventListener("touchend", _prev2.default.handle);
7223      } else {
7224        prev_classes[i].removeEventListener("click", _prev2.default.handle);
7225        prev_classes[i].addEventListener("click", _prev2.default.handle);
7226      }
7227    }
7228  }
7229
7230  /**
7231   * Binds click and touchend events for AmplitudeJS shuffle buttons.
7232   *
7233   * @access private
7234   */
7235  function bindShuffle() {
7236    /*
7237    Gets all of the elements with the class amplitude-shuffle
7238    */
7239    var shuffle_classes = document.getElementsByClassName("amplitude-shuffle");
7240
7241    /*
7242    Iterates over all of the shuffle classes and binds the event interaction
7243    methods to the element. If the browser is mobile, then the event is touchend
7244    otherwise it is click.
7245    */
7246    for (var i = 0; i < shuffle_classes.length; i++) {
7247      /*
7248      Since we are re-binding everything we remove any classes that signify
7249      a state of the shuffle control.
7250      */
7251      shuffle_classes[i].classList.remove("amplitude-shuffle-on");
7252      shuffle_classes[i].classList.add("amplitude-shuffle-off");
7253
7254      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
7255        shuffle_classes[i].removeEventListener("touchend", _shuffle2.default.handle);
7256        shuffle_classes[i].addEventListener("touchend", _shuffle2.default.handle);
7257      } else {
7258        shuffle_classes[i].removeEventListener("click", _shuffle2.default.handle);
7259        shuffle_classes[i].addEventListener("click", _shuffle2.default.handle);
7260      }
7261    }
7262  }
7263
7264  /**
7265   * Binds click and touchend events for AmplitudeJS repeat buttons.
7266   *
7267   * @access private
7268   */
7269  function bindRepeat() {
7270    /*
7271    Gets all of the elements with the class amplitude-repeat
7272    */
7273    var repeat_classes = document.getElementsByClassName("amplitude-repeat");
7274
7275    /*
7276    Iterates over all of the repeat classes and binds the event interaction
7277    methods to the element. If the browser is mobile, then the event is touchend
7278    otherwise it is click.
7279    */
7280    for (var i = 0; i < repeat_classes.length; i++) {
7281      /*
7282      Since we are re-binding everything we remove any classes that signify
7283      a state of the repeat control.
7284      */
7285      repeat_classes[i].classList.remove("amplitude-repeat-on");
7286      repeat_classes[i].classList.add("amplitude-repeat-off");
7287
7288      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
7289        repeat_classes[i].removeEventListener("touchend", _repeat2.default.handle);
7290        repeat_classes[i].addEventListener("touchend", _repeat2.default.handle);
7291      } else {
7292        repeat_classes[i].removeEventListener("click", _repeat2.default.handle);
7293        repeat_classes[i].addEventListener("click", _repeat2.default.handle);
7294      }
7295    }
7296  }
7297
7298  /**
7299   * Binds click and touchend events for AmplitudeJS repeat song buttons.
7300   *
7301   * @access private
7302   */
7303  function bindRepeatSong() {
7304    /*
7305    Gets all of the elements with the class amplitude-repeat-song
7306    */
7307    var repeat_song_classes = document.getElementsByClassName("amplitude-repeat-song");
7308
7309    /*
7310    Iterates over all of the repeat song classes and binds the event interaction
7311    methods to the element. If the browser is mobile, then the event is touchend
7312    otherwise it is click.
7313    */
7314    for (var i = 0; i < repeat_song_classes.length; i++) {
7315      /*
7316      Since we are re-binding everything we remove any classes that signify
7317      a state of the repeat control.
7318      */
7319      repeat_song_classes[i].classList.remove("amplitude-repeat-on");
7320      repeat_song_classes[i].classList.add("amplitude-repeat-off");
7321
7322      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
7323        repeat_song_classes[i].removeEventListener("touchend", _repeatSong2.default.handle);
7324        repeat_song_classes[i].addEventListener("touchend", _repeatSong2.default.handle);
7325      } else {
7326        repeat_song_classes[i].removeEventListener("click", _repeatSong2.default.handle);
7327        repeat_song_classes[i].addEventListener("click", _repeatSong2.default.handle);
7328      }
7329    }
7330  }
7331
7332  /**
7333   * Binds click and touchend events for AmplitudeJS playback speed buttons
7334   *
7335   * @access private
7336   */
7337  function bindPlaybackSpeed() {
7338    /*
7339    Gets all of the elements with the class amplitude-playback-speed
7340    */
7341    var playback_speed_classes = document.getElementsByClassName("amplitude-playback-speed");
7342
7343    /*
7344    Iterates over all of the playback speed classes and binds the event interaction
7345    methods to the element. If the browser is mobile, then the event is touchend
7346    otherwise it is click.
7347    */
7348    for (var i = 0; i < playback_speed_classes.length; i++) {
7349      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
7350        playback_speed_classes[i].removeEventListener("touchend", _playbackSpeed2.default.handle);
7351        playback_speed_classes[i].addEventListener("touchend", _playbackSpeed2.default.handle);
7352      } else {
7353        playback_speed_classes[i].removeEventListener("click", _playbackSpeed2.default.handle);
7354        playback_speed_classes[i].addEventListener("click", _playbackSpeed2.default.handle);
7355      }
7356    }
7357  }
7358
7359  /**
7360   * Binds click and touchend events for AmplitudeJS skip to buttons.
7361   *
7362   * @access private
7363   */
7364  function bindSkipTo() {
7365    /*
7366    Gets all of the skip to elements with the class 'amplitude-skip-to'
7367    */
7368    var skipToClasses = document.getElementsByClassName("amplitude-skip-to");
7369
7370    /*
7371    Iterates over all of the skip to classes and binds the event interaction
7372    methods to the element. If the browser is mobile, then the event is touchend
7373    otherwise it's a click.
7374    */
7375    for (var i = 0; i < skipToClasses.length; i++) {
7376      if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
7377        skipToClasses[i].removeEventListener("touchend", _skipTo2.default.handle);
7378        skipToClasses[i].addEventListener("touchend", _skipTo2.default.handle);
7379      } else {
7380        skipToClasses[i].removeEventListener("click", _skipTo2.default.handle);
7381        skipToClasses[i].addEventListener("click", _skipTo2.default.handle);
7382      }
7383    }
7384  }
7385
7386  /**
7387   * Binds can play through to a song.
7388   *
7389   * @access private
7390   */
7391  function bindCanPlayThrough() {
7392    if (_waveform2.default.determineIfUsingWaveforms()) {
7393      _config2.default.audio.removeEventListener("canplaythrough", _waveform2.default.build);
7394      _config2.default.audio.addEventListener("canplaythrough", _waveform2.default.build);
7395    }
7396  }
7397
7398  /*
7399  Returns the public facing functions.
7400  */
7401  return {
7402    initialize: initialize
7403  };
7404}();
7405
7406/**
7407 * Imports the utility classes used by the evnets.
7408 */
7409/*
7410	Import the necessary classes and config to use
7411	with the events.
7412*/
7413exports.default = Events;
7414module.exports = exports["default"];
7415
7416/***/ }),
7417/* 27 */
7418/***/ (function(module, exports, __webpack_require__) {
7419
7420"use strict";
7421
7422
7423Object.defineProperty(exports, "__esModule", {
7424  value: true
7425});
7426
7427var _config = __webpack_require__(0);
7428
7429var _config2 = _interopRequireDefault(_config);
7430
7431var _core = __webpack_require__(1);
7432
7433var _core2 = _interopRequireDefault(_core);
7434
7435var _shuffler = __webpack_require__(13);
7436
7437var _shuffler2 = _interopRequireDefault(_shuffler);
7438
7439var _repeater = __webpack_require__(12);
7440
7441var _repeater2 = _interopRequireDefault(_repeater);
7442
7443var _audioNavigation = __webpack_require__(3);
7444
7445var _audioNavigation2 = _interopRequireDefault(_audioNavigation);
7446
7447var _repeatElements = __webpack_require__(
vendor: 44,086 bytes, lines 7447-9257
74479);
7448
7449var _repeatElements2 = _interopRequireDefault(_repeatElements);
7450
7451var _playPauseElements = __webpack_require__(2);
7452
7453var _playPauseElements2 = _interopRequireDefault(_playPauseElements);
7454
7455function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7456
7457/**
7458 * AmplitudeJS Key Down event handler
7459 *
7460 * @module events/KeyDown
7461 */
7462
7463
7464/**
7465 * Imports the Repeat Elements Visual Handler
7466 * @module visual/RepeatElements
7467 */
7468
7469
7470/**
7471 * Imports the Repeater Utility
7472 * @module utilities/Repeater
7473 */
7474
7475
7476/**
7477 * Imports the core of AmplitudeJS
7478 * @module core/Core
7479 */
7480var KeyDown = function () {
7481  /**
7482   * When the keydown event is fired, we determine which function should be run
7483   * based on what was passed in.
7484   *
7485   * HANDLER FOR: keydown
7486   *
7487   * @access public
7488   * @prop {object} event The event object being passed in.
7489   */
7490  function handle(event) {
7491    runKeyEvent(event.which);
7492  }
7493
7494  /**
7495   * Runs an event on key down
7496   *
7497   * @access public
7498   * @param {number} key 	- The key code the event is bound to.
7499   */
7500  function runKeyEvent(key) {
7501    /*
7502    Checks to see if the user bound an event to the code pressed.
7503    */
7504    if (_config2.default.bindings[key] != undefined) {
7505      /*
7506      Determine which event should be run if bound.
7507      */
7508      switch (_config2.default.bindings[key]) {
7509        /*
7510        Fires a play pause event.
7511        */
7512        case "play_pause":
7513          runPlayPauseKeyDownEvent();
7514          break;
7515
7516        /*
7517        Fires a next event.
7518        */
7519        case "next":
7520          runNextKeyDownEvent();
7521          break;
7522
7523        /*
7524        Fires a previous event.
7525        */
7526        case "prev":
7527          runPrevKeyDownEvent();
7528          break;
7529
7530        /*
7531        Fires a stop event.
7532        */
7533        case "stop":
7534          runStopKeyDownEvent();
7535          break;
7536
7537        /*
7538        Fires a shuffle event.
7539        */
7540        case "shuffle":
7541          runShuffleKeyDownEvent();
7542          break;
7543
7544        /*
7545        Fires a repeat event.
7546        */
7547        case "repeat":
7548          runRepeatKeyDownEvent();
7549          break;
7550      }
7551    }
7552  }
7553
7554  /**
7555   * Runs the play pause method for key down.
7556   */
7557  function runPlayPauseKeyDownEvent() {
7558    /*
7559      If the song is paused, we play the song. If the song is playing,
7560      we pause the song.
7561    */
7562    if (_config2.default.audio.paused) {
7563      _core2.default.play();
7564    } else {
7565      _core2.default.pause();
7566    }
7567
7568    /*
7569      Now we sync all the elements to match the state of the audio.
7570      We don't need to do any checks on new songs or changed playlists
7571      in the global since it's whatever song is playing.
7572    */
7573    _playPauseElements2.default.sync();
7574  }
7575
7576  /**
7577   * Runs the next method for key down.
7578   */
7579  function runNextKeyDownEvent() {
7580    /*
7581      Check to see if the current state of the player
7582      is in playlist mode or not playlist mode.
7583    */
7584    if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) {
7585      _audioNavigation2.default.setNext();
7586    } else {
7587      _audioNavigation2.default.setNextPlaylist(_config2.default.active_playlist);
7588    }
7589  }
7590
7591  /**
7592   * Runs the previous method for key down.
7593   */
7594  function runPrevKeyDownEvent() {
7595    /*
7596      Check to see if the current playlist has been set
7597      or null and set the previous song.
7598    */
7599    if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) {
7600      _audioNavigation2.default.setPrevious();
7601    } else {
7602      _audioNavigation2.default.setPreviousPlaylist(_config2.default.active_playlist);
7603    }
7604  }
7605
7606  /**
7607   * Runs the stop method for key down.
7608   */
7609  function runStopKeyDownEvent() {
7610    /*
7611      Syncs all of the play pause elements to pause.
7612    */
7613    _playPauseElements2.default.syncToPause();
7614
7615    /*
7616      Stops the active song.
7617    */
7618    _core2.default.stop();
7619  }
7620
7621  /**
7622   * Runs the shuffle method for key down.
7623   */
7624  function runShuffleKeyDownEvent() {
7625    /*
7626      Check to see if the current playlist has been set
7627      or null and set the previous song.
7628    */
7629    if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) {
7630      _shuffler2.default.toggleShuffle();
7631    } else {
7632      _shuffler2.default.toggleShufflePlaylist(_config2.default.active_playlist);
7633    }
7634  }
7635
7636  /**
7637   * Run the repeat method for key down.
7638   */
7639  function runRepeatKeyDownEvent() {
7640    /*
7641      Toggles the repeat
7642    */
7643    _repeater2.default.setRepeat(!_config2.default.repeat);
7644
7645    /*
7646      Visually sync repeat
7647    */
7648    _repeatElements2.default.syncRepeat();
7649  }
7650
7651  /**
7652   * Returns the public methods for the handler.
7653   */
7654  return {
7655    handle: handle
7656  };
7657}();
7658
7659/**
7660 * Imports the Play Pause Elements Visual Handler
7661 * @module visual/PlayPauseElements
7662 */
7663
7664
7665/**
7666 * Imports the Audio Navigation Utility
7667 * @module utilities/AudioNavigation
7668 */
7669
7670
7671/**
7672 * Imports the Shuffle Utility
7673 * @module utilities/Shuffle
7674 */
7675/**
7676 * Imports the config module
7677 * @module config
7678 */
7679exports.default = KeyDown;
7680module.exports = exports["default"];
7681
7682/***/ }),
7683/* 28 */
7684/***/ (function(module, exports, __webpack_require__) {
7685
7686"use strict";
7687
7688
7689Object.defineProperty(exports, "__esModule", {
7690  value: true
7691});
7692
7693var _config = __webpack_require__(0);
7694
7695var _config2 = _interopRequireDefault(_config);
7696
7697var _core = __webpack_require__(1);
7698
7699var _core2 = _interopRequireDefault(_core);
7700
7701var _muteElements = __webpack_require__(10);
7702
7703var _muteElements2 = _interopRequireDefault(_muteElements);
7704
7705var _volumeSliderElements = __webpack_require__(11);
7706
7707var _volumeSliderElements2 = _interopRequireDefault(_volumeSliderElements);
7708
7709function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7710
7711/**
7712 * Handles all events for a mute event.
7713 * @module events/Mute
7714 */
7715
7716
7717/**
7718 * Imports the AmplitudeJS Visual Mute Elements
7719 * @module visual/MuteElements
7720 */
7721/**
7722 * Imports the config to use the values
7723 */
7724var Mute = function () {
7725  /**
7726   * Handles an event for a mute element
7727   *
7728   * HANDLER FOR:       class="amplitude-mute"
7729   *
7730   * @access public
7731   */
7732  function handle() {
7733    /*
7734      We don't fire this if the user is touching the screen and it's moving.
7735      This could lead to a mis-fire
7736    */
7737    if (!_config2.default.is_touch_moving) {
7738      /*
7739      If the current volume in the config is 0, we set the volume to the
7740      pre_mute level.  This means that the audio is already muted and
7741      needs to be restored to the pre_mute level.
7742      Otherwise, we set pre_mute volume to the current volume
7743      and set the config volume to 0, muting the audio.
7744      */
7745      if (_config2.default.volume == 0) {
7746        _core2.default.setVolume(_config2.default.pre_mute_volume);
7747      } else {
7748        _config2.default.pre_mute_volume = _config2.default.volume;
7749        _core2.default.setVolume(0);
7750      }
7751
7752      /*
7753        Sync Mute Elements.
7754      */
7755      _muteElements2.default.setMuted(_config2.default.volume == 0 ? true : false);
7756
7757      /*
7758      Syncs the volume sliders so the visuals align up with the functionality.
7759      If the volume is at 0, then the sliders should represent that so the user
7760      has the right starting point.
7761      */
7762      _volumeSliderElements2.default.sync();
7763    }
7764  }
7765
7766  /**
7767   * Returns the public facing methods
7768   */
7769  return {
7770    handle: handle
7771  };
7772}();
7773
7774/**
7775 * Imports the AmplitudeJS Visual Volume Slider Elements
7776 * @module visual/VolumeSliderElements
7777 */
7778
7779
7780/**
7781 * Imports the AmplitudeJS Core Methods
7782 * @module core/core
7783 */
7784exports.default = Mute;
7785module.exports = exports["default"];
7786
7787/***/ }),
7788/* 29 */
7789/***/ (function(module, exports, __webpack_require__) {
7790
7791"use strict";
7792
7793
7794Object.defineProperty(exports, "__esModule", {
7795  value: true
7796});
7797
7798var _config = __webpack_require__(0);
7799
7800var _config2 = _interopRequireDefault(_config);
7801
7802var _core = __webpack_require__(1);
7803
7804var _core2 = _interopRequireDefault(_core);
7805
7806var _playPauseElements = __webpack_require__(2);
7807
7808var _playPauseElements2 = _interopRequireDefault(_playPauseElements);
7809
7810var _callbacks = __webpack_require__(7);
7811
7812var _callbacks2 = _interopRequireDefault(_callbacks);
7813
7814var _audioNavigation = __webpack_require__(3);
7815
7816var _audioNavigation2 = _interopRequireDefault(_audioNavigation);
7817
7818var _debug = __webpack_require__(4);
7819
7820var _debug2 = _interopRequireDefault(_debug);
7821
7822function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7823
7824/**
7825 * AmplitudeJS Next Event Handler
7826 *
7827 * @module events/Next
7828 */
7829
7830
7831/**
7832 * Imports the Amplitude Audio Navigation Utility
7833 * @module utilities/AudioNavigation
7834 */
7835
7836
7837/**
7838 * Imports the Play Pause Elements Module.
7839 * @module visual/PlayPauseElements
7840 */
7841/**
7842 * Imports the config module
7843 * @module config
7844 */
7845var Next = function () {
7846  /**
7847   * Handles an event on the next button
7848   *
7849   * HANDLER FOR:       class="amplitude-next"
7850   *
7851   * GLOBAL:            class="amplitude-next"
7852   * PLAYLIST:          class="amplitude-next" amplitude-playlist="playlist_key"
7853   *
7854   * @access public
7855   */
7856  function handle() {
7857    /*
7858      We don't fire this if the user is touching the screen and it's moving.
7859      This could lead to a mis-fire
7860    */
7861    if (!_config2.default.is_touch_moving) {
7862      /*
7863        Gets the playlist attribute from the element.
7864      */
7865      var playlist = this.getAttribute("data-amplitude-playlist");
7866
7867      /*
7868        If the playlist is null, we handle the global next.
7869      */
7870      if (playlist == null) {
7871        handleGlobalNext();
7872      }
7873
7874      /*
7875        If the playlist is set, we handle the playlist next.
7876      */
7877      if (playlist != null) {
7878        handlePlaylistNext(playlist);
7879      }
7880    }
7881  }
7882
7883  /**
7884   * Handles an event on a global enxt button.
7885   *
7886   * @access private
7887   */
7888  function handleGlobalNext() {
7889    /*
7890      Check to see if the current state of the player
7891      is in playlist mode or not playlist mode. If we are in playlist mode,
7892      we set next on the playlist.
7893    */
7894    if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) {
7895      _audioNavigation2.default.setNext();
7896    } else {
7897      _audioNavigation2.default.setNextPlaylist(_config2.default.active_playlist);
7898    }
7899  }
7900
7901  /**
7902   * Handles an event on a next playlist button.
7903   *
7904   * @access private
7905   * @prop {string} playlist  - The playlist we are handling the next for.
7906   */
7907  function handlePlaylistNext(playlist) {
7908    /*
7909      Ensure the playlist is the same as the active playlist. To get to change
7910      the scope to a new playlist, you need to play that playlist.
7911    */
7912    if (playlist == _config2.default.active_playlist) {
7913      _audioNavigation2.default.setNextPlaylist(playlist);
7914    } else {
7915      _debug2.default.writeMessage("You can not go to the next song on a playlist that is not being played!");
7916    }
7917  }
7918
7919  /*
7920    Returns the public facing methods.
7921  */
7922  return {
7923    handle: handle
7924  };
7925}();
7926
7927/**
7928 * AmplitudeJS Debug Module
7929 * @module utilities/Debug
7930 */
7931
7932
7933/**
7934 * Imports the Callbacks Module
7935 * @module utilities/Callbacks
7936 */
7937
7938
7939/**
7940 * Imports the AmplitudeJS Core module.
7941 * @module core/core
7942 */
7943exports.default = Next;
7944module.exports = exports["default"];
7945
7946/***/ }),
7947/* 30 */
7948/***/ (function(module, exports, __webpack_require__) {
7949
7950"use strict";
7951
7952
7953Object.defineProperty(exports, "__esModule", {
7954  value: true
7955});
7956
7957var _config = __webpack_require__(0);
7958
7959var _config2 = _interopRequireDefault(_config);
7960
7961var _configState = __webpack_require__(6);
7962
7963var _configState2 = _interopRequireDefault(_configState);
7964
7965var _core = __webpack_require__(1);
7966
7967var _core2 = _interopRequireDefault(_core);
7968
7969var _playPauseElements = __webpack_require__(2);
7970
7971var _playPauseElements2 = _interopRequireDefault(_playPauseElements);
7972
7973function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
7974
7975/**
7976 * Handles all of the pause events
7977 * @module events/Pause
7978 */
7979
7980
7981/**
7982 * Imports the AmplitudeJS Core Methods
7983 * @module core/Core
7984 */
7985/**
7986 * Imports the config module
7987 * @module config
7988 */
7989var Pause = function () {
7990  /**
7991   * Handles an event on a pause button
7992   *
7993   * HANDLER FOR:       class="amplitude-pause"
7994   *
7995   * GLOBAL:            class="amplitude-pause"
7996   * PLAYLIST:          class="amplitude-pause" amplitude-playlist="playlist_key"
7997   * SONG:              class="amplitude-pause" amplitude-song-index="song_index"
7998   * SONG IN PLAYLIST:  class="amplitude-pause" amplitude-playlist="playlist-key" amplitude-song-index="playlist_index"
7999   *
8000   * @access public
8001   */
8002  function handle() {
8003    /*
8004      If the touch is moving, we do not want to accidentally touch the play
8005      pause element and fire an event.
8006    */
8007    if (!_config2.default.is_touch_moving) {
8008      /*
8009        Gets the attribute for song index so we can check if
8010        there is a need to change the song.  In some scenarios
8011        there might be multiple pause classes on the page. In that
8012        case it is possible the user could click a different pause
8013        class.
8014      */
8015      var songIndexAttribute = this.getAttribute("data-amplitude-song-index");
8016      var playlistAttribute = this.getAttribute("data-amplitude-playlist");
8017
8018      /*
8019        Handle a global pause button.
8020      */
8021      if (playlistAttribute == null && songIndexAttribute == null) {
8022        handleGlobalPause();
8023      }
8024
8025      /*
8026        Handle a playlist pause button.
8027      */
8028      if (playlistAttribute != null && songIndexAttribute == null) {
8029        handlePlaylistPause(playlistAttribute);
8030      }
8031
8032      /*
8033        Handle a song pause button.
8034      */
8035      if (playlistAttribute == null && songIndexAttribute != null) {
8036        handleSongPause(songIndexAttribute);
8037      }
8038
8039      /*
8040        Handle a song in playlist pause button.
8041      */
8042      if (playlistAttribute != null && songIndexAttribute != null) {
8043        handleSongInPlaylistPause(playlistAttribute, songIndexAttribute);
8044      }
8045
8046      _configState2.default.setPlayerState();
8047    }
8048  }
8049
8050  /**
8051   * Handles global pause button which pauses whatever song is
8052   * active.
8053   *
8054   * @access private
8055   */
8056  function handleGlobalPause() {
8057    /*
8058      Pauses the song.
8059    */
8060    _core2.default.pause();
8061
8062    /*
8063      Sync the play pause elements.
8064    */
8065    _playPauseElements2.default.sync();
8066  }
8067
8068  /**
8069   * Handles the playlist pause.
8070   *
8071   * @access private
8072   * @param {string} playlist The playlist the pause button belongs to.
8073   */
8074  function handlePlaylistPause(playlist) {
8075    /*
8076      Checks to see if the active playlist is the same
8077    */
8078    if (_config2.default.active_playlist == playlist) {
8079      /*
8080        Pauses the song.
8081      */
8082      _core2.default.pause();
8083
8084      /*
8085        Sync the play pause elements.
8086      */
8087      _playPauseElements2.default.sync();
8088    }
8089  }
8090
8091  /**
8092   * Handles the song pause.
8093   *
8094   * @access private
8095   * @param {integer} song The song the pause button belongs to.
8096   */
8097  function handleSongPause(song) {
8098    /*
8099      Checks to see if the active playlist is null and the song matches
8100      the active index.
8101    */
8102    if ((_config2.default.active_playlist == "" || _config2.default.active_playlist == null) && _config2.default.active_index == song) {
8103      /*
8104        Pauses the song.
8105      */
8106      _core2.default.pause();
8107
8108      /*
8109        Sync the play pause elements.
8110      */
8111      _playPauseElements2.default.sync();
8112    }
8113  }
8114
8115  /**
8116   * Handles the song in playlist pause.
8117   *
8118   * @access private
8119   * @param {string} playlist The playlist the pause button belongs to.
8120   * @param {integer} song The song the pause button belongs to.
8121   */
8122  function handleSongInPlaylistPause(playlist, song) {
8123    /*
8124      Checks to see if the active song matches the song and the
8125      active playlist matches the playlist. This means the pause button is
8126      for the song in the playlist.
8127    */
8128    if (_config2.default.active_playlist == playlist && _config2.default.playlists[playlist].active_index == song) {
8129      /*
8130        Pauses the song.
8131      */
8132      _core2.default.pause();
8133
8134      /*
8135        Sync the play pause elements.
8136      */
8137      _playPauseElements2.default.sync();
8138    }
8139  }
8140
8141  /*
8142    Returns the public facing elements
8143  */
8144  return {
8145    handle: handle
8146  };
8147}();
8148
8149/**
8150 * Imports the AmplitudeJS Play Pause Elements
8151 * @module visual/PlayPauseElements
8152 */
8153
8154
8155/**
8156 * Imports the ConfigState module.
8157 * @module utilities/ConfigState
8158 */
8159exports.default = Pause;
8160module.exports = exports["default"];
8161
8162/***/ }),
8163/* 31 */
8164/***/ (function(module, exports, __webpack_require__) {
8165
8166"use strict";
8167
8168
8169Object.defineProperty(exports, "__esModule", {
8170  value: true
8171});
8172
8173var _config = __webpack_require__(0);
8174
8175var _config2 = _interopRequireDefault(_config);
8176
8177var _configState = __webpack_require__(6);
8178
8179var _configState2 = _interopRequireDefault(_configState);
8180
8181var _core = __webpack_require__(1);
8182
8183var _core2 = _interopRequireDefault(_core);
8184
8185var _checks = __webpack_require__(5);
8186
8187var _checks2 = _interopRequireDefault(_checks);
8188
8189var _audioNavigation = __webpack_require__(3);
8190
8191var _audioNavigation2 = _interopRequireDefault(_audioNavigation);
8192
8193var _playPauseElements = __webpack_require__(2);
8194
8195var _playPauseElements2 = _interopRequireDefault(_playPauseElements);
8196
8197function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8198
8199/**
8200 * Handles all of the play events
8201 * @module events/Play
8202 */
8203
8204
8205/**
8206 * Imports the AmplitudeJS Audio Navigation Utility
8207 * @module utilities/AudioNavigation
8208 */
8209
8210
8211/**
8212 * Imports the AmplitudeJS Core Methods
8213 * @module core/Core
8214 */
8215/**
8216 * Imports the config module
8217 * @module config
8218 */
8219var Play = function () {
8220  /**
8221   * Handles an event on a play button in Amplitude.
8222   *
8223   * HANDLER FOR:       class="amplitude-play"
8224   *
8225   * GLOBAL:            class="amplitude-play"
8226   * PLAYLIST:          class="amplitude-play" amplitude-playlist="playlist_key"
8227   * SONG:              class="amplitude-play" amplitude-song-index="song_index"
8228   * SONG IN PLAYLIST:  class="amplitude-play" amplitude-playlist="playlist-key" amplitude-song-index="playlist_index"
8229   *
8230   * @access public
8231   */
8232  function handle() {
8233    /*
8234      If the touch is moving, we do not want to accidentally touch the play
8235      pause element and fire an event.
8236    */
8237    if (!_config2.default.is_touch_moving) {
8238      /*
8239        Gets the attribute for song index so we can check if
8240        there is a need to change the song.  In some scenarios
8241        there might be multiple play classes on the page. In that
8242        case it is possible the user could click a different play
8243        class and change the song.
8244      */
8245      var songIndexAttribute = this.getAttribute("data-amplitude-song-index");
8246      var playlistAttribute = this.getAttribute("data-amplitude-playlist");
8247
8248      /*
8249        Handle a global play button.
8250      */
8251      if (playlistAttribute == null && songIndexAttribute == null) {
8252        handleGlobalPlay();
8253      }
8254
8255      /*
8256        Handle a playlist play button.
8257      */
8258      if (playlistAttribute != null && songIndexAttribute == null) {
8259        handlePlaylistPlay(playlistAttribute);
8260      }
8261
8262      /*
8263        Handle a song play button.
8264      */
8265      if (playlistAttribute == null && songIndexAttribute != null) {
8266        handleSongPlay(songIndexAttribute);
8267      }
8268
8269      /*
8270        Handle a song in playlist play button.
8271      */
8272      if (playlistAttribute != null && songIndexAttribute != null) {
8273        handleSongInPlaylistPlay(playlistAttribute, songIndexAttribute);
8274      }
8275
8276      _configState2.default.setPlayerState();
8277    }
8278  }
8279
8280  /**
8281   * Handles global play button which plays whatever song is
8282   * active.
8283   *
8284   * @access private
8285   */
8286  function handleGlobalPlay() {
8287    /*
8288      Plays the song
8289    */
8290    _core2.default.play();
8291
8292    /*
8293      Sync the play pause elements.
8294    */
8295    _playPauseElements2.default.sync();
8296  }
8297
8298  /**
8299   * Handle the playlist play.
8300   *
8301   * @access private
8302   * @param {string} playlist The playlist the play button belongs to.
8303   */
8304  function handlePlaylistPlay(playlist) {
8305    /*
8306      Checks if we have a new playlist.
8307    */
8308    if (_checks2.default.newPlaylist(playlist)) {
8309      /*
8310        Sets the active playlist to what belongs to the playlist.
8311      */
8312      _audioNavigation2.default.setActivePlaylist(playlist);
8313
8314      /*
8315        Play first song in the playlist since we just
8316        switched playlists, we start from the first song.
8317         If the user has shuffle on for the playlist, then
8318        we go from the first song in the shuffle playlist array.
8319      */
8320      if (_config2.default.playlists[playlist].shuffle) {
8321        _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].shuffle_list[0], 0);
8322      } else {
8323        _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[0], 0);
8324      }
8325    }
8326
8327    /*
8328      Plays the song.
8329    */
8330    _core2.default.play();
8331
8332    /*
8333      Syncs the play pause elements since they are dependent upon this state
8334      of the player.
8335    */
8336    _playPauseElements2.default.sync();
8337  }
8338
8339  /**
8340   * Handles the song play button.
8341   *
8342   * @access private
8343   * @param {integer} song The index of the song we are playing.
8344   */
8345  function handleSongPlay(song) {
8346    /*
8347      There can be multiple playlists on the page and there can be
8348      multiple songs on the page AND there can be songs in multiple
8349      playlists, so we have some checking to do.
8350    */
8351
8352    /*
8353      Check to see if the playlist has changed. Essentially, if we are moving
8354      out of a playlist context.
8355    */
8356    if (_checks2.default.newPlaylist(null)) {
8357      /*
8358        We've moved out of the playlist context, so we set the active playlist
8359        to null
8360      */
8361      _audioNavigation2.default.setActivePlaylist(null);
8362
8363      /*
8364        We then change the song to the index selected.
8365      */
8366      _audioNavigation2.default.changeSong(_config2.default.songs[song], song);
8367    }
8368
8369    /*
8370      Check to see if the song has changed. If it has,
8371      set the active song. If it was in a playlist, the
8372      song wouldn't change here, since we already set the
8373      song when we checked for a playlist.
8374    */
8375    if (_checks2.default.newSong(null, song)) {
8376      /*
8377        The song selected is different, so we change the
8378        song.
8379      */
8380      _audioNavigation2.default.changeSong(_config2.default.songs[song], song);
8381    }
8382
8383    /*
8384      Plays the song
8385    */
8386    _core2.default.play();
8387
8388    /*
8389      Syncs the play pause elements since they are dependent upon this state
8390      of the player.
8391    */
8392    _playPauseElements2.default.sync();
8393  }
8394
8395  /**
8396   * Handles the song in playlist play.
8397   *
8398   * @access private
8399   * @param {string} playlist The playlist the play button belongs to.
8400   * @param {integer} song The song the play button belongs to.
8401   */
8402  function handleSongInPlaylistPlay(playlist, song) {
8403    /*
8404    There can be multiple playlists on the page and there can be
8405    multiple songs on the page AND there can be songs in multiple
8406    playlists, so we have some checking to do.
8407    */
8408
8409    /*
8410    Check to see if the playlist has changed. Essentially, if we are moving
8411      out of a playlist context.
8412    */
8413    if (_checks2.default.newPlaylist(playlist)) {
8414      /*
8415        We've moved out of the playlist context, so we set the active playlist
8416        to null
8417      */
8418      _audioNavigation2.default.setActivePlaylist(playlist);
8419
8420      /*
8421      We then change the song to the index selected.
8422      */
8423      _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[song], song);
8424    }
8425
8426    /*
8427    Check to see if the song has changed. If it has,
8428    set the active song. If it was in a playlist, the
8429    song wouldn't change here, since we already set the
8430    song when we checked for a playlist.
8431    */
8432    if (_checks2.default.newSong(playlist, song)) {
8433      /*
8434      The song selected is different, so we change the
8435      song.
8436      */
8437      _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[song], song);
8438    }
8439
8440    /*
8441      Plays the song
8442    */
8443    _core2.default.play();
8444
8445    /*
8446      Now we sync all the elements to match the state of the audio.
8447      We don't need to do any checks on new songs or changed playlists
8448      in the global since it's whatever song is playing.
8449    */
8450    _playPauseElements2.default.sync();
8451  }
8452
8453  /*
8454    Returns the public facing elements
8455  */
8456  return {
8457    handle: handle
8458  };
8459}();
8460
8461/**
8462 * Imports the AmplitudeJS Play Pause Elements
8463 * @module visual/PlayPauseElements
8464 */
8465
8466
8467/**
8468 * Imports the AmplitudeJS Checks Utility
8469 * @module utilities/Checks
8470 */
8471
8472
8473/**
8474 * Imports the config state utility.
8475 * @module utilities/ConfigState
8476 */
8477exports.default = Play;
8478module.exports = exports["default"];
8479
8480/***/ }),
8481/* 32 */
8482/***/ (function(module, exports, __webpack_require__) {
8483
8484"use strict";
8485
8486
8487Object.defineProperty(exports, "__esModule", {
8488  value: true
8489});
8490
8491var _config = __webpack_require__(0);
8492
8493var _config2 = _interopRequireDefault(_config);
8494
8495var _configState = __webpack_require__(6);
8496
8497var _configState2 = _interopRequireDefault(_configState);
8498
8499var _core = __webpack_require__(1);
8500
8501var _core2 = _interopRequireDefault(_core);
8502
8503var _checks = __webpack_require__(5);
8504
8505var _checks2 = _interopRequireDefault(_checks);
8506
8507var _audioNavigation = __webpack_require__(3);
8508
8509var _audioNavigation2 = _interopRequireDefault(_audioNavigation);
8510
8511var _playPauseElements = __webpack_require__(2);
8512
8513var _playPauseElements2 = _interopRequireDefault(_playPauseElements);
8514
8515function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8516
8517/**
8518 * Handles all of the play pause events
8519 * @module events/PlayPause
8520 */
8521
8522
8523/**
8524 * Imports the AmplitudeJS Audio Navigation Utility
8525 * @module utilities/AudioNavigation
8526 */
8527
8528
8529/**
8530 * Imports the AmplitudeJS Core Methods
8531 * @module core/Core
8532 */
8533/**
8534 * Imports the config module
8535 * @module config
8536 */
8537var PlayPause = function () {
8538  /**
8539   * Handles an event on a play/pause button
8540   *
8541   * HANDLER FOR:       class="amplitude-play-pause"
8542   *
8543   * GLOBAL:            class="amplitude-play-pause"
8544   * PLAYLIST:          class="amplitude-play-pause" amplitude-playlist="playlist_key"
8545   * SONG:              class="amplitude-play-pause" amplitude-song-index="song_index"
8546   * SONG IN PLAYLIST:  class="amplitude-play-pause" amplitude-playlist="playlist-key" amplitude-song-index="playlist_index"
8547   *
8548   * @access public
8549   */
8550  function handle() {
8551    /*
8552      If the touch is moving, we do not want to accidentally touch the play
8553      pause element and fire an event.
8554    */
8555    if (!_config2.default.is_touch_moving) {
8556      /*
8557        Get the playlist and song from the element. It's alright if these
8558        are null.
8559      */
8560      var playlist = this.getAttribute("data-amplitude-playlist");
8561      var song = this.getAttribute("data-amplitude-song-index");
8562
8563      /*
8564        Handle a global play pause button
8565      */
8566      if (playlist == null && song == null) {
8567        handleGlobalPlayPause();
8568      }
8569
8570      /*
8571        Handle a playlist play pause button
8572      */
8573      if (playlist != null && song == null) {
8574        handlePlaylistPlayPause(playlist);
8575      }
8576
8577      /*
8578        Handle a song play pause button
8579      */
8580      if (playlist == null && song != null) {
8581        handleSongPlayPause(song);
8582      }
8583
8584      /*
8585        Handle a song in playlist play pause button
8586      */
8587      if (playlist != null && song != null) {
8588        handleSongInPlaylistPlayPause(playlist, song);
8589      }
8590
8591      _configState2.default.setPlayerState();
8592    }
8593  }
8594
8595  /**
8596   * Sets the main play pause buttons to the current state of the song.
8597   * @access private
8598   */
8599  function handleGlobalPlayPause() {
8600    /*
8601      If the song is paused, we play the song. If the song is playing,
8602      we pause the song.
8603    */
8604    if (_config2.default.audio.paused) {
8605      _core2.default.play();
8606    } else {
8607      _core2.default.pause();
8608    }
8609
8610    /*
8611      Now we sync all the elements to match the state of the audio.
8612      We don't need to do any checks on new songs or changed playlists
8613      in the global since it's whatever song is playing.
8614    */
8615    _playPauseElements2.default.sync();
8616  }
8617
8618  /**
8619   * Sets the playlist main play pause buttons to the current state of the song.
8620   * @access private
8621   * @param {string} playlist The playlist the main play pause button controls
8622   */
8623  function handlePlaylistPlayPause(playlist) {
8624    /*
8625      The only thing that can change when you click a playlist
8626      play pause is the playlist. Main play pauses have no change
8627      in song, song play pauses can change playlist and song.
8628    */
8629    if (_checks2.default.newPlaylist(playlist)) {
8630      /*
8631        If there's a new playlist, then we set the new playlist.
8632      */
8633      _audioNavigation2.default.setActivePlaylist(playlist);
8634
8635      /*
8636        Play first song in the playlist since we just
8637        switched playlists, we start from the first song.
8638         If the user has shuffle on for the playlist, then
8639        we go from the first song in the shuffle playlist array.
8640      */
8641      if (_config2.default.playlists[playlist].shuffle) {
8642        _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].shuffle_list[0], 0);
8643      } else {
8644        _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[0], 0);
8645      }
8646    }
8647
8648    /*
8649      If the song is paused, we play the song. If the song is playing,
8650      we pause the song.
8651    */
8652    if (_config2.default.audio.paused) {
8653      _core2.default.play();
8654    } else {
8655      _core2.default.pause();
8656    }
8657
8658    /*
8659      Now we sync all the elements to match the state of the audio.
8660      We don't need to do any checks on new songs or changed playlists
8661      in the global since it's whatever song is playing.
8662    */
8663    _playPauseElements2.default.sync();
8664  }
8665
8666  /**
8667   * Sets the playlist main play pause buttons to the current state of the song.
8668   * @access private
8669   * @param {string} song The index of the song being played/paused
8670   */
8671  function handleSongPlayPause(song) {
8672    /*
8673    There can be multiple playlists on the page and there can be
8674    multiple songs on the page AND there can be songs in multiple
8675    playlists, so we have some checking to do.
8676    */
8677
8678    /*
8679    Check to see if the playlist has changed. Essentially, if we are moving
8680      out of a playlist context.
8681    */
8682    if (_checks2.default.newPlaylist(null)) {
8683      /*
8684        We've moved out of the playlist context, so we set the active playlist
8685        to null
8686      */
8687      _audioNavigation2.default.setActivePlaylist(null);
8688
8689      /*
8690      We then change the song to the index selected.
8691      */
8692      _audioNavigation2.default.changeSong(_config2.default.songs[song], song);
8693    }
8694
8695    /*
8696    Check to see if the song has changed. If it has,
8697    set the active song. If it was in a playlist, the
8698    song wouldn't change here, since we already set the
8699    song when we checked for a playlist.
8700    */
8701    if (_checks2.default.newSong(null, song)) {
8702      /*
8703      The song selected is different, so we change the
8704      song.
8705      */
8706      _audioNavigation2.default.changeSong(_config2.default.songs[song], song);
8707    }
8708
8709    /*
8710      If the song is paused, we play the song. If the song is playing,
8711      we pause the song.
8712    */
8713    if (_config2.default.audio.paused) {
8714      _core2.default.play();
8715    } else {
8716      _core2.default.pause();
8717    }
8718
8719    /*
8720      Now we sync all the elements to match the state of the audio.
8721      We don't need to do any checks on new songs or changed playlists
8722      in the global since it's whatever song is playing.
8723    */
8724    _playPauseElements2.default.sync();
8725  }
8726
8727  /**
8728   * Sets the song in playlist play pause buttons to the current
8729   * state of the song.
8730   * @access private
8731   * @param {string} playlist The playlist the song is a part of
8732   * @param {number} song The index of the song being played/paused
8733   */
8734  function handleSongInPlaylistPlayPause(playlist, song) {
8735    /*
8736    There can be multiple playlists on the page and there can be
8737    multiple songs on the page AND there can be songs in multiple
8738    playlists, so we have some checking to do.
8739    */
8740
8741    /*
8742    Check to see if the playlist has changed. Essentially, if we are moving
8743      out of a playlist context.
8744    */
8745    if (_checks2.default.newPlaylist(playlist)) {
8746      /*
8747        We've moved out of the playlist context, so we set the active playlist
8748        to null
8749      */
8750      _audioNavigation2.default.setActivePlaylist(playlist);
8751
8752      /*
8753      We then change the song to the index selected.
8754      */
8755      _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[song], song);
8756    }
8757
8758    /*
8759    Check to see if the song has changed. If it has,
8760    set the active song. If it was in a playlist, the
8761    song wouldn't change here, since we already set the
8762    song when we checked for a playlist.
8763    */
8764    if (_checks2.default.newSong(playlist, song)) {
8765      /*
8766      The song selected is different, so we change the
8767      song.
8768      */
8769      _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[song], song);
8770    }
8771
8772    /*
8773      If the song is paused, we play the song. If the song is playing,
8774      we pause the song.
8775    */
8776    if (_config2.default.audio.paused) {
8777      _core2.default.play();
8778    } else {
8779      _core2.default.pause();
8780    }
8781
8782    /*
8783      Now we sync all the elements to match the state of the audio.
8784      We don't need to do any checks on new songs or changed playlists
8785      in the global since it's whatever song is playing.
8786    */
8787    _playPauseElements2.default.sync();
8788  }
8789
8790  /**
8791   * Returns the public facing methods
8792   */
8793  return {
8794    handle: handle
8795  };
8796}();
8797
8798/**
8799 * Imports the AmplitudeJS Play Pause Elements
8800 * @module visual/PlayPauseElements
8801 */
8802
8803
8804/**
8805 * Imports the AmplitudeJS Checks Utility
8806 * @module utilities/Checks
8807 */
8808
8809
8810/**
8811 * Import the config state utility.
8812 * @module utilities/configState
8813 */
8814exports.default = PlayPause;
8815module.exports = exports["default"];
8816
8817/***/ }),
8818/* 33 */
8819/***/ (function(module, exports, __webpack_require__) {
8820
8821"use strict";
8822
8823
8824Object.defineProperty(exports, "__esModule", {
8825  value: true
8826});
8827
8828var _config = __webpack_require__(0);
8829
8830var _config2 = _interopRequireDefault(_config);
8831
8832var _core = __webpack_require__(1);
8833
8834var _core2 = _interopRequireDefault(_core);
8835
8836var _playbackSpeedElements = __webpack_require__(18);
8837
8838var _playbackSpeedElements2 = _interopRequireDefault(_playbackSpeedElements);
8839
8840function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8841
8842/**
8843 * AmplitudeJS Playback Speed Event Handler
8844 *
8845 * @module events/PlaybackSpeed
8846 */
8847
8848
8849/**
8850 * Imports the Amplitude Core module
8851 * @module core/Core
8852 */
8853var PlaybackSpeed = function () {
8854  /**
8855   * Handles an event on the playback speed button
8856   *
8857   * HANDLER FOR:       class="amplitude-playback-speed"
8858   *
8859   * @access public
8860   */
8861  function handle() {
8862    if (!_config2.default.is_touch_moving) {
8863      /*
8864      We increment the speed by .5 everytime we click
8865      the button to change the playback speed. Once we are
8866      actively playing back at 2, we start back at 1 which
8867      is normal speed.
8868      */
8869      switch (_config2.default.playback_speed) {
8870        case 1:
8871          _core2.default.setPlaybackSpeed(1.5);
8872          break;
8873        case 1.5:
8874          _core2.default.setPlaybackSpeed(2);
8875          break;
8876        case 2:
8877          _core2.default.setPlaybackSpeed(1);
8878          break;
8879      }
8880
8881      /*
8882      Visually sync the playback speed.
8883      */
8884      _playbackSpeedElements2.default.sync();
8885    }
8886  }
8887
8888  /*
8889    Returns public facing methods
8890  */
8891  return {
8892    handle: handle
8893  };
8894}();
8895
8896/**
8897 * Imports the Playback Speed Visual Elements
8898 * @module visual/PlaybackSpeedElements
8899 */
8900/**
8901 * Imports the config module
8902 * @module config
8903 */
8904exports.default = PlaybackSpeed;
8905module.exports = exports["default"];
8906
8907/***/ }),
8908/* 34 */
8909/***/ (function(module, exports, __webpack_require__) {
8910
8911"use strict";
8912
8913
8914Object.defineProperty(exports, "__esModule", {
8915  value: true
8916});
8917
8918var _config = __webpack_require__(0);
8919
8920var _config2 = _interopRequireDefault(_config);
8921
8922var _audioNavigation = __webpack_require__(3);
8923
8924var _audioNavigation2 = _interopRequireDefault(_audioNavigation);
8925
8926var _debug = __webpack_require__(4);
8927
8928var _debug2 = _interopRequireDefault(_debug);
8929
8930function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8931
8932/**
8933 * AmplitudeJS Prev Event Handler
8934 *
8935 * @module events/Prev
8936 */
8937
8938
8939/**
8940 * Imports the Amplitude Audio Navigation Utility
8941 * @module utilities/AudioNavigation
8942 */
8943var Prev = function () {
8944  /**
8945   * Handles an event on the previous button
8946   *
8947   * HANDLER FOR:       class="amplitude-prev"
8948   *
8949   * GLOBAL:            class="amplitude-prev"
8950   * PLAYLIST:          class="amplitude-prev" amplitude-playlist="playlist_key"
8951   *
8952   * @access public
8953   */
8954  function handle() {
8955    /*
8956      We don't fire this if the user is touching the screen and it's moving.
8957      This could lead to a mis-fire
8958    */
8959    if (!_config2.default.is_touch_moving) {
8960      /*
8961        Gets the playlist attribute from the element.
8962      */
8963      var playlist = this.getAttribute("data-amplitude-playlist");
8964
8965      /*
8966        If the playlist is null, we handle the global prev.
8967      */
8968      if (playlist == null) {
8969        handleGlobalPrev();
8970      }
8971
8972      /*
8973        If the playlist is set, we handle the playlist prev.
8974      */
8975      if (playlist != null) {
8976        handlePlaylistPrev(playlist);
8977      }
8978    }
8979  }
8980
8981  /**
8982   * Handles an event on a global previous button.
8983   *
8984   * @access private
8985   */
8986  function handleGlobalPrev() {
8987    /*
8988      Check to see if the current state of the player
8989      is in playlist mode or not playlist mode. If we are in playlist mode,
8990      we set prev on the playlist.
8991    */
8992    if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) {
8993      _audioNavigation2.default.setPrevious();
8994    } else {
8995      _audioNavigation2.default.setPreviousPlaylist(_config2.default.active_playlist);
8996    }
8997  }
8998
8999  /**
9000   * Handles an event on a previous playlist button.
9001   *
9002   * @access private
9003   * @prop {string} playlist  - The playlist we are handling the previous for.
9004   */
9005  function handlePlaylistPrev(playlist) {
9006    /*
9007      Ensure the playlist is the same as the active playlist. To get to change
9008      the scope to a new playlist, you need to play that playlist.
9009    */
9010    if (playlist == _config2.default.active_playlist) {
9011      _audioNavigation2.default.setPreviousPlaylist(_config2.default.active_playlist);
9012    } else {
9013      _debug2.default.writeMessage("You can not go to the previous song on a playlist that is not being played!");
9014    }
9015  }
9016
9017  /*
9018    Returns the public facing methods.
9019  */
9020  return {
9021    handle: handle
9022  };
9023}();
9024
9025/**
9026 * AmplitudeJS Debug Module
9027 * @module utilities/Debug
9028 */
9029/**
9030 * Imports the config module
9031 * @module config
9032 */
9033exports.default = Prev;
9034module.exports = exports["default"];
9035
9036/***/ }),
9037/* 35 */
9038/***/ (function(module, exports, __webpack_require__) {
9039
9040"use strict";
9041
9042
9043Object.defineProperty(exports, "__esModule", {
9044  value: true
9045});
9046
9047var _config = __webpack_require__(0);
9048
9049var _config2 = _interopRequireDefault(_config);
9050
9051var _bufferedProgressElements = __webpack_require__(24);
9052
9053var _bufferedProgressElements2 = _interopRequireDefault(_bufferedProgressElements);
9054
9055function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9056
9057/**
9058 * AmplitudeJS Event Handler for progress
9059 *
9060 * @module events/Progress
9061 */
9062/**
9063 * Imports the config module
9064 * @module config
9065 */
9066var Progress = function () {
9067  /**
9068   * As the song is buffered, we can display the buffered percentage in
9069   * a progress bar.
9070   *
9071   * HANDLER FOR: progress
9072   *
9073   * @access public
9074   */
9075  function handle() {
9076    /*
9077      Help from: http://jsbin.com/badimipi/1/edit?html,js,output
9078    */
9079    if (_config2.default.audio.buffered.length - 1 >= 0) {
9080      var bufferedEnd = _config2.default.audio.buffered.end(_config2.default.audio.buffered.length - 1);
9081      var duration = _config2.default.audio.duration;
9082
9083      /*
9084        Set the computed song buffered value to the config.
9085      */
9086      _config2.default.buffered = bufferedEnd / duration * 100;
9087    }
9088
9089    /*
9090      Sync the buffered progress bars.
9091    */
9092    _bufferedProgressElements2.default.sync();
9093  }
9094
9095  /**
9096   * Returns the public facing methods
9097   */
9098  return {
9099    handle: handle
9100  };
9101}();
9102
9103/**
9104 * Imports the BufferedProgressElements visual handler
9105 * @module visual/bufferedProgressElements.js
9106 */
9107exports.default = Progress;
9108module.exports = exports["default"];
9109
9110/***/ }),
9111/* 36 */
9112/***/ (function(module, exports, __webpack_require__) {
9113
9114"use strict";
9115
9116
9117Object.defineProperty(exports, "__esModule", {
9118  value: true
9119});
9120
9121var _config = __webpack_require__(0);
9122
9123var _config2 = _interopRequireDefault(_config);
9124
9125var _repeater = __webpack_require__(12);
9126
9127var _repeater2 = _interopRequireDefault(_repeater);
9128
9129var _repeatElements = __webpack_require__(9);
9130
9131var _repeatElements2 = _interopRequireDefault(_repeatElements);
9132
9133function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9134
9135/**
9136 * AmplitudeJS Repeat Event Handler
9137 *
9138 * @module events/Repeat
9139 */
9140
9141
9142/**
9143 * Imports the repeater utility module.
9144 * @module utilities/Repeater
9145 */
9146var Repeat = function () {
9147  /**
9148   * Handles an event on the repeat button
9149   *
9150   * HANDLER FOR:       class="amplitude-repeat"
9151   *
9152   * GLOBAL:            class="amplitude-repeat"
9153   * PLAYLIST:          class="amplitude-repeat" amplitude-playlist="playlist_key"
9154   *
9155   * @access public
9156   */
9157  function handle() {
9158    /*
9159      We don't fire this if the user is touching the screen and it's moving.
9160      This could lead to a mis-fire
9161    */
9162    if (!_config2.default.is_touch_moving) {
9163      /*
9164        Gets the playlist attribute from the element.
9165      */
9166      var playlist = this.getAttribute("data-amplitude-playlist");
9167
9168      /*
9169        If the playlist is null, we handle the global repeat.
9170      */
9171      if (playlist == null) {
9172        handleGlobalRepeat();
9173      }
9174
9175      /*
9176        If the playlist is set, we handle the playlist repeat.
9177      */
9178      if (playlist != null) {
9179        handlePlaylistRepeat(playlist);
9180      }
9181    }
9182  }
9183
9184  /**
9185   * Handles an event on a global repeat button.
9186   *
9187   * @access private
9188   */
9189  function handleGlobalRepeat() {
9190    /*
9191      Sets repeat to the opposite of what it was set to
9192    */
9193    _repeater2.default.setRepeat(!_config2.default.repeat);
9194
9195    /*
9196      Visually sync repeat
9197    */
9198    _repeatElements2.default.syncRepeat();
9199  }
9200
9201  /**
9202   * Handles an event on a playlist repeat button.
9203   *
9204   * @access private
9205   * @prop {string} playlist - The playlist we are handling the repeat store.
9206   */
9207  function handlePlaylistRepeat(playlist) {
9208    /*
9209      Sets repeat to the opposite of what it was set to for the playlist.
9210    */
9211    _repeater2.default.setRepeatPlaylist(!_config2.default.playlists[playlist].repeat, playlist);
9212
9213    /*
9214      Visually sync playlist repeat
9215    */
9216    _repeatElements2.default.syncRepeatPlaylist(playlist);
9217  }
9218
9219  /*
9220    Returns the public facing methods.
9221  */
9222  return {
9223    handle: handle
9224  };
9225}();
9226
9227/**
9228 * Imports the visual repeat elements module
9229 * @module visual/RepeatElements
9230 */
9231/**
9232 * Imports the config module
9233 * @module config
9234 */
9235exports.default = Repeat;
9236module.exports = exports["default"];
9237
9238/***/ }),
9239/* 37 */
9240/***/ (function(module, exports, __webpack_require__) {
9241
9242"use strict";
9243
9244
9245Object.defineProperty(exports, "__esModule", {
9246  value: true
9247});
9248
9249var _config = __webpack_require__(0);
9250
9251var _config2 = _interopRequireDefault(_config);
9252
9253var _repeater = __webpack_require__(12);
9254
9255var _repeater2 = _interopRequireDefault(_repeater);
9256
9257var _repeatElements = __webpack_require__(9
vendor: 17,156 bytes, lines 9257-9929
9257);
9258
9259var _repeatElements2 = _interopRequireDefault(_repeatElements);
9260
9261function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9262
9263/**
9264 * Handles an event on the Amplitude Repeat Song.
9265 *
9266 * @module events/RepeatSong
9267 */
9268
9269
9270/**
9271 * Imports the repeat utility
9272 * @module utilities/Repeater
9273 */
9274var RepeatSong = function () {
9275  /**
9276   * Handles an event on the repeat song button
9277   *
9278   * HANDLER FOR: 'amplitude-repeat-song'
9279   *
9280   * @access public
9281   */
9282  function handle() {
9283    /*
9284      If the touch is moving, we do not want to accidentally touch the play
9285      pause element and fire an event.
9286    */
9287    if (!_config2.default.is_touch_moving) {
9288      /*
9289      Sets repeat song to the opposite of what it was set to
9290      */
9291      _repeater2.default.setRepeatSong(!_config2.default.repeat_song);
9292
9293      /*
9294      Visually sync repeat song
9295      */
9296      _repeatElements2.default.syncRepeatSong();
9297    }
9298  }
9299
9300  /**
9301   * Returns the public facing methods
9302   */
9303  return {
9304    handle: handle
9305  };
9306}();
9307
9308/**
9309 * Imports the AmplitudeJS Repeat Element
9310 * @module visual/RepeatElements
9311 */
9312/**
9313 * Imports the config module
9314 * @module config
9315 */
9316exports.default = RepeatSong;
9317module.exports = exports["default"];
9318
9319/***/ }),
9320/* 38 */
9321/***/ (function(module, exports, __webpack_require__) {
9322
9323"use strict";
9324
9325
9326Object.defineProperty(exports, "__esModule", {
9327  value: true
9328});
9329
9330var _config = __webpack_require__(0);
9331
9332var _config2 = _interopRequireDefault(_config);
9333
9334var _shuffler = __webpack_require__(13);
9335
9336var _shuffler2 = _interopRequireDefault(_shuffler);
9337
9338var _shuffleElements = __webpack_require__(19);
9339
9340var _shuffleElements2 = _interopRequireDefault(_shuffleElements);
9341
9342function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9343
9344/**
9345 * Handles all of the shuffle events
9346 * @module events/Shuffle
9347 */
9348
9349
9350/**
9351 * Imports the shuffler utility
9352 * @module utilities/Shuffler
9353 */
9354var Shuffle = function () {
9355  /**
9356   * Handles an event on the shuffle button
9357   *
9358   * HANDLER FOR:       class="amplitude-shuffle"
9359   *
9360   * GLOBAL:            class="amplitude-shuffle"
9361   * PLAYLIST:          class="amplitude-shuffle" amplitude-playlist="playlist_key"
9362   *
9363   * @access public
9364   */
9365  function handle() {
9366    /*
9367      If the touch is moving, we do not want to accidentally touch the play
9368      pause element and fire an event.
9369    */
9370    if (!_config2.default.is_touch_moving) {
9371      /*
9372        Get the playlist attribute
9373      */
9374      var playlist = this.getAttribute("data-amplitude-playlist");
9375
9376      /*
9377      Check to see if the shuffle button belongs to a playlist
9378      */
9379      if (playlist == null) {
9380        handleGlobalShuffle();
9381      } else {
9382        handlePlaylistShuffle(playlist);
9383      }
9384    }
9385  }
9386
9387  /**
9388   * Handles the event on the global shuffle button.
9389   */
9390  function handleGlobalShuffle() {
9391    /*
9392      Either shuffles or removes shuffle on the global state.
9393    */
9394    _shuffler2.default.toggleShuffle();
9395
9396    /*
9397      Visualize the shuffle state change.
9398    */
9399    _shuffleElements2.default.syncMain(_config2.default.shuffle_on);
9400  }
9401
9402  /**
9403   * Handles the event on the playlist shuffle button.
9404   *
9405   * @param {string} playlist - The playlist string the shuffle button belongs to.
9406   */
9407  function handlePlaylistShuffle(playlist) {
9408    /*
9409      Either shuffles or removes shuffle on the playlist state.
9410    */
9411    _shuffler2.default.toggleShufflePlaylist(playlist);
9412
9413    /*
9414      Visually sync the playlist shuffle statuses.
9415    */
9416    _shuffleElements2.default.syncPlaylist(playlist);
9417  }
9418
9419  /**
9420   * Returns public facing methods
9421   */
9422  return {
9423    handle: handle
9424  };
9425}();
9426
9427/**
9428 * Imports the visual shuffle elements
9429 * @module visual/ShuffleElements
9430 */
9431/**
9432 * Imports the config module
9433 * @module config
9434 */
9435exports.default = Shuffle;
9436module.exports = exports["default"];
9437
9438/***/ }),
9439/* 39 */
9440/***/ (function(module, exports, __webpack_require__) {
9441
9442"use strict";
9443
9444
9445Object.defineProperty(exports, "__esModule", {
9446  value: true
9447});
9448
9449var _config = __webpack_require__(0);
9450
9451var _config2 = _interopRequireDefault(_config);
9452
9453var _debug = __webpack_require__(4);
9454
9455var _debug2 = _interopRequireDefault(_debug);
9456
9457var _audioNavigation = __webpack_require__(3);
9458
9459var _audioNavigation2 = _interopRequireDefault(_audioNavigation);
9460
9461var _checks = __webpack_require__(5);
9462
9463var _checks2 = _interopRequireDefault(_checks);
9464
9465var _core = __webpack_require__(1);
9466
9467var _core2 = _interopRequireDefault(_core);
9468
9469var _playPauseElements = __webpack_require__(2);
9470
9471var _playPauseElements2 = _interopRequireDefault(_playPauseElements);
9472
9473function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9474
9475/**
9476 * Handles the skip to event.
9477 *
9478 * @module events/SkipTo
9479 */
9480
9481
9482/**
9483 * Imports the AmplitudeJS Core Methods
9484 * @module core/Core
9485 */
9486
9487
9488/**
9489 * Imports the AmplitudeJS Audio Navigation Utility
9490 * @module utilities/AudioNavigation
9491 */
9492/**
9493 * Imports the config module
9494 * @module config
9495 */
9496var SkipTo = function () {
9497  /**
9498   * Handles an event on a skip to button.
9499   *
9500   * HANDLER FOR:       class="amplitude-skip-to"
9501   *
9502   * GLOBAL:            class="amplitude-skip-to" amplitude-song-index="song_index" amplitude-location="seconds"
9503   * PLAYLIST:          class="amplitude-skip-to" amplitude-playlist="playlist_key" amplitude-song-index="song_index" amplitude-location="seconds"
9504   *
9505   * @access public
9506   */
9507  function handle() {
9508    /*
9509      If the touch is moving, we do not want to accidentally touch the play
9510      pause element and fire an event.
9511    */
9512    if (!_config2.default.is_touch_moving) {
9513      /*
9514        Extracts the needed attributes from the element.
9515      */
9516      var playlist = this.getAttribute("data-amplitude-playlist");
9517      var songIndex = this.getAttribute("data-amplitude-song-index");
9518      var location = this.getAttribute("data-amplitude-location");
9519
9520      /*
9521        If the location is null, write a message. We can't skip to a location
9522        that is null
9523      */
9524      if (location == null) {
9525        _debug2.default.writeMessage("You must add an 'data-amplitude-location' attribute in seconds to your 'amplitude-skip-to' element.");
9526      }
9527
9528      /*
9529        If the song index is null, write a debug message. We can't skip to a location
9530        of a null song.
9531      */
9532      if (songIndex == null) {
9533        _debug2.default.writeMessage("You must add an 'data-amplitude-song-index' attribute to your 'amplitude-skip-to' element.");
9534      }
9535
9536      /*
9537        If the location and song index are set, continue.
9538      */
9539      if (location != null && songIndex != null) {
9540        /*
9541        Determines if the skip to button is in the scope of a playlist.
9542        */
9543        if (playlist == null) {
9544          handleSkipToSong(parseInt(songIndex), parseInt(location));
9545        } else {
9546          handleSkipToPlaylist(playlist, parseInt(songIndex), parseInt(location));
9547        }
9548      }
9549    }
9550  }
9551
9552  /**
9553   * Handles the skipping to a specific song
9554   *
9555   * @access private
9556   * @param {string} songIndex  - The index of the song being skipped to
9557   * @param {number} location   - The seconds location of the song in the playlist.
9558   */
9559  function handleSkipToSong(songIndex, location) {
9560    /*
9561      Changes the song to where it's being skipped and then
9562      play the song.
9563    */
9564    _audioNavigation2.default.changeSong(_config2.default.songs[songIndex], songIndex);
9565    _core2.default.play();
9566
9567    /*
9568      Syncs all of the play pause buttons now that we've skipped.
9569    */
9570    _playPauseElements2.default.syncGlobal();
9571    _playPauseElements2.default.syncSong();
9572
9573    /*
9574      Skip to the location in the song.
9575    */
9576    _core2.default.skipToLocation(location);
9577  }
9578
9579  /**
9580   * Handles the skipping to a song that's in a playlist.
9581   *
9582   * @access private
9583   * @param {string} playlist   - The playlist being skipped to
9584   * @param {string} songIndex  - The index of the song in the playlist
9585   * @param {number} location   - The seconds location of the song in the playlist.
9586   */
9587  function handleSkipToPlaylist(playlist, songIndex, location) {
9588    /*
9589      Checks if we are skipping to a new playlist
9590    */
9591    if (_checks2.default.newPlaylist(playlist)) {
9592      _audioNavigation2.default.setActivePlaylist(playlist);
9593    }
9594
9595    /*
9596      Changes the song to where it's being skipped and then
9597      play the song.
9598    */
9599    _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[songIndex], songIndex);
9600    _core2.default.play();
9601
9602    /*
9603      Sync all of the play pause elements.
9604    */
9605    _playPauseElements2.default.syncGlobal();
9606    _playPauseElements2.default.syncPlaylist();
9607    _playPauseElements2.default.syncSong();
9608
9609    /*
9610      Skip to the location in the song.
9611    */
9612    _core2.default.skipToLocation(location);
9613  }
9614
9615  /**
9616   * Return public facing methods
9617   */
9618  return {
9619    handle: handle
9620  };
9621}();
9622
9623/**
9624 * Imports the AmplitudeJS play pause elements.
9625 * @module visual/PlayPauseElements
9626 */
9627
9628
9629/**
9630 * Imports the AmplitudeJS Checks Utility
9631 * @module utilities/Checks
9632 */
9633
9634
9635/**
9636 * Imports AmplitudeJS Debug Utility
9637 * @module utilities/debug
9638 */
9639exports.default = SkipTo;
9640module.exports = exports["default"];
9641
9642/***/ }),
9643/* 40 */
9644/***/ (function(module, exports, __webpack_require__) {
9645
9646"use strict";
9647
9648
9649Object.defineProperty(exports, "__esModule", {
9650  value: true
9651});
9652
9653var _config = __webpack_require__(0);
9654
9655var _config2 = _interopRequireDefault(_config);
9656
9657var _time = __webpack_require__(23);
9658
9659var _time2 = _interopRequireDefault(_time);
9660
9661var _songSliderElements = __webpack_require__(14);
9662
9663var _songSliderElements2 = _interopRequireDefault(_songSliderElements);
9664
9665function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9666
9667/**
9668 * Handles the song slider to event.
9669 *
9670 * @module events/SongSlider
9671 */
9672
9673
9674/**
9675 * Imports the time utility
9676 * @module utilities/Time
9677 */
9678var SongSlider = function () {
9679  /**
9680   * Handles a song slider element.
9681   *
9682   * HANDLER FOR:       class="amplitude-song-slider"
9683   *
9684   * GLOBAL:            class="amplitude-song-slider"
9685   * PLAYLIST:          class="amplitude-song-slider" amplitude-playlist="playlist_key"
9686   * SONG:              class="amplitude-song-slider" amplitude-song-index="song_index"
9687   * SONG IN PLAYLIST:  class="amplitude-song-slider" amplitude-playlist="playlist_key" amplitude-song-index="song_index"
9688   *
9689   * @access public
9690   */
9691  function handle() {
9692    /*
9693    Gets the percentage of the song we will be setting the location for.
9694    */
9695    var locationPercentage = this.value;
9696
9697    /*
9698      Computes the time in seconds for the current song.
9699    */
9700    var computedTime = _config2.default.audio.duration * (locationPercentage / 100);
9701
9702    /*
9703      Gets the attributes for playlist and index for the element.
9704    */
9705    var playlist = this.getAttribute("data-amplitude-playlist");
9706    var song = this.getAttribute("data-amplitude-song-index");
9707
9708    /*
9709      If no playlist or song is defined, then it's a global song slider.
9710    */
9711    if (playlist == null && song == null) {
9712      handleGlobalSongSlider(computedTime, locationPercentage);
9713    }
9714
9715    /*
9716      If a playlist but no song is defined, then it's playlist slider.
9717    */
9718    if (playlist != null && song == null) {
9719      handlePlaylistSongSlider(computedTime, locationPercentage, playlist);
9720    }
9721
9722    /*
9723      If no playlist but a song is defined, then it's a song slider.
9724    */
9725    if (playlist == null && song != null) {
9726      handleSongSongSlider(computedTime, locationPercentage, song);
9727    }
9728
9729    /*
9730      If playlist and song are defined then it's a song in a playlist
9731      slider.
9732    */
9733    if (playlist != null && song != null) {
9734      handleSongInPlaylistSongSlider(computedTime, locationPercentage, playlist, song);
9735    }
9736  }
9737
9738  /**
9739   * Handles a change on a global audio slider
9740   *
9741   * @access private
9742   * @param {integer} computedTime  - The time we will set the audio to.
9743   * @param {float}   locationPercentage - The percent through the song.
9744   */
9745  function handleGlobalSongSlider(computedTime, locationPercentage) {
9746    /*
9747    If the active song is not live, set the current time and adjust the slider.
9748    */
9749    if (!_config2.default.active_metadata.live) {
9750      _time2.default.setCurrentTime(computedTime);
9751
9752      /*
9753        Sync song slider elements.
9754      */
9755      _songSliderElements2.default.sync(locationPercentage, _config2.default.active_playlist, _config2.default.active_index);
9756    }
9757  }
9758
9759  /**
9760   * Handles a change on a playlist audio slider
9761   *
9762   * @access private
9763   * @param {integer} computedTime  - The time we will set the audio to.
9764   * @param {float}   locationPercentage - The percent through the song.
9765   * @param {string}  playlist = The playlist the song slider belongs to.
9766   */
9767  function handlePlaylistSongSlider(computedTime, locationPercentage, playlist) {
9768    /*
9769    We don't want to song slide a playlist that's not the
9770    active placylist.
9771    */
9772    if (_config2.default.active_playlist == playlist) {
9773      /*
9774      If the active song is not live, set the current time
9775      */
9776      if (!_config2.default.active_metadata.live) {
9777        _time2.default.setCurrentTime(computedTime);
9778
9779        /*
9780          Sync song slider elements.
9781        */
9782        _songSliderElements2.default.sync(locationPercentage, playlist, _config2.default.active_index);
9783      }
9784    }
9785  }
9786
9787  /**
9788   * Handles a change on a song audio slider
9789   *
9790   * @access private
9791   * @param {integer} computedTime  - The time we will set the audio to.
9792   * @param {float}   locationPercentage - The percent through the song.
9793   * @param {integer} songIndex = The song being navigated.
9794   */
9795  function handleSongSongSlider(computedTime, locationPercentage, songIndex) {
9796    /*
9797      We only want to move the slider if the active song is the
9798      same as the song being selected.
9799    */
9800    if (_config2.default.active_index == songIndex && _config2.default.active_playlist == null) {
9801      /*
9802      If the active song is not live, set the current time
9803      */
9804      if (!_config2.default.active_metadata.live) {
9805        _time2.default.setCurrentTime(computedTime);
9806
9807        /*
9808          Sync song slider elements.
9809        */
9810        _songSliderElements2.default.sync(locationPercentage, _config2.default.active_playlist, songIndex);
9811      }
9812    }
9813  }
9814
9815  /**
9816   * Handles a change on a song audio slider
9817   *
9818   * @access private
9819   * @param {integer} computedTime  - The time we will set the audio to.
9820   * @param {float}   locationPercentage - The percent through the song.
9821   * @param {integer} playlist = The playlist the song belongs to.
9822   * @param {integer} songIndex = The song being navigated.
9823   */
9824  function handleSongInPlaylistSongSlider(computedTime, locationPercentage, playlist, songIndex) {
9825    /*
9826      We only want to move the slider if the active song is the
9827      same as the song being selected and the active playlist is the same
9828      as the playlist selected.
9829    */
9830    if (_config2.default.playlists[playlist].active_index == songIndex && _config2.default.active_playlist == playlist) {
9831      /*
9832      If the active song is not live, set the current time
9833      */
9834      if (!_config2.default.active_metadata.live) {
9835        _time2.default.setCurrentTime(computedTime);
9836
9837        /*
9838          Sync song slider elements.
9839        */
9840        _songSliderElements2.default.sync(locationPercentage, playlist, songIndex);
9841      }
9842    }
9843  }
9844
9845  /*
9846    Return public facing methods
9847  */
9848  return {
9849    handle: handle
9850  };
9851}();
9852
9853/**
9854 * Imports the song slider elements.
9855 * @module visual/SongSliderElements
9856 */
9857/**
9858 * Imports the config module
9859 * @module config
9860 */
9861exports.default = SongSlider;
9862module.exports = exports["default"];
9863
9864/***/ }),
9865/* 41 */
9866/***/ (function(module, exports, __webpack_require__) {
9867
9868"use strict";
9869
9870
9871Object.defineProperty(exports, "__esModule", {
9872  value: true
9873});
9874
9875var _config = __webpack_require__(0);
9876
9877var _config2 = _interopRequireDefault(_config);
9878
9879var _configState = __webpack_require__(6);
9880
9881var _configState2 = _interopRequireDefault(_configState);
9882
9883var _playPauseElements = __webpack_require__(2);
9884
9885var _playPauseElements2 = _interopRequireDefault(_playPauseElements);
9886
9887var _core = __webpack_require__(1);
9888
9889var _core2 = _interopRequireDefault(_core);
9890
9891function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9892
9893/**
9894 * Handles all of the stop events
9895 * @module events/Stop
9896 */
9897
9898
9899/**
9900 * Imports the AmplitudeJS Play Pause Elements
9901 * @module visual/PlayPauseElements
9902 */
9903/**
9904 * Imports the config module
9905 * @module config
9906 */
9907var Stop = function () {
9908  /**
9909   * Handles an event on a stop element.
9910   *
9911   * HANDLER FOR:       class="amplitude-stop"
9912   *
9913   * @access public
9914   */
9915  function handle() {
9916    /*
9917      If touch is not moving, we run. We don't want to accidentally press
9918      stop if touch is moving.
9919    */
9920    if (!_config2.default.is_touch_moving) {
9921      /*
9922      Sets all of the play/pause buttons to pause
9923      */
9924      _playPauseElements2.default.syncToPause();
9925
9926      /*
9927      Stops the active song.
9928      */
9929      _core2.default.stop();
9930
9931      /*
9932        Set the state of the player.
9933      */
9934      _configState2.default.setPlayerState();
9935    }
9936  }
9937
9938  /**
9939   * Returns public facing methods
9940   */
9941  return {
9942    handle: handle
9943  };
9944}();
9945
9946/**
9947 * Imports the AmplitudeJS Core Methods
9948 * @module core/Core
9949 */
9950
9951
9952/**
9953 * Imports the config state module.
9954 * @module utilities/configState
9955 */
9956exports.default = Stop;
9957module.exports = exports["default"];
9958
9959/***/ }),
9960/* 42 */
9961/***/ (function(module, exports, __webpack_require__) {
9962
9963"use strict";
9964
9965
9966Object.defineProperty(exports, "__esModule", {
9967  value: true
9968});
9969
9970var _config = __webpack_require__(0);
9971
9972var _config2 = _interopRequireDefault(_config);
9973
9974var _bufferedProgressElements = __webpack_require__(24);
9975
9976var _bufferedProgressElements2 = _interopRequireDefault(_bufferedProgressElements);
9977
9978var _timeElements = __webpack_require__(15);
9979
9980var _timeElements2 = _interopRequireDefault(_timeElements);
9981
9982var _songSliderElements = __webpack_require__(14);
9983
9984var _songSliderElements2 = _interopRequireDefault(_songSliderElements);
9985
9986var _songPlayedProgressElements = __webpack_require__(20);
9987
9988var _songPlayedProgressElements2 = _interopRequireDefault(_songPlayedProgressElements);
9989
9990var _time = __webpack_require__(23);
9991
9992var _time2 = _interopRequireDefault(_time);
9993
9994var _callbacks = __webpack_require__(7
vendor: 16,958 bytes, lines 9994-10680
9994);
9995
9996var _callbacks2 = _interopRequireDefault(_callbacks);
9997
9998function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9999
10000/**
10001 * AmplitudeJS Event Handler for Time Update
10002 *
10003 * @module events/TimeUpdate
10004 */
10005
10006
10007/**
10008 * Imports the Time utility class
10009 * @module utilities/Time
10010 */
10011
10012
10013/**
10014 * Imports the Song Slider Elements visual class.
10015 * @module visual/songSliderElements
10016 */
10017
10018
10019/**
10020 * Imports the Buffered Progress Elements visual class
10021 * @module visual/bufferedProgressElements
10022 */
10023var TimeUpdate = function () {
10024  /**
10025   * When the time updates on the active song, we sync the current time displays
10026   *
10027   * HANDLER FOR: timeupdate
10028   *
10029   * @access public
10030   */
10031  function handle() {
10032    /*
10033      Computes the buffered time.
10034    */
10035    computeBufferedTime();
10036
10037    /*
10038      Sync the buffered progress elements.
10039    */
10040    _bufferedProgressElements2.default.sync();
10041
10042    /*
10043      Updates the current time information.
10044    */
10045    updateTimeInformation();
10046
10047    /*
10048      Run time callbacks
10049    */
10050    runTimeCallbacks();
10051  }
10052
10053  /**
10054   * Computes the buffered time
10055   */
10056  function computeBufferedTime() {
10057    /*
10058      Help from: http://jsbin.com/badimipi/1/edit?html,js,output
10059    */
10060    if (_config2.default.audio.buffered.length - 1 >= 0) {
10061      var bufferedEnd = _config2.default.audio.buffered.end(_config2.default.audio.buffered.length - 1);
10062      var duration = _config2.default.audio.duration;
10063
10064      _config2.default.buffered = bufferedEnd / duration * 100;
10065    }
10066  }
10067
10068  /**
10069   * Updates the current time information.
10070   * @access private
10071   */
10072  function updateTimeInformation() {
10073    /*
10074      If the current song is not live, then
10075      we can update the time information. Otherwise the
10076      current time updates wouldn't mean much since the time
10077      is infinite.
10078    */
10079    if (!_config2.default.active_metadata.live) {
10080      /*
10081        Compute the current time
10082      */
10083      var currentTime = _time2.default.computeCurrentTimes();
10084
10085      /*
10086        Compute the song completion percentage
10087      */
10088      var songCompletionPercentage = _time2.default.computeSongCompletionPercentage();
10089
10090      /*
10091        Computes the song duration
10092      */
10093      var songDuration = _time2.default.computeSongDuration();
10094
10095      /*
10096        Sync the current time elements with the current
10097        location of the song and the song duration elements with
10098        the duration of the song.
10099      */
10100      _timeElements2.default.syncCurrentTimes(currentTime);
10101
10102      /*
10103        Sync the song slider elements.
10104      */
10105      _songSliderElements2.default.sync(songCompletionPercentage, _config2.default.active_playlist, _config2.default.active_index);
10106
10107      /*
10108        Sync the song played progress elements.
10109      */
10110      _songPlayedProgressElements2.default.sync(songCompletionPercentage);
10111
10112      /*
10113        Sync the duration time elements.
10114      */
10115      _timeElements2.default.syncDurationTimes(currentTime, songDuration);
10116    }
10117  }
10118
10119  /**
10120   * Runs a callback at a certain time in the song.
10121   */
10122  function runTimeCallbacks() {
10123    /*
10124      Gets the current seconds into the song.
10125    */
10126    var currentSeconds = Math.floor(_config2.default.audio.currentTime);
10127
10128    /*
10129      Checks to see if there is a callback at the certain seconds into the song.
10130    */
10131    if (_config2.default.active_metadata.time_callbacks != undefined && _config2.default.active_metadata.time_callbacks[currentSeconds] != undefined) {
10132      /*
10133        Checks to see if the callback has been run. Since the time updates more than
10134        one second, we don't want the callback to run X times.
10135      */
10136      if (!_config2.default.active_metadata.time_callbacks[currentSeconds].run) {
10137        _config2.default.active_metadata.time_callbacks[currentSeconds].run = true;
10138        _config2.default.active_metadata.time_callbacks[currentSeconds]();
10139      }
10140    } else {
10141      /*
10142        Iterate over all of the callbacks for a song. If the song has one, we flag
10143        the run as false. This occurs because we have passed the active second for
10144        the callback, so we flag it as not run. It will either run again if the user
10145        seeks back or not run in the future.
10146      */
10147      for (var seconds in _config2.default.active_metadata.time_callbacks) {
10148        if (_config2.default.active_metadata.time_callbacks.hasOwnProperty(seconds)) {
10149          _config2.default.active_metadata.time_callbacks[seconds].run = false;
10150        }
10151      }
10152    }
10153  }
10154  /**
10155   * Returns public functions
10156   */
10157  return {
10158    handle: handle
10159  };
10160}();
10161
10162/**
10163 * Imports the Callback utility class
10164 * @module utilities/Callbacks
10165 */
10166
10167
10168/**
10169 * Imports the Song Played Progress Elements visual class.
10170 * @module visual/songPlayedProgressElements
10171 */
10172
10173
10174/**
10175 * Imports the Time Elements visual class.
10176 * @module visual/timeElements
10177 */
10178/**
10179 * Imports the config module
10180 * @module config
10181 */
10182exports.default = TimeUpdate;
10183module.exports = exports["default"];
10184
10185/***/ }),
10186/* 43 */
10187/***/ (function(module, exports, __webpack_require__) {
10188
10189"use strict";
10190
10191
10192Object.defineProperty(exports, "__esModule", {
10193  value: true
10194});
10195
10196var _config = __webpack_require__(0);
10197
10198var _config2 = _interopRequireDefault(_config);
10199
10200var _core = __webpack_require__(1);
10201
10202var _core2 = _interopRequireDefault(_core);
10203
10204var _muteElements = __webpack_require__(10);
10205
10206var _muteElements2 = _interopRequireDefault(_muteElements);
10207
10208var _volumeSliderElements = __webpack_require__(11);
10209
10210var _volumeSliderElements2 = _interopRequireDefault(_volumeSliderElements);
10211
10212function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10213
10214/**
10215 * Handles all events for a volume down event.
10216 * @module events/VolumeDown
10217 */
10218
10219
10220/**
10221 * Imports the AmplitudeJS Visual Mute Elements
10222 * @module visual/MuteElements
10223 */
10224/**
10225 * Imports the config to use the values
10226 */
10227var VolumeDown = function () {
10228  /**
10229   * Handles a click on a volume down element.
10230   *
10231   * HANDLER FOR:       class="amplitude-volume-down"
10232   *
10233   * @access public
10234   */
10235  function handle() {
10236    /*
10237      We don't fire this if the user is touching the screen and it's moving.
10238      This could lead to a mis-fire
10239    */
10240    if (!_config2.default.is_touch_moving) {
10241      /*
10242      The volume range is from 0 to 1 for an audio element. We make this
10243      a base of 100 for ease of working with.
10244      If the new value is less than 100, we use the new calculated
10245      value which gets converted to the proper unit for the audio element.
10246      If the new value is greater than 100, we set the volume to 1 which
10247      is the max for the audio element.
10248      */
10249      var volume = null;
10250
10251      if (_config2.default.volume - _config2.default.volume_increment > 0) {
10252        volume = _config2.default.volume - _config2.default.volume_increment;
10253      } else {
10254        volume = 0;
10255      }
10256
10257      /*
10258      Calls the core function to set the volume to the computed value
10259      based on the user's intent.
10260      */
10261      _core2.default.setVolume(volume);
10262
10263      /*
10264        Sync Mute Elements.
10265      */
10266      _muteElements2.default.setMuted(_config2.default.volume == 0 ? true : false);
10267
10268      /*
10269        Sync Volume Slider Elements
10270      */
10271      _volumeSliderElements2.default.sync();
10272    }
10273  }
10274
10275  /**
10276   * Returns the public facing methods
10277   */
10278  return {
10279    handle: handle
10280  };
10281}();
10282
10283/**
10284 * Imports the AmplitudeJS Visual Volume Slider Elements
10285 * @module visual/VolumeSliderElements
10286 */
10287
10288
10289/**
10290 * Imports the AmplitudeJS Core Methods
10291 * @module core/core
10292 */
10293exports.default = VolumeDown;
10294module.exports = exports["default"];
10295
10296/***/ }),
10297/* 44 */
10298/***/ (function(module, exports, __webpack_require__) {
10299
10300"use strict";
10301
10302
10303Object.defineProperty(exports, "__esModule", {
10304  value: true
10305});
10306
10307var _config = __webpack_require__(0);
10308
10309var _config2 = _interopRequireDefault(_config);
10310
10311var _core = __webpack_require__(1);
10312
10313var _core2 = _interopRequireDefault(_core);
10314
10315var _muteElements = __webpack_require__(10);
10316
10317var _muteElements2 = _interopRequireDefault(_muteElements);
10318
10319var _volumeSliderElements = __webpack_require__(11);
10320
10321var _volumeSliderElements2 = _interopRequireDefault(_volumeSliderElements);
10322
10323function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10324
10325/**
10326 * Handles all events for a volume up event.
10327 * @module events/VolumeSlider
10328 */
10329
10330
10331/**
10332 * Imports the AmplitudeJS Visual Mute Elements
10333 * @module visual/MuteElements
10334 */
10335/**
10336 * Imports the config to use the values
10337 */
10338var VolumeSlider = function () {
10339  /**
10340   * Handles a change on the volume slider
10341   *
10342   * HANDLER FOR:       class="amplitude-volume-slider"
10343   *
10344   * @access public
10345   */
10346  function handle() {
10347    /*
10348    Calls the core function to set the volume to the computed value
10349    based on the user's intent.
10350    */
10351    _core2.default.setVolume(this.value);
10352
10353    /*
10354      Sync Mute Elements.
10355    */
10356    _muteElements2.default.setMuted(_config2.default.volume == 0 ? true : false);
10357
10358    /*
10359    Sync the volume slider locations
10360    */
10361    _volumeSliderElements2.default.sync();
10362  }
10363
10364  /**
10365   * Returns the public facing methods
10366   */
10367  return {
10368    handle: handle
10369  };
10370}();
10371
10372/**
10373 * Imports the AmplitudeJS Visual Volume Slider Elements
10374 * @module visual/VolumeSliderElements
10375 */
10376
10377
10378/**
10379 * Imports the AmplitudeJS Core Methods
10380 * @module core/core
10381 */
10382exports.default = VolumeSlider;
10383module.exports = exports["default"];
10384
10385/***/ }),
10386/* 45 */
10387/***/ (function(module, exports, __webpack_require__) {
10388
10389"use strict";
10390
10391
10392Object.defineProperty(exports, "__esModule", {
10393  value: true
10394});
10395
10396var _config = __webpack_require__(0);
10397
10398var _config2 = _interopRequireDefault(_config);
10399
10400var _core = __webpack_require__(1);
10401
10402var _core2 = _interopRequireDefault(_core);
10403
10404var _muteElements = __webpack_require__(10);
10405
10406var _muteElements2 = _interopRequireDefault(_muteElements);
10407
10408var _volumeSliderElements = __webpack_require__(11);
10409
10410var _volumeSliderElements2 = _interopRequireDefault(_volumeSliderElements);
10411
10412function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10413
10414/**
10415 * Handles all events for a volume up event.
10416 * @module events/VolumeUp
10417 */
10418
10419
10420/**
10421 * Imports the AmplitudeJS Visual Mute Elements
10422 * @module visual/MuteElements
10423 */
10424/**
10425 * Imports the config to use the values
10426 */
10427var VolumeUp = function () {
10428  /**
10429   * Handles a click on a volume up element.
10430   *
10431   * HANDLER FOR:       class="amplitude-volume-up"
10432   *
10433   * @access public
10434   */
10435  function handle() {
10436    /*
10437      We don't fire this if the user is touching the screen and it's moving.
10438      This could lead to a mis-fire
10439    */
10440    if (!_config2.default.is_touch_moving) {
10441      /*
10442      The volume range is from 0 to 1 for an audio element. We make this
10443      a base of 100 for ease of working with.
10444      If the new value is less than 100, we use the new calculated
10445      value which gets converted to the proper unit for the audio element.
10446      If the new value is greater than 100, we set the volume to 1 which
10447      is the max for the audio element.
10448      */
10449      var volume = null;
10450
10451      if (_config2.default.volume + _config2.default.volume_increment <= 100) {
10452        volume = _config2.default.volume + _config2.default.volume_increment;
10453      } else {
10454        volume = 100;
10455      }
10456
10457      /*
10458      Calls the core function to set the volume to the computed value
10459      based on the user's intent.
10460      */
10461      _core2.default.setVolume(volume);
10462
10463      /*
10464        Sync Mute Elements.
10465      */
10466      _muteElements2.default.setMuted(_config2.default.volume == 0 ? true : false);
10467
10468      /*
10469        Sync Volume Slider Elements
10470      */
10471      _volumeSliderElements2.default.sync();
10472    }
10473  }
10474
10475  /**
10476   * Returns the public facing methods
10477   */
10478  return {
10479    handle: handle
10480  };
10481}();
10482
10483/**
10484 * Imports the AmplitudeJS Visual Volume Slider Elements
10485 * @module visual/VolumeSliderElements
10486 */
10487
10488
10489/**
10490 * Imports the AmplitudeJS Core Methods
10491 * @module core/core
10492 */
10493exports.default = VolumeUp;
10494module.exports = exports["default"];
10495
10496/***/ }),
10497/* 46 */
10498/***/ (function(module, exports, __webpack_require__) {
10499
10500"use strict";
10501
10502
10503Object.defineProperty(exports, "__esModule", {
10504  value: true
10505});
10506
10507var _config = __webpack_require__(0);
10508
10509var _config2 = _interopRequireDefault(_config);
10510
10511function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10512
10513/**
10514 * AmplitudeJS FX Module. Helps with configuring and setting up visualizations
10515 * and any other features of the Web Audio API that Amplitude takes advantage
10516 * of.
10517 *
10518 * @module fx/FX
10519 */
10520var Fx = function () {
10521  /**
10522   * Configures the Web Audio API to work with AmplitudeJS
10523   */
10524  function configureWebAudioAPI() {
10525    /*
10526    Gets the context for the browser. If this is null, the Web Audio
10527    API is unavailable.
10528    */
10529    var browserContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext || window.oAudioContext || window.msAudioContext;
10530
10531    /*
10532    If we have a context, the Web Audio API is available and we can continue,
10533    otherwise, we alert the user if they have debug turned on.
10534    */
10535    if (browserContext) {
10536      /*
10537      Web Audio API is available, set the context in our config.
10538      */
10539      _config2.default.context = new browserContext();
10540
10541      /*
10542      Create an analyzer that we will use in the context.
10543      */
10544      _config2.default.analyser = _config2.default.context.createAnalyser();
10545
10546      /*
10547      Set cross origin to anonymous so we have a better chance of being able
10548      to use the power of the Web Audio API.
10549      */
10550      _config2.default.audio.crossOrigin = "anonymous";
10551
10552      /*
10553      Bind the source to the Javascript Audio Element.
10554      */
10555      _config2.default.source = _config2.default.context.createMediaElementSource(_config2.default.audio);
10556
10557      /*
10558      Connect the analyser to the source
10559      */
10560      _config2.default.source.connect(_config2.default.analyser);
10561
10562      /*
10563      Connect the context destination to the analyser.
10564      */
10565      _config2.default.analyser.connect(_config2.default.context.destination);
10566    } else {
10567      AmplitudeHelpers.writeDebugMessage("Web Audio API is unavailable! We will set any of your visualizations with your back up definition!");
10568    }
10569  }
10570
10571  /**
10572   * Determines if the web audio API is available or not.
10573   */
10574  function webAudioAPIAvailable() {
10575    /*
10576    Gets the context for the browser. If this is null, the Web Audio
10577    API is unavailable.
10578    */
10579    var browserContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext || window.oAudioContext || window.msAudioContext;
10580    _config2.default.web_audio_api_available = false;
10581
10582    /*
10583    Determines if the Web Audio API is available or not.
10584    */
10585    if (browserContext) {
10586      /*
10587      Set the flag in the config that the Web Audio API is available
10588      */
10589      _config2.default.web_audio_api_available = true;
10590      return true;
10591    } else {
10592      /*
10593      Set the flag in the config that the Web Audio API is not available
10594      */
10595      _config2.default.web_audio_api_available = false;
10596      return false;
10597    }
10598  }
10599
10600  /**
10601   * Determines if the user is using any of the web audio API features.
10602   */
10603  function determineUsingAnyFX() {
10604    var waveforms = document.querySelectorAll(".amplitude-wave-form");
10605    var visualizationElements = document.querySelectorAll(".amplitude-visualization");
10606
10607    if (waveforms.length > 0 || visualizationElements.length > 0) {
10608      return true;
10609    } else {
10610      return false;
10611    }
10612  }
10613
10614  /*
10615  Returns the publicly accessible methods
10616  */
10617  return {
10618    configureWebAudioAPI: configureWebAudioAPI,
10619    webAudioAPIAvailable: webAudioAPIAvailable,
10620    determineUsingAnyFX: determineUsingAnyFX
10621  };
10622}(); /**
10623      * Imports the config module
10624      * @module config
10625      */
10626exports.default = Fx;
10627module.exports = exports["default"];
10628
10629/***/ }),
10630/* 47 */
10631/***/ (function(module, exports, __webpack_require__) {
10632
10633"use strict";
10634
10635
10636Object.defineProperty(exports, "__esModule", {
10637  value: true
10638});
10639
10640var _init = __webpack_require__(21);
10641
10642var _init2 = _interopRequireDefault(_init);
10643
10644var _config = __webpack_require__(0);
10645
10646var _config2 = _interopRequireDefault(_config);
10647
10648var _core = __webpack_require__(1);
10649
10650var _core2 = _interopRequireDefault(_core);
10651
10652var _shuffler = __webpack_require__(13);
10653
10654var _shuffler2 = _interopRequireDefault(_shuffler);
10655
10656var _configState = __webpack_require__(6);
10657
10658var _configState2 = _interopRequireDefault(_configState);
10659
10660var _audioNavigation = __webpack_require__(3);
10661
10662var _audioNavigation2 = _interopRequireDefault(_audioNavigation);
10663
10664var _repeater = __webpack_require__(12);
10665
10666var _repeater2 = _interopRequireDefault(_repeater);
10667
10668var _checks = __webpack_require__(5);
10669
10670var _checks2 = _interopRequireDefault(_checks);
10671
10672var _visualizations = __webpack_require__(16);
10673
10674var _visualizations2 = _interopRequireDefault(_visualizations);
10675
10676var _shuffleElements = __webpack_require__(19);
10677
10678var _shuffleElements2 = _interopRequireDefault(_shuffleElements);
10679
10680var _repeatElements = __webpack_require__(
vendor: 48,059 bytes, lines 10680-12419
106809);
10681
10682var _repeatElements2 = _interopRequireDefault(_repeatElements);
10683
10684var _songSliderElements = __webpack_require__(14);
10685
10686var _songSliderElements2 = _interopRequireDefault(_songSliderElements);
10687
10688var _songPlayedProgressElements = __webpack_require__(20);
10689
10690var _songPlayedProgressElements2 = _interopRequireDefault(_songPlayedProgressElements);
10691
10692var _timeElements = __webpack_require__(15);
10693
10694var _timeElements2 = _interopRequireDefault(_timeElements);
10695
10696var _playPauseElements = __webpack_require__(2);
10697
10698var _playPauseElements2 = _interopRequireDefault(_playPauseElements);
10699
10700var _metaDataElements = __webpack_require__(8);
10701
10702var _metaDataElements2 = _interopRequireDefault(_metaDataElements);
10703
10704var _playbackSpeedElements = __webpack_require__(18);
10705
10706var _playbackSpeedElements2 = _interopRequireDefault(_playbackSpeedElements);
10707
10708var _debug = __webpack_require__(4);
10709
10710var _debug2 = _interopRequireDefault(_debug);
10711
10712var _soundcloud = __webpack_require__(17);
10713
10714var _soundcloud2 = _interopRequireDefault(_soundcloud);
10715
10716function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10717
10718/**
10719 * Amplitude should just be an interface to the public functions.
10720 * Everything else should be handled by other objects
10721 *
10722 * @module Amplitude
10723 */
10724
10725
10726/**
10727 * Meta Data Elements
10728 * @module visual/MetaDataElements
10729 */
10730
10731
10732/**
10733 * Time Elements
10734 * @module visual/TimeElements
10735 */
10736
10737
10738/**
10739 * Song Slider Elements
10740 * @module visual/SongSliderElements
10741 */
10742
10743
10744/****************************************************
10745 * Elements
10746 ****************************************************/
10747/**
10748 * Visual Shuffle Elements
10749 * @module visual/ShuffleElements
10750 */
10751
10752
10753/**
10754 * Imports the checks
10755 * @module utilities/Checks
10756 */
10757
10758
10759/**
10760 * Imports the audio navigation
10761 * @module utilities/AudioNavigation
10762 */
10763
10764
10765/****************************************************
10766 * Utilities
10767 ****************************************************/
10768/**
10769 * Shuffler Module
10770 * @module utilities/Shuffler
10771 */
10772
10773
10774/****************************************************
10775 * Config
10776 ****************************************************/
10777/**
10778 * Imports the config module
10779 * @module config
10780 */
10781var Amplitude = function () {
10782  /**
10783   * The main init function.  The user will call this through
10784   * Amplitude.init({}) and pass in their settings.
10785   *
10786   * Public Accessor: Amplitude.init( user_config_json );
10787   *
10788   * @access public
10789   * @param {object} userConfig 	- A JSON object of user defined values that helps configure and initialize AmplitudeJS.
10790   */
10791  function init(userConfig) {
10792    _init2.default.initialize(userConfig);
10793  }
10794
10795  /**
10796   * Returns the current config for AmplitudeJS
10797   */
10798  function getConfig() {
10799    return _config2.default;
10800  }
10801
10802  /**
10803   * Binds new elements that were added to the page.
10804   *
10805   * Public Accessor: Amplitude.bindNewElements()
10806   *
10807   * @access public
10808   */
10809  function bindNewElements() {
10810    _init2.default.rebindDisplay();
10811  }
10812
10813  /**
10814   * Returns the active playlist.
10815   *
10816   * Public Accessor: Amplitude.getActivePlaylist()
10817   *
10818   * @access public
10819   */
10820  function getActivePlaylist() {
10821    return _config2.default.active_playlist;
10822  }
10823
10824  /**
10825   * Returns the current playback speed.
10826   *
10827   * Public Accessor: Amplitude.getPlaybackSpeed()
10828   *
10829   * @access public
10830   */
10831  function getPlaybackSpeed() {
10832    return _config2.default.playback_speed;
10833  }
10834
10835  /**
10836   * Sets the playback speed
10837   * 
10838   * Public Accessor: Amplitude.setPlaybackSpeed( speed )
10839   * 
10840   * @access public
10841   */
10842  function setPlaybackSpeed(speed) {
10843    /*
10844      Increments are set in .5 We only accept values
10845      1, 1.5, 2
10846       1 -> Regular Speed
10847      1.5 -> 50% faster
10848      2 -> Twice as fast
10849    */
10850    _core2.default.setPlaybackSpeed(speed);
10851
10852    /*
10853      Visually sync the playback speed.
10854    */
10855    _playbackSpeedElements2.default.sync();
10856  }
10857
10858  /**
10859   * Gets the repeat state of the player.
10860   *
10861   * Public Accessor: Amplitude.getRepeat()
10862   *
10863   * @access public
10864   */
10865  function getRepeat() {
10866    return _config2.default.repeat;
10867  }
10868
10869  /**
10870   * Gets the repeat state for a playlist
10871   *
10872   * Public Accessor: Amplitude.getRepeatPlaylist()
10873   *
10874   * @access public
10875   */
10876  function getRepeatPlaylist(playlistKey) {
10877    return _config2.default.playlists[playlistKey].repeat;
10878  }
10879
10880  /**
10881   * Returns the shuffle state of the player.
10882   *
10883   * Public Accessor: Amplitude.getShuffle()
10884   *
10885   * @access public
10886   */
10887  function getShuffle() {
10888    return _config2.default.shuffle_on;
10889  }
10890
10891  /**
10892   * Returns the shuffle state of the playlist.
10893   *
10894   * Public Accessor: Amplitude.getShufflePlaylist( playlist )
10895   *
10896   * @access public
10897   * @param {string} playlist 	- The key representing the playlist ID to see if it's shuffled or not.
10898   */
10899  function getShufflePlaylist(playlist) {
10900    return _config2.default.playlists[playlist].shuffle;
10901  }
10902
10903  /**
10904   * Sets the shuffle state for the player.
10905   *
10906   * Public Accessor: Amplitude.setShuffle()
10907   *
10908   * @param {boolean} shuffle  	- True when we are shuffling the songs, false when we turn off shuffle.
10909   *
10910   * @access public
10911   */
10912  function setShuffle(shuffle) {
10913    _shuffler2.default.setShuffle(shuffle);
10914
10915    _shuffleElements2.default.syncMain();
10916  }
10917
10918  /**
10919   * Sets the shuffle state for the playlist
10920   *
10921   * Public Accessor: Amplitude.setShufflePlaylist( playlist )
10922   *
10923   * @access public
10924   * @param {string} playlist 	- The key representing the playlist ID to to shuffle the playlist.
10925   * @param {boolean} shuffle 	- True when we are shuffling the playlist, false when we turn off shuffle.
10926   */
10927  function setShufflePlaylist(playlist, shuffle) {
10928    _shuffler2.default.setShufflePlaylist(playlist, shuffle);
10929
10930    _shuffleElements2.default.syncMain();
10931    _shuffleElements2.default.syncPlaylist(playlist);
10932  }
10933
10934  /**
10935   * Sets the repeat state for the player.
10936   *
10937   * Public Accessor: Amplitude.setRepeat()
10938   *
10939   * @access public
10940   * @param {boolean} repeatState 	- The state you want the repeat song to be in.
10941   */
10942  function setRepeat(repeatState) {
10943    _repeater2.default.setRepeat(repeatState);
10944    _repeatElements2.default.syncRepeat();
10945  }
10946
10947  /**
10948   * Sets the repeat state for a playlist.
10949   *
10950   * Public Accessor: Amplitude.setRepeatPlaylist( playlistKey )
10951   *
10952   * @access public
10953   * @param {string} playlist 	- The key representing the playlist ID to to shuffle the playlist.
10954   * @param {boolean} repeatState - The state you want the repeat playlist to be in.
10955   */
10956  function setRepeatPlaylist(playlist, repeatState) {
10957    _repeater2.default.setRepeatPlaylist(repeatState, playlist);
10958    _repeatElements2.default.syncRepeatPlaylist(playlist);
10959  }
10960
10961  /**
10962   * Sets the repeat state for the song.
10963   *
10964   * Public Accessor: Amplitude.setRepeatSong()
10965   *
10966   * @access public
10967   * @param {boolean} repeatState 	- The state you want the repeat song status to be in.
10968   */
10969  function setRepeatSong(repeatState) {
10970    if (!_config2.default.is_touch_moving) {
10971      /*
10972      Sets repeat to the opposite of what it was set to
10973      */
10974      _repeater2.default.setRepeatSong(!_config2.default.repeat_song);
10975
10976      /*
10977      Visually sync repeat song
10978      */
10979      _repeatElements2.default.syncRepeatSong();
10980    }
10981  }
10982
10983  /**
10984   * Gets the default album art for the player
10985   *
10986   * Public Accessor: Amplitude.getDefaultAlbumArt()
10987   *
10988   * @access public
10989   */
10990  function getDefaultAlbumArt() {
10991    return _config2.default.default_album_art;
10992  }
10993
10994  /**
10995   * Gets the default playlist art for the playlists
10996   *
10997   * Public Accessor: Amplitude.getDefaultPlaylistArt()
10998   *
10999   * @access public
11000   */
11001  function getDefaultPlaylistArt() {
11002    return _config2.default.default_playlist_art;
11003  }
11004
11005  /**
11006   * Sets the default album art for the player
11007   *
11008   * Public Accessor: Amplitude.setDefaultAlbumArt( url )
11009   *
11010   * @access public
11011   * @param {string} url 	- A string representing the URL of the new default album art.
11012   */
11013  function setDefaultAlbumArt(url) {
11014    _config2.default.default_album_art = url;
11015  }
11016
11017  /**
11018   * Sets the default playlist art for the player
11019   *
11020   * Public Accessor: Amplitude.setDefaultPlaylistArt( url )
11021   *
11022   * @access public
11023   * @param {string} url - A string representing the URL of the new default playlist art.
11024   */
11025  function setDefaultPlaylistArt(url) {
11026    _config2.default.default_plalist_art = url;
11027  }
11028
11029  /**
11030   * Allows the user to get the percentage of the song played.
11031   *
11032   * Public Accessor: Amplitude.getSongPlayedPercentage();
11033   *
11034   * @access public
11035   */
11036  function getSongPlayedPercentage() {
11037    /*
11038    Returns the percentage of the song played.
11039    */
11040    return _config2.default.audio.currentTime / _config2.default.audio.duration * 100;
11041  }
11042
11043  /**
11044   * Allows the user to get the amount of seconds the song has played.
11045   *
11046   * Public Accessor: Amplitude.getSongPlayed();
11047   *
11048   * @access public
11049   */
11050  function getSongPlayedSeconds() {
11051    /*
11052    Returns the amount of seconds the song has played.
11053    */
11054    return _config2.default.audio.currentTime;
11055  }
11056
11057  /**
11058   * Allows the user to get the duration of the current song
11059   *
11060   * Public Accessor: Amplitude.getSongPlayed();
11061   *
11062   * @access public
11063   */
11064  function getSongDuration() {
11065    /*
11066    Returns the duration of the current song
11067    */
11068    return _config2.default.audio.duration;
11069  }
11070
11071  /**
11072   * Allows the user to set how far into the song they want to be. This is
11073   * helpful for implementing custom range sliders. Only works on the current song.
11074   *
11075   * Public Accessor: Amplitude.setSongPlayedPercentage( float );
11076   *
11077   * @access public
11078   * @param {number} percentage 	- The percentage of the song played
11079   */
11080  function setSongPlayedPercentage(percentage) {
11081    /*
11082    Ensures the percentage is a number and is between 0 and 100.
11083    */
11084    if (typeof percentage == "number" && percentage > 0 && percentage < 100) {
11085      /*
11086      Sets the current time of the song to the percentage.
11087      */
11088      _config2.default.audio.currentTime = _config2.default.audio.duration * (percentage / 100);
11089    }
11090  }
11091
11092  /**
11093   * Allows the user to turn on debugging.
11094   *
11095   * Public Accessor: Amplitude.setDebug( bool );
11096   *
11097   * @access public
11098   * @param {boolean} state 		- Turns debugging on and off.
11099   */
11100  function setDebug(state) {
11101    /*
11102    Sets the global config debug on or off.
11103    */
11104    _config2.default.debug = state;
11105  }
11106
11107  /**
11108   * Returns the active song meta data for the user to do what is
11109   * needed.
11110   *
11111   * Public Accessor: Amplitude.getActiveSongMetadata();
11112   *
11113   * @access public
11114   * @returns {object} JSON Object with the active song information
11115   */
11116  function getActiveSongMetadata() {
11117    return _config2.default.active_metadata;
11118  }
11119
11120  /**
11121   * Returns the active playlist meta data for the for the user to use.
11122   *
11123   * Public Accessor: Amplitude.getActivePlaylistMetadata();
11124   *
11125   * @access public
11126   * @returns {object} JSON representation for the active playlist
11127   */
11128  function getActivePlaylistMetadata() {
11129    return _config2.default.playlists[_config2.default.active_playlist];
11130  }
11131
11132  /**
11133   * Returns a song in the songs array at that index
11134   *
11135   * Public Accessor: Amplitude.getSongAtIndex( song_index )
11136   *
11137   * @access public
11138   * @param {number} index 	- The integer for the index of the song in the songs array.
11139   * @returns {object} JSON representation for the song at a specific index.
11140   */
11141  function getSongAtIndex(index) {
11142    return _config2.default.songs[index];
11143  }
11144
11145  /**
11146   * Returns a song at a playlist index
11147   *
11148   * Public Accessor: Amplitude.getSongAtPlaylistIndex( playlist, index
11149   *
11150   * @access public
11151   * @param {number} index 			- The integer for the index of the song in the playlist.
11152   * @param {string} playlist		- The key of the playlist we are getting the song at the index for
11153   * @returns {object} JSON representation for the song at a specific index.
11154   */
11155  function getSongAtPlaylistIndex(playlist, index) {
11156    var song = _config2.default.playlists[playlist].songs[index];
11157
11158    return song;
11159  }
11160
11161  /**
11162   * Adds a song to the end of the config array.  This will allow Amplitude
11163   * to play the song in a playlist type setting.
11164   *
11165   * Public Accessor: Amplitude.addSong( song_json )
11166   *
11167   * @access public
11168   * @param {object} song 	- JSON representation of a song.
11169   * @returns {number} New index of the song.
11170   */
11171  function addSong(song) {
11172    /*
11173    Ensures we have a songs array to push to.
11174    */
11175    if (_config2.default.songs == undefined) {
11176      _config2.default.songs = [];
11177    }
11178
11179    _config2.default.songs.push(song);
11180
11181    if (_config2.default.shuffle_on) {
11182      _config2.default.shuffle_list.push(song);
11183    }
11184
11185    if (_soundcloud2.default.isSoundCloudURL(song.url)) {
11186      _soundcloud2.default.resolveIndividualStreamableURL(song.url, null, _config2.default.songs.length - 1, _config2.default.shuffle_on);
11187    }
11188
11189    return _config2.default.songs.length - 1;
11190  }
11191
11192  /**
11193   * Adds a song to a playlist. This will allow Amplitude to play the song in the
11194   * playlist
11195   *
11196   * Public Accessor: Amplitude.addSongToPlaylist( song_json, playlist_key )
11197   *
11198   * @access public
11199   * @param {object} song 			- JSON representation of a song.
11200   * @param {string} playlist		- Playlist we are adding the song to.
11201   * @returns {mixed} New index of song in playlist or null if no playlist exists
11202   */
11203  function addSongToPlaylist(song, playlist) {
11204    if (_config2.default.playlists[playlist] != undefined) {
11205      _config2.default.playlists[playlist].songs.push(song);
11206
11207      if (_config2.default.playlists[playlist].shuffle) {
11208        _config2.default.playlists[playlist].shuffle_list.push(song);
11209      }
11210
11211      if (_soundcloud2.default.isSoundCloudURL(song.url)) {
11212        _soundcloud2.default.resolveIndividualStreamableURL(song.url, playlist, _config2.default.playlists[playlist].songs.length - 1, _config2.default.playlists[playlist].shuffle);
11213      }
11214
11215      return _config2.default.playlists[playlist].songs.length - 1;
11216    } else {
11217      _debug2.default.writeMessage("Playlist doesn't exist!");
11218      return null;
11219    }
11220  }
11221
11222  /**
11223   * Adds a playlist to Amplitude.
11224   *
11225   * @param {string} key  - The key of the playlist we are adding.
11226   * @param {object} data - The data relating to the playlist
11227   * @param {array} songs - The songs to add to the playlist
11228   */
11229  function addPlaylist(key, data, songs) {
11230    /*
11231      Ensures the playlist is not already defined.
11232    */
11233    if (_config2.default.playlists[key] == undefined) {
11234      /*
11235        Initialize the new playlist object.
11236      */
11237      _config2.default.playlists[key] = {};
11238
11239      /*
11240        Define the ignored keys that we don't want to copy over.
11241      */
11242      var ignoredKeys = ["repeat", "shuffle", "shuffle_list", "songs", "src"];
11243
11244      /*
11245        Iterate over all of the keys defined by the user and
11246        set them on the playlist.
11247      */
11248      for (var dataKey in data) {
11249        if (ignoredKeys.indexOf(dataKey) < 0) {
11250          _config2.default.playlists[key][dataKey] = data[dataKey];
11251        }
11252      }
11253
11254      /*
11255        Initialize the default parameters for the playlist and set the songs.
11256      */
11257      _config2.default.playlists[key].songs = songs;
11258      _config2.default.playlists[key].active_index = null;
11259      _config2.default.playlists[key].repeat = false;
11260      _config2.default.playlists[key].shuffle = false;
11261      _config2.default.playlists[key].shuffle_list = [];
11262
11263      return _config2.default.playlists[key];
11264    } else {
11265      _debug2.default.writeMessage("A playlist already exists with that key!");
11266      return null;
11267    }
11268  }
11269
11270  /**
11271   * Removes a song from the song array
11272   *
11273   * Public Accessor: Amplitude.removeSong( index )
11274   *
11275   * @access public
11276   * @param {integer} index - Index of the song being removed
11277   * @returns {boolean} True if removed false if not.
11278   */
11279  function removeSong(index) {
11280    _config2.default.songs.splice(index, 1);
11281  }
11282
11283  /**
11284   * Removes a song from the playlist
11285   *
11286   * Public Accessor: Amplitude.removeSongFromPlaylist( index, playlist )
11287   *
11288   * @access public
11289   * @param {integer} index 			- Index of the song being removed from the playlist.
11290   * @param {string} playlist			- Playlist we are removing the song from.
11291   * @returns {boolean} True if removed false if not.
11292   */
11293  function removeSongFromPlaylist(index, playlist) {
11294    if (_config2.default.playlists[playlist] != undefined) {
11295      _config2.default.playlists[playlist].songs.splice(index, 1);
11296    }
11297  }
11298
11299  /**
11300   * When you pass a song object it plays that song right awawy.  It sets
11301   * the active song in the config to the song you pass in and synchronizes
11302   * the visuals.
11303   *
11304   * Public Accessor: Amplitude.playNow( song )
11305   *
11306   * @access public
11307   * @param {object} song 	- JSON representation of a song.
11308   */
11309  function playNow(song) {
11310    /*
11311    Makes sure the song object has a URL associated with it
11312    or there will be nothing to play.
11313    */
11314    if (song.url) {
11315      _config2.default.audio.src = song.url;
11316      _config2.default.active_metadata = song;
11317      _config2.default.active_album = song.album;
11318    } else {
11319      /*
11320      Write error message since the song passed in doesn't
11321      have a URL.
11322      */
11323      _debug2.default.writeMessage("The song needs to have a URL!");
11324    }
11325
11326    /*
11327    Plays the song.
11328    */
11329    _core2.default.play();
11330
11331    /*
11332    Sets the main song control status visual
11333    */
11334    _playPauseElements2.default.sync();
11335
11336    /*
11337    Update the song meta data
11338    */
11339    _metaDataElements2.default.displayMetaData();
11340
11341    /*
11342    Reset the song sliders, song progress bar info, and
11343    reset times. This ensures everything stays in sync.
11344    */
11345    _songSliderElements2.default.resetElements();
11346
11347    /*
11348    Reset the song played progress elements.
11349    */
11350    _songPlayedProgressElements2.default.resetElements();
11351
11352    /*
11353    Reset all of the current time elements.
11354    */
11355    _timeElements2.default.resetCurrentTimes();
11356
11357    /*
11358    Reset all of the duration time elements.
11359    */
11360    _timeElements2.default.resetDurationTimes();
11361
11362    /*
11363      Sets the state of the player.
11364    */
11365    _configState2.default.setPlayerState();
11366  }
11367
11368  /**
11369   * Plays a song at the index passed in from the songs array.
11370   *
11371   * Public Accessor: Amplitude.playSongAtIndex( index )
11372   *
11373   * @access public
11374   * @param {number} index 	- The number representing the song in the songs array.
11375   */
11376  function playSongAtIndex(index) {
11377    /*
11378    Stop the current song.
11379    */
11380    _core2.default.stop();
11381
11382    /*
11383    Determine if there is a new playlist, if so set the active playlist and change the song.
11384    */
11385    if (_checks2.default.newPlaylist(null)) {
11386      _audioNavigation2.default.setActivePlaylist(null);
11387
11388      _audioNavigation2.default.changeSong(_config2.default.songs[index], index);
11389    }
11390
11391    /*
11392    Check if the song is new. If so, change the song.
11393    */
11394    if (_checks2.default.newSong(null, index)) {
11395      _audioNavigation2.default.changeSong(_config2.default.songs[index], index);
11396    }
11397
11398    /*
11399    Play the song
11400    */
11401    _core2.default.play();
11402
11403    /*
11404      Sets the state of the player.
11405    */
11406    _configState2.default.setPlayerState();
11407
11408    /*
11409    Sync all of the play pause buttons.
11410    */
11411    _playPauseElements2.default.sync();
11412  }
11413
11414  /**
11415   * Plays a song at the index passed in for the playlist provided. The index passed
11416   * in should be the index of the song in the playlist and not the songs array.
11417   *
11418   * @access public
11419   * @param {number} index 		- The number representing the song in the playlist array.
11420   * @param {string} playlist - The key string representing the playlist we are playing the song from.
11421   *
11422   */
11423  function playPlaylistSongAtIndex(index, playlist) {
11424    _core2.default.stop();
11425
11426    /*
11427    Determine if there is a new playlist, if so set the active playlist and change the song.
11428    */
11429    if (_checks2.default.newPlaylist(playlist)) {
11430      _audioNavigation2.default.setActivePlaylist(playlist);
11431
11432      _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[index], index);
11433    }
11434
11435    /*
11436    Check if the song is new. If so, change the song.
11437    */
11438    if (_checks2.default.newSong(playlist, index)) {
11439      _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[index], index);
11440    }
11441
11442    /*
11443    Sync all of the play pause buttons.
11444    */
11445    _playPauseElements2.default.sync();
11446
11447    /*
11448    Play the song
11449    */
11450    _core2.default.play();
11451
11452    /*
11453    Set the state of the player
11454    */
11455    _configState2.default.setPlayerState();
11456  }
11457
11458  /**
11459   * Allows the user to play whatever the active song is directly
11460   * through Javascript. Normally ALL of Amplitude functions that access
11461   * the core features are called through event handlers.
11462   *
11463   * Public Accessor: Amplitude.play();
11464   *
11465   * @access public
11466   */
11467  function play() {
11468    _core2.default.play();
11469
11470    _configState2.default.setPlayerState();
11471  }
11472
11473  /**
11474   * Allows the user to pause whatever the active song is directly
11475   * through Javascript. Normally ALL of Amplitude functions that access
11476   * the core features are called through event handlers.
11477   *
11478   * Public Accessor: Amplitude.pause();
11479   *
11480   * @access public
11481   */
11482  function pause() {
11483    _core2.default.pause();
11484
11485    _configState2.default.setPlayerState();
11486  }
11487
11488  /**
11489   * Returns the audio object used to play the audio
11490   *
11491   * Public Accessor: Amplitude.getAudio();
11492   *
11493   * @access public
11494   */
11495  function getAudio() {
11496    return _config2.default.audio;
11497  }
11498
11499  /**
11500   * Returns the Web Audio API ANalyser used for visualizations.
11501   *
11502   * Public Accessor: Amplitude.getAnalyser()
11503   *
11504   * @access public
11505   */
11506  function getAnalyser() {
11507    return _config2.default.analyser;
11508  }
11509
11510  /**
11511   * Plays the next song either in the playlist or globally.
11512   *
11513   * Public Accessor: Amplitude.next( playlist );
11514   *
11515   * @access public
11516   * @param {string} [playlist = null 	- The playlist key
11517   */
11518  function next() {
11519    var playlist = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
11520
11521    var nextData = {};
11522    /*
11523    If the playlist is empty or null, then we check the active
11524    playlist
11525    */
11526    if (playlist == "" || playlist == null) {
11527      /*
11528      If the active playlist is null, then we set the next global
11529      song or we set the next in the playlist.
11530      */
11531      if (_config2.default.active_playlist == null || _config2.default.active_playlist == "") {
11532        _audioNavigation2.default.setNext();
11533      } else {
11534        _audioNavigation2.default.setNextPlaylist(_config2.default.active_playlist);
11535      }
11536    } else {
11537      _audioNavigation2.default.setNextPlaylist(playlist);
11538    }
11539  }
11540
11541  /**
11542   * Plays the prev song either in the playlist or globally.
11543   *
11544   * Public Accessor: Amplitude.prev( playlist );
11545   *
11546   * @access public
11547   * @param {string} [playlist = null] 	- The playlist key
11548   */
11549  function prev() {
11550    var playlist = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
11551
11552    var prevData = {};
11553
11554    /*
11555    If the playlist is empty or null, then we check the active
11556    playlist
11557    */
11558    if (playlist == "" || playlist == null) {
11559      /*
11560      If the active playlist is null, then we set the prev global
11561      song or we set the prev in the playlist.
11562      */
11563      if (_config2.default.active_playlist == null || _config2.default.active_playlist == "") {
11564        _audioNavigation2.default.setPrevious();
11565      } else {
11566        _audioNavigation2.default.setPreviousPlaylist(_config2.default.active_playlist);
11567      }
11568    } else {
11569      _audioNavigation2.default.setPreviousPlaylist(playlist);
11570    }
11571  }
11572
11573  /**
11574   * Gets all of the songs in the songs array
11575   *
11576   * Public Accessor: Amplitude.getSongs( );
11577   *
11578   * @access public
11579   */
11580  function getSongs() {
11581    return _config2.default.songs;
11582  }
11583
11584  /**
11585   * Gets all of the songs in a playlist
11586   *
11587   * Public Accessor: Amplitude.getSongsInPlaylist( playlist );
11588   *
11589   * @access public
11590   * @param {string} playlist 	- The playlist key
11591   */
11592  function getSongsInPlaylist(playlist) {
11593    return _config2.default.playlists[playlist].songs;
11594  }
11595
11596  /**
11597   * Get current state of songs. If shuffled, this will return the shuffled
11598   * songs.
11599   *
11600   * Public Accessor: Amplitude.getSongsState();
11601   *
11602   * @access public
11603   */
11604  function getSongsState() {
11605    if (_config2.default.shuffle_on) {
11606      return _config2.default.shuffle_list;
11607    } else {
11608      return _config2.default.songs;
11609    }
11610  }
11611
11612  /**
11613   * Get current state of songs in playlist. If shuffled, this will return the
11614   * shuffled songs.
11615   *
11616   * Public Accessor: Amplitude.getSongsStatePlaylist( playlist );
11617   *
11618   * @access public
11619   * @param {string} playlist 	- The playlist key
11620   */
11621  function getSongsStatePlaylist(playlist) {
11622    if (_config2.default.playlists[playlist].shuffle) {
11623      return _config2.default.playlists[playlist].shuffle_list;
11624    } else {
11625      return _config2.default.playlists[playlist].songs;
11626    }
11627  }
11628
11629  /**
11630   * Gets the active index of the player
11631   *
11632   * Public Accessor: Amplitude.getActiveIndex()
11633   *
11634   * @access public
11635   */
11636  function getActiveIndex() {
11637    return parseInt(_config2.default.active_index);
11638  }
11639
11640  /**
11641   * Get the version of AmplitudeJS
11642   *
11643   * Public Accessor: Amplitude.getVersion()
11644   *
11645   * @access public
11646   */
11647  function getVersion() {
11648    return _config2.default.version;
11649  }
11650
11651  /**
11652   * Get the buffered amount for the current song
11653   *
11654   * Public Accessor: Amplitude.getBuffered()
11655   *
11656   * @access public
11657   */
11658  function getBuffered() {
11659    return _config2.default.buffered;
11660  }
11661
11662  /**
11663   * Skip to a certain location in a selected song.
11664   *
11665   * Public Accessor: Amplitude.getBuffered()
11666   *
11667   * @access public
11668   * @param {number} seconds 						- The amount of seconds we should skip to in the song.
11669   * @param {number} songIndex 					- The index of the song in the songs array.
11670   * @param {string} [playlist = null]	- The playlist the song we are skipping to belogns to.
11671   */
11672  function skipTo(seconds, songIndex) {
11673    var playlist = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
11674
11675    seconds = parseInt(seconds);
11676
11677    if (playlist != null) {
11678      /*
11679        Checks if we are skipping to a new playlist
11680      */
11681      if (_checks2.default.newPlaylist(playlist)) {
11682        _audioNavigation2.default.setActivePlaylist(playlist);
11683      }
11684
11685      /*
11686        Changes the song to where it's being skipped and then
11687        play the song.
11688      */
11689      _audioNavigation2.default.changeSongPlaylist(playlist, _config2.default.playlists[playlist].songs[songIndex], songIndex);
11690      _core2.default.play();
11691
11692      /*
11693        Sync all of the play pause elements.
11694      */
11695      _playPauseElements2.default.syncGlobal();
11696      _playPauseElements2.default.syncPlaylist();
11697      _playPauseElements2.default.syncSong();
11698
11699      /*
11700        Skip to the location in the song.
11701      */
11702      _core2.default.skipToLocation(seconds);
11703    } else {
11704      /*
11705        Changes the song to where it's being skipped and then
11706        play the song.
11707      */
11708      _audioNavigation2.default.changeSong(_config2.default.songs[songIndex], songIndex);
11709      _core2.default.play();
11710
11711      /*
11712        Syncs all of the play pause buttons now that we've skipped.
11713      */
11714      _playPauseElements2.default.syncGlobal();
11715      _playPauseElements2.default.syncSong();
11716
11717      /*
11718        Skip to the location in the song.
11719      */
11720      _core2.default.skipToLocation(seconds);
11721    }
11722  }
11723
11724  /**
11725   * Sets the meta data for a song in the songs array. This will set any
11726   * meta data for a song besides the URL. The URL could cause issues if the
11727   * song was playing.
11728   *
11729   * Public Accessor: Amplitude.setSongMetaData()
11730   *
11731   * @access public
11732   * @param {number} index					- The index of the song in the songs array.
11733   * @param {object} metaData 			- The object containing the meta data we are updating.
11734   * @param {string} playlist       - The playlist we are updating the song meta data for.
11735   */
11736  function setSongMetaData(index, metaData) {
11737    var playlist = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
11738
11739    /*
11740      Update the meta data for a song in a playlist.
11741    */
11742    if (playlist != "" && playlist != null && _config2.default.playlists[playlist] != undefined) {
11743      /*
11744        Set all of the defined meta data properties
11745      */
11746      for (var key in metaData) {
11747        if (metaData.hasOwnProperty(key)) {
11748          if (key != "url" && key != "URL" && key != "live" && key != "LIVE") {
11749            _config2.default.playlists[playlist].songs[index][key] = metaData[key];
11750          }
11751        }
11752      }
11753    } else {
11754      /*
11755        Update the meta data for a song.
11756      */
11757      for (var key in metaData) {
11758        if (metaData.hasOwnProperty(key)) {
11759          if (key != "url" && key != "URL" && key != "live" && key != "LIVE") {
11760            _config2.default.songs[index][key] = metaData[key];
11761          }
11762        }
11763      }
11764    }
11765
11766    /*
11767      Display the updates on the screen.
11768    */
11769    _metaDataElements2.default.displayMetaData();
11770    _metaDataElements2.default.syncMetaData();
11771  }
11772
11773  function setPlaylistMetaData(playlist, metaData) {
11774    if (_config2.default.playlists[playlist] != undefined) {
11775      /*
11776      These are the ignored keys that we won't be worrying about displaying.
11777      Every other key in the playlist object can be displayed.
11778      */
11779      var ignoredKeys = ["repeat", "shuffle", "shuffle_list", "songs", "src"];
11780
11781      for (var key in metaData) {
11782        if (metaData.hasOwnProperty(key)) {
11783          if (ignoredKeys.indexOf(key) < 0) {
11784            _config2.default.playlists[playlist][key] = metaData[key];
11785          }
11786        }
11787      }
11788
11789      _metaDataElements2.default.displayPlaylistMetaData();
11790    } else {
11791      _debug2.default.writeMessage("You must provide a valid playlist key!");
11792    }
11793  }
11794
11795  /**
11796   * Sets the delay between the songs when they are finished.
11797   *
11798   * Public Accessor: Amplitude.setDelay()
11799   *
11800   * @access public
11801   * @param {number} delay 	- The millisecond delay time between songs
11802   */
11803  function setDelay(time) {
11804    _config2.default.delay = time;
11805  }
11806
11807  /**
11808   * Returns the current delay between songs.
11809   *
11810   * Public Accessor: Amplitude.getDelay()
11811   *
11812   * @access public
11813   */
11814  function getDelay() {
11815    return _config2.default.delay;
11816  }
11817
11818  /**
11819   * Returns the state of the player.
11820   *
11821   * Public Accessor: Amplitude.getPlayerState();
11822   */
11823  function getPlayerState() {
11824    return _config2.default.player_state;
11825  }
11826
11827  /**
11828   * Registers a visualization and sets that visualization's
11829   * preferences. When creating a visualization, you can set certain
11830   * preferences that the user can overwrite similar to Amplitude.
11831   * Public Accessor: Amplitude.registerVisualization( visualization, preferences )
11832   *
11833   * @param {object} visualzation A visualization object that gets registered
11834   * with Amplitude
11835   *
11836   * @param {object} preferences A JSON object of preferences relating to the
11837   * visualization
11838   */
11839  function registerVisualization(visualization, preferences) {
11840    _visualizations2.default.register(visualization, preferences);
11841  }
11842
11843  /**
11844   * Set the visualization for the playlist
11845   *
11846   * @param {string} playlist - The playlist we are setting the visualization for.
11847   * @param {string} visualizationKey - The key of the visualization we are adding to the playlist.
11848   */
11849  function setPlaylistVisualization(playlist, visualizationKey) {
11850    if (_config2.default.playlists[playlist] != undefined) {
11851      if (_config2.default.visualizations.available[visualizationKey] != undefined) {
11852        _config2.default.playlists[playlist].visualization = visualizationKey;
11853      } else {
11854        _debug2.default.writeMessage("A visualization does not exist for the key provided.");
11855      }
11856    } else {
11857      _debug2.default.writeMessage("The playlist for the key provided does not exist");
11858    }
11859  }
11860
11861  /**
11862   * Set a visualization for the song.
11863   *
11864   * @param {number} songIndex - The index of the song in the songs array we are setting the visualization for.
11865   * @param {string} visualizationKey - The key of the visualization we are adding to the playlist.
11866   */
11867  function setSongVisualization(songIndex, visualizationKey) {
11868    if (_config2.default.songs[songIndex]) {
11869      if (_config2.default.visualizations.available[visualizationKey] != undefined) {
11870        _config2.default.songs[songIndex].visualization = visualizationKey;
11871      } else {
11872        _debug2.default.writeMessage("A visualization does not exist for the key provided.");
11873      }
11874    } else {
11875      _debug2.default.writeMessage("A song at that index is undefined");
11876    }
11877  }
11878
11879  /**
11880   * Set song in playlist visualization.
11881   *
11882   * @param {string} playlist - The playlist we are setting the song visualization for.
11883   * @param {number} songIndex - The index we are setting the visualization for.
11884   * @param {strong} visualizationKey - The key of the visualization we are adding to the song in the playlist.
11885   */
11886  function setSongInPlaylistVisualization(playlist, songIndex, visualizationKey) {
11887    if (_config2.default.playlists[playlist].songs[songIndex] != undefined) {
11888      if (_config2.default.visualizations.available[visualizationKey] != undefined) {
11889        _config2.default.playlists[playlist].songs[songIndex].visualization = visualizationKey;
11890      } else {
11891        _debug2.default.writeMessage("A visualization does not exist for the key provided.");
11892      }
11893    } else {
11894      _debug2.default.writeMessage("The song in the playlist at that key is not defined");
11895    }
11896  }
11897
11898  /**
11899   * Sets the global visualization default.
11900   */
11901  function setGlobalVisualization(visualizationKey) {
11902    if (_config2.default.visualizations.available[visualizationKey] != undefined) {
11903      _config2.default.visualization = visualizationKey;
11904    } else {
11905      _debug2.default.writeMessage("A visualization does not exist for the key provided.");
11906    }
11907  }
11908
11909  /**
11910   * Sets the active volume.
11911   * @param {number} volumeLevel - A number between 1 and 100 as a percentage of
11912   * min to max for a volume level.
11913   */
11914  function setVolume(volumeLevel) {
11915    _core2.default.setVolume(volumeLevel);
11916  }
11917
11918  /**
11919   * Gets the active volume.
11920   */
11921  function getVolume() {
11922    return _config2.default.volume;
11923  }
11924
11925  /*
11926  Returns all of the publically accesible methods.
11927  */
11928  return {
11929    init: init,
11930    getConfig: getConfig,
11931    bindNewElements: bindNewElements,
11932    getActivePlaylist: getActivePlaylist,
11933    getPlaybackSpeed: getPlaybackSpeed,
11934    setPlaybackSpeed: setPlaybackSpeed,
11935    getRepeat: getRepeat,
11936    getRepeatPlaylist: getRepeatPlaylist,
11937    getShuffle: getShuffle,
11938    getShufflePlaylist: getShufflePlaylist,
11939    setShuffle: setShuffle,
11940    setShufflePlaylist: setShufflePlaylist,
11941    setRepeat: setRepeat,
11942    setRepeatSong: setRepeatSong,
11943    setRepeatPlaylist: setRepeatPlaylist,
11944    getDefaultAlbumArt: getDefaultAlbumArt,
11945    setDefaultAlbumArt: setDefaultAlbumArt,
11946    getDefaultPlaylistArt: getDefaultPlaylistArt,
11947    setDefaultPlaylistArt: setDefaultPlaylistArt,
11948    getSongPlayedPercentage: getSongPlayedPercentage,
11949    setSongPlayedPercentage: setSongPlayedPercentage,
11950    getSongPlayedSeconds: getSongPlayedSeconds,
11951    getSongDuration: getSongDuration,
11952    setDebug: setDebug,
11953    getActiveSongMetadata: getActiveSongMetadata,
11954    getActivePlaylistMetadata: getActivePlaylistMetadata,
11955    getSongAtIndex: getSongAtIndex,
11956    getSongAtPlaylistIndex: getSongAtPlaylistIndex,
11957    addSong: addSong,
11958    addSongToPlaylist: addSongToPlaylist,
11959    removeSong: removeSong,
11960    removeSongFromPlaylist: removeSongFromPlaylist,
11961    playNow: playNow,
11962    playSongAtIndex: playSongAtIndex,
11963    playPlaylistSongAtIndex: playPlaylistSongAtIndex,
11964    play: play,
11965    pause: pause,
11966    getAudio: getAudio,
11967    getAnalyser: getAnalyser,
11968    next: next,
11969    prev: prev,
11970    getSongs: getSongs,
11971    getSongsInPlaylist: getSongsInPlaylist,
11972    getSongsState: getSongsState,
11973    getSongsStatePlaylist: getSongsStatePlaylist,
11974    getActiveIndex: getActiveIndex,
11975    getVersion: getVersion,
11976    getBuffered: getBuffered,
11977    skipTo: skipTo,
11978    setSongMetaData: setSongMetaData,
11979    setPlaylistMetaData: setPlaylistMetaData,
11980    setDelay: setDelay,
11981    getDelay: getDelay,
11982    getPlayerState: getPlayerState,
11983    addPlaylist: addPlaylist,
11984    registerVisualization: registerVisualization,
11985    setPlaylistVisualization: setPlaylistVisualization,
11986    setSongVisualization: setSongVisualization,
11987    setSongInPlaylistVisualization: setSongInPlaylistVisualization,
11988    setGlobalVisualization: setGlobalVisualization,
11989    getVolume: getVolume,
11990    setVolume: setVolume
11991  };
11992}();
11993
11994/** 
11995 * Playback Speed Elements
11996 * @module visual/PlaybackSpeedElements
11997 */
11998
11999
12000/**
12001 * Play Pause Elements
12002 * @module visual/PlayPauseElements
12003 */
12004
12005
12006/**
12007 * Song Played Progress Elements
12008 * @module visual/SongPlayedProgressElements
12009 */
12010
12011
12012/**
12013 * Visual Repeat Elements
12014 * @module visual/RepeatElements
12015 */
12016
12017
12018/****************************************************
12019 * FX Modules
12020 ****************************************************/
12021/**
12022 * Imports the visualizations module
12023 * @module fx/Visualizations
12024 */
12025
12026
12027/**
12028 * Repeater Module
12029 *
12030 * @module utilities/Repeater
12031 */
12032
12033
12034/**
12035 * Imports the config state module.
12036 * @module ConfigState
12037 */
12038
12039
12040/****************************************************
12041 * Core
12042 ****************************************************/
12043/**
12044 * AmplitudeJS Core Module
12045 *
12046 * @module core/Core
12047 */
12048/**
12049 * @name 		Amplitude.js
12050 * @author 	Dan Pastori (521 Dimensions) <[email protected]>
12051 */
12052/**
12053 * AmplitudeJS Initializer Module
12054 *
12055 * @module init/AmplitudeInitializer
12056 */
12057exports.default = Amplitude;
12058module.exports = exports["default"];
12059
12060/***/ }),
12061/* 48 */
12062/***/ (function(module, exports, __webpack_require__) {
12063
12064"use strict";
12065
12066
12067Object.defineProperty(exports, "__esModule", {
12068  value: true
12069});
12070
12071var _config = __webpack_require__(0);
12072
12073var _config2 = _interopRequireDefault(_config);
12074
12075var _debug = __webpack_require__(4);
12076
12077var _debug2 = _interopRequireDefault(_debug);
12078
12079var _checks = __webpack_require__(5);
12080
12081var _checks2 = _interopRequireDefault(_checks);
12082
12083var _metaDataElements = __webpack_require__(8);
12084
12085var _metaDataElements2 = _interopRequireDefault(_metaDataElements);
12086
12087var _soundcloud = __webpack_require__(17);
12088
12089var _soundcloud2 = _interopRequireDefault(_soundcloud);
12090
12091function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12092
12093/**
12094 * Handles the initialization of the playlists.
12095 *
12096 * @module init/PlaylistsInitializer
12097 */
12098
12099
12100/**
12101 * AmplitudeJS Visual Meta Data Elements Module
12102 * @module visual/MetaDataElements
12103 */
12104
12105
12106/**
12107 * AmplitudeJS Debug Module
12108 * @module utilities/Debug
12109 */
12110var PlaylistsInitializer = function () {
12111  /**
12112   * Initializes the playlists for AmplitudeJS
12113   *
12114   * @param {Object} playlists - The playlists defined by the user.
12115   */
12116  function initialize(playlists) {
12117    /*
12118      Copy the playlists over to Amplitude
12119    */
12120    _config2.default.playlists = playlists;
12121
12122    /*
12123      Copy songs over from songs array.
12124    */
12125    copySongsToPlaylists();
12126
12127    /*
12128      Grab any SoundCloud Data for the playlist songs if needed.
12129    */
12130    grabSoundCloudData();
12131
12132    /*
12133      Initialize a scoped active index for each playlist.
12134    */
12135    initializePlaylistActiveIndexes();
12136
12137    /*
12138      Initialize the shuffle status of the playlists.
12139    */
12140    initializePlaylistShuffleStatuses();
12141
12142    /*
12143      Initialize the repeat status for the playlits.
12144    */
12145    initializePlaylistsRepeatStatuses();
12146
12147    /*
12148      Initialize temporary place holders for shuffle lists.
12149    */
12150    initializePlaylistShuffleLists();
12151
12152    /*
12153      Initializes the first song in the playlist
12154    */
12155    initializeFirstSongInPlaylistMetaData();
12156  }
12157
12158  /**
12159   * Initializes a scoped active index for each playlist.
12160   *
12161   * @access private
12162   */
12163  function initializePlaylistActiveIndexes() {
12164    /*
12165    Iterate over all of the playlists defined by the user
12166      and add an active index.
12167    */
12168    for (var key in _config2.default.playlists) {
12169      _config2.default.playlists[key].active_index = null;
12170    }
12171  }
12172
12173  /**
12174   * Ensures the indexes in the playlists are valid indexes. The song has
12175   * to exist in the Amplitude config to be played correctly. If the index
12176   * is an integer, we ensure it exists and coy it to the array.
12177   *
12178   * @access private
12179   */
12180  function copySongsToPlaylists() {
12181    /*
12182      Iterate over all of the config's playlists
12183    */
12184    for (var key in _config2.default.playlists) {
12185      /*
12186        Checks if the playlist key is accurate.
12187      */
12188      if (_config2.default.playlists.hasOwnProperty(key)) {
12189        /*
12190          Checks if the playlist has songs.
12191        */
12192        if (_config2.default.playlists[key].songs) {
12193          /*
12194            Iterate over all of the songs in the playlist
12195          */
12196          for (var i = 0; i < _config2.default.playlists[key].songs.length; i++) {
12197            if (_checks2.default.isInt(_config2.default.playlists[key].songs[i])) {
12198              _config2.default.playlists[key].songs[i] = _config2.default.songs[_config2.default.playlists[key].songs[i]];
12199
12200              _config2.default.playlists[key].songs[i].index = i;
12201            }
12202            /*
12203              Check to see if the index for the song in the playlist
12204              exists in the songs config.
12205            */
12206            if (_checks2.default.isInt(_config2.default.playlists[key].songs[i]) && !_config2.default.songs[_config2.default.playlists[key].songs[i]]) {
12207              _debug2.default.writeMessage("The song index: " + _config2.default.playlists[key].songs[i] + " in playlist with key: " + key + " is not defined in your songs array!");
12208            }
12209
12210            /*
12211              If not an int, then is a dedicated song, just set the index.
12212            */
12213            if (!_checks2.default.isInt(_config2.default.playlists[key].songs[i])) {
12214              _config2.default.playlists[key].songs[i].index = i;
12215            }
12216          }
12217        }
12218      }
12219    }
12220  }
12221
12222  /**
12223   * Grabs the SoundCloud data for any song in the playlist that
12224   * the user needs to grab data for.
12225   *
12226   * @access private
12227   */
12228  function grabSoundCloudData() {
12229    /*
12230      Iterate over all of the config's playlists
12231    */
12232    for (var key in _config2.default.playlists) {
12233      /*
12234        Checks if the playlist key is accurate.
12235      */
12236      if (_config2.default.playlists.hasOwnProperty(key)) {
12237        /*
12238          Iterate over all of the songs in the playlist and see if
12239          they need to grab the SoundCloud data for the song.
12240        */
12241        for (var i = 0; i < _config2.default.playlists[key].songs.length; i++) {
12242          /*
12243            Only Grab the data if the URL is a SoundCloud URL.
12244          */
12245          if (_soundcloud2.default.isSoundCloudURL(_config2.default.playlists[key].songs[i].url)) {
12246            /*
12247              Only grab the data if the SoundCloud data has not already been
12248              grabbed for the audio. This could happen if the user defined the
12249              song in the songs array and was grabbed before.
12250            */
12251            if (_config2.default.playlists[key].songs[i].soundcloud_data == undefined) {
12252              _soundcloud2.default.resolveIndividualStreamableURL(_config2.default.playlists[key].songs[i].url, key, i);
12253            }
12254          }
12255        }
12256      }
12257    }
12258  }
12259
12260  /**
12261   * Initializes the shuffle statuses for each of the playlists. These will
12262   * be referenced when we shuffle individual playlists.
12263   *
12264   * @access private
12265   */
12266  function initializePlaylistShuffleStatuses() {
12267    /*
12268    Iterate over all of the playlists the user defined adding
12269    the playlist key to the shuffled playlist array and creating
12270    and empty object to house the statuses.
12271    */
12272    for (var key in _config2.default.playlists) {
12273      _config2.default.playlists[key].shuffle = false;
12274    }
12275  }
12276
12277  /**
12278   * Initializes the repeat statuses for each of the playlists.  These will
12279   * be referenced when we repeat individual playlits.
12280   *
12281   * @access private
12282   */
12283  function initializePlaylistsRepeatStatuses() {
12284    /*
12285      Iterate over all of the playlists the user defined adding
12286      the playlist key to the repeated playlist array and creating
12287      and empty object to house the statuses.
12288    */
12289    for (var key in _config2.default.playlists) {
12290      _config2.default.playlists[key].repeat = false;
12291    }
12292  }
12293
12294  /**
12295   * Initializes the shuffled playlist placeholders. These will be set for
12296   * playlists that are shuffled and contain the shuffled songs.
12297   *
12298   * @access private
12299   */
12300  function initializePlaylistShuffleLists() {
12301    /*
12302    Iterate over all of the playlists the user defined adding
12303    the playlist key to the shuffled playlists array and creating
12304    and empty object to house the shuffled playlists
12305    */
12306    for (var key in _config2.default.playlists) {
12307      _config2.default.playlists[key].shuffle_list = [];
12308    }
12309  }
12310
12311  /**
12312   * Intializes the display for the first song in the playlist meta data.
12313   *
12314   * @access private
12315   */
12316  function initializeFirstSongInPlaylistMetaData() {
12317    /*
12318    Iterates over all of the playlists setting the meta data for the
12319    first song.
12320    */
12321    for (var key in _config2.default.playlists) {
12322      _metaDataElements2.default.setFirstSongInPlaylist(_config2.default.playlists[key].songs[0], key);
12323    }
12324  }
12325
12326  /*
12327    Returns the public facing methods
12328  */
12329  return {
12330    initialize: initialize
12331  };
12332}();
12333
12334/**
12335 * AmplitudeJS SoundCloud Meta module
12336 * @module soundcloud/Soundcloud
12337 */
12338
12339
12340/**
12341 * AmplitudeJS Checks Utility.
12342 * @module utilities/Checks
12343 */
12344/**
12345 * Imports the config module
12346 * @module config
12347 */
12348exports.default = PlaylistsInitializer;
12349module.exports = exports["default"];
12350
12351/***/ }),
12352/* 49 */
12353/***/ (function(module, exports, __webpack_require__) {
12354
12355"use strict";
12356
12357
12358Object.defineProperty(exports, "__esModule", {
12359  value: true
12360});
12361
12362var _config = __webpack_require__(0);
12363
12364var _config2 = _interopRequireDefault(_config);
12365
12366function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12367
12368/**
12369 * Handles all of the container elements.
12370 *
12371 * @param visual/ContainerElements
12372 */
12373var ContainerElements = function () {
12374  /**
12375   * Applies the class 'amplitude-active-song-container' to the element
12376   * containing visual information regarding the active song.
12377   *
12378   * @access public
12379   */
12380  function setActive() {
12381    /*
12382      Gets all of the song container elements.
12383    */
12384    var songContainers = document.getElementsByClassName("amplitude-song-container");
12385
12386    /*
12387    Removes all of the active song containrs.
12388    */
12389    for (var i = 0; i < songContainers.length; i++) {
12390      songContainers[i].classList.remove("amplitude-active-song-container");
12391    }
12392
12393    /*
12394    Finds the active index and adds the active song container to the element
12395    that represents the song at the index.
12396    */
12397    if (_config2.default.active_playlist == "" || _config2.default.active_playlist == null) {
12398      var activeIndex = '';
12399
12400      if (_config2.default.shuffle_on) {
12401        activeIndex = _config2.default.shuffle_list[_config2.default.active_index].index;
12402      } else {
12403        activeIndex = _config2.default.active_index;
12404      }
12405
12406      if (document.querySelectorAll('.amplitude-song-container[data-amplitude-song-index="' + activeIndex + '"]')) {
12407        var _songContainers = document.querySelectorAll('.amplitude-song-container[data-amplitude-song-index="' + activeIndex + '"]');
12408
12409        for (var _i = 0; _i < _songContainers.length; _i++) {
12410          if (!_songContainers[_i].hasAttribute("data-amplitude-playlist")) {
12411            _songContainers[_i].classList.add("amplitude-active-song-container");
12412          }
12413        }
12414      }
12415    } else {
12416      if (_config2.default.active_playlist != null && _config2.default.active_playlist != '') {
12417        var activePlaylistIndex = _config2.default.playlists[_config2.default.active_playlist].active_index;
12418      } else {
12419        var activePlaylistIndex = ''
vendor: 43,839 bytes, lines 12419-13861
12419;
12420
12421        if (_config2.default.playlists[_config2.default.active_playlist].shuffle) {
12422          activePlaylistIndex = _config2.default.playlists[_config2.default.active_playlist].shuffle_list[_config2.default.playlists[_config2.default.active_playlist].active_index].index;
12423        } else {
12424          activePlaylistIndex = _config2.default.playlists[_config2.default.active_playlist].active_index;
12425        }
12426      }
12427
12428      if (document.querySelectorAll('.amplitude-song-container[data-amplitude-song-index="' + activePlaylistIndex + '"][data-amplitude-playlist="' + _config2.default.active_playlist + '"]')) {
12429        var _songContainers2 = document.querySelectorAll('.amplitude-song-container[data-amplitude-song-index="' + activePlaylistIndex + '"][data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
12430
12431        for (var _i2 = 0; _i2 < _songContainers2.length; _i2++) {
12432          _songContainers2[_i2].classList.add("amplitude-active-song-container");
12433        }
12434      }
12435    }
12436  }
12437
12438  return {
12439    setActive: setActive
12440  };
12441}(); /**
12442      * Imports the config module
12443      * @module config
12444      */
12445exports.default = ContainerElements;
12446module.exports = exports["default"];
12447
12448/***/ }),
12449/* 50 */
12450/***/ (function(module, exports, __webpack_require__) {
12451
12452"use strict";
12453
12454
12455Object.defineProperty(exports, "__esModule", {
12456  value: true
12457});
12458
12459var _config = __webpack_require__(0);
12460
12461var _config2 = _interopRequireDefault(_config);
12462
12463function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12464
12465/**
12466 * Handles all of the current time hour elements.
12467 *
12468 * @module visual/time/CurrentHourElements
12469 */
12470var CurrentHourElements = function () {
12471  function sync(hours) {
12472    syncGlobal(hours);
12473    syncPlaylist(hours);
12474    syncSong(hours);
12475    syncSongInPlaylist(hours);
12476  }
12477
12478  /**
12479   * Updates any elements that display the current hour for the song.
12480   *
12481   * @access public
12482   * @param {number} hours 	- An integer conaining how many hours into the song.
12483   */
12484  function syncGlobal(hours) {
12485    /*
12486    Get all of the hour selectors
12487    */
12488    var currentHourSelectors = document.querySelectorAll(".amplitude-current-hours");
12489
12490    /*
12491    Set the current hour selector's inner html to hours passed in.
12492    */
12493    for (var i = 0; i < currentHourSelectors.length; i++) {
12494      var playlist = currentHourSelectors[i].getAttribute("data-amplitude-playlist");
12495      var songIndex = currentHourSelectors[i].getAttribute("data-amplitude-song-index");
12496
12497      /*
12498        Updates the current hour selector for a global display.
12499      */
12500      if (playlist == null && songIndex == null) {
12501        currentHourSelectors[i].innerHTML = hours;
12502      }
12503    }
12504  }
12505
12506  /**
12507   * Syncs the playlist current hour elements.
12508   *
12509   * @param {Integer} hour - The current audio hour.
12510   */
12511  function syncPlaylist(hours) {
12512    /*
12513    Get all of the hour selectors
12514    */
12515    var currentHourPlaylistSelectors = document.querySelectorAll('.amplitude-current-hours[data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
12516
12517    /*
12518    Set the current hour selector's inner html to hours passed in.
12519    */
12520    for (var i = 0; i < currentHourPlaylistSelectors.length; i++) {
12521      var songIndex = currentHourPlaylistSelectors[i].getAttribute("data-amplitude-song-index");
12522
12523      /*
12524        Updates the current hour selector for a global display.
12525      */
12526      if (songIndex == null) {
12527        currentHourPlaylistSelectors[i].innerHTML = hours;
12528      }
12529    }
12530  }
12531
12532  /**
12533   * Syncs the song hour elements.
12534   *
12535   * @param {Integer} hour - The current audio hour.
12536   */
12537  function syncSong(hours) {
12538    if (_config2.default.active_playlist == null) {
12539      /*
12540      Get all of the hour selectors
12541      */
12542      var currentHourSongSelectors = document.querySelectorAll('.amplitude-current-hours[data-amplitude-song-index="' + _config2.default.active_index + '"]');
12543
12544      /*
12545      Set the current hour selector's inner html to hours passed in.
12546      */
12547      for (var i = 0; i < currentHourSongSelectors.length; i++) {
12548        var playlist = currentHourSongSelectors[i].getAttribute("data-amplitude-playlist");
12549
12550        /*
12551          Updates the current hour selector for a global display.
12552        */
12553        if (playlist == null) {
12554          currentHourSongSelectors[i].innerHTML = hours;
12555        }
12556      }
12557    }
12558  }
12559
12560  /**
12561   * Syncs the song in playlist song hour elements.
12562   *
12563   * @param {Integer} hour - The current audio hour.
12564   */
12565  function syncSongInPlaylist(hours) {
12566    var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null;
12567    /*
12568    Get all of the hour selectors
12569    */
12570    var currentHourPlaylistSongSelectors = document.querySelectorAll('.amplitude-current-hours[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]');
12571
12572    /*
12573    Set the current hour selector's inner html to hours passed in.
12574    */
12575    for (var i = 0; i < currentHourPlaylistSongSelectors.length; i++) {
12576      currentHourPlaylistSongSelectors[i].innerHTML = hours;
12577    }
12578  }
12579
12580  /**
12581   * Reset the current hour elements.
12582   */
12583  function resetTimes() {
12584    /*
12585      Gets the hour display elements
12586    */
12587    var hourSelectors = document.querySelectorAll(".amplitude-current-hours");
12588
12589    /*
12590      Iterates over all of the hour selectors and sets the inner HTML
12591      to 00.
12592    */
12593    for (var i = 0; i < hourSelectors.length; i++) {
12594      hourSelectors[i].innerHTML = "00";
12595    }
12596  }
12597
12598  /**
12599   * Returns the publically facing methods.
12600   */
12601  return {
12602    sync: sync,
12603    resetTimes: resetTimes
12604  };
12605}(); /**
12606      * Imports the config module
12607      * @module config
12608      */
12609exports.default = CurrentHourElements;
12610module.exports = exports["default"];
12611
12612/***/ }),
12613/* 51 */
12614/***/ (function(module, exports, __webpack_require__) {
12615
12616"use strict";
12617
12618
12619Object.defineProperty(exports, "__esModule", {
12620  value: true
12621});
12622
12623var _config = __webpack_require__(0);
12624
12625var _config2 = _interopRequireDefault(_config);
12626
12627function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12628
12629/**
12630 * Handles all of the current time minutes elements.
12631 *
12632 * @module visual/time/CurrentMinuteElements
12633 */
12634var CurrentMinuteElements = function () {
12635  /**
12636   * Syncs the current minutes elements.
12637   *
12638   * @param {Integer} minutes - The current audio minutes.
12639   */
12640  function sync(minutes) {
12641    syncGlobal(minutes);
12642    syncPlaylist(minutes);
12643    syncSong(minutes);
12644    syncSongInPlaylist(minutes);
12645  }
12646
12647  /**
12648   * Syncs the global current minutes elements.
12649   *
12650   * @param {Integer} minutes - The current audio minutes.
12651   */
12652  function syncGlobal(minutes) {
12653    /*
12654    Get all of the minute selectors
12655    */
12656    var currentMinuteSelectors = document.querySelectorAll(".amplitude-current-minutes");
12657
12658    /*
12659    Set the current minute selector's inner html to minutes passed in.
12660    */
12661    for (var i = 0; i < currentMinuteSelectors.length; i++) {
12662      var playlist = currentMinuteSelectors[i].getAttribute("data-amplitude-playlist");
12663      var songIndex = currentMinuteSelectors[i].getAttribute("data-amplitude-song-index");
12664
12665      /*
12666        Updates the current minute selector for a global display.
12667      */
12668      if (playlist == null && songIndex == null) {
12669        currentMinuteSelectors[i].innerHTML = minutes;
12670      }
12671    }
12672  }
12673
12674  /**
12675   * Syncs the playlist minutes elements.
12676   *
12677   * @param {Integer} minutes - The current audio minutes.
12678   */
12679  function syncPlaylist(minutes) {
12680    /*
12681    Get all of the minute selectors
12682    */
12683    var currentMinutePlaylistSelectors = document.querySelectorAll('.amplitude-current-minutes[data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
12684
12685    /*
12686    Set the current minute selector's inner html to minutes passed in.
12687    */
12688    for (var i = 0; i < currentMinutePlaylistSelectors.length; i++) {
12689      var songIndex = currentMinutePlaylistSelectors[i].getAttribute("data-amplitude-song-index");
12690
12691      /*
12692        Updates the current minute selector for a global display.
12693      */
12694      if (songIndex == null) {
12695        currentMinutePlaylistSelectors[i].innerHTML = minutes;
12696      }
12697    }
12698  }
12699
12700  /**
12701   * Syncs the current song minutes elements.
12702   *
12703   * @param {Integer} minutes - The current audio minutes.
12704   */
12705  function syncSong(minutes) {
12706    if (_config2.default.active_playlist == null) {
12707      /*
12708      Get all of the minute selectors
12709      */
12710      var currentMinuteSongSelectors = document.querySelectorAll('.amplitude-current-minutes[data-amplitude-song-index="' + _config2.default.active_index + '"]');
12711
12712      /*
12713      Set the current minute selector's inner html to minutes passed in.
12714      */
12715      for (var i = 0; i < currentMinuteSongSelectors.length; i++) {
12716        var playlist = currentMinuteSongSelectors[i].getAttribute("data-amplitude-playlist");
12717
12718        /*
12719          Updates the current minute selector for a global display.
12720        */
12721        if (playlist == null) {
12722          currentMinuteSongSelectors[i].innerHTML = minutes;
12723        }
12724      }
12725    }
12726  }
12727
12728  /**
12729   * Syncs the current song in playlist minutes elements.
12730   *
12731   * @param {Integer} minutes - The current audio minutes.
12732   */
12733  function syncSongInPlaylist(minutes) {
12734    var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null;
12735
12736    /*
12737    Get all of the minute selectors
12738    */
12739    var currentMinutePlaylistSongSelectors = document.querySelectorAll('.amplitude-current-minutes[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]');
12740
12741    /*
12742    Set the current minute selector's inner html to minutes passed in.
12743    */
12744    for (var i = 0; i < currentMinutePlaylistSongSelectors.length; i++) {
12745      currentMinutePlaylistSongSelectors[i].innerHTML = minutes;
12746    }
12747  }
12748
12749  /**
12750   * Reset the current times.
12751   */
12752  function resetTimes() {
12753    /*
12754      Gets the minute display elements
12755    */
12756    var minuteSelectors = document.querySelectorAll(".amplitude-current-minutes");
12757
12758    /*
12759      Iterates over all of the minute selectors and sets the inner HTML
12760      to 00.
12761    */
12762    for (var i = 0; i < minuteSelectors.length; i++) {
12763      minuteSelectors[i].innerHTML = "00";
12764    }
12765  }
12766
12767  /**
12768   * Returns the publically facing methods.
12769   */
12770  return {
12771    sync: sync,
12772    resetTimes: resetTimes
12773  };
12774}(); /**
12775      * Imports the config module
12776      * @module config
12777      */
12778exports.default = CurrentMinuteElements;
12779module.exports = exports["default"];
12780
12781/***/ }),
12782/* 52 */
12783/***/ (function(module, exports, __webpack_require__) {
12784
12785"use strict";
12786
12787
12788Object.defineProperty(exports, "__esModule", {
12789  value: true
12790});
12791
12792var _config = __webpack_require__(0);
12793
12794var _config2 = _interopRequireDefault(_config);
12795
12796function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12797
12798/**
12799 * Handles all of the current time seconds elements.
12800 *
12801 * @module visual/time/CurrentSecondElements
12802 */
12803var CurrentSecondElements = function () {
12804  /**
12805   * Syncs the current seconds elements.
12806   *
12807   * @param {Integer} seconds - The current audio seconds.
12808   */
12809  function sync(seconds) {
12810    syncGlobal(seconds);
12811    syncPlaylist(seconds);
12812    syncSong(seconds);
12813    syncSongInPlaylist(seconds);
12814  }
12815
12816  /**
12817   * Syncs the global current seconds elements.
12818   *
12819   * @param {Integer} seconds - The current audio seconds.
12820   */
12821  function syncGlobal(seconds) {
12822    /*
12823    Get all of the second selectors
12824    */
12825    var currentSecondSelectors = document.querySelectorAll(".amplitude-current-seconds");
12826
12827    /*
12828    Set the current second selector's inner html to seconds passed in.
12829    */
12830    for (var i = 0; i < currentSecondSelectors.length; i++) {
12831      var playlist = currentSecondSelectors[i].getAttribute("data-amplitude-playlist");
12832      var songIndex = currentSecondSelectors[i].getAttribute("data-amplitude-song-index");
12833
12834      /*
12835        Updates the current second selector for a global display.
12836      */
12837      if (playlist == null && songIndex == null) {
12838        currentSecondSelectors[i].innerHTML = seconds;
12839      }
12840    }
12841  }
12842
12843  /**
12844   * Syncs the playlist seconds elements.
12845   *
12846   * @param {Integer} seconds - The current audio seconds.
12847   */
12848  function syncPlaylist(seconds) {
12849    /*
12850    Get all of the second selectors
12851    */
12852    var currentSecondPlaylistSelectors = document.querySelectorAll('.amplitude-current-seconds[data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
12853
12854    /*
12855    Set the current second selector's inner html to seconds passed in.
12856    */
12857    for (var i = 0; i < currentSecondPlaylistSelectors.length; i++) {
12858      var songIndex = currentSecondPlaylistSelectors[i].getAttribute("data-amplitude-song-index");
12859
12860      /*
12861        Updates the current second selector for a global display.
12862      */
12863      if (songIndex == null) {
12864        currentSecondPlaylistSelectors[i].innerHTML = seconds;
12865      }
12866    }
12867  }
12868
12869  /**
12870   * Syncs the current song seconds elements.
12871   *
12872   * @param {Integer} seconds - The current audio seconds.
12873   */
12874  function syncSong(seconds) {
12875    if (_config2.default.active_playlist == null) {
12876      /*
12877      Get all of the second selectors
12878      */
12879      var currentSecondSongSelectors = document.querySelectorAll('.amplitude-current-seconds[data-amplitude-song-index="' + _config2.default.active_index + '"]');
12880
12881      /*
12882      Set the current second selector's inner html to seconds passed in.
12883      */
12884      for (var i = 0; i < currentSecondSongSelectors.length; i++) {
12885        var playlist = currentSecondSongSelectors[i].getAttribute("data-amplitude-playlist");
12886
12887        /*
12888          Updates the current second selector for a global display.
12889        */
12890        if (playlist == null) {
12891          currentSecondSongSelectors[i].innerHTML = seconds;
12892        }
12893      }
12894    }
12895  }
12896
12897  /**
12898   * Syncs the current song in playlist seconds elements.
12899   *
12900   * @param {Integer} seconds - The current audio seconds.
12901   */
12902  function syncSongInPlaylist(seconds) {
12903    var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null;
12904    /*
12905    Get all of the second selectors
12906    */
12907    var currentSecondPlaylistSongSelectors = document.querySelectorAll('.amplitude-current-seconds[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]');
12908
12909    /*
12910    Set the current second selector's inner html to seconds passed in.
12911    */
12912    for (var i = 0; i < currentSecondPlaylistSongSelectors.length; i++) {
12913      currentSecondPlaylistSongSelectors[i].innerHTML = seconds;
12914    }
12915  }
12916
12917  /**
12918   * Reset the current seconds elements.
12919   */
12920  function resetTimes() {
12921    /*
12922      Gets the second display elements
12923    */
12924    var secondSelectors = document.querySelectorAll(".amplitude-current-seconds");
12925
12926    /*
12927      Iterates over all of the second selectors and sets the inner HTML
12928      to 00.
12929    */
12930    for (var i = 0; i < secondSelectors.length; i++) {
12931      secondSelectors[i].innerHTML = "00";
12932    }
12933  }
12934
12935  /**
12936   * Returns the publically facing methods.
12937   */
12938  return {
12939    sync: sync,
12940    resetTimes: resetTimes
12941  };
12942}(); /**
12943      * Imports the config module
12944      * @module config
12945      */
12946exports.default = CurrentSecondElements;
12947module.exports = exports["default"];
12948
12949/***/ }),
12950/* 53 */
12951/***/ (function(module, exports, __webpack_require__) {
12952
12953"use strict";
12954
12955
12956Object.defineProperty(exports, "__esModule", {
12957  value: true
12958});
12959
12960var _config = __webpack_require__(0);
12961
12962var _config2 = _interopRequireDefault(_config);
12963
12964function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12965
12966/**
12967 * These methods help sync visual time elements.
12968 *
12969 * @module visual/CurrentTimeElements
12970 */
12971var CurrentTimeElements = function () {
12972  /**
12973   * Visually displays the current time on the screen. This is called on
12974   * time update for the current song.
12975   *
12976   * @access public
12977   * @param {object} currentTime 					- An object containing the current time for the song in seconds, minutes, and hours.
12978   */
12979  function sync(currentTime) {
12980    /*
12981    Set current time display.
12982    */
12983    syncGlobal(currentTime);
12984    syncPlaylist(currentTime);
12985    syncSong(currentTime);
12986    syncSongInPlaylist(currentTime);
12987  }
12988
12989  /**
12990   * Updates any elements that display the current time for the song. This
12991   * is a computed field that will be commonly used.
12992   *
12993   * @access public
12994   * @param {object} time 	- A json object conaining the parts for the current time for the song.
12995   */
12996  function syncGlobal(time) {
12997    /*
12998    Get all of the time selectors.
12999    */
13000    var currentTimeSelectors = document.querySelectorAll(".amplitude-current-time");
13001
13002    /*
13003    Set the time selector's inner html to the current time for the song. The current
13004    time is computed by joining minutes and seconds.
13005    */
13006    var timeText = time.minutes + ":" + time.seconds;
13007
13008    if (time.hours > 0) {
13009      timeText = time.hours + ":" + timeText;
13010    }
13011
13012    for (var i = 0; i < currentTimeSelectors.length; i++) {
13013      var playlist = currentTimeSelectors[i].getAttribute("data-amplitude-playlist");
13014      var songIndex = currentTimeSelectors[i].getAttribute("data-amplitude-song-index");
13015
13016      if (playlist == null && songIndex == null) {
13017        currentTimeSelectors[i].innerHTML = timeText;
13018      }
13019    }
13020  }
13021
13022  /**
13023   * Updates any elements that display the current time for the song. This
13024   * is a computed field that will be commonly used.
13025   *
13026   * @access public
13027   * @param {object} time 	- A json object conaining the parts for the current time for the song.
13028   */
13029  function syncPlaylist(time) {
13030    /*
13031    Get all of the time selectors.
13032    */
13033    var currentTimeSelectors = document.querySelectorAll('.amplitude-current-time[data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
13034
13035    /*
13036    Set the time selector's inner html to the current time for the song. The current
13037    time is computed by joining minutes and seconds.
13038    */
13039    var timeText = time.minutes + ":" + time.seconds;
13040
13041    if (time.hours > 0) {
13042      timeText = time.hours + ":" + timeText;
13043    }
13044
13045    for (var i = 0; i < currentTimeSelectors.length; i++) {
13046      var songIndex = currentTimeSelectors[i].getAttribute("data-amplitude-song-index");
13047
13048      if (songIndex == null) {
13049        currentTimeSelectors[i].innerHTML = timeText;
13050      }
13051    }
13052  }
13053
13054  /**
13055   * Updates any elements that display the current time for the song. This
13056   * is a computed field that will be commonly used.
13057   *
13058   * @access public
13059   * @param {object} time 	- A json object conaining the parts for the current time for the song.
13060   */
13061  function syncSong(time) {
13062    if (_config2.default.active_playlist == null) {
13063      /*
13064      Get all of the time selectors.
13065      */
13066      var currentTimeSelectors = document.querySelectorAll('.amplitude-current-time[data-amplitude-song-index="' + _config2.default.active_index + '"]');
13067
13068      /*
13069      Set the time selector's inner html to the current time for the song. The current
13070      time is computed by joining minutes and seconds.
13071      */
13072      var timeText = time.minutes + ":" + time.seconds;
13073
13074      if (time.hours > 0) {
13075        timeText = time.hours + ":" + timeText;
13076      }
13077
13078      for (var i = 0; i < currentTimeSelectors.length; i++) {
13079        var playlist = currentTimeSelectors[i].getAttribute("data-amplitude-playlist");
13080
13081        if (playlist == null) {
13082          currentTimeSelectors[i].innerHTML = timeText;
13083        }
13084      }
13085    }
13086  }
13087
13088  /**
13089   * Updates any elements that display the current time for the song. This
13090   * is a computed field that will be commonly used.
13091   *
13092   * @access public
13093   * @param {object} time 	- A json object conaining the parts for the current time for the song.
13094   */
13095  function syncSongInPlaylist(time) {
13096    var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null;
13097    /*
13098    Get all of the time selectors.
13099    */
13100    var currentTimeSelectors = document.querySelectorAll('.amplitude-current-time[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]');
13101
13102    /*
13103    Set the time selector's inner html to the current time for the song. The current
13104    time is computed by joining minutes and seconds.
13105    */
13106    var timeText = time.minutes + ":" + time.seconds;
13107
13108    if (time.hours > 0) {
13109      timeText = time.hours + ":" + timeText;
13110    }
13111
13112    for (var i = 0; i < currentTimeSelectors.length; i++) {
13113      currentTimeSelectors[i].innerHTML = timeText;
13114    }
13115  }
13116
13117  /**
13118   * Resets the current time displays to 00:00
13119   *
13120   * @access public
13121   */
13122  function resetTimes() {
13123    /*
13124    Gets the time selector display elements
13125    */
13126    var timeSelectors = document.querySelectorAll(".amplitude-current-time");
13127
13128    /*
13129    Iterates over all of the time selectors and sets the inner HTML
13130    to 00.
13131    */
13132    for (var i = 0; i < timeSelectors.length; i++) {
13133      timeSelectors[i].innerHTML = "00:00";
13134    }
13135  }
13136
13137  /**
13138   * Returns the publically facing methods
13139   */
13140  return {
13141    sync: sync,
13142    resetTimes: resetTimes
13143  };
13144}(); /**
13145      * Imports the config module
13146      * @module config
13147      */
13148exports.default = CurrentTimeElements;
13149module.exports = exports["default"];
13150
13151/***/ }),
13152/* 54 */
13153/***/ (function(module, exports, __webpack_require__) {
13154
13155"use strict";
13156
13157
13158Object.defineProperty(exports, "__esModule", {
13159  value: true
13160});
13161
13162var _config = __webpack_require__(0);
13163
13164var _config2 = _interopRequireDefault(_config);
13165
13166function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13167
13168/**
13169 * Handles all of the duration countdown elements.
13170 *
13171 * @module visual/time/DurationCountDownTimeElements.
13172 */
13173var DurationCountDownTimeElements = function () {
13174  /**
13175   * Syncs all of the countdown time elements.
13176   *
13177   * @param {object} countDownTime - The current time of the audio.
13178   * @param {object} songDuration - The song duration of the audio.
13179   */
13180  function sync(countDownTime, songDuration) {
13181    var timeRemaining = computeTimeRemaining(countDownTime, songDuration);
13182
13183    syncGlobal(timeRemaining);
13184    syncPlaylist(timeRemaining);
13185    syncSong(timeRemaining);
13186    syncSongInPlaylist(timeRemaining);
13187  }
13188
13189  /**
13190   * Syncs the global count down time elements.
13191   *
13192   * @param {string} timeRemaining - The time remaining for the audio.
13193   */
13194  function syncGlobal(timeRemaining) {
13195    var durationTimeRemainingSelectors = document.querySelectorAll(".amplitude-time-remaining");
13196
13197    for (var i = 0; i < durationTimeRemainingSelectors.length; i++) {
13198      var playlist = durationTimeRemainingSelectors[i].getAttribute("data-amplitude-playlist");
13199      var songIndex = durationTimeRemainingSelectors[i].getAttribute("data-amplitude-song-index");
13200
13201      if (playlist == null && songIndex == null) {
13202        durationTimeRemainingSelectors[i].innerHTML = timeRemaining;
13203      }
13204    }
13205  }
13206
13207  /**
13208   * Syncs the playlist count down time elements.
13209   *
13210   * @param {string} timeRemaining - The time remaining for the audio.
13211   */
13212  function syncPlaylist(timeRemaining) {
13213    var durationTimeRemainingSelectors = document.querySelectorAll('.amplitude-time-remaining[data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
13214
13215    for (var i = 0; i < durationTimeRemainingSelectors.length; i++) {
13216      var songIndex = durationTimeRemainingSelectors[i].getAttribute("data-amplitude-song-index");
13217
13218      if (songIndex == null) {
13219        durationTimeRemainingSelectors[i].innerHTML = timeRemaining;
13220      }
13221    }
13222  }
13223
13224  /**
13225   * Syncs the song count down time elements.
13226   *
13227   * @param {string} timeRemaining - The time remaining for the audio.
13228   */
13229  function syncSong(timeRemaining) {
13230    if (_config2.default.active_playlist == null) {
13231      var durationTimeRemainingSelectors = document.querySelectorAll('.amplitude-time-remaining[data-amplitude-song-index="' + _config2.default.active_index + '"]');
13232
13233      for (var i = 0; i < durationTimeRemainingSelectors.length; i++) {
13234        var playlist = durationTimeRemainingSelectors[i].getAttribute("data-amplitude-playlist");
13235
13236        if (playlist == null) {
13237          durationTimeRemainingSelectors[i].innerHTML = timeRemaining;
13238        }
13239      }
13240    }
13241  }
13242
13243  /**
13244   * Syncs the song in playlist count down time elements.
13245   *
13246   * @param {string} timeRemaining - The time remaining for the audio.
13247   */
13248  function syncSongInPlaylist(timeRemaining) {
13249    var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null;
13250
13251    var durationTimeRemainingSelectors = document.querySelectorAll('.amplitude-time-remaining[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]');
13252
13253    for (var i = 0; i < durationTimeRemainingSelectors.length; i++) {
13254      durationTimeRemainingSelectors[i].innerHTML = timeRemaining;
13255    }
13256  }
13257
13258  /**
13259   * Resets the count down times.
13260   */
13261  function resetTimes() {
13262    var durationTimeRemainingSelectors = document.querySelectorAll(".amplitude-time-remaining");
13263
13264    for (var i = 0; i < durationTimeRemainingSelectors.length; i++) {
13265      durationTimeRemainingSelectors[i].innerHTML = "00";
13266    }
13267  }
13268
13269  /**
13270   * Computes the time remaining for the audio.
13271   *
13272   * @param {object} currentTime - The current time of the audio.
13273   * @param {object} songDuration - The duration of the audio.
13274   */
13275  function computeTimeRemaining(currentTime, songDuration) {
13276    var timeRemaining = "00:00";
13277
13278    /*
13279      Initialize the total current seconds and total duration seconds
13280    */
13281    var totalCurrentSeconds = parseInt(currentTime.seconds) + parseInt(currentTime.minutes) * 60 + parseInt(currentTime.hours) * 60 * 60;
13282    var totalDurationSeconds = parseInt(songDuration.seconds) + parseInt(songDuration.minutes) * 60 + parseInt(songDuration.hours) * 60 * 60;
13283
13284    /*
13285      If the two variables are numbers we continue the computing.
13286    */
13287    if (!isNaN(totalCurrentSeconds) && !isNaN(totalDurationSeconds)) {
13288      /*
13289        Find the total remaining seconds.
13290      */
13291      var timeRemainingTotalSeconds = totalDurationSeconds - totalCurrentSeconds;
13292
13293      var remainingHours = Math.floor(timeRemainingTotalSeconds / 3600);
13294      var remainingMinutes = Math.floor((timeRemainingTotalSeconds - remainingHours * 3600) / 60);
13295      var remainingSeconds = timeRemainingTotalSeconds - remainingHours * 3600 - remainingMinutes * 60;
13296
13297      timeRemaining = (remainingMinutes < 10 ? "0" + remainingMinutes : remainingMinutes) + ":" + (remainingSeconds < 10 ? "0" + remainingSeconds : remainingSeconds);
13298
13299      if (remainingHours > 0) {
13300        timeRemaining = remainingHours + ":" + timeRemaining;
13301      }
13302    }
13303
13304    return timeRemaining;
13305  }
13306
13307  /**
13308   * Returns the publically facing methods.
13309   */
13310  return {
13311    sync: sync,
13312    resetTimes: resetTimes
13313  };
13314}(); /**
13315      * Imports the config module
13316      * @module config
13317      */
13318exports.default = DurationCountDownTimeElements;
13319module.exports = exports["default"];
13320
13321/***/ }),
13322/* 55 */
13323/***/ (function(module, exports, __webpack_require__) {
13324
13325"use strict";
13326
13327
13328Object.defineProperty(exports, "__esModule", {
13329  value: true
13330});
13331
13332var _config = __webpack_require__(0);
13333
13334var _config2 = _interopRequireDefault(_config);
13335
13336function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13337
13338/**
13339 * Handles all of the duration hours elements.
13340 *
13341 * @module visual/time/DurationHourElements.
13342 */
13343var DurationHourElements = function () {
13344  /**
13345   * Sync the duration hours elements.
13346   *
13347   * @param {Integer} hours - The duration hours for the audio.
13348   */
13349  function sync(hours) {
13350    syncGlobal(hours);
13351    syncPlaylist(hours);
13352    syncSong(hours);
13353    syncSongInPlaylist(hours);
13354  }
13355
13356  /**
13357   * Syncs the global duration hours elements.
13358   *
13359   * @param {Integer} hours - the duration hours for the audio.
13360   */
13361  function syncGlobal(hours) {
13362    var durationHourSelectors = document.querySelectorAll(".amplitude-duration-hours");
13363
13364    for (var i = 0; i < durationHourSelectors.length; i++) {
13365      var playlist = durationHourSelectors[i].getAttribute("data-amplitude-playlist");
13366      var songIndex = durationHourSelectors[i].getAttribute("data-amplitude-song-index");
13367
13368      if (playlist == null && songIndex == null) {
13369        durationHourSelectors[i].innerHTML = hours;
13370      }
13371    }
13372  }
13373
13374  /**
13375   * Syncs the playlist duration hours for the audio.
13376   *
13377   * @param {Integer} hours - The duration hours for the audio.
13378   */
13379  function syncPlaylist(hours) {
13380    var durationHourSelectors = document.querySelectorAll('.amplitude-duration-hours[data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
13381
13382    for (var i = 0; i < durationHourSelectors.length; i++) {
13383      var songIndex = durationHourSelectors[i].getAttribute("data-amplitude-song-index");
13384
13385      if (songIndex == null) {
13386        durationHourSelectors[i].innerHTML = hours;
13387      }
13388    }
13389  }
13390
13391  /**
13392   * Syncs the song duration hours.
13393   *
13394   * @param {Integer} hours - The duration hours for the audio.
13395   */
13396  function syncSong(hours) {
13397    if (_config2.default.active_playlist == null) {
13398      var durationHourSelectors = document.querySelectorAll('.amplitude-duration-hours[data-amplitude-song-index="' + _config2.default.active_index + '"]');
13399
13400      for (var i = 0; i < durationHourSelectors.length; i++) {
13401        var playlist = durationHourSelectors[i].getAttribute("data-amplitude-playlist");
13402
13403        if (playlist == null) {
13404          durationHourSelectors[i].innerHTML = hours;
13405        }
13406      }
13407    }
13408  }
13409
13410  /**
13411   * Syncs the song in playlist duration hours.
13412   *
13413   * @param {Integer} hours - The duration hours of the audio.
13414   */
13415  function syncSongInPlaylist(hours) {
13416    var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null;
13417
13418    var durationHourSelectors = document.querySelectorAll('.amplitude-duration-hours[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]');
13419
13420    for (var i = 0; i < durationHourSelectors.length; i++) {
13421      durationHourSelectors[i].innerHTML = hours;
13422    }
13423  }
13424
13425  /**
13426   * Resets the duration shours elements to '00'
13427   */
13428  function resetTimes() {
13429    var durationHourSelectors = document.querySelectorAll(".amplitude-duration-hours");
13430
13431    for (var i = 0; i < durationHourSelectors.length; i++) {
13432      durationHourSelectors[i].innerHTML = "00";
13433    }
13434  }
13435
13436  /**
13437   * Returns the publically facing methods.
13438   */
13439  return {
13440    sync: sync,
13441    resetTimes: resetTimes
13442  };
13443}(); /**
13444      * Imports the config module
13445      * @module config
13446      */
13447exports.default = DurationHourElements;
13448module.exports = exports["default"];
13449
13450/***/ }),
13451/* 56 */
13452/***/ (function(module, exports, __webpack_require__) {
13453
13454"use strict";
13455
13456
13457Object.defineProperty(exports, "__esModule", {
13458  value: true
13459});
13460
13461var _config = __webpack_require__(0);
13462
13463var _config2 = _interopRequireDefault(_config);
13464
13465function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13466
13467/**
13468 * Handles all of the duration minutes elements.
13469 *
13470 * @module visual/time/DurationMinuteElements.
13471 */
13472var DurationMinuteElements = function () {
13473  /**
13474   * Sync the duration minutes elements.
13475   *
13476   * @param {Integer} minutes - The duration minutes for the audio.
13477   */
13478  function sync(minutes) {
13479    syncGlobal(minutes);
13480    syncPlaylist(minutes);
13481    syncSong(minutes);
13482    syncSongInPlaylist(minutes);
13483  }
13484
13485  /**
13486   * Syncs the global duration minutes elements.
13487   *
13488   * @param {Integer} minutes - the duration minutes for the audio.
13489   */
13490  function syncGlobal(minutes) {
13491    var durationMinuteSelectors = document.querySelectorAll(".amplitude-duration-minutes");
13492
13493    for (var i = 0; i < durationMinuteSelectors.length; i++) {
13494      var playlist = durationMinuteSelectors[i].getAttribute("data-amplitude-playlist");
13495      var songIndex = durationMinuteSelectors[i].getAttribute("data-amplitude-song-index");
13496
13497      if (playlist == null && songIndex == null) {
13498        durationMinuteSelectors[i].innerHTML = minutes;
13499      }
13500    }
13501  }
13502
13503  /**
13504   * Syncs the playlist duration minutes for the audio.
13505   *
13506   * @param {Integer} minutes - The duration minutes for the audio.
13507   */
13508  function syncPlaylist(minutes) {
13509    var durationMinuteSelectors = document.querySelectorAll('.amplitude-duration-minutes[data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
13510
13511    for (var i = 0; i < durationMinuteSelectors.length; i++) {
13512      var songIndex = durationMinuteSelectors[i].getAttribute("data-amplitude-song-index");
13513
13514      if (songIndex == null) {
13515        durationMinuteSelectors[i].innerHTML = minutes;
13516      }
13517    }
13518  }
13519
13520  /**
13521   * Syncs the song duration minutes.
13522   *
13523   * @param {Integer} minutes - The duration minutes for the audio.
13524   */
13525  function syncSong(minutes) {
13526    if (_config2.default.active_playlist == null) {
13527      var durationMinuteSelectors = document.querySelectorAll('.amplitude-duration-minutes[data-amplitude-song-index="' + _config2.default.active_index + '"]');
13528
13529      for (var i = 0; i < durationMinuteSelectors.length; i++) {
13530        var playlist = durationMinuteSelectors[i].getAttribute("data-amplitude-playlist");
13531
13532        if (playlist == null) {
13533          durationMinuteSelectors[i].innerHTML = minutes;
13534        }
13535      }
13536    }
13537  }
13538
13539  /**
13540   * Syncs the song in playlist duration minutes.
13541   *
13542   * @param {Integer} minutes - The duration minutes of the audio.
13543   */
13544  function syncSongInPlaylist(minutes) {
13545    var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null;
13546
13547    var durationMinuteSelectors = document.querySelectorAll('.amplitude-duration-minutes[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]');
13548
13549    for (var i = 0; i < durationMinuteSelectors.length; i++) {
13550      durationMinuteSelectors[i].innerHTML = minutes;
13551    }
13552  }
13553
13554  /**
13555   * Resets the duration minutes elements to '00'
13556   */
13557  function resetTimes() {
13558    var durationMinuteSelectors = document.querySelectorAll(".amplitude-duration-minutes");
13559
13560    for (var i = 0; i < durationMinuteSelectors.length; i++) {
13561      durationMinuteSelectors[i].innerHTML = "00";
13562    }
13563  }
13564
13565  /**
13566   * Returns the publically facing methods.
13567   */
13568  return {
13569    sync: sync,
13570    resetTimes: resetTimes
13571  };
13572}(); /**
13573      * Imports the config module
13574      * @module config
13575      */
13576exports.default = DurationMinuteElements;
13577module.exports = exports["default"];
13578
13579/***/ }),
13580/* 57 */
13581/***/ (function(module, exports, __webpack_require__) {
13582
13583"use strict";
13584
13585
13586Object.defineProperty(exports, "__esModule", {
13587  value: true
13588});
13589
13590var _config = __webpack_require__(0);
13591
13592var _config2 = _interopRequireDefault(_config);
13593
13594function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13595
13596/**
13597 * Handles all of the duration seconds elements.
13598 *
13599 * @module visual/time/DurationSecondElements.
13600 */
13601var DurationSecondElements = function () {
13602  /**
13603   * Sync the duration seconds elements.
13604   *
13605   * @param {Integer} seconds - The duration seconds for the audio.
13606   */
13607  function sync(seconds) {
13608    syncGlobal(seconds);
13609    syncPlaylist(seconds);
13610    syncSong(seconds);
13611    syncSongInPlaylist(seconds);
13612  }
13613
13614  /**
13615   * Syncs the global duration seconds elements.
13616   *
13617   * @param {Integer} seconds - the duration seconds for the audio.
13618   */
13619  function syncGlobal(seconds) {
13620    var durationSecondSelectors = document.querySelectorAll(".amplitude-duration-seconds");
13621
13622    for (var i = 0; i < durationSecondSelectors.length; i++) {
13623      var playlist = durationSecondSelectors[i].getAttribute("data-amplitude-playlist");
13624      var songIndex = durationSecondSelectors[i].getAttribute("data-amplitude-song-index");
13625
13626      if (playlist == null && songIndex == null) {
13627        durationSecondSelectors[i].innerHTML = seconds;
13628      }
13629    }
13630  }
13631
13632  /**
13633   * Syncs the playlist duration seconds for the audio.
13634   *
13635   * @param {Integer} seconds - The duration seconds for the audio.
13636   */
13637  function syncPlaylist(seconds) {
13638    var durationSecondSelectors = document.querySelectorAll('.amplitude-duration-seconds[data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
13639
13640    for (var i = 0; i < durationSecondSelectors.length; i++) {
13641      var songIndex = durationSecondSelectors[i].getAttribute("data-amplitude-song-index");
13642
13643      if (songIndex == null) {
13644        durationSecondSelectors[i].innerHTML = seconds;
13645      }
13646    }
13647  }
13648
13649  /**
13650   * Syncs the song duration seconds.
13651   *
13652   * @param {Integer} seconds - The duration seconds for the audio.
13653   */
13654  function syncSong(seconds) {
13655    if (_config2.default.active_playlist == null) {
13656      var durationSecondSelectors = document.querySelectorAll('.amplitude-duration-seconds[data-amplitude-song-index="' + _config2.default.active_index + '"]');
13657
13658      for (var i = 0; i < durationSecondSelectors.length; i++) {
13659        var playlist = durationSecondSelectors[i].getAttribute("data--amplitude-playlist");
13660
13661        if (playlist == null) {
13662          durationSecondSelectors[i].innerHTML = seconds;
13663        }
13664      }
13665    }
13666  }
13667
13668  /**
13669   * Syncs the song in playlist duration seconds.
13670   *
13671   * @param {Integer} seconds - The duration seconds of the audio.
13672   */
13673  function syncSongInPlaylist(seconds) {
13674    var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null;
13675
13676    var durationSecondSelectors = document.querySelectorAll('.amplitude-duration-seconds[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]');
13677
13678    for (var i = 0; i < durationSecondSelectors.length; i++) {
13679      durationSecondSelectors[i].innerHTML = seconds;
13680    }
13681  }
13682
13683  /**
13684   * Resets the duration seconds elements to '00'
13685   */
13686  function resetTimes() {
13687    var durationSecondSelectors = document.querySelectorAll(".amplitude-duration-seconds");
13688
13689    for (var i = 0; i < durationSecondSelectors.length; i++) {
13690      durationSecondSelectors[i].innerHTML = "00";
13691    }
13692  }
13693
13694  /**
13695   * Returns the publically facing methods.
13696   */
13697  return {
13698    sync: sync,
13699    resetTimes: resetTimes
13700  };
13701}(); /**
13702      * Imports the config module
13703      * @module config
13704      */
13705exports.default = DurationSecondElements;
13706module.exports = exports["default"];
13707
13708/***/ }),
13709/* 58 */
13710/***/ (function(module, exports, __webpack_require__) {
13711
13712"use strict";
13713
13714
13715Object.defineProperty(exports, "__esModule", {
13716  value: true
13717});
13718
13719var _config = __webpack_require__(0);
13720
13721var _config2 = _interopRequireDefault(_config);
13722
13723function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13724
13725/**
13726 * Handles all of the duration time elements.
13727 *
13728 * @module visual/time/DurationTimeElements.
13729 */
13730var DurationTimeElements = function () {
13731  /**
13732   * Syncs the duration time for all elements.
13733   *
13734   * @param {Object} durationTime - The object containing all of the song duration times.
13735   */
13736  function sync(durationTime) {
13737    var durationText = computeDurationText(durationTime);
13738
13739    syncGlobal(durationText);
13740    syncPlaylist(durationText);
13741    syncSong(durationText);
13742    syncSongInPlaylist(durationText);
13743  }
13744
13745  /**
13746   * Sync the global song duration elements.
13747   *
13748   * @param {Object} durationText - The text for the song duration.
13749   */
13750  function syncGlobal(durationText) {
13751    var durationTimeSelectors = document.querySelectorAll(".amplitude-duration-time");
13752
13753    for (var i = 0; i < durationTimeSelectors.length; i++) {
13754      var playlist = durationTimeSelectors[i].getAttribute("data-amplitude-playlist");
13755      var songIndex = durationTimeSelectors[i].getAttribute("data-amplitude-song-index");
13756
13757      if (playlist == null && songIndex == null) {
13758        durationTimeSelectors[i].innerHTML = durationText;
13759      }
13760    }
13761  }
13762
13763  /**
13764   * Sync the playlist duration times.
13765   *
13766   * @param {Object} durationText - The text for the song duration.
13767   */
13768  function syncPlaylist(durationText) {
13769    var durationTimeSelectors = document.querySelectorAll('.amplitude-duration-time[data-amplitude-playlist="' + _config2.default.active_playlist + '"]');
13770
13771    for (var i = 0; i < durationTimeSelectors.length; i++) {
13772      var songIndex = durationTimeSelectors[i].getAttribute("data-amplitude-song-index");
13773
13774      if (songIndex == null) {
13775        durationTimeSelectors[i].innerHTML = durationText;
13776      }
13777    }
13778  }
13779
13780  /**
13781   * Sync the song duration times.
13782   *
13783   * @param {Object} durationText - The text for the song duration.
13784   */
13785  function syncSong(durationText) {
13786    if (_config2.default.active_playlist == null) {
13787      var durationTimeSelectors = document.querySelectorAll('.amplitude-duration-time[data-amplitude-song-index="' + _config2.default.active_index + '"]');
13788
13789      for (var i = 0; i < durationTimeSelectors.length; i++) {
13790        var playlist = durationTimeSelectors[i].getAttribute("data-amplitude-playlist");
13791
13792        if (playlist == null) {
13793          durationTimeSelectors[i].innerHTML = durationText;
13794        }
13795      }
13796    }
13797  }
13798
13799  /**
13800   * Sync the song in playlist duration times.
13801   *
13802   * @param {Object} durationText - An object containing the duration text.
13803   */
13804  function syncSongInPlaylist(durationText) {
13805    var activePlaylistIndex = _config2.default.active_playlist != "" && _config2.default.active_playlist != null ? _config2.default.playlists[_config2.default.active_playlist].active_index : null;
13806
13807    var durationTimeSelectors = document.querySelectorAll('.amplitude-duration-time[data-amplitude-playlist="' + _config2.default.active_playlist + '"][data-amplitude-song-index="' + activePlaylistIndex + '"]');
13808
13809    for (var i = 0; i < durationTimeSelectors.length; i++) {
13810      durationTimeSelectors[i].innerHTML = durationText;
13811    }
13812  }
13813
13814  /**
13815   * Resets all of the duration times to empty.
13816   */
13817  function resetTimes() {
13818    var durationTimeSelectors = document.querySelectorAll(".amplitude-duration-time");
13819
13820    for (var i = 0; i < durationTimeSelectors.length; i++) {
13821      durationTimeSelectors[i].innerHTML = "00:00";
13822    }
13823  }
13824
13825  /**
13826   * Computes the duration text
13827   *
13828   * @param {Object} durationTime - An object containint the duration times.
13829   */
13830  function computeDurationText(durationTime) {
13831    var durationText = "00:00";
13832
13833    if (!isNaN(durationTime.minutes) && !isNaN(durationTime.seconds)) {
13834      durationText = durationTime.minutes + ":" + durationTime.seconds;
13835      if (!isNaN(durationTime.hours) && durationTime.hours > 0) {
13836        durationText = durationTime.hours + ":" + durationText;
13837      }
13838    }
13839
13840    return durationText;
13841  }
13842
13843  /**
13844   * Return publically accessible methods.
13845   */
13846  return {
13847    sync: sync,
13848    resetTimes: resetTimes
13849  };
13850}(); /**
13851      * Imports the config module
13852      * @module config
13853      */
13854exports.default = DurationTimeElements;
13855module.exports = exports["default"];
13856
13857/***/ }),
13858/* 59 */
13859/***/ (function(module, exports) {
13860
13861module.exports = {"name":"amplitudejs","version":"5.
138610.3","description":"A JavaScript library that allows you to control the design of your media controls in your webpage -- not the browser. No dependencies (jQuery not required) https://521dimensions.com/open-source/amplitudejs","main":"dist/amplitude.js","devDependencies":{"babel-core":"^6.26.3","babel-loader":"^7.1.5","babel-plugin-add-module-exports":"0.2.1","babel-polyfill":"^6.26.0","babel-preset-es2015":"^6.18.0","husky":"^1.3.1","jest":"^23.6.0","prettier":"1.15.1","pretty-quick":"^1.11.1","watch":"^1.0.2","webpack":"^2.7.0"},"directories":{"doc":"docs"},"files":["dist"],"funding":{"type":"opencollective","url":"https://opencollective.com/amplitudejs"},"scripts":{"build":"node_modules/.bin/webpack","watch":"watch 'node_modules/.bin/webpack' dist","prettier":"npx pretty-quick","test":"jest"},"repository":{"type":"git","url":"git+https://github.com/521dimensions/amplitudejs.git"},"keywords":["webaudio","html5","javascript","audio-player"],"author":"521 Dimensions (https://521dimensions.com)","license":"MIT","bugs":{"url":"https://github.com/521dimensions/amplitudejs/issues"},"homepage":"https://github.com/521dimensions/amplitudejs#readme"}
13862
13863/***/ })
13864/******/ ]);
13865});
13866//# 
13867
13868document.addEventListener('DOMContentLoaded', function () {
13869  
13870  var amplitude_array_starts = [];
13871  var amplitude_array_ends = [];
13872  
13873  function dfvMp3PlayerAppendEvents(players){
13874    
13875    var amplitude_songs_array = [];
13876    
13877    for (var i = 0; i < players.length; ++i) {
13878      let player = players[i];
13879      amplitude_array_starts[i] = amplitude_array_ends[i] = false;
13880      
13881      amplitude_songs_array[amplitude_songs_array.length] = {
13882                         "name"  : player.dataset.title,
13883                         "artist": 'xxxx',
13884                         "album" : player.dataset.kicker,
13885                         "url"   : player.dataset.src,
13886      };
13887            
13888    }
13889    
13890    // Amplitude.init
13891    Amplitude.init( {
13892                     "songs": amplitude_songs_array,
13893
13894                     "controls" : [
13895
13896                       'play-large', // The large play button in the center
13897                       'rewind', // Rewind by the seek time (default 10 seconds)
13898                       'play', // Play/pause playback
13899                       'fast-forward', // Fast forward by the seek time (default 10 seconds)
13900                       'progress', // The progress bar and scrubber for playback and buffering
13901                       'current-time', // The current time of playback
13902                       'volume', // Volume control
13903                     ],
13904                "callbacks": {
13905                       'play' : function(){
13906                         if(!amplitude_array_starts[ Amplitude.getActiveIndex() ]){
13907                           let player = players[Amplitude.getActiveIndex()];
13908                           console.log('play start:', Amplitude.getActiveIndex(), player.dataset.galabel);
13909                           amplitude_array_starts[ Amplitude.getActiveIndex() ] = true;
13910                           dfv_helper.podcast_ga_events('start', player.dataset.galabel, player.dataset.gacategory);
13911                         }
13912                       },
13913                       'ended': function(){
13914                         if(!ended){
13915                           let player = players[Amplitude.getActiveIndex()];
13916                           console.log('play ended:', Amplitude.getActiveIndex(), player.dataset.galabel);
13917                           amplitude_array_ends[ Amplitude.getActiveIndex() ] = true;
13918                           dfv_helper.podcast_ga_events('complete', player.dataset.galabel, player.dataset.gacategory);
13919                         }
13920                       }
13921                     }
13922    });
13923    
13924    for (var i = 0; i < players.length; ++i) {
13925      let player = players[i];
13926      player.getElementsByClassName('amplitude-song-played-progress')[0].addEventListener('click', function( e ){
13927        //console.log( 'Amplitude.getActiveIndex()', Amplitude.getActiveIndex() ); //, 'currentSongIndex', currentSongIndex );
13928        var offset = this.getBoundingClientRect();
13929        var x = e.pageX - offset.left;
13930        Amplitude.setSongPlayedPercentage( ( parseFloat( x ) / parseFloat( this.offsetWidth) ) * 100 );
13931      });
13932    }
13933  
13934  }
13935
13936  var players = document.querySelectorAll('.dfv_mp3_player');
13937  
13938  dfvMp3PlayerAppendEvents(players);
13939  
13940});
13941/*
13942 this file is kind of hack.
13943 social-buttons at sidebar are distinct from the player in the content.
13944 social-button php reachability has no information if a mp3-player exists in news.
13945 so social-button is hidden on page and if a mp3-player in the main news exists, it is set to visible via js.
13946
13947 click on social-button makes the mp3-player visible.
13948 */
13949
13950document.addEventListener('DOMContentLoaded', function(){
13951  if(document.getElementsByClassName('dfv_mp3_player').length > 0){
13952    function showPlayer(){
13953      //real mp3-player is hidden by default. when social-play-button is clicked, then it appears.
13954      let player           = document.getElementsByClassName('dfv_mp3_player')[0];
13955      player.style.display = 'block';
13956      player.scrollIntoView({behavior: 'smooth'});
13957      let playButton       = player.getElementsByClassName('amplitude-play-pause')[0];
13958      playButton.className = playButton.className.replace(/\bamplitude-paused\b/g, "amplitude-playing");
13959      Amplitude.play();
13960    }
13961
13962    //Socialbuttons
13963    let socialButton = document.getElementsByClassName('mp3player');
13964    if(socialButton.length > 0){
13965      let player = document.getElementsByClassName('dfv_mp3_player')[0];
13966      // lznet15 != lz21
13967      //if (!socialButton[0].className.match(/ButtonSharing/)) {
13968        socialButton[0].style.display = 'flex';
13969      //}
13970      socialButton[0].addEventListener('click', function(e){
13971        showPlayer();
13972      });
13973      /*
13974      var xhr = new XMLHttpRequest();
13975      xhr.open('HEAD', player.dataset.src);
13976      xhr.onload = function() {
13977        if (xhr.status === 200) {
13978          socialButton[0].style.display = 'flex';
13979          socialButton[0].addEventListener('click', function(e){
13980            showPlayer();
13981          });
13982        }
13983      };
13984      xhr.send();
13985      */
13986    }
13987
13988    //Socialbuttons-mobile
13989    let socialButtonMobile = document.getElementsByClassName('dfv_mp3_player-mobile');
13990    if(socialButtonMobile.length > 0){
13991      socialButtonMobile[0].style.display = 'flex';
13992      socialButtonMobile[0].addEventListener('click', function(e){
13993        showPlayer();
13994      });
13995    }
13996
13997  }
13998});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.