// EdgeCommons v1.0.0 +++ Visit edgecommons.org for documentation, updates and examples +++ Copyright (c) 2013 by Simon Widjaja +++ Distributed under the terms of the MIT license (http://www.opensource.org/licenses/mit-license.html) +++ This notice shall be included in all copies or substantial portions of the Software.
// Input 0
(function(a){var d=function(){};d.VERSION="1.0.0";d.soundManifest=null;var e=ModulogLog,b=null;d.getQueue=function(){return b};d.setup=function(c,h,a){try{c?(b=new createjs.LoadQueue,b.installPlugin(createjs.Sound),h&&b.addEventListener("complete",h),a&&b.addEventListener("error",a),b.loadManifest(c)):e.error("Sound.setup() failed: manifest argument is not optional","EdgeCommons | Sound")}catch(d){e.error("Error in setup(): "+d.toString(),"EdgeCommons | Sound",d)}};d.play=function(c){return createjs.Sound.play(c,
createjs.Sound.INTERRUPT_NONE,0,0,0,1,0)};d.stop=function(c){createjs.Sound.stop(c)};a.Sound=d})(EdgeCommons);(function(){var a=this.createjs=this.createjs||{},a=a.PreloadJS=a.PreloadJS||{};a.version="0.3.0";a.buildDate="Tue, 12 Feb 2013 21:12:02 GMT"})();this.createjs=this.createjs||{};
(function(){var a=function(){this.initialize()},d=a.prototype;a.initialize=function(a){a.addEventListener=d.addEventListener;a.removeEventListener=d.removeEventListener;a.removeAllEventListeners=d.removeAllEventListeners;a.hasEventListener=d.hasEventListener;a.dispatchEvent=d.dispatchEvent};d._listeners=null;d.initialize=function(){};d.addEventListener=function(a,b){var c=this._listeners;c?this.removeEventListener(a,b):c=this._listeners={};var h=c[a];h||(h=c[a]=[]);h.push(b);return b};d.removeEventListener=
function(a,b){var c=this._listeners;if(c){var h=c[a];if(h)for(var d=0,f=h.length;d<f;d++)if(h[d]==b){1==f?delete c[a]:h.splice(d,1);break}}};d.removeAllEventListeners=function(a){a?this._listeners&&delete this._listeners[a]:this._listeners=null};d.dispatchEvent=function(a,b){var c=!1,h=this._listeners;if(a&&h){"string"==typeof a&&(a={type:a});a.target=b||this;h=h[a.type];if(!h)return c;for(var h=h.slice(),d=0,f=h.length;d<f;d++){var g=h[d];g instanceof Function?c=c||g.apply(null,[a]):g.handleEvent&&
(c=c||g.handleEvent(a))}}return!!c};d.hasEventListener=function(a){var b=this._listeners;return!(!b||!b[a])};d.toString=function(){return"[EventDispatcher]"};createjs.EventDispatcher=a})();this.createjs=this.createjs||{};
(function(){var a=function(){this.init()};a.prototype={};var d=a.prototype;a.FILE_PATTERN=/(\w+:\/{2})?((?:\w+\.){2}\w+)?(\/?[\S]+\/|\/)?([\w\-%\.]+)(?:\.)(\w+)?(\?\S+)?/i;d.loaded=!1;d.canceled=!1;d.progress=0;d._item=null;d.onProgress=null;d.onLoadStart=null;d.onComplete=null;d.onError=null;d.addEventListener=null;d.removeEventListener=null;d.removeAllEventListeners=null;d.dispatchEvent=null;d.hasEventListener=null;d._listeners=null;createjs.EventDispatcher.initialize(d);d.getItem=function(){return this._item};
d.init=function(){};d.load=function(){};d.close=function(){};d._sendLoadStart=function(){this._isCanceled()||(this.onLoadStart&&this.onLoadStart({target:this}),this.dispatchEvent("loadStart"))};d._sendProgress=function(a){if(!this._isCanceled()){var b=null;if("number"==typeof a)this.progress=a,b={loaded:this.progress,total:1};else if(b=a,this.progress=a.loaded/a.total,isNaN(this.progress)||Infinity==this.progress)this.progress=0;b.target=this;b.type="progress";this.onProgress&&this.onProgress(b);
this.dispatchEvent(b)}};d._sendComplete=function(){this._isCanceled()||(this.onComplete&&this.onComplete({target:this}),this.dispatchEvent("complete"))};d._sendError=function(a){this._isCanceled()||(null==a&&(a={}),a.target=this,a.type="error",this.onError&&this.onError(a),this.dispatchEvent(a))};d._isCanceled=function(){return null==window.createjs||this.canceled?!0:!1};d._parseURI=function(d){return!d?null:d.match(a.FILE_PATTERN)};d.toString=function(){return"[PreloadJS AbstractLoader]"};createjs.AbstractLoader=
a})();this.createjs=this.createjs||{};
(function(){var a=function(b){this.init(b)},d=a.prototype=new createjs.AbstractLoader;a.LOAD_TIMEOUT=8E3;a.BINARY="binary";a.CSS="css";a.IMAGE="image";a.JAVASCRIPT="javascript";a.JSON="json";a.SOUND="sound";a.SVG="svg";a.TEXT="text";a.XML="xml";d.useXHR=!0;d.stopOnError=!1;d.maintainScriptOrder=!0;d.next=null;d.onFileLoad=null;d.onFileProgress=null;d._typeCallbacks=null;d._extensionCallbacks=null;d._loadStartWasDispatched=!1;d._maxConnections=1;d._currentlyLoadingScript=null;d._currentLoads=null;
d._loadQueue=null;d._loadQueueBackup=null;d._loadItemsById=null;d._loadItemsBySrc=null;d._loadedResults=null;d._loadedRawResults=null;d._numItems=0;d._numItemsLoaded=0;d._scriptOrder=null;d._loadedScripts=null;d.init=function(b){this._numItems=this._numItemsLoaded=0;this._loadStartWasDispatched=this._paused=!1;this._currentLoads=[];this._loadQueue=[];this._loadQueueBackup=[];this._scriptOrder=[];this._loadedScripts=[];this._loadItemsById={};this._loadItemsBySrc={};this._loadedResults={};this._loadedRawResults=
{};this._typeCallbacks={};this._extensionCallbacks={};this.setUseXHR(b)};d.setUseXHR=function(b){return this.useXHR=!1!=b&&null!=window.XMLHttpRequest};d.removeAll=function(){this.remove()};d.remove=function(b){var c=null;b&&!(b instanceof Array)?c=[b]:b&&(c=b);b=!1;if(c){for(;c.length;){for(var a=c.pop(),d=this.getResult(a),e=this._loadQueue.length-1;0<=e;e--)if(g=this._loadQueue[e].getItem(),g.id==a||g.src==a){this._loadQueue.splice(e,1)[0].cancel();break}for(e=this._loadQueueBackup.length-1;0<=
e;e--)if(g=this._loadQueueBackup[e].getItem(),g.id==a||g.src==a){this._loadQueueBackup.splice(e,1)[0].cancel();break}if(d)delete this._loadItemsById[d.id],delete this._loadItemsBySrc[d.src],this._disposeItem(d);else for(e=this._currentLoads.length-1;0<=e;e--){var g=this._currentLoads[e].getItem();if(g.id==a||g.src==a){this._currentLoads.splice(e,1)[0].cancel();b=!0;break}}}b&&this._loadNext()}else{this.close();for(a in this._loadItemsById)this._disposeItem(this._loadItemsById[a]);this.initialize(this.useXHR)}};
d.reset=function(){this.close();for(var b in this._loadItemsById)this._disposeItem(this._loadItemsById[b]);b=[];i=0;for(l=this._loadQueueBackup.length;i<l;i++)b.push(this._loadQueueBackup[i].getItem());this.loadManifest(b,!1)};a.isBinary=function(b){switch(b){case createjs.LoadQueue.IMAGE:case createjs.LoadQueue.BINARY:return!0;default:return!1}};d.installPlugin=function(b){if(!(null==b||null==b.getPreloadHandlers)){b=b.getPreloadHandlers();if(null!=b.types)for(var c=0,a=b.types.length;c<a;c++)this._typeCallbacks[b.types[c]]=
b.callback;if(null!=b.extensions){c=0;for(a=b.extensions.length;c<a;c++)this._extensionCallbacks[b.extensions[c]]=b.callback}}};d.setMaxConnections=function(b){this._maxConnections=b;this._paused||this._loadNext()};d.loadFile=function(b,c){null==b?this._sendError({text:"PRELOAD_NO_FILE"}):(this._addItem(b),!1!==c&&this.setPaused(!1))};d.loadManifest=function(b,c){var a=null;if(b instanceof Array){if(0==b.length){this._sendError({text:"PRELOAD_MANIFEST_EMPTY"});return}a=b}else{if(null==b){this._sendError({text:"PRELOAD_MANIFEST_NULL"});
return}a=[b]}for(var d=0,e=a.length;d<e;d++)this._addItem(a[d]);!1!==c&&this.setPaused(!1)};d.load=function(){this.setPaused(!1)};d.getItem=function(b){return this._loadItemsById[b]||this._loadItemsBySrc[b]};d.getResult=function(b,c){var a=this._loadItemsById[b]||this._loadItemsBySrc[b];if(null==a)return null;a=a.id;return c&&this._loadedRawResults[a]?this._loadedRawResults[a]:this._loadedResults[a]};d.setPaused=function(b){(this._paused=b)||this._loadNext()};d.close=function(){for(;this._currentLoads.length;)this._currentLoads.pop().cancel();
this._scriptOrder.length=0;this._loadedScripts.length=0;this.loadStartWasDispatched=!1};d._addItem=function(b){b=this._createLoadItem(b);if(null!=b){var c=this._createLoader(b);null!=c&&(this._loadQueue.push(c),this._loadQueueBackup.push(c),this._numItems++,this._updateProgress(),this.maintainScriptOrder&&b.type==createjs.LoadQueue.JAVASCRIPT&&c instanceof createjs.XHRLoader&&(this._scriptOrder.push(b),this._loadedScripts.push(null)))}};d._createLoadItem=function(b){var c=null;switch(typeof b){case "string":c=
{src:b};break;case "object":c=window.HTMLAudioElement&&b instanceof HTMLAudioElement?{tag:b,src:c.tag.src,type:createjs.LoadQueue.SOUND}:b}b=this._parseURI(c.src);null!=b&&(c.ext=b[5]);null==c.type&&(c.type=this._getTypeByExtension(c.ext));null==c.tag&&(c.tag=this._createTag(c.type));if(null==c.id||""==c.id)c.id=c.src;if(b=this._typeCallbacks[c.type]||this._extensionCallbacks[c.ext]){b=b(c.src,c.type,c.id,c.data);if(!1===b)return null;if(!0!==b&&(null!=b.src&&(c.src=b.src),null!=b.id&&(c.id=b.id),
null!=b.tag&&b.tag.load instanceof Function&&(c.tag=b.tag),null!=b.completeHandler))c.completeHandler=b.completeHandler;b.type&&(c.type=b.type);b=this._parseURI(c.src);null!=b&&(c.ext=b[5])}this._loadItemsById[c.id]=c;return this._loadItemsBySrc[c.src]=c};d._createLoader=function(b){var c=this.useXHR;switch(b.type){case createjs.LoadQueue.JSON:case createjs.LoadQueue.XML:case createjs.LoadQueue.TEXT:c=!0;break;case createjs.LoadQueue.SOUND:c=!1}return c?new createjs.XHRLoader(b):new createjs.TagLoader(b)};
d._loadNext=function(){if(!this._paused){this._loadStartWasDispatched||(this._sendLoadStart(),this._loadStartWasDispatched=!0);this._numItems==this._numItemsLoaded&&(this.loaded=!0,this._sendComplete(),this.next&&this.next.load&&this.next.load());for(var b=0,c=this._loadQueue.length;b<c&&!(this._currentLoads.length>=this._maxConnections);b++){var a=this._loadQueue[b];if(this.maintainScriptOrder&&a instanceof createjs.TagLoader&&a.getItem().type==createjs.LoadQueue.JAVASCRIPT){if(this._currentlyLoadingScript)continue;
this._currentlyLoadingScript=!0}this._loadQueue.splice(b,1);this._loadItem(a);b--;c--}}};d._loadItem=function(b){b.addEventListener("progress",createjs.proxy(this._handleProgress,this));b.addEventListener("complete",createjs.proxy(this._handleFileComplete,this));b.addEventListener("error",createjs.proxy(this._handleFileError,this));this._currentLoads.push(b);b.load()};d._handleFileError=function(b){var c=b.target;this._numItemsLoaded++;this._updateProgress();b={item:c.getItem()};this._sendError(b);
this.stopOnError||(this._removeLoadItem(c),this._loadNext())};d._handleFileComplete=function(b){var b=b.target,c=b.getItem();this._loadedResults[c.id]=b.getResult();b instanceof createjs.XHRLoader&&(this._loadedRawResults[c.id]=b.getResult(!0));this._removeLoadItem(b);if(this.maintainScriptOrder&&c.type==createjs.LoadQueue.JAVASCRIPT)if(b instanceof createjs.TagLoader)this._currentlyLoadingScript=!1;else{this._loadedScripts[this._scriptOrder.indexOf(c)]=c;this._checkScriptLoadOrder(b);return}this._processFinishedLoad(c)};
d._processFinishedLoad=function(b){this._numItemsLoaded++;this._updateProgress();this._sendFileComplete(b);this._loadNext()};d._checkScriptLoadOrder=function(){for(var b=this._loadedScripts.length,c=0;c<b;c++){var a=this._loadedScripts[c];if(null===a)break;!0!==a&&(this._processFinishedLoad(a),this._loadedScripts[c]=!0,c--,b--)}};d._removeLoadItem=function(b){for(var c=this._currentLoads.length,a=0;a<c;a++)if(this._currentLoads[a]==b){this._currentLoads.splice(a,1);break}};d._handleProgress=function(b){b=
b.target;this._sendFileProgress(b.getItem(),b.progress);this._updateProgress()};d._updateProgress=function(){var b=this._numItemsLoaded/this._numItems,c=this._numItems-this._numItemsLoaded;if(0<c){for(var a=0,d=0,e=this._currentLoads.length;d<e;d++)a+=this._currentLoads[d].progress;b+=a/c*(c/this._numItems)}this._sendProgress(b)};d._disposeItem=function(b){delete this._loadedResults[b.id];delete this._loadedRawResults[b.id];delete this._loadItemsById[b.id];delete this._loadItemsBySrc[b.src]};d._createTag=
function(b){var c=null;switch(b){case createjs.LoadQueue.IMAGE:return document.createElement("img");case createjs.LoadQueue.SOUND:return c=document.createElement("audio"),c.autoplay=!1,c;case createjs.LoadQueue.JAVASCRIPT:return c=document.createElement("script"),c.type="text/javascript",c;case createjs.LoadQueue.CSS:return c=this.useXHR?document.createElement("style"):document.createElement("link"),c.rel="stylesheet",c.type="text/css",c;case createjs.LoadQueue.SVG:return this.useXHR?c=document.createElement("svg"):
(c=document.createElement("object"),c.type="image/svg+xml"),c}return null};d._getTypeByExtension=function(b){switch(b){case "jpeg":case "jpg":case "gif":case "png":case "webp":case "bmp":return createjs.LoadQueue.IMAGE;case "ogg":case "mp3":case "wav":return createjs.LoadQueue.SOUND;case "json":return createjs.LoadQueue.JSON;case "xml":return createjs.LoadQueue.XML;case "css":return createjs.LoadQueue.CSS;case "js":return createjs.LoadQueue.JAVASCRIPT;case "svg":return createjs.LoadQueue.SVG;default:return createjs.LoadQueue.TEXT}};
d._sendFileProgress=function(b,c){if(this._isCanceled())this._cleanUp();else{var a={target:this,type:"fileprogress",progress:c,loaded:c,total:1,item:b};this.onFileProgress&&this.onFileProgress(a);this.dispatchEvent(a)}};d._sendFileComplete=function(b){if(!this._isCanceled()){var c={target:this,type:"fileload",item:b,result:this._loadedResults[b.id],rawResult:this._loadedRawResults[b.id]};b.completeHandler&&b.completeHandler(c);this.onFileLoad&&this.onFileLoad(c);this.dispatchEvent(c)}};d.toString=
function(){return"[PreloadJS LoadQueue]"};createjs.proxy=function(b,c){return function(){return b.apply(c,arguments)}};createjs.LoadQueue=a;createjs.proxy||(createjs.proxy=function(b,c){var a=Array.prototype.slice.call(arguments,2);return function(){return b.apply(c,Array.prototype.slice.call(arguments,0).concat(a))}});var e=function(){};e.init=function(){var b=navigator.userAgent;e.isFirefox=b.indexOf("Firefox")>-1;e.isOpera=window.opera!=null;e.isChrome=b.indexOf("Chrome")>-1;e.isIOS=b.indexOf("iPod")>
-1||b.indexOf("iPhone")>-1||b.indexOf("iPad")>-1};e.init();createjs.LoadQueue.BrowserDetect=e;Array.prototype.indexOf||(Array.prototype.indexOf=function(b){if(this==null)throw new TypeError;var c=Object(this),a=c.length>>>0;if(a===0)return-1;var d=0;arguments.length>1&&(d=Number(arguments[1]),d!=d?d=0:d!=0&&d!=Infinity&&d!=-Infinity&&(d=(d>0||-1)*Math.floor(Math.abs(d))));if(d>=a)return-1;for(d=d>=0?d:Math.max(a-Math.abs(d),0);d<a;d++)if(d in c&&c[d]===b)return d;return-1})})();
this.createjs=this.createjs||{};
(function(){var a=function(a){this.init(a)},d=a.prototype=new createjs.AbstractLoader;d._loadTimeout=null;d._tagCompleteProxy=null;d._isAudio=!1;d._tag=null;d.init=function(a){this._item=a;this._tag=a.tag;this._isAudio=window.HTMLAudioElement&&a.tag instanceof HTMLAudioElement;this._tagCompleteProxy=createjs.proxy(this._handleLoad,this)};d.getResult=function(){return this._tag};d.cancel=function(){this.canceled=!0;this._clean();this.getItem()};d.load=function(){var a=this._item,b=this._tag;clearTimeout(this._loadTimeout);
this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),createjs.LoadQueue.LOAD_TIMEOUT);this._isAudio&&(b.src=null,b.preload="auto");b.onerror=createjs.proxy(this._handleError,this);this._isAudio?(b.onstalled=createjs.proxy(this._handleStalled,this),b.addEventListener("canplaythrough",this._tagCompleteProxy,!1)):(b.onload=createjs.proxy(this._handleLoad,this),b.onreadystatechange=createjs.proxy(this._handleReadyStateChange,this));switch(a.type){case createjs.LoadQueue.CSS:b.href=a.src;
break;case createjs.LoadQueue.SVG:b.data=a.src;break;default:b.src=a.src}if(a.type==createjs.LoadQueue.SVG||a.type==createjs.LoadQueue.JAVASCRIPT||a.type==createjs.LoadQueue.CSS)(document.body||document.getElementsByTagName("body")[0]).appendChild(b);null!=b.load&&b.load()};d._handleTimeout=function(){this._clean();this._sendError({reason:"PRELOAD_TIMEOUT"})};d._handleStalled=function(){};d._handleError=function(){this._clean();this._sendError()};d._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);
"loaded"==this.getItem().tag.readyState&&this._handleLoad()};d._handleLoad=function(){if(!this._isCanceled()){var a=this.getItem(),b=a.tag;this.loaded||this.isAudio&&4!==b.readyState||(this.loaded=!0,a.type==createjs.LoadQueue.SVG&&(document.body||document.getElementsByTagName("body")[0]).removeChild(b),this._clean(),this._sendComplete())}};d._clean=function(){clearTimeout(this._loadTimeout);var a=this.getItem().tag;a.onload=null;a.removeEventListener&&a.removeEventListener("canplaythrough",this._tagCompleteProxy,
!1);a.onstalled=null;a.onprogress=null;a.onerror=null;a.parentNode&&a.parentNode.removeChild(a)};d.toString=function(){return"[PreloadJS TagLoader]"};createjs.TagLoader=a})();this.createjs=this.createjs||{};
(function(){var a=function(a){this.init(a)},d=a.prototype=new createjs.AbstractLoader;d._request=null;d._loadTimeout=null;d._xhrLevel=1;d._response=null;d._rawResponse=null;d.init=function(a){this._item=a;this._createXHR(a)};d.getResult=function(a){return a&&this._rawResponse?this._rawResponse:this._response};d.cancel=function(){this.canceled=!0;this._clean();this._request.abort()};d.load=function(){if(null==this._request)this._handleError();else{this._request.onloadstart=createjs.proxy(this._handleLoadStart,
this);this._request.onprogress=createjs.proxy(this._handleProgress,this);this._request.onabort=createjs.proxy(this._handleAbort,this);this._request.onerror=createjs.proxy(this._handleError,this);this._request.ontimeout=createjs.proxy(this._handleTimeout,this);1==this._xhrLevel&&(this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),createjs.LoadQueue.LOAD_TIMEOUT));this._request.onload=createjs.proxy(this._handleLoad,this);this._request.onreadystatechange&&(this._request.onreadystatechange=
this._handleReadyStateChange(this));try{this._request.send()}catch(a){this._sendError({source:a})}}};d._handleProgress=function(a){0<a.loaded&&0==a.total||this._sendProgress({loaded:a.loaded,total:a.total})};d._handleLoadStart=function(){clearTimeout(this._loadTimeout);this._sendLoadStart()};d._handleAbort=function(){this._clean();this._sendError()};d._handleError=function(){this._clean();this._sendError()};d._handleReadyStateChange=function(){4==this._request.readyState&&this._handleLoad()};d._handleLoad=
function(){this.loaded||(this.loaded=!0,this._checkError()?(this._response=this._getResponse(),this._clean(),this._generateTag()&&this._sendComplete()):this._handleError())};d._handleTimeout=function(){this._clean();this._sendError({reason:"PRELOAD_TIMEOUT"})};d._checkError=function(){switch(parseInt(this._request.status)){case 404:case 0:return!1}return!0};d._getResponse=function(){if(null!=this._response)return this._response;if(null!=this._request.response)return this._request.response;try{if(null!=
this._request.responseText)return this._request.responseText}catch(a){}try{if(null!=this._request.responseXML)return this._request.responseXML}catch(b){}return null};d._createXHR=function(a){var b=document.createElement("a");b.href=a.src;var c=document.createElement("a");c.href=location.href;b=""!=b.hostname&&(b.port!=c.port||b.protocol!=c.protocol||b.hostname!=c.hostname);c=null;if(b&&window.XDomainRequest)c=new XDomainRequest;else if(window.XMLHttpRequest)c=new XMLHttpRequest;else try{c=new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(d){try{c=
new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(j){try{c=new ActiveXObject("Msxml2.XMLHTTP")}catch(f){return!1}}}a.type==createjs.LoadQueue.TEXT&&c.overrideMimeType&&c.overrideMimeType("text/plain; charset=x-user-defined");this._xhrLevel="string"===typeof c.responseType?2:1;c.open("GET",a.src,!0);b&&c instanceof XMLHttpRequest&&1==this._xhrLevel&&c.setRequestHeader("Origin",location.origin);createjs.LoadQueue.isBinary(a.type)&&(c.responseType="arraybuffer");this._request=c;return!0};d._clean=function(){clearTimeout(this._loadTimeout);
var a=this._request;a.onloadstart=null;a.onprogress=null;a.onabort=null;a.onerror=null;a.onload=null;a.ontimeout=null;a.onloadend=null;a.onreadystatechange=null};d._generateTag=function(){var a=this._item.tag;switch(this._item.type){case createjs.LoadQueue.IMAGE:return a.onload=createjs.proxy(this._handleTagReady,this),a.src=this._item.src,this._rawResponse=this._response,this._response=a,!1;case createjs.LoadQueue.JAVASCRIPT:a=document.createElement("script");this._rawResponse=a.text=this._response;
this._response=a;break;case createjs.LoadQueue.CSS:document.getElementsByTagName("head")[0].appendChild(a);if(a.styleSheet)a.styleSheet.cssText=this._response;else{var b=document.createTextNode(this._response);a.appendChild(b)}this._rawResponse=this._response;this._response=a;break;case createjs.LoadQueue.XML:this._response=this._parseXML(this._response,"text/xml");break;case createjs.LoadQueue.SVG:b=this._parseXML(this._response,"image/svg+xml");this._rawResponse=this._response;a.appendChild(b.documentElement);
this._response=a;break;case createjs.LoadQueue.JSON:a={};try{a=JSON.parse(this._response)}catch(c){a=null}this._rawResponse=this._response;this._response=a}return!0};d._parseXML=function(a,b){var c=null;window.DOMParser?c=(new DOMParser).parseFromString(a,b):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async=!1,c.loadXML(a));return c};d._handleTagReady=function(){this._sendComplete()};d.toString=function(){return"[PreloadJS XHRLoader]"};createjs.XHRLoader=a})();"object"!==typeof JSON&&(JSON={});
(function(){function a(c){return 10>c?"0"+c:c}function d(a){c.lastIndex=0;return c.test(a)?'"'+a.replace(c,function(c){var a=f[c];return"string"===typeof a?a:"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function e(c,a){var b,f,p,q,r=h,o,m=a[c];m&&"object"===typeof m&&"function"===typeof m.toJSON&&(m=m.toJSON(c));"function"===typeof g&&(m=g.call(a,c,m));switch(typeof m){case "string":return d(m);case "number":return isFinite(m)?""+m:"null";case "boolean":case "null":return""+
m;case "object":if(!m)return"null";h+=j;o=[];if("[object Array]"===Object.prototype.toString.apply(m)){q=m.length;for(b=0;b<q;b+=1)o[b]=e(b,m)||"null";p=0===o.length?"[]":h?"[\n"+h+o.join(",\n"+h)+"\n"+r+"]":"["+o.join(",")+"]";h=r;return p}if(g&&"object"===typeof g){q=g.length;for(b=0;b<q;b+=1)"string"===typeof g[b]&&(f=g[b],(p=e(f,m))&&o.push(d(f)+(h?": ":":")+p))}else for(f in m)Object.prototype.hasOwnProperty.call(m,f)&&(p=e(f,m))&&o.push(d(f)+(h?": ":":")+p);p=0===o.length?"{}":h?"{\n"+h+o.join(",\n"+
h)+"\n"+r+"}":"{"+o.join(",")+"}";h=r;return p}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var b=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
c=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,j,f={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},g;"function"!==typeof JSON.stringify&&(JSON.stringify=function(c,a,b){var d;j=h="";if(typeof b==="number")for(d=0;d<b;d=d+1)j=j+" ";else typeof b==="string"&&(j=b);if((g=a)&&typeof a!=="function"&&(typeof a!=="object"||typeof a.length!=="number"))throw Error("JSON.stringify");return e("",
{"":c})});"function"!==typeof JSON.parse&&(JSON.parse=function(c,a){function d(c,b){var h,j,f=c[b];if(f&&typeof f==="object")for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(j=d(f,h),j!==void 0?f[h]=j:delete f[h]);return a.call(c,b,f)}var h,c=""+c;b.lastIndex=0;b.test(c)&&(c=c.replace(b,function(c){return"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(c.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return h=eval("("+c+")"),typeof a==="function"?d({"":h},""):h;throw new SyntaxError("JSON.parse");})})();this.createjs=this.createjs||{};
(function(){var a=function(){this.initialize()},d=a.prototype;a.initialize=function(a){a.addEventListener=d.addEventListener;a.removeEventListener=d.removeEventListener;a.removeAllEventListeners=d.removeAllEventListeners;a.hasEventListener=d.hasEventListener;a.dispatchEvent=d.dispatchEvent};d._listeners=null;d.initialize=function(){};d.addEventListener=function(a,b){var c=this._listeners;c?this.removeEventListener(a,b):c=this._listeners={};var d=c[a];d||(d=c[a]=[]);d.push(b);return b};d.removeEventListener=
function(a,b){var c=this._listeners;if(c){var d=c[a];if(d)for(var j=0,f=d.length;j<f;j++)if(d[j]==b){1==f?delete c[a]:d.splice(j,1);break}}};d.removeAllEventListeners=function(a){a?this._listeners&&delete this._listeners[a]:this._listeners=null};d.dispatchEvent=function(a,b){var c=!1,d=this._listeners;if(a&&d){"string"==typeof a&&(a={type:a});a.target=b||this;d=d[a.type];if(!d)return c;for(var d=d.slice(),j=0,f=d.length;j<f;j++){var g=d[j];g instanceof Function?c=c||g.apply(null,[a]):g.handleEvent&&
(c=c||g.handleEvent(a))}}return!!c};d.hasEventListener=function(a){var b=this._listeners;return!(!b||!b[a])};d.toString=function(){return"[EventDispatcher]"};createjs.EventDispatcher=a})();this.createjs=this.createjs||{};
(function(){function a(){throw"Sound cannot be instantiated";}function d(c,a){this.init(c,a)}function e(){}a.DELIMITER="|";a.AUDIO_TIMEOUT=8E3;a.INTERRUPT_ANY="any";a.INTERRUPT_EARLY="early";a.INTERRUPT_LATE="late";a.INTERRUPT_NONE="none";a.PLAY_INITED="playInited";a.PLAY_SUCCEEDED="playSucceeded";a.PLAY_INTERRUPTED="playInterrupted";a.PLAY_FINISHED="playFinished";a.PLAY_FAILED="playFailed";a.SUPPORTED_EXTENSIONS="mp3 ogg mpeg wav m4a mp4 aiff wma mid".split(" ");a.EXTENSION_MAP={m4a:"mp4"};a.FILE_PATTERN=
/(\w+:\/{2})?((?:\w+\.){2}\w+)?(\/?[\S]+\/|\/)?([\w\-%\.]+)(?:\.)(\w+)?(\?\S+)?/i;a.defaultInterruptBehavior=a.INTERRUPT_NONE;a.lastId=0;a.activePlugin=null;a.pluginsRegistered=!1;a.masterVolume=1;a.masterMute=!1;a.instances=[];a.idHash={};a.preloadHash={};a.defaultSoundInstance=null;a.addEventListener=null;a.removeEventListener=null;a.removeAllEventListeners=null;a.dispatchEvent=null;a.hasEventListener=null;a._listeners=null;createjs.EventDispatcher.initialize(a);a.onLoadComplete=null;a.sendLoadComplete=
function(c){if(a.preloadHash[c])for(var b=0,d=a.preloadHash[c].length;b<d;b++){var f=a.preloadHash[c][b],f={target:this,type:"loadComplete",src:f.src,id:f.id,data:f.data};a.preloadHash[c][b]=!0;a.onLoadComplete&&a.onLoadComplete(f);a.dispatchEvent(f)}};a.getPreloadHandlers=function(){return{callback:createjs.proxy(a.initLoad,a),types:["sound"],extensions:a.SUPPORTED_EXTENSIONS}};a.registerPlugin=function(c){a.pluginsRegistered=!0;return null==c?!1:c.isSupported()?(a.activePlugin=new c,!0):!1};a.registerPlugins=
function(c){for(var b=0,d=c.length;b<d;b++)if(a.registerPlugin(c[b]))return!0;return!1};a.initializeDefaultPlugins=function(){return null!=a.activePlugin?!0:a.pluginsRegistered?!1:a.registerPlugins([createjs.WebAudioPlugin,createjs.HTMLAudioPlugin])?!0:!1};a.isReady=function(){return null!=a.activePlugin};a.getCapabilities=function(){return null==a.activePlugin?null:a.activePlugin.capabilities};a.getCapability=function(c){return null==a.activePlugin?null:a.activePlugin.capabilities[c]};a.initLoad=
function(c,b,d,f){c=a.registerSound(c,d,f,!1);return null==c?!1:c};a.registerSound=function(c,b,j,f){if(!a.initializeDefaultPlugins())return!1;c instanceof Object&&(c=c.src,b=c.id,j=c.data);var g=a.parsePath(c,"sound",b,j);if(null==g)return!1;null!=b&&(a.idHash[b]=g.src);var e=null;null!=j&&(isNaN(j.channels)?isNaN(j)||(e=parseInt(j)):e=parseInt(j.channels));var k=a.activePlugin.register(g.src,e);null!=k&&(null!=k.numChannels&&(e=k.numChannels),d.create(g.src,e),null==j||!isNaN(j)?j=g.data=e||d.maxPerChannel():
j.channels=g.data.channels=e||d.maxPerChannel(),null!=k.tag?g.tag=k.tag:k.src&&(g.src=k.src),null!=k.completeHandler&&(g.completeHandler=k.completeHandler),g.type=k.type);!1!=f&&(a.preloadHash[g.src]||(a.preloadHash[g.src]=[]),a.preloadHash[g.src].push({src:c,id:b,data:j}),1==a.preloadHash[g.src].length&&a.activePlugin.preload(g.src,k));return g};a.registerManifest=function(c){for(var a=[],b=0,d=c.length;b<d;b++)a[b]=createjs.Sound.registerSound(c[b].src,c[b].id,c[b].data,c[b].preload);return a};
a.loadComplete=function(c){var b=a.parsePath(c,"sound"),c=b?a.getSrcById(b.src):a.getSrcById(c);return!0==a.preloadHash[c][0]};a.parsePath=function(c,b,d,f){"string"!=typeof c&&(c=c.toString());for(var c=c.split(a.DELIMITER),b={type:b||"sound",id:d,data:f},d=a.getCapabilities(),f=0,g=c.length;f<g;f++){var e=c[f],k=e.match(a.FILE_PATTERN);if(null==k)return!1;var s=k[4],k=k[5];if(d[k]&&-1<a.SUPPORTED_EXTENSIONS.indexOf(k))return b.name=s,b.src=e,b.extension=k,b}return null};a.play=function(c,b,d,f,
g,e,k){c=a.createInstance(c);a.playInstance(c,b,d,f,g,e,k)||c.playFailed();return c};a.createInstance=function(c){if(!a.initializeDefaultPlugins())return a.defaultSoundInstance;var b=a.parsePath(c,"sound"),c=b?a.getSrcById(b.src):a.getSrcById(c),b=c.lastIndexOf("."),j=c.slice(b+1);-1!=b&&-1<a.SUPPORTED_EXTENSIONS.indexOf(j)?(d.create(c),c=a.activePlugin.create(c)):c=a.defaultSoundInstance;c.uniqueId=a.lastId++;return c};a.setVolume=function(c){if(null==Number(c))return!1;c=Math.max(0,Math.min(1,c));
a.masterVolume=c;if(!this.activePlugin||!this.activePlugin.setVolume||!this.activePlugin.setVolume(c))for(var b=this.instances,d=0,f=b.length;d<f;d++)b[d].setMasterVolume(c)};a.getVolume=function(){return a.masterVolume};a.mute=function(c){this.masterMute=c;if(!this.activePlugin||!this.activePlugin.setMute||!this.activePlugin.setMute(c))for(var a=this.instances,b=0,d=a.length;b<d;b++)a[b].setMasterMute(c)};a.setMute=function(c){if(null==c||void 0==c)return!1;this.masterMute=c;if(!this.activePlugin||
!this.activePlugin.setMute||!this.activePlugin.setMute(c))for(var a=this.instances,b=0,d=a.length;b<d;b++)a[b].setMasterMute(c);return!0};a.getMute=function(){return this.masterMute};a.stop=function(){for(var c=this.instances,a=c.length;0<a;a--)c[a-1].stop()};a.playInstance=function(c,b,d,f,g,e,k){b=b||a.defaultInterruptBehavior;null==d&&(d=0);null==f&&(f=c.getPosition());null==g&&(g=0);null==e&&(e=c.getVolume());null==k&&(k=c.getPan());if(0==d){if(!a.beginPlaying(c,b,f,g,e,k))return!1}else d=setTimeout(function(){a.beginPlaying(c,
b,f,g,e,k)},d),c.delayTimeoutId=d;this.instances.push(c);return!0};a.beginPlaying=function(c,a,b,f,g,e){return!d.add(c,a)?!1:!c.beginPlaying(b,f,g,e)?(c=this.instances.indexOf(c),-1<c&&this.instances.splice(c,1),!1):!0};a.getSrcById=function(c){return null==a.idHash||null==a.idHash[c]?c:a.idHash[c]};a.playFinished=function(c){d.remove(c);c=this.instances.indexOf(c);-1<c&&this.instances.splice(c,1)};a.proxy=function(c,a){return function(){return c.apply(a,arguments)}};createjs.Sound=a;createjs.proxy=
function(c,a){var b=Array.prototype.slice.call(arguments,2);return function(){return c.apply(a,Array.prototype.slice.call(arguments,0).concat(b))}};d.channels={};d.create=function(c,a){return null==d.get(c)?(d.channels[c]=new d(c,a),!0):!1};d.add=function(a,b){var e=d.get(a.src);return null==e?!1:e.add(a,b)};d.remove=function(a){var b=d.get(a.src);if(null==b)return!1;b.remove(a);return!0};d.maxPerChannel=function(){return b.maxDefault};d.get=function(a){return d.channels[a]};var b=d.prototype={src:null,
max:null,maxDefault:100,length:0,init:function(a,b){this.src=a;this.max=b||this.maxDefault;-1==this.max&&this.max==this.maxDefault;this.instances=[]},get:function(a){return this.instances[a]},add:function(a,b){if(!this.getSlot(b,a))return!1;this.instances.push(a);this.length++;return!0},remove:function(a){a=this.instances.indexOf(a);if(-1==a)return!1;this.instances.splice(a,1);this.length--;return!0},getSlot:function(c){for(var b,d,f=0,e=this.max;f<e;f++){b=this.get(f);if(null==b)return!0;if(!(c==
a.INTERRUPT_NONE&&b.playState!=a.PLAY_FINISHED))if(0==f)d=b;else if(b.playState==a.PLAY_FINISHED||b==a.PLAY_INTERRUPTED||b==a.PLAY_FAILED)d=b;else if(c==a.INTERRUPT_EARLY&&b.getPosition()<d.getPosition()||c==a.INTERRUPT_LATE&&b.getPosition()>d.getPosition())d=b}return null!=d?(d.interrupt(),this.remove(d),!0):!1},toString:function(){return"[Sound SoundChannel]"}};a.defaultSoundInstance=new function(){this.isDefault=!0;this.addEventListener=this.removeEventListener=this.removeAllEventListener=this.dispatchEvent=
this.hasEventListener=this._listeners=this.interrupt=this.playFailed=this.pause=this.resume=this.play=this.beginPlaying=this.cleanUp=this.stop=this.setMasterVolume=this.setVolume=this.mute=this.setMute=this.getMute=this.setPan=this.getPosition=this.setPosition=function(){return!1};this.getVolume=this.getPan=this.getDuration=function(){return 0};this.playState=a.PLAY_FAILED;this.toString=function(){return"[Sound Default Sound Instance]"}};e.init=function(){var a=navigator.userAgent;e.isFirefox=-1<
a.indexOf("Firefox");e.isOpera=null!=window.opera;e.isChrome=-1<a.indexOf("Chrome");e.isIOS=-1<a.indexOf("iPod")||-1<a.indexOf("iPhone")||-1<a.indexOf("iPad");e.isAndroid=-1<a.indexOf("Android");e.isBlackberry=-1<a.indexOf("Blackberry")};e.init();createjs.Sound.BrowserDetect=e})();this.createjs=this.createjs||{};
(function(){function a(){this.init()}function d(a,c){this.init(a,c)}function e(a,c){this.init(a,c)}a.capabilities=null;a.isSupported=function(){if("file:"==location.protocol)return!1;a.generateCapabilities();return null==a.context?!1:!0};a.generateCapabilities=function(){if(null==a.capabilities){var b=document.createElement("audio");if(null==b.canPlayType)return null;if(window.webkitAudioContext)a.context=new webkitAudioContext;else if(window.AudioContext)a.context=new AudioContext;else return null;
a.capabilities={panning:!0,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;e<f;e++){var g=c[e],n=d[g]||g;a.capabilities[g]="no"!=b.canPlayType("audio/"+g)&&""!=b.canPlayType("audio/"+g)||"no"!=b.canPlayType("audio/"+n)&&""!=b.canPlayType("audio/"+n)}2>a.context.destination.numberOfChannels&&(a.capabilities.panning=!1);a.dynamicsCompressorNode=a.context.createDynamicsCompressor();a.dynamicsCompressorNode.connect(a.context.destination);
a.gainNode=a.context.createGainNode();a.gainNode.connect(a.dynamicsCompressorNode)}};a.prototype={capabilities:null,volume:1,context:null,dynamicsCompressorNode:null,gainNode:null,arrayBuffers:null,init:function(){this.capabilities=a.capabilities;this.arrayBuffers={};this.context=a.context;this.gainNode=a.gainNode;this.dynamicsCompressorNode=a.dynamicsCompressorNode},register:function(a){this.arrayBuffers[a]=!0;return{tag:new e(a,this)}},isPreloadStarted:function(a){return null!=this.arrayBuffers[a]},
isPreloadComplete:function(a){return!(null==this.arrayBuffers[a]||!0==this.arrayBuffers[a])},removeFromPreload:function(a){delete this.arrayBuffers[a]},addPreloadResults:function(a,c){this.arrayBuffers[a]=c},handlePreloadComplete:function(){createjs.Sound.sendLoadComplete(this.src)},preload:function(a){this.arrayBuffers[a]=!0;a=new e(a,this);a.onload=this.handlePreloadComplete;a.load()},create:function(a){this.isPreloadStarted(a)||this.preload(a);return new d(a,this)},setVolume:function(a){this.volume=
a;this.updateVolume();return!0},updateVolume:function(){var a=createjs.Sound.masterMute?0:this.volume;a!=this.gainNode.gain.value&&(this.gainNode.gain.value=a)},getVolume:function(){return this.volume},setMute:function(){this.updateVolume();return!0},toString:function(){return"[WebAudioPlugin]"}};createjs.WebAudioPlugin=a;d.prototype={src:null,uniqueId:-1,playState:null,owner:null,offset:0,delay:0,volume:1,pan:0,duration:0,remainingLoops:0,delayTimeoutId:null,soundCompleteTimeout:null,panNode:null,
gainNode:null,sourceNode:null,muted:!1,paused:!1,startTime:0,addEventListener:null,removeEventListener:null,removeAllEventListeners:null,dispatchEvent:null,hasEventListener:null,_listeners:null,endedHandler:null,readyHandler:null,stalledHandler:null,onReady:null,onPlaySucceeded:null,onPlayInterrupted:null,onPlayFailed:null,onComplete:null,onLoop:null,sendEvent:function(a){this.dispatchEvent({target:this,type:a})},init:function(a,c){this.owner=c;this.src=a;this.panNode=this.owner.context.createPanner();
this.gainNode=this.owner.context.createGainNode();this.gainNode.connect(this.panNode);this.owner.isPreloadComplete(this.src)&&(this.duration=1E3*this.owner.arrayBuffers[this.src].duration);this.endedHandler=createjs.proxy(this.handleSoundComplete,this);this.readyHandler=createjs.proxy(this.handleSoundReady,this);this.stalledHandler=createjs.proxy(this.handleSoundStalled,this)},cleanUp:function(){this.sourceNode&&this.sourceNode.playbackState!=this.sourceNode.UNSCHEDULED_STATE&&(this.sourceNode.noteOff(0),
this.sourceNode=null);0!=this.panNode.numberOfOutputs&&this.panNode.disconnect(0);clearTimeout(this.delayTimeoutId);clearTimeout(this.soundCompleteTimeout);null!=window.createjs&&createjs.Sound.playFinished(this)},interrupt:function(){this.playState=createjs.Sound.PLAY_INTERRUPTED;if(this.onPlayInterrupted)this.onPlayInterrupted(this);this.sendEvent("interrupted");this.cleanUp();this.paused=!1},handleSoundStalled:function(){if(null!=this.onPlayFailed)this.onPlayFailed(this);this.sendEvent("failed")},
handleSoundReady:function(){null!=window.createjs&&(this.offset>this.getDuration()?this.playFailed():(0>this.offset&&(this.offset=0),this.playState=createjs.Sound.PLAY_SUCCEEDED,this.paused=!1,this.panNode.connect(this.owner.gainNode),this.sourceNode=this.owner.context.createBufferSource(),this.sourceNode.buffer=this.owner.arrayBuffers[this.src],this.duration=1E3*this.owner.arrayBuffers[this.src].duration,this.sourceNode.connect(this.gainNode),this.soundCompleteTimeout=setTimeout(this.endedHandler,
1E3*(this.sourceNode.buffer.duration-this.offset)),this.startTime=this.owner.context.currentTime-this.offset,this.sourceNode.noteGrainOn(0,this.offset,this.sourceNode.buffer.duration-this.offset)))},play:function(a,c,d,e,f,g){this.cleanUp();createjs.Sound.playInstance(this,a,c,d,e,f,g)},beginPlaying:function(a,c,d,e){if(null!=window.createjs&&this.src){this.offset=a/1E3;this.remainingLoops=c;this.setVolume(d);this.setPan(e);if(this.owner.isPreloadComplete(this.src))return this.handleSoundReady(null),
this.onPlaySucceeded&&this.onPlaySucceeded(this),this.sendEvent("succeeded"),1;this.playFailed()}},pause:function(){return!this.paused&&this.playState==createjs.Sound.PLAY_SUCCEEDED?(this.paused=!0,this.offset=this.owner.context.currentTime-this.startTime,this.sourceNode.noteOff(0),0!=this.panNode.numberOfOutputs&&this.panNode.disconnect(),clearTimeout(this.delayTimeoutId),clearTimeout(this.soundCompleteTimeout),!0):!1},resume:function(){if(!this.paused)return!1;this.handleSoundReady(null);return!0},
stop:function(){this.playState=createjs.Sound.PLAY_FINISHED;this.cleanUp();this.offset=0;return!0},setVolume:function(a){if(null==Number(a))return!1;this.volume=Math.max(0,Math.min(1,a));this.updateVolume();return!0},updateVolume:function(){var a=this.muted?0:this.volume;return a!=this.gainNode.gain.value?(this.gainNode.gain.value=a,!0):!1},getVolume:function(){return this.volume},mute:function(a){this.muted=a;this.updateVolume();return!0},setMute:function(a){if(null==a||void 0==a)return!1;this.muted=
a;this.updateVolume();return!0},getMute:function(){return this.muted},setPan:function(a){if(this.owner.capabilities.panning)this.panNode.setPosition(a,0,-0.5),this.pan=a;else return!1},getPan:function(){return this.pan},getPosition:function(){return 1E3*(this.paused||null==this.sourceNode?this.offset:this.owner.context.currentTime-this.startTime)},setPosition:function(a){this.offset=a/1E3;this.sourceNode&&this.sourceNode.playbackState!=this.sourceNode.UNSCHEDULED_STATE&&(this.sourceNode.noteOff(0),
clearTimeout(this.soundCompleteTimeout));!this.paused&&this.playState==createjs.Sound.PLAY_SUCCEEDED&&this.handleSoundReady(null);return!0},getDuration:function(){return this.duration},handleSoundComplete:function(){this.offset=0;if(0!=this.remainingLoops){this.remainingLoops--;this.handleSoundReady(null);if(null!=this.onLoop)this.onLoop(this);this.sendEvent("loop")}else if(null!=window.createjs){this.playState=createjs.Sound.PLAY_FINISHED;if(null!=this.onComplete)this.onComplete(this);this.sendEvent("complete");
this.cleanUp()}},playFailed:function(){if(null!=window.createjs){this.playState=createjs.Sound.PLAY_FAILED;if(null!=this.onPlayFailed)this.onPlayFailed(this);this.sendEvent("failed");this.cleanUp()}},toString:function(){return"[WebAudioPlugin SoundInstance]"}};createjs.EventDispatcher.initialize(d.prototype);e.prototype={request:null,owner:null,progress:-1,src:null,result:null,onload:null,onprogress:null,onError:null,init:function(a,c){this.src=a;this.owner=c},load:function(a){null!=a&&(this.src=
a);this.request=new XMLHttpRequest;this.request.open("GET",this.src,!0);this.request.responseType="arraybuffer";this.request.onload=createjs.proxy(this.handleLoad,this);this.request.onError=createjs.proxy(this.handleError,this);this.request.onprogress=createjs.proxy(this.handleProgress,this);this.request.send()},handleProgress:function(a,c){this.progress=a/c;if(null!=this.onprogress)this.onprogress({loaded:a,total:c,progress:this.progress})},handleLoad:function(){a.context.decodeAudioData(this.request.response,
createjs.proxy(this.handleAudioDecoded,this),createjs.proxy(this.handleError,this))},handleAudioDecoded:function(a){this.progress=1;this.result=a;this.owner.addPreloadResults(this.src,this.result);this.onload&&this.onload()},handleError:function(a){this.owner.removeFromPreload(this.src);this.onerror&&this.onerror(a)},toString:function(){return"[WebAudioPlugin WebAudioLoader]"}}})();this.createjs=this.createjs||{};
(function(){function a(){this.init()}function d(a,b){this.init(a,b)}function e(a,b){this.init(a,b)}function b(a){this.init(a)}a.MAX_INSTANCES=30;a.capabilities=null;a.AUDIO_READY="canplaythrough";a.AUDIO_ENDED="ended";a.AUDIO_ERROR="error";a.AUDIO_STALLED="stalled";a.isSupported=function(){if(createjs.Sound.BrowserDetect.isIOS)return!1;a.generateCapabilities();return null==a.tag||null==a.capabilities?!1:!0};a.generateCapabilities=function(){if(null==a.capabilities){var c=a.tag=document.createElement("audio");
if(null==c.canPlayType)return null;a.capabilities={panning:!0,volume:!0,tracks:-1};for(var b=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,g=b.length;e<g;e++){var n=b[e],k=d[n]||n;a.capabilities[n]="no"!=c.canPlayType("audio/"+n)&&""!=c.canPlayType("audio/"+n)||"no"!=c.canPlayType("audio/"+k)&&""!=c.canPlayType("audio/"+k)}}};a.prototype={capabilities:null,audioSources:null,defaultNumChannels:2,init:function(){this.capabilities=a.capabilities;this.audioSources={}},register:function(a,
d){this.audioSources[a]=!0;for(var e=b.get(a),f=null,g=d||this.defaultNumChannels,n=0;n<g;n++)f=this.createTag(a),e.add(f);return{tag:f,numChannels:g}},createTag:function(a){var b=document.createElement("audio");b.autoplay=!1;b.preload="none";b.src=a;return b},create:function(a){if(!this.isPreloadStarted(a)){var e=b.get(a),j=this.createTag(a);e.add(j);this.preload(a,{tag:j})}return new d(a,this)},isPreloadStarted:function(a){return null!=this.audioSources[a]},preload:function(a,b){this.audioSources[a]=
!0;new e(a,b.tag)},toString:function(){return"[HTMLAudioPlugin]"}};createjs.HTMLAudioPlugin=a;d.prototype={src:null,uniqueId:-1,playState:null,owner:null,loaded:!1,offset:0,delay:0,volume:1,pan:0,duration:0,remainingLoops:0,delayTimeoutId:null,tag:null,muted:!1,paused:!1,addEventListener:null,removeEventListener:null,removeAllEventListeners:null,dispatchEvent:null,hasEventListener:null,_listeners:null,onComplete:null,onLoop:null,onReady:null,onPlayFailed:null,onPlayInterrupted:null,onPlaySucceeded:null,
endedHandler:null,readyHandler:null,stalledHandler:null,init:function(a,b){this.src=a;this.owner=b;this.endedHandler=createjs.proxy(this.handleSoundComplete,this);this.readyHandler=createjs.proxy(this.handleSoundReady,this);this.stalledHandler=createjs.proxy(this.handleSoundStalled,this)},sendEvent:function(a){this.dispatchEvent({target:this,type:a})},cleanUp:function(){var a=this.tag;if(null!=a){a.pause();try{a.currentTime=0}catch(d){}a.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_ENDED,this.endedHandler,
!1);a.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_READY,this.readyHandler,!1);b.setInstance(this.src,a);this.tag=null}clearTimeout(this.delayTimeoutId);null!=window.createjs&&createjs.Sound.playFinished(this)},interrupt:function(){if(null!=this.tag){this.playState=createjs.Sound.PLAY_INTERRUPTED;if(this.onPlayInterrupted)this.onPlayInterrupted(this);this.sendEvent("interrupted");this.cleanUp();this.paused=!1}},play:function(a,b,d,e,g,n){this.cleanUp();createjs.Sound.playInstance(this,a,b,d,
e,g,n)},beginPlaying:function(a,d,e){if(null==window.createjs)return-1;var f=this.tag=b.getInstance(this.src);if(null==f)return this.playFailed(),-1;this.duration=1E3*this.tag.duration;f.addEventListener(createjs.HTMLAudioPlugin.AUDIO_ENDED,this.endedHandler,!1);this.offset=a;this.volume=e;this.updateVolume();this.remainingLoops=d;4!==f.readyState?(f.addEventListener(createjs.HTMLAudioPlugin.AUDIO_READY,this.readyHandler,!1),f.addEventListener(createjs.HTMLAudioPlugin.AUDIO_STALLED,this.stalledHandler,
!1),f.load()):this.handleSoundReady(null);this.onPlaySucceeded&&this.onPlaySucceeded(this);this.sendEvent("succeeded");return 1},handleSoundStalled:function(){if(null!=this.onPlayFailed)this.onPlayFailed(this);this.sendEvent("failed");this.cleanUp()},handleSoundReady:function(){null!=window.createjs&&(this.playState=createjs.Sound.PLAY_SUCCEEDED,this.paused=!1,this.tag.removeEventListener(createjs.HTMLAudioPlugin.AUDIO_READY,this.readyHandler,!1),this.offset>=this.getDuration()?this.playFailed():
(0<this.offset&&(this.tag.currentTime=0.0010*this.offset),-1==this.remainingLoops&&(this.tag.loop=!0),this.tag.play()))},pause:function(){return!this.paused&&this.playState==createjs.Sound.PLAY_SUCCEEDED&&null!=this.tag?(this.paused=!0,this.tag.pause(),clearTimeout(this.delayTimeoutId),!0):!1},resume:function(){if(!this.paused||null==this.tag)return!1;this.paused=!1;this.tag.play();return!0},stop:function(){this.offset=0;this.pause();this.playState=createjs.Sound.PLAY_FINISHED;this.cleanUp();return!0},
setMasterVolume:function(){this.updateVolume();return!0},setVolume:function(a){if(null==Number(a))return!1;this.volume=Math.max(0,Math.min(1,a));this.updateVolume();return!0},updateVolume:function(){if(null!=this.tag){var a=this.muted||createjs.Sound.masterMute?0:this.volume*createjs.Sound.masterVolume;a!=this.tag.volume&&(this.tag.volume=a);return!0}return!1},getVolume:function(){return this.volume},mute:function(a){this.muted=a;this.updateVolume();return!0},setMasterMute:function(){this.updateVolume();
return!0},setMute:function(a){if(null==a||void 0==a)return!1;this.muted=a;this.updateVolume();return!0},getMute:function(){return this.muted},setPan:function(){return!1},getPan:function(){return 0},getPosition:function(){return null==this.tag?this.offset:1E3*this.tag.currentTime},setPosition:function(a){if(null==this.tag)this.offset=a;else try{this.tag.currentTime=0.0010*a}catch(b){return!1}return!0},getDuration:function(){return this.duration},handleSoundComplete:function(){this.offset=0;if(0!=this.remainingLoops){this.remainingLoops--;
this.tag.play();if(null!=this.onLoop)this.onLoop(this);this.sendEvent("loop")}else if(null!=window.createjs){this.playState=createjs.Sound.PLAY_FINISHED;if(null!=this.onComplete)this.onComplete(this);this.sendEvent("complete");this.cleanUp()}},playFailed:function(){if(null!=window.createjs){this.playState=createjs.Sound.PLAY_FAILED;if(null!=this.onPlayFailed)this.onPlayFailed(this);this.sendEvent("failed");this.cleanUp()}},toString:function(){return"[HTMLAudioPlugin SoundInstance]"}};createjs.EventDispatcher.initialize(d.prototype);
e.prototype={src:null,tag:null,preloadTimer:null,loadedHandler:null,init:function(a,b){this.src=a;this.tag=b;this.preloadTimer=setInterval(createjs.proxy(this.preloadTick,this),200);this.loadedHandler=createjs.proxy(this.sendLoadedEvent,this);this.tag.addEventListener&&this.tag.addEventListener("canplaythrough",this.loadedHandler);this.tag.onreadystatechange=createjs.proxy(this.sendLoadedEvent,this);this.tag.preload="auto";this.tag.src=a;this.tag.load()},preloadTick:function(){var a=this.tag.buffered,
b=this.tag.duration;0<a.length&&a.end(0)>=b-1&&this.handleTagLoaded()},handleTagLoaded:function(){clearInterval(this.preloadTimer)},sendLoadedEvent:function(){this.tag.removeEventListener&&this.tag.removeEventListener("canplaythrough",this.loadedHandler);this.tag.onreadystatechange=null;createjs.Sound.sendLoadComplete(this.src)},toString:function(){return"[HTMLAudioPlugin HTMLAudioLoader]"}};b.tags={};b.get=function(a){var d=b.tags[a];null==d&&(d=b.tags[a]=new b(a));return d};b.getInstance=function(a){a=
b.tags[a];return null==a?null:a.get()};b.setInstance=function(a,d){var e=b.tags[a];return null==e?null:e.set(d)};b.prototype={src:null,length:0,available:0,tags:null,init:function(a){this.src=a;this.tags=[]},add:function(a){this.tags.push(a);this.length++;this.available++},get:function(){if(0==this.tags.length)return null;this.available=this.tags.length;var a=this.tags.pop();null==a.parentNode&&document.body.appendChild(a);return a},set:function(a){-1==this.tags.indexOf(a)&&this.tags.push(a);this.available=
this.tags.length},toString:function(){return"[HTMLAudioPlugin TagPool]"}}})();(function(){var a=this.createjs=this.createjs||{},a=a.SoundJS=a.SoundJS||{};a.version="0.4.0";a.buildDate="Tue, 12 Feb 2013 21:11:51 GMT"})();
