diff --git a/.npmignore b/.npmignore new file mode 100644 index 00000000..41a9ccc6 --- /dev/null +++ b/.npmignore @@ -0,0 +1,14 @@ +_assets +build +bower.json +dev +docs +examples +extras +icon.png +lib/**-NEXT**.js +spikes +src +tests +tutorials +VERSIONS.txt \ No newline at end of file diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..4ca50b6c --- /dev/null +++ b/ISSUE_TEMPLATE.md @@ -0,0 +1,27 @@ +### TODO +- [ ] Is this a question or bug? [Stack Overflow](https://stackoverflow.com/questions/tagged/createjs) is a much better place to ask any questions you may have. + +- [ ] Did you search the [issues](https://github.com/CreateJS/SoundJS/issues) to see if someone else has already reported your issue? If yes, please add more details if you have any! + +- [ ] If you're using an older [version](https://github.com/CreateJS/SoundJS/blob/master/VERSIONS.txt), have you tried the latest? + +- [ ] If you're requesting a new feature; provide as many details as you can. Why do you want this feature? Do you have ideas for how this feature should be implemented? Pseudocode is always welcome! + + +### Issue Details +* Version used (Ex; 1.0): + + +* Describe whats happening (Include any relevant console errors, a [Gist](https://gist.github.com/) is preferred for longer errors): + + + +* OS & Browser version *(Please be specific)* (Ex; Windows 10 Home, Chrome 62.0.3202.94): + + + +* Do you know of any workarounds? + + + +* Provide any extra details that will help us fix your issue. Including a link to a [CodePen.io](https://codepen.io) or [JSFiddle.net](https://jsfiddle.net) example that shows the issue in isolation will greatly increase the chance of getting a quick response. diff --git a/README.md b/README.md index 0eab1ac8..61aa4eb5 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ SoundJS is a library to make working with audio on the web easier. It provides a consistent API for playing audio in different browsers, including using a target plugin model to provide an easy way to provide additional audio plugins -like a Flash fallback. A mechanism has been provided for easily tying in audio preloading to -[PreloadJS](http://createjs.com/preloadjs/). +like a Flash fallback (included, but must be used separately from the combined/minified version). + +A mechanism has been provided for easily tying in audio preloading to [PreloadJS](http://createjs.com/preloadjs/). ## Example diff --git a/VERSIONS.txt b/VERSIONS.txt index 8ea2eb4d..50c59b77 100644 --- a/VERSIONS.txt +++ b/VERSIONS.txt @@ -1,5 +1,30 @@ -Version NEXT [Not yet released] +Version 1.0.0 (September 14, 2017) **************************************************************************************************** +CRITICAL +- removed deprecated properties, particularly getValue/setValue properties, in favour of .value + this particularly affects instance and global properties like mute, volume, pan, etc. +- removed deprecated TYPE duplicates, notably the loader types (LoadQueue.SOUND, AbstractLoader.SOUND) + in place of the Types.SOUND, and request methods (LoadQueue.POST, AbstractLoader.POST) in place + of Methods.POST. +- Deprecated get/set methods are now protect with an underscore (eg _setEnabled) + The deprecated methods and properties will still work, but will display a console warning when used. +- Sound.play is no longer overloaded, and only takes a source and an initialization object + (or PlayPropsConfig) instead of a bunch of arguments. A console warning will be displayed if the + old approach is used, and additional arguments will be ignored. +- Changed version naming to use soundjs.js, instead of containing the version number + +***** +- changed XHR error conditions to only include 400-599. Specifically removed status=0 as an error, + which affects compiled applications. +- fixed issue where values don't get appended to GET requests in XHRRequest +- added "touchstart" as an audio unlocking event, which seems to be the best for iOS +- checked if preload candidates are videos, since SoundJS mistakenly handles these when they are mp4. +- added missing Methods and Types classes from recent PreloadJS changes +- handled case where audio duration returned < 0, resulting in a DOM Error +- fixed issue where new instances wouldn't get the global mute/volume (thanks @PythonFanboy) +- added a shared createjs.deprecate() method, which wraps old methods and property getter/setters to display + a console warning when used. +- fixed an issue with the initial 1.0.0 build that used a deprecated property that was improperly removed Version 0.6.2 [November 26, 2015] diff --git a/_assets/audio/05-Binrpilot-Underground.ogg b/_assets/audio/05-Binrpilot-Underground.ogg new file mode 100644 index 00000000..003e29d8 Binary files /dev/null and b/_assets/audio/05-Binrpilot-Underground.ogg differ diff --git a/_assets/libs/easeljs-NEXT.min.js b/_assets/libs/easeljs-NEXT.min.js index c9eb59c4..39bec8a4 100644 --- a/_assets/libs/easeljs-NEXT.min.js +++ b/_assets/libs/easeljs-NEXT.min.js @@ -9,6 +9,7 @@ * * This notice shall be included in all copies or substantial portions of the Software. */ -this.createjs=this.createjs||{},createjs.extend=function(a,b){"use strict";function c(){this.constructor=a}return c.prototype=b.prototype,a.prototype=new c},this.createjs=this.createjs||{},createjs.promote=function(a,b){"use strict";var c=a.prototype,d=Object.getPrototypeOf&&Object.getPrototypeOf(c)||c.__proto__;if(d){c[(b+="_")+"constructor"]=d.constructor;for(var e in d)c.hasOwnProperty(e)&&"function"==typeof d[e]&&(c[b+e]=d[e])}return a},this.createjs=this.createjs||{},createjs.indexOf=function(a,b){"use strict";for(var c=0,d=a.length;d>c;c++)if(b===a[c])return c;return-1},this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c){this.type=a,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!b,this.cancelable=!!c,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var b=a.prototype;b.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},b.stopPropagation=function(){this.propagationStopped=!0},b.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},b.remove=function(){this.removed=!0},b.clone=function(){return new a(this.type,this.bubbles,this.cancelable)},b.set=function(a){for(var b in a)this[b]=a[b];return this},b.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(){this._listeners=null,this._captureListeners=null}var b=a.prototype;a.initialize=function(a){a.addEventListener=b.addEventListener,a.on=b.on,a.removeEventListener=a.off=b.removeEventListener,a.removeAllEventListeners=b.removeAllEventListeners,a.hasEventListener=b.hasEventListener,a.dispatchEvent=b.dispatchEvent,a._dispatchEvent=b._dispatchEvent,a.willTrigger=b.willTrigger},b.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},b.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},b.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},b.off=b.removeEventListener,b.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},b.dispatchEvent=function(a,b,c){if("string"==typeof a){var d=this._listeners;if(!(b||d&&d[a]))return!0;a=new createjs.Event(a,b,c)}else a.target&&a.clone&&(a=a.clone());try{a.target=this}catch(e){}if(a.bubbles&&this.parent){for(var f=this,g=[f];f.parent;)g.push(f=f.parent);var h,i=g.length;for(h=i-1;h>=0&&!a.propagationStopped;h--)g[h]._dispatchEvent(a,1+(0==h));for(h=1;i>h&&!a.propagationStopped;h++)g[h]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return!a.defaultPrevented},b.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},b.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1},b.toString=function(){return"[EventDispatcher]"},b._dispatchEvent=function(a,b){var c,d=1==b?this._captureListeners:this._listeners;if(a&&d){var e=d[a.type];if(!e||!(c=e.length))return;try{a.currentTarget=this}catch(f){}try{a.eventPhase=b}catch(f){}a.removed=!1,e=e.slice();for(var g=0;c>g&&!a.immediatePropagationStopped;g++){var h=e[g];h.handleEvent?h.handleEvent(a):h(a),a.removed&&(this.off(a.type,h,1==b),a.removed=!1)}}},createjs.EventDispatcher=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(){throw"Ticker cannot be instantiated."}a.RAF_SYNCHED="synched",a.RAF="raf",a.TIMEOUT="timeout",a.useRAF=!1,a.timingMode=null,a.maxDelta=0,a.paused=!1,a.removeEventListener=null,a.removeAllEventListeners=null,a.dispatchEvent=null,a.hasEventListener=null,a._listeners=null,createjs.EventDispatcher.initialize(a),a._addEventListener=a.addEventListener,a.addEventListener=function(){return!a._inited&&a.init(),a._addEventListener.apply(a,arguments)},a._inited=!1,a._startTime=0,a._pausedTime=0,a._ticks=0,a._pausedTicks=0,a._interval=50,a._lastTime=0,a._times=null,a._tickTimes=null,a._timerId=null,a._raf=!0,a.setInterval=function(b){a._interval=b,a._inited&&a._setupTick()},a.getInterval=function(){return a._interval},a.setFPS=function(b){a.setInterval(1e3/b)},a.getFPS=function(){return 1e3/a._interval};try{Object.defineProperties(a,{interval:{get:a.getInterval,set:a.setInterval},framerate:{get:a.getFPS,set:a.setFPS}})}catch(b){console.log(b)}a.init=function(){a._inited||(a._inited=!0,a._times=[],a._tickTimes=[],a._startTime=a._getTime(),a._times.push(a._lastTime=0),a.interval=a._interval)},a.reset=function(){if(a._raf){var b=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame;b&&b(a._timerId)}else clearTimeout(a._timerId);a.removeAllEventListeners("tick"),a._timerId=a._times=a._tickTimes=null,a._startTime=a._lastTime=a._ticks=0,a._inited=!1},a.getMeasuredTickTime=function(b){var c=0,d=a._tickTimes;if(!d||d.length<1)return-1;b=Math.min(d.length,b||0|a.getFPS());for(var e=0;b>e;e++)c+=d[e];return c/b},a.getMeasuredFPS=function(b){var c=a._times;return!c||c.length<2?-1:(b=Math.min(c.length-1,b||0|a.getFPS()),1e3/((c[0]-c[b])/b))},a.setPaused=function(b){a.paused=b},a.getPaused=function(){return a.paused},a.getTime=function(b){return a._startTime?a._getTime()-(b?a._pausedTime:0):-1},a.getEventTime=function(b){return a._startTime?(a._lastTime||a._startTime)-(b?a._pausedTime:0):-1},a.getTicks=function(b){return a._ticks-(b?a._pausedTicks:0)},a._handleSynch=function(){a._timerId=null,a._setupTick(),a._getTime()-a._lastTime>=.97*(a._interval-1)&&a._tick()},a._handleRAF=function(){a._timerId=null,a._setupTick(),a._tick()},a._handleTimeout=function(){a._timerId=null,a._setupTick(),a._tick()},a._setupTick=function(){if(null==a._timerId){var b=a.timingMode||a.useRAF&&a.RAF_SYNCHED;if(b==a.RAF_SYNCHED||b==a.RAF){var c=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(c)return a._timerId=c(b==a.RAF?a._handleRAF:a._handleSynch),void(a._raf=!0)}a._raf=!1,a._timerId=setTimeout(a._handleTimeout,a._interval)}},a._tick=function(){var b=a.paused,c=a._getTime(),d=c-a._lastTime;if(a._lastTime=c,a._ticks++,b&&(a._pausedTicks++,a._pausedTime+=d),a.hasEventListener("tick")){var e=new createjs.Event("tick"),f=a.maxDelta;e.delta=f&&d>f?f:d,e.paused=b,e.time=c,e.runTime=c-a._pausedTime,a.dispatchEvent(e)}for(a._tickTimes.unshift(a._getTime()-c);a._tickTimes.length>100;)a._tickTimes.pop();for(a._times.unshift(c);a._times.length>100;)a._times.pop()};var c=window.performance&&(performance.now||performance.mozNow||performance.msNow||performance.oNow||performance.webkitNow);a._getTime=function(){return(c&&c.call(performance)||(new Date).getTime())-a._startTime},createjs.Ticker=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(){throw"UID cannot be instantiated"}a._nextID=0,a.get=function(){return a._nextID++},createjs.UID=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d,e,f,g,h,i,j,k){this.Event_constructor(a,b,c),this.stageX=d,this.stageY=e,this.rawX=null==i?d:i,this.rawY=null==j?e:j,this.nativeEvent=f,this.pointerID=g,this.primary=!!h,this.relatedTarget=k}var b=createjs.extend(a,createjs.Event);b._get_localX=function(){return this.currentTarget.globalToLocal(this.rawX,this.rawY).x},b._get_localY=function(){return this.currentTarget.globalToLocal(this.rawX,this.rawY).y},b._get_isTouch=function(){return-1!==this.pointerID};try{Object.defineProperties(b,{localX:{get:b._get_localX},localY:{get:b._get_localY},isTouch:{get:b._get_isTouch}})}catch(c){}b.clone=function(){return new a(this.type,this.bubbles,this.cancelable,this.stageX,this.stageY,this.nativeEvent,this.pointerID,this.primary,this.rawX,this.rawY)},b.toString=function(){return"[MouseEvent (type="+this.type+" stageX="+this.stageX+" stageY="+this.stageY+")]"},createjs.MouseEvent=createjs.promote(a,"Event")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d,e,f){this.setValues(a,b,c,d,e,f)}var b=a.prototype;a.DEG_TO_RAD=Math.PI/180,a.identity=null,b.setValues=function(a,b,c,d,e,f){return this.a=null==a?1:a,this.b=b||0,this.c=c||0,this.d=null==d?1:d,this.tx=e||0,this.ty=f||0,this},b.append=function(a,b,c,d,e,f){var g=this.a,h=this.b,i=this.c,j=this.d;return(1!=a||0!=b||0!=c||1!=d)&&(this.a=g*a+i*b,this.b=h*a+j*b,this.c=g*c+i*d,this.d=h*c+j*d),this.tx=g*e+i*f+this.tx,this.ty=h*e+j*f+this.ty,this},b.prepend=function(a,b,c,d,e,f){var g=this.a,h=this.c,i=this.tx;return this.a=a*g+c*this.b,this.b=b*g+d*this.b,this.c=a*h+c*this.d,this.d=b*h+d*this.d,this.tx=a*i+c*this.ty+e,this.ty=b*i+d*this.ty+f,this},b.appendMatrix=function(a){return this.append(a.a,a.b,a.c,a.d,a.tx,a.ty)},b.prependMatrix=function(a){return this.prepend(a.a,a.b,a.c,a.d,a.tx,a.ty)},b.appendTransform=function(b,c,d,e,f,g,h,i,j){if(f%360)var k=f*a.DEG_TO_RAD,l=Math.cos(k),m=Math.sin(k);else l=1,m=0;return g||h?(g*=a.DEG_TO_RAD,h*=a.DEG_TO_RAD,this.append(Math.cos(h),Math.sin(h),-Math.sin(g),Math.cos(g),b,c),this.append(l*d,m*d,-m*e,l*e,0,0)):this.append(l*d,m*d,-m*e,l*e,b,c),(i||j)&&(this.tx-=i*this.a+j*this.c,this.ty-=i*this.b+j*this.d),this},b.prependTransform=function(b,c,d,e,f,g,h,i,j){if(f%360)var k=f*a.DEG_TO_RAD,l=Math.cos(k),m=Math.sin(k);else l=1,m=0;return(i||j)&&(this.tx-=i,this.ty-=j),g||h?(g*=a.DEG_TO_RAD,h*=a.DEG_TO_RAD,this.prepend(l*d,m*d,-m*e,l*e,0,0),this.prepend(Math.cos(h),Math.sin(h),-Math.sin(g),Math.cos(g),b,c)):this.prepend(l*d,m*d,-m*e,l*e,b,c),this},b.rotate=function(b){b*=a.DEG_TO_RAD;var c=Math.cos(b),d=Math.sin(b),e=this.a,f=this.b;return this.a=e*c+this.c*d,this.b=f*c+this.d*d,this.c=-e*d+this.c*c,this.d=-f*d+this.d*c,this},b.skew=function(b,c){return b*=a.DEG_TO_RAD,c*=a.DEG_TO_RAD,this.append(Math.cos(c),Math.sin(c),-Math.sin(b),Math.cos(b),0,0),this},b.scale=function(a,b){return this.a*=a,this.b*=a,this.c*=b,this.d*=b,this},b.translate=function(a,b){return this.tx+=this.a*a+this.c*b,this.ty+=this.b*a+this.d*b,this},b.identity=function(){return this.a=this.d=1,this.b=this.c=this.tx=this.ty=0,this},b.invert=function(){var a=this.a,b=this.b,c=this.c,d=this.d,e=this.tx,f=a*d-b*c;return this.a=d/f,this.b=-b/f,this.c=-c/f,this.d=a/f,this.tx=(c*this.ty-d*e)/f,this.ty=-(a*this.ty-b*e)/f,this},b.isIdentity=function(){return 0===this.tx&&0===this.ty&&1===this.a&&0===this.b&&0===this.c&&1===this.d},b.equals=function(a){return this.tx===a.tx&&this.ty===a.ty&&this.a===a.a&&this.b===a.b&&this.c===a.c&&this.d===a.d},b.transformPoint=function(a,b,c){return c=c||{},c.x=a*this.a+b*this.c+this.tx,c.y=a*this.b+b*this.d+this.ty,c},b.decompose=function(b){null==b&&(b={}),b.x=this.tx,b.y=this.ty,b.scaleX=Math.sqrt(this.a*this.a+this.b*this.b),b.scaleY=Math.sqrt(this.c*this.c+this.d*this.d);var c=Math.atan2(-this.c,this.d),d=Math.atan2(this.b,this.a),e=Math.abs(1-c/d);return 1e-5>e?(b.rotation=d/a.DEG_TO_RAD,this.a<0&&this.d>=0&&(b.rotation+=b.rotation<=0?180:-180),b.skewX=b.skewY=0):(b.skewX=c/a.DEG_TO_RAD,b.skewY=d/a.DEG_TO_RAD),b},b.copy=function(a){return this.setValues(a.a,a.b,a.c,a.d,a.tx,a.ty)},b.clone=function(){return new a(this.a,this.b,this.c,this.d,this.tx,this.ty)},b.toString=function(){return"[Matrix2D (a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+")]"},a.identity=new a,createjs.Matrix2D=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d,e){this.setValues(a,b,c,d,e)}var b=a.prototype;b.setValues=function(a,b,c,d,e){return this.visible=null==a?!0:!!a,this.alpha=null==b?1:b,this.shadow=c,this.compositeOperation=d,this.matrix=e||this.matrix&&this.matrix.identity()||new createjs.Matrix2D,this},b.append=function(a,b,c,d,e){return this.alpha*=b,this.shadow=c||this.shadow,this.compositeOperation=d||this.compositeOperation,this.visible=this.visible&&a,e&&this.matrix.appendMatrix(e),this},b.prepend=function(a,b,c,d,e){return this.alpha*=b,this.shadow=this.shadow||c,this.compositeOperation=this.compositeOperation||d,this.visible=this.visible&&a,e&&this.matrix.prependMatrix(e),this},b.identity=function(){return this.visible=!0,this.alpha=1,this.shadow=this.compositeOperation=null,this.matrix.identity(),this},b.clone=function(){return new a(this.alpha,this.shadow,this.compositeOperation,this.visible,this.matrix.clone())},createjs.DisplayProps=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b){this.setValues(a,b)}var b=a.prototype;b.setValues=function(a,b){return this.x=a||0,this.y=b||0,this},b.copy=function(a){return this.x=a.x,this.y=a.y,this},b.clone=function(){return new a(this.x,this.y)},b.toString=function(){return"[Point (x="+this.x+" y="+this.y+")]"},createjs.Point=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d){this.setValues(a,b,c,d)}var b=a.prototype;b.setValues=function(a,b,c,d){return this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0,this},b.extend=function(a,b,c,d){return c=c||0,d=d||0,a+c>this.x+this.width&&(this.width=a+c-this.x),b+d>this.y+this.height&&(this.height=b+d-this.y),a=this.x&&a+c<=this.x+this.width&&b>=this.y&&b+d<=this.y+this.height},b.union=function(a){return this.clone().extend(a.x,a.y,a.width,a.height)},b.intersection=function(b){var c=b.x,d=b.y,e=c+b.width,f=d+b.height;return this.x>c&&(c=this.x),this.y>d&&(d=this.y),this.x+this.width=e||d>=f?null:new a(c,d,e-c,f-d)},b.intersects=function(a){return a.x<=this.x+this.width&&this.x<=a.x+a.width&&a.y<=this.y+this.height&&this.y<=a.y+a.height},b.isEmpty=function(){return this.width<=0||this.height<=0},b.clone=function(){return new a(this.x,this.y,this.width,this.height)},b.toString=function(){return"[Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")]"},createjs.Rectangle=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d,e,f,g){a.addEventListener&&(this.target=a,this.overLabel=null==c?"over":c,this.outLabel=null==b?"out":b,this.downLabel=null==d?"down":d,this.play=e,this._isPressed=!1,this._isOver=!1,this._enabled=!1,a.mouseChildren=!1,this.enabled=!0,this.handleEvent({}),f&&(g&&(f.actionsEnabled=!1,f.gotoAndStop&&f.gotoAndStop(g)),a.hitArea=f))}var b=a.prototype;b.setEnabled=function(a){if(a!=this._enabled){var b=this.target;this._enabled=a,a?(b.cursor="pointer",b.addEventListener("rollover",this),b.addEventListener("rollout",this),b.addEventListener("mousedown",this),b.addEventListener("pressup",this),b._reset&&(b.__reset=b._reset,b._reset=this._reset)):(b.cursor=null,b.removeEventListener("rollover",this),b.removeEventListener("rollout",this),b.removeEventListener("mousedown",this),b.removeEventListener("pressup",this),b.__reset&&(b._reset=b.__reset,delete b.__reset))}},b.getEnabled=function(){return this._enabled};try{Object.defineProperties(b,{enabled:{get:b.getEnabled,set:b.setEnabled}})}catch(c){}b.toString=function(){return"[ButtonHelper]"},b.handleEvent=function(a){var b,c=this.target,d=a.type;"mousedown"==d?(this._isPressed=!0,b=this.downLabel):"pressup"==d?(this._isPressed=!1,b=this._isOver?this.overLabel:this.outLabel):"rollover"==d?(this._isOver=!0,b=this._isPressed?this.downLabel:this.overLabel):(this._isOver=!1,b=this._isPressed?this.overLabel:this.outLabel),this.play?c.gotoAndPlay&&c.gotoAndPlay(b):c.gotoAndStop&&c.gotoAndStop(b)},b._reset=function(){var a=this.paused;this.__reset(),this.paused=a},createjs.ButtonHelper=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d){this.color=a||"black",this.offsetX=b||0,this.offsetY=c||0,this.blur=d||0}var b=a.prototype;a.identity=new a("transparent",0,0,0),b.toString=function(){return"[Shadow]"},b.clone=function(){return new a(this.color,this.offsetX,this.offsetY,this.blur)},createjs.Shadow=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.EventDispatcher_constructor(),this.complete=!0,this.framerate=0,this._animations=null,this._frames=null,this._images=null,this._data=null,this._loadCount=0,this._frameHeight=0,this._frameWidth=0,this._numFrames=0,this._regX=0,this._regY=0,this._spacing=0,this._margin=0,this._parseData(a)}var b=createjs.extend(a,createjs.EventDispatcher);b.getAnimations=function(){return this._animations.slice()};try{Object.defineProperties(b,{animations:{get:b.getAnimations}})}catch(c){}b.getNumFrames=function(a){if(null==a)return this._frames?this._frames.length:this._numFrames||0;var b=this._data[a];return null==b?0:b.frames.length},b.getAnimation=function(a){return this._data[a]},b.getFrame=function(a){var b;return this._frames&&(b=this._frames[a])?b:null},b.getFrameBounds=function(a,b){var c=this.getFrame(a);return c?(b||new createjs.Rectangle).setValues(-c.regX,-c.regY,c.rect.width,c.rect.height):null},b.toString=function(){return"[SpriteSheet]"},b.clone=function(){throw"SpriteSheet cannot be cloned."},b._parseData=function(a){var b,c,d,e;if(null!=a){if(this.framerate=a.framerate||0,a.images&&(c=a.images.length)>0)for(e=this._images=[],b=0;c>b;b++){var f=a.images[b];if("string"==typeof f){var g=f;f=document.createElement("img"),f.src=g}e.push(f),f.getContext||f.naturalWidth||(this._loadCount++,this.complete=!1,function(a,b){f.onload=function(){a._handleImageLoad(b)}}(this,g),function(a,b){f.onerror=function(){a._handleImageError(b)}}(this,g))}if(null==a.frames);else if(Array.isArray(a.frames))for(this._frames=[],e=a.frames,b=0,c=e.length;c>b;b++){var h=e[b];this._frames.push({image:this._images[h[4]?h[4]:0],rect:new createjs.Rectangle(h[0],h[1],h[2],h[3]),regX:h[5]||0,regY:h[6]||0})}else d=a.frames,this._frameWidth=d.width,this._frameHeight=d.height,this._regX=d.regX||0,this._regY=d.regY||0,this._spacing=d.spacing||0,this._margin=d.margin||0,this._numFrames=d.count,0==this._loadCount&&this._calculateFrames();if(this._animations=[],null!=(d=a.animations)){this._data={};var i;for(i in d){var j={name:i},k=d[i];if("number"==typeof k)e=j.frames=[k];else if(Array.isArray(k))if(1==k.length)j.frames=[k[0]];else for(j.speed=k[3],j.next=k[2],e=j.frames=[],b=k[0];b<=k[1];b++)e.push(b);else{j.speed=k.speed,j.next=k.next;var l=k.frames;e=j.frames="number"==typeof l?[l]:l.slice(0)}(j.next===!0||void 0===j.next)&&(j.next=i),(j.next===!1||e.length<2&&j.next==i)&&(j.next=null),j.speed||(j.speed=1),this._animations.push(i),this._data[i]=j}}}},b._handleImageLoad=function(){0==--this._loadCount&&(this._calculateFrames(),this.complete=!0,this.dispatchEvent("complete"))},b._handleImageError=function(a){var b=new createjs.Event("error");b.src=a,this.dispatchEvent(b),0==--this._loadCount&&this.dispatchEvent("complete")},b._calculateFrames=function(){if(!this._frames&&0!=this._frameWidth){this._frames=[];var a=this._numFrames||1e5,b=0,c=this._frameWidth,d=this._frameHeight,e=this._spacing,f=this._margin;a:for(var g=0,h=this._images;g=l;){for(var m=f;j-f-c>=m;){if(b>=a)break a;b++,this._frames.push({image:i,rect:new createjs.Rectangle(m,l,c,d),regX:this._regX,regY:this._regY}),m+=c+e}l+=d+e}this._numFrames=b}},createjs.SpriteSheet=createjs.promote(a,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function a(){this.command=null,this._stroke=null,this._strokeStyle=null,this._oldStrokeStyle=null,this._strokeDash=null,this._oldStrokeDash=null,this._strokeIgnoreScale=!1,this._fill=null,this._instructions=[],this._commitIndex=0,this._activeInstructions=[],this._dirty=!1,this._storeIndex=0,this.clear()}var b=a.prototype,c=a;a.getRGB=function(a,b,c,d){return null!=a&&null==c&&(d=b,c=255&a,b=a>>8&255,a=a>>16&255),null==d?"rgb("+a+","+b+","+c+")":"rgba("+a+","+b+","+c+","+d+")"},a.getHSL=function(a,b,c,d){return null==d?"hsl("+a%360+","+b+"%,"+c+"%)":"hsla("+a%360+","+b+"%,"+c+"%,"+d+")"},a.BASE_64={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,a:26,b:27,c:28,d:29,e:30,f:31,g:32,h:33,i:34,j:35,k:36,l:37,m:38,n:39,o:40,p:41,q:42,r:43,s:44,t:45,u:46,v:47,w:48,x:49,y:50,z:51,0:52,1:53,2:54,3:55,4:56,5:57,6:58,7:59,8:60,9:61,"+":62,"/":63},a.STROKE_CAPS_MAP=["butt","round","square"],a.STROKE_JOINTS_MAP=["miter","round","bevel"];var d=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");d.getContext&&(a._ctx=d.getContext("2d"),d.width=d.height=1),b.getInstructions=function(){return this._updateInstructions(),this._instructions};try{Object.defineProperties(b,{instructions:{get:b.getInstructions}})}catch(e){}b.isEmpty=function(){return!(this._instructions.length||this._activeInstructions.length)},b.draw=function(a,b){this._updateInstructions();for(var c=this._instructions,d=this._storeIndex,e=c.length;e>d;d++)c[d].exec(a,b)},b.drawAsPath=function(a){this._updateInstructions();for(var b,c=this._instructions,d=this._storeIndex,e=c.length;e>d;d++)(b=c[d]).path!==!1&&b.exec(a)},b.moveTo=function(a,b){return this.append(new c.MoveTo(a,b),!0)},b.lineTo=function(a,b){return this.append(new c.LineTo(a,b))},b.arcTo=function(a,b,d,e,f){return this.append(new c.ArcTo(a,b,d,e,f))},b.arc=function(a,b,d,e,f,g){return this.append(new c.Arc(a,b,d,e,f,g))},b.quadraticCurveTo=function(a,b,d,e){return this.append(new c.QuadraticCurveTo(a,b,d,e))},b.bezierCurveTo=function(a,b,d,e,f,g){return this.append(new c.BezierCurveTo(a,b,d,e,f,g))},b.rect=function(a,b,d,e){return this.append(new c.Rect(a,b,d,e))},b.closePath=function(){return this._activeInstructions.length?this.append(new c.ClosePath):this},b.clear=function(){return this._instructions.length=this._activeInstructions.length=this._commitIndex=0,this._strokeStyle=this._oldStrokeStyle=this._stroke=this._fill=this._strokeDash=this._oldStrokeDash=null,this._dirty=this._strokeIgnoreScale=!1,this},b.beginFill=function(a){return this._setFill(a?new c.Fill(a):null)},b.beginLinearGradientFill=function(a,b,d,e,f,g){return this._setFill((new c.Fill).linearGradient(a,b,d,e,f,g))},b.beginRadialGradientFill=function(a,b,d,e,f,g,h,i){return this._setFill((new c.Fill).radialGradient(a,b,d,e,f,g,h,i))},b.beginBitmapFill=function(a,b,d){return this._setFill(new c.Fill(null,d).bitmap(a,b))},b.endFill=function(){return this.beginFill()},b.setStrokeStyle=function(a,b,d,e,f){return this._updateInstructions(!0),this._strokeStyle=this.command=new c.StrokeStyle(a,b,d,e,f),this._stroke&&(this._stroke.ignoreScale=f),this._strokeIgnoreScale=f,this},b.setStrokeDash=function(a,b){return this._updateInstructions(!0),this._strokeDash=this.command=new c.StrokeDash(a,b),this},b.beginStroke=function(a){return this._setStroke(a?new c.Stroke(a):null)},b.beginLinearGradientStroke=function(a,b,d,e,f,g){return this._setStroke((new c.Stroke).linearGradient(a,b,d,e,f,g))},b.beginRadialGradientStroke=function(a,b,d,e,f,g,h,i){return this._setStroke((new c.Stroke).radialGradient(a,b,d,e,f,g,h,i))},b.beginBitmapStroke=function(a,b){return this._setStroke((new c.Stroke).bitmap(a,b))},b.endStroke=function(){return this.beginStroke()},b.curveTo=b.quadraticCurveTo,b.drawRect=b.rect,b.drawRoundRect=function(a,b,c,d,e){return this.drawRoundRectComplex(a,b,c,d,e,e,e,e)},b.drawRoundRectComplex=function(a,b,d,e,f,g,h,i){return this.append(new c.RoundRect(a,b,d,e,f,g,h,i))},b.drawCircle=function(a,b,d){return this.append(new c.Circle(a,b,d))},b.drawEllipse=function(a,b,d,e){return this.append(new c.Ellipse(a,b,d,e))},b.drawPolyStar=function(a,b,d,e,f,g){return this.append(new c.PolyStar(a,b,d,e,f,g))},b.append=function(a,b){return this._activeInstructions.push(a),this.command=a,b||(this._dirty=!0),this},b.decodePath=function(b){for(var c=[this.moveTo,this.lineTo,this.quadraticCurveTo,this.bezierCurveTo,this.closePath],d=[2,2,4,6,0],e=0,f=b.length,g=[],h=0,i=0,j=a.BASE_64;f>e;){var k=b.charAt(e),l=j[k],m=l>>3,n=c[m];if(!n||3&l)throw"bad path data (@"+e+"): "+k;var o=d[m];m||(h=i=0),g.length=0,e++;for(var p=(l>>2&1)+2,q=0;o>q;q++){var r=j[b.charAt(e)],s=r>>5?-1:1;r=(31&r)<<6|j[b.charAt(e+1)],3==p&&(r=r<<6|j[b.charAt(e+2)]),r=s*r/10,q%2?h=r+=h:i=r+=i,g[q]=r,e+=p}n.apply(this,g)}return this},b.store=function(){return this._updateInstructions(!0),this._storeIndex=this._instructions.length,this},b.unstore=function(){return this._storeIndex=0,this},b.clone=function(){var b=new a;return b.command=this.command,b._stroke=this._stroke,b._strokeStyle=this._strokeStyle,b._strokeDash=this._strokeDash,b._strokeIgnoreScale=this._strokeIgnoreScale,b._fill=this._fill,b._instructions=this._instructions.slice(),b._commitIndex=this._commitIndex,b._activeInstructions=this._activeInstructions.slice(),b._dirty=this._dirty,b._storeIndex=this._storeIndex,b},b.toString=function(){return"[Graphics]"},b.mt=b.moveTo,b.lt=b.lineTo,b.at=b.arcTo,b.bt=b.bezierCurveTo,b.qt=b.quadraticCurveTo,b.a=b.arc,b.r=b.rect,b.cp=b.closePath,b.c=b.clear,b.f=b.beginFill,b.lf=b.beginLinearGradientFill,b.rf=b.beginRadialGradientFill,b.bf=b.beginBitmapFill,b.ef=b.endFill,b.ss=b.setStrokeStyle,b.sd=b.setStrokeDash,b.s=b.beginStroke,b.ls=b.beginLinearGradientStroke,b.rs=b.beginRadialGradientStroke,b.bs=b.beginBitmapStroke,b.es=b.endStroke,b.dr=b.drawRect,b.rr=b.drawRoundRect,b.rc=b.drawRoundRectComplex,b.dc=b.drawCircle,b.de=b.drawEllipse,b.dp=b.drawPolyStar,b.p=b.decodePath,b._updateInstructions=function(b){var c=this._instructions,d=this._activeInstructions,e=this._commitIndex;if(this._dirty&&d.length){c.length=e,c.push(a.beginCmd);var f=d.length,g=c.length;c.length=g+f;for(var h=0;f>h;h++)c[h+g]=d[h];this._fill&&c.push(this._fill),this._stroke&&(this._strokeDash!==this._oldStrokeDash&&(this._oldStrokeDash=this._strokeDash,c.push(this._strokeDash)),this._strokeStyle!==this._oldStrokeStyle&&(this._oldStrokeStyle=this._strokeStyle,c.push(this._strokeStyle)),c.push(this._stroke)),this._dirty=!1}b&&(d.length=0,this._commitIndex=c.length)},b._setFill=function(a){return this._updateInstructions(!0),this.command=this._fill=a,this},b._setStroke=function(a){return this._updateInstructions(!0),(this.command=this._stroke=a)&&(a.ignoreScale=this._strokeIgnoreScale),this},(c.LineTo=function(a,b){this.x=a,this.y=b}).prototype.exec=function(a){a.lineTo(this.x,this.y)},(c.MoveTo=function(a,b){this.x=a,this.y=b}).prototype.exec=function(a){a.moveTo(this.x,this.y)},(c.ArcTo=function(a,b,c,d,e){this.x1=a,this.y1=b,this.x2=c,this.y2=d,this.radius=e}).prototype.exec=function(a){a.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)},(c.Arc=function(a,b,c,d,e,f){this.x=a,this.y=b,this.radius=c,this.startAngle=d,this.endAngle=e,this.anticlockwise=!!f}).prototype.exec=function(a){a.arc(this.x,this.y,this.radius,this.startAngle,this.endAngle,this.anticlockwise)},(c.QuadraticCurveTo=function(a,b,c,d){this.cpx=a,this.cpy=b,this.x=c,this.y=d}).prototype.exec=function(a){a.quadraticCurveTo(this.cpx,this.cpy,this.x,this.y)},(c.BezierCurveTo=function(a,b,c,d,e,f){this.cp1x=a,this.cp1y=b,this.cp2x=c,this.cp2y=d,this.x=e,this.y=f}).prototype.exec=function(a){a.bezierCurveTo(this.cp1x,this.cp1y,this.cp2x,this.cp2y,this.x,this.y)},(c.Rect=function(a,b,c,d){this.x=a,this.y=b,this.w=c,this.h=d}).prototype.exec=function(a){a.rect(this.x,this.y,this.w,this.h)},(c.ClosePath=function(){}).prototype.exec=function(a){a.closePath()},(c.BeginPath=function(){}).prototype.exec=function(a){a.beginPath()},b=(c.Fill=function(a,b){this.style=a,this.matrix=b}).prototype,b.exec=function(a){if(this.style){a.fillStyle=this.style;var b=this.matrix;b&&(a.save(),a.transform(b.a,b.b,b.c,b.d,b.tx,b.ty)),a.fill(),b&&a.restore()}},b.linearGradient=function(b,c,d,e,f,g){for(var h=this.style=a._ctx.createLinearGradient(d,e,f,g),i=0,j=b.length;j>i;i++)h.addColorStop(c[i],b[i]);return h.props={colors:b,ratios:c,x0:d,y0:e,x1:f,y1:g,type:"linear"},this},b.radialGradient=function(b,c,d,e,f,g,h,i){for(var j=this.style=a._ctx.createRadialGradient(d,e,f,g,h,i),k=0,l=b.length;l>k;k++)j.addColorStop(c[k],b[k]);return j.props={colors:b,ratios:c,x0:d,y0:e,r0:f,x1:g,y1:h,r1:i,type:"radial"},this},b.bitmap=function(b,c){if(b.naturalWidth||b.getContext||b.readyState>=2){var d=this.style=a._ctx.createPattern(b,c||"");d.props={image:b,repetition:c,type:"bitmap"}}return this},b.path=!1,b=(c.Stroke=function(a,b){this.style=a,this.ignoreScale=b}).prototype,b.exec=function(a){this.style&&(a.strokeStyle=this.style,this.ignoreScale&&(a.save(),a.setTransform(1,0,0,1,0,0)),a.stroke(),this.ignoreScale&&a.restore())},b.linearGradient=c.Fill.prototype.linearGradient,b.radialGradient=c.Fill.prototype.radialGradient,b.bitmap=c.Fill.prototype.bitmap,b.path=!1,b=(c.StrokeStyle=function(a,b,c,d,e){this.width=a,this.caps=b,this.joints=c,this.miterLimit=d,this.ignoreScale=e}).prototype,b.exec=function(b){b.lineWidth=null==this.width?"1":this.width,b.lineCap=null==this.caps?"butt":isNaN(this.caps)?this.caps:a.STROKE_CAPS_MAP[this.caps],b.lineJoin=null==this.joints?"miter":isNaN(this.joints)?this.joints:a.STROKE_JOINTS_MAP[this.joints],b.miterLimit=null==this.miterLimit?"10":this.miterLimit,b.ignoreScale=null==this.ignoreScale?!1:this.ignoreScale},b.path=!1,(c.StrokeDash=function(a,b){this.segments=a,this.offset=b||0}).prototype.exec=function(a){a.setLineDash&&(a.setLineDash(this.segments||c.StrokeDash.EMPTY_SEGMENTS),a.lineDashOffset=this.offset||0)},c.StrokeDash.EMPTY_SEGMENTS=[],(c.RoundRect=function(a,b,c,d,e,f,g,h){this.x=a,this.y=b,this.w=c,this.h=d,this.radiusTL=e,this.radiusTR=f,this.radiusBR=g,this.radiusBL=h}).prototype.exec=function(a){var b=(j>i?i:j)/2,c=0,d=0,e=0,f=0,g=this.x,h=this.y,i=this.w,j=this.h,k=this.radiusTL,l=this.radiusTR,m=this.radiusBR,n=this.radiusBL;0>k&&(k*=c=-1),k>b&&(k=b),0>l&&(l*=d=-1),l>b&&(l=b),0>m&&(m*=e=-1),m>b&&(m=b),0>n&&(n*=f=-1),n>b&&(n=b),a.moveTo(g+i-l,h),a.arcTo(g+i+l*d,h-l*d,g+i,h+l,l),a.lineTo(g+i,h+j-m),a.arcTo(g+i+m*e,h+j+m*e,g+i-m,h+j,m),a.lineTo(g+n,h+j),a.arcTo(g-n*f,h+j+n*f,g,h+j-n,n),a.lineTo(g,h+k),a.arcTo(g-k*c,h-k*c,g+k,h,k),a.closePath()},(c.Circle=function(a,b,c){this.x=a,this.y=b,this.radius=c}).prototype.exec=function(a){a.arc(this.x,this.y,this.radius,0,2*Math.PI)},(c.Ellipse=function(a,b,c,d){this.x=a,this.y=b,this.w=c,this.h=d}).prototype.exec=function(a){var b=this.x,c=this.y,d=this.w,e=this.h,f=.5522848,g=d/2*f,h=e/2*f,i=b+d,j=c+e,k=b+d/2,l=c+e/2;a.moveTo(b,l),a.bezierCurveTo(b,l-h,k-g,c,k,c),a.bezierCurveTo(k+g,c,i,l-h,i,l),a.bezierCurveTo(i,l+h,k+g,j,k,j),a.bezierCurveTo(k-g,j,b,l+h,b,l)},(c.PolyStar=function(a,b,c,d,e,f){this.x=a,this.y=b,this.radius=c,this.sides=d,this.pointSize=e,this.angle=f}).prototype.exec=function(a){var b=this.x,c=this.y,d=this.radius,e=(this.angle||0)/180*Math.PI,f=this.sides,g=1-(this.pointSize||0),h=Math.PI/f;a.moveTo(b+Math.cos(e)*d,c+Math.sin(e)*d);for(var i=0;f>i;i++)e+=h,1!=g&&a.lineTo(b+Math.cos(e)*d*g,c+Math.sin(e)*d*g),e+=h,a.lineTo(b+Math.cos(e)*d,c+Math.sin(e)*d);a.closePath()},a.beginCmd=new c.BeginPath,createjs.Graphics=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(){this.EventDispatcher_constructor(),this.alpha=1,this.cacheCanvas=null,this.cacheID=0,this.id=createjs.UID.get(),this.mouseEnabled=!0,this.tickEnabled=!0,this.name=null,this.parent=null,this.regX=0,this.regY=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.skewX=0,this.skewY=0,this.shadow=null,this.visible=!0,this.x=0,this.y=0,this.transformMatrix=null,this.compositeOperation=null,this.snapToPixel=!0,this.filters=null,this.mask=null,this.hitArea=null,this.cursor=null,this._cacheOffsetX=0,this._cacheOffsetY=0,this._filterOffsetX=0,this._filterOffsetY=0,this._cacheScale=1,this._cacheDataURLID=0,this._cacheDataURL=null,this._props=new createjs.DisplayProps,this._rectangle=new createjs.Rectangle,this._bounds=null -}var b=createjs.extend(a,createjs.EventDispatcher);a._MOUSE_EVENTS=["click","dblclick","mousedown","mouseout","mouseover","pressmove","pressup","rollout","rollover"],a.suppressCrossDomainErrors=!1,a._snapToPixelEnabled=!1;var c=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");c.getContext&&(a._hitTestCanvas=c,a._hitTestContext=c.getContext("2d"),c.width=c.height=1),a._nextCacheID=1,b.getStage=function(){for(var a=this,b=createjs.Stage;a.parent;)a=a.parent;return a instanceof b?a:null};try{Object.defineProperties(b,{stage:{get:b.getStage}})}catch(d){}b.isVisible=function(){return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY)},b.draw=function(a,b){var c=this.cacheCanvas;if(b||!c)return!1;var d=this._cacheScale;return a.drawImage(c,this._cacheOffsetX+this._filterOffsetX,this._cacheOffsetY+this._filterOffsetY,c.width/d,c.height/d),!0},b.updateContext=function(b){var c=this,d=c.mask,e=c._props.matrix;d&&d.graphics&&!d.graphics.isEmpty()&&(d.getMatrix(e),b.transform(e.a,e.b,e.c,e.d,e.tx,e.ty),d.graphics.drawAsPath(b),b.clip(),e.invert(),b.transform(e.a,e.b,e.c,e.d,e.tx,e.ty)),this.getMatrix(e);var f=e.tx,g=e.ty;a._snapToPixelEnabled&&c.snapToPixel&&(f=f+(0>f?-.5:.5)|0,g=g+(0>g?-.5:.5)|0),b.transform(e.a,e.b,e.c,e.d,f,g),b.globalAlpha*=c.alpha,c.compositeOperation&&(b.globalCompositeOperation=c.compositeOperation),c.shadow&&this._applyShadow(b,c.shadow)},b.cache=function(a,b,c,d,e){e=e||1,this.cacheCanvas||(this.cacheCanvas=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas")),this._cacheWidth=c,this._cacheHeight=d,this._cacheOffsetX=a,this._cacheOffsetY=b,this._cacheScale=e,this.updateCache()},b.updateCache=function(b){var c=this.cacheCanvas;if(!c)throw"cache() must be called before updateCache()";var d=this._cacheScale,e=this._cacheOffsetX*d,f=this._cacheOffsetY*d,g=this._cacheWidth,h=this._cacheHeight,i=c.getContext("2d"),j=this._getFilterBounds();e+=this._filterOffsetX=j.x,f+=this._filterOffsetY=j.y,g=Math.ceil(g*d)+j.width,h=Math.ceil(h*d)+j.height,g!=c.width||h!=c.height?(c.width=g,c.height=h):b||i.clearRect(0,0,g+1,h+1),i.save(),i.globalCompositeOperation=b,i.setTransform(d,0,0,d,-e,-f),this.draw(i,!0),this._applyFilters(),i.restore(),this.cacheID=a._nextCacheID++},b.uncache=function(){this._cacheDataURL=this.cacheCanvas=null,this.cacheID=this._cacheOffsetX=this._cacheOffsetY=this._filterOffsetX=this._filterOffsetY=0,this._cacheScale=1},b.getCacheDataURL=function(){return this.cacheCanvas?(this.cacheID!=this._cacheDataURLID&&(this._cacheDataURL=this.cacheCanvas.toDataURL()),this._cacheDataURL):null},b.localToGlobal=function(a,b,c){return this.getConcatenatedMatrix(this._props.matrix).transformPoint(a,b,c||new createjs.Point)},b.globalToLocal=function(a,b,c){return this.getConcatenatedMatrix(this._props.matrix).invert().transformPoint(a,b,c||new createjs.Point)},b.localToLocal=function(a,b,c,d){return d=this.localToGlobal(a,b,d),c.globalToLocal(d.x,d.y,d)},b.setTransform=function(a,b,c,d,e,f,g,h,i){return this.x=a||0,this.y=b||0,this.scaleX=null==c?1:c,this.scaleY=null==d?1:d,this.rotation=e||0,this.skewX=f||0,this.skewY=g||0,this.regX=h||0,this.regY=i||0,this},b.getMatrix=function(a){var b=this,c=a&&a.identity()||new createjs.Matrix2D;return b.transformMatrix?c.copy(b.transformMatrix):c.appendTransform(b.x,b.y,b.scaleX,b.scaleY,b.rotation,b.skewX,b.skewY,b.regX,b.regY)},b.getConcatenatedMatrix=function(a){for(var b=this,c=this.getMatrix(a);b=b.parent;)c.prependMatrix(b.getMatrix(b._props.matrix));return c},b.getConcatenatedDisplayProps=function(a){a=a?a.identity():new createjs.DisplayProps;var b=this,c=b.getMatrix(a.matrix);do a.prepend(b.visible,b.alpha,b.shadow,b.compositeOperation),b!=this&&c.prependMatrix(b.getMatrix(b._props.matrix));while(b=b.parent);return a},b.hitTest=function(b,c){var d=a._hitTestContext;d.setTransform(1,0,0,1,-b,-c),this.draw(d);var e=this._testHit(d);return d.setTransform(1,0,0,1,0,0),d.clearRect(0,0,2,2),e},b.set=function(a){for(var b in a)this[b]=a[b];return this},b.getBounds=function(){if(this._bounds)return this._rectangle.copy(this._bounds);var a=this.cacheCanvas;if(a){var b=this._cacheScale;return this._rectangle.setValues(this._cacheOffsetX,this._cacheOffsetY,a.width/b,a.height/b)}return null},b.getTransformedBounds=function(){return this._getBounds()},b.setBounds=function(a,b,c,d){null==a&&(this._bounds=a),this._bounds=(this._bounds||new createjs.Rectangle).setValues(a,b,c,d)},b.clone=function(){return this._cloneProps(new a)},b.toString=function(){return"[DisplayObject (name="+this.name+")]"},b._cloneProps=function(a){return a.alpha=this.alpha,a.mouseEnabled=this.mouseEnabled,a.tickEnabled=this.tickEnabled,a.name=this.name,a.regX=this.regX,a.regY=this.regY,a.rotation=this.rotation,a.scaleX=this.scaleX,a.scaleY=this.scaleY,a.shadow=this.shadow,a.skewX=this.skewX,a.skewY=this.skewY,a.visible=this.visible,a.x=this.x,a.y=this.y,a.compositeOperation=this.compositeOperation,a.snapToPixel=this.snapToPixel,a.filters=null==this.filters?null:this.filters.slice(0),a.mask=this.mask,a.hitArea=this.hitArea,a.cursor=this.cursor,a._bounds=this._bounds,a},b._applyShadow=function(a,b){b=b||Shadow.identity,a.shadowColor=b.color,a.shadowOffsetX=b.offsetX,a.shadowOffsetY=b.offsetY,a.shadowBlur=b.blur},b._tick=function(a){var b=this._listeners;b&&b.tick&&(a.target=null,a.propagationStopped=a.immediatePropagationStopped=!1,this.dispatchEvent(a))},b._testHit=function(b){try{var c=b.getImageData(0,0,1,1).data[3]>1}catch(d){if(!a.suppressCrossDomainErrors)throw"An error has occurred. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images."}return c},b._applyFilters=function(){if(this.filters&&0!=this.filters.length&&this.cacheCanvas)for(var a=this.filters.length,b=this.cacheCanvas.getContext("2d"),c=this.cacheCanvas.width,d=this.cacheCanvas.height,e=0;a>e;e++)this.filters[e].applyFilter(b,0,0,c,d)},b._getFilterBounds=function(){var a,b=this.filters,c=this._rectangle.setValues(0,0,0,0);if(!b||!(a=b.length))return c;for(var d=0;a>d;d++){var e=this.filters[d];e.getBounds&&e.getBounds(c)}return c},b._getBounds=function(a,b){return this._transformBounds(this.getBounds(),a,b)},b._transformBounds=function(a,b,c){if(!a)return a;var d=a.x,e=a.y,f=a.width,g=a.height,h=this._props.matrix;h=c?h.identity():this.getMatrix(h),(d||e)&&h.appendTransform(0,0,1,1,0,0,0,-d,-e),b&&h.prependMatrix(b);var i=f*h.a,j=f*h.b,k=g*h.c,l=g*h.d,m=h.tx,n=h.ty,o=m,p=m,q=n,r=n;return(d=i+m)p&&(p=d),(d=i+k+m)p&&(p=d),(d=k+m)p&&(p=d),(e=j+n)r&&(r=e),(e=j+l+n)r&&(r=e),(e=l+n)r&&(r=e),a.setValues(o,q,p-o,r-q)},b._hasMouseEventListener=function(){for(var b=a._MOUSE_EVENTS,c=0,d=b.length;d>c;c++)if(this.hasEventListener(b[c]))return!0;return!!this.cursor},createjs.DisplayObject=createjs.promote(a,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function a(){this.DisplayObject_constructor(),this.children=[],this.mouseChildren=!0,this.tickChildren=!0}var b=createjs.extend(a,createjs.DisplayObject);b.getNumChildren=function(){return this.children.length};try{Object.defineProperties(b,{numChildren:{get:b.getNumChildren}})}catch(c){}b.initialize=a,b.isVisible=function(){var a=this.cacheCanvas||this.children.length;return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&a)},b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return!0;for(var c=this.children.slice(),d=0,e=c.length;e>d;d++){var f=c[d];f.isVisible()&&(a.save(),f.updateContext(a),f.draw(a),a.restore())}return!0},b.addChild=function(a){if(null==a)return a;var b=arguments.length;if(b>1){for(var c=0;b>c;c++)this.addChild(arguments[c]);return arguments[b-1]}return a.parent&&a.parent.removeChild(a),a.parent=this,this.children.push(a),a.dispatchEvent("added"),a},b.addChildAt=function(a,b){var c=arguments.length,d=arguments[c-1];if(0>d||d>this.children.length)return arguments[c-2];if(c>2){for(var e=0;c-1>e;e++)this.addChildAt(arguments[e],d+e);return arguments[c-2]}return a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),a.dispatchEvent("added"),a},b.removeChild=function(a){var b=arguments.length;if(b>1){for(var c=!0,d=0;b>d;d++)c=c&&this.removeChild(arguments[d]);return c}return this.removeChildAt(createjs.indexOf(this.children,a))},b.removeChildAt=function(a){var b=arguments.length;if(b>1){for(var c=[],d=0;b>d;d++)c[d]=arguments[d];c.sort(function(a,b){return b-a});for(var e=!0,d=0;b>d;d++)e=e&&this.removeChildAt(c[d]);return e}if(0>a||a>this.children.length-1)return!1;var f=this.children[a];return f&&(f.parent=null),this.children.splice(a,1),f.dispatchEvent("removed"),!0},b.removeAllChildren=function(){for(var a=this.children;a.length;)this.removeChildAt(0)},b.getChildAt=function(a){return this.children[a]},b.getChildByName=function(a){for(var b=this.children,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},b.sortChildren=function(a){this.children.sort(a)},b.getChildIndex=function(a){return createjs.indexOf(this.children,a)},b.swapChildrenAt=function(a,b){var c=this.children,d=c[a],e=c[b];d&&e&&(c[a]=e,c[b]=d)},b.swapChildren=function(a,b){for(var c,d,e=this.children,f=0,g=e.length;g>f&&(e[f]==a&&(c=f),e[f]==b&&(d=f),null==c||null==d);f++);f!=g&&(e[c]=b,e[d]=a)},b.setChildIndex=function(a,b){var c=this.children,d=c.length;if(!(a.parent!=this||0>b||b>=d)){for(var e=0;d>e&&c[e]!=a;e++);e!=d&&e!=b&&(c.splice(e,1),c.splice(b,0,a))}},b.contains=function(a){for(;a;){if(a==this)return!0;a=a.parent}return!1},b.hitTest=function(a,b){return null!=this.getObjectUnderPoint(a,b)},b.getObjectsUnderPoint=function(a,b,c){var d=[],e=this.localToGlobal(a,b);return this._getObjectsUnderPoint(e.x,e.y,d,c>0,1==c),d},b.getObjectUnderPoint=function(a,b,c){var d=this.localToGlobal(a,b);return this._getObjectsUnderPoint(d.x,d.y,null,c>0,1==c)},b.getBounds=function(){return this._getBounds(null,!0)},b.getTransformedBounds=function(){return this._getBounds()},b.clone=function(b){var c=this._cloneProps(new a);return b&&this._cloneChildren(c),c},b.toString=function(){return"[Container (name="+this.name+")]"},b._tick=function(a){if(this.tickChildren)for(var b=this.children.length-1;b>=0;b--){var c=this.children[b];c.tickEnabled&&c._tick&&c._tick(a)}this.DisplayObject__tick(a)},b._cloneChildren=function(a){a.children.length&&a.removeAllChildren();for(var b=a.children,c=0,d=this.children.length;d>c;c++){var e=this.children[c].clone(!0);e.parent=a,b.push(e)}},b._getObjectsUnderPoint=function(b,c,d,e,f,g){if(g=g||0,!g&&!this._testMask(this,b,c))return null;var h,i=createjs.DisplayObject._hitTestContext;f=f||e&&this._hasMouseEventListener();for(var j=this.children,k=j.length,l=k-1;l>=0;l--){var m=j[l],n=m.hitArea;if(m.visible&&(n||m.isVisible())&&(!e||m.mouseEnabled)&&(n||this._testMask(m,b,c)))if(!n&&m instanceof a){var o=m._getObjectsUnderPoint(b,c,d,e,f,g+1);if(!d&&o)return e&&!this.mouseChildren?this:o}else{if(e&&!f&&!m._hasMouseEventListener())continue;var p=m.getConcatenatedDisplayProps(m._props);if(h=p.matrix,n&&(h.appendMatrix(n.getMatrix(n._props.matrix)),p.alpha=n.alpha),i.globalAlpha=p.alpha,i.setTransform(h.a,h.b,h.c,h.d,h.tx-b,h.ty-c),(n||m).draw(i),!this._testHit(i))continue;if(i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,2,2),!d)return e&&!this.mouseChildren?this:m;d.push(m)}}return null},b._testMask=function(a,b,c){var d=a.mask;if(!d||!d.graphics||d.graphics.isEmpty())return!0;var e=this._props.matrix,f=a.parent;e=f?f.getConcatenatedMatrix(e):e.identity(),e=d.getMatrix(d._props.matrix).prependMatrix(e);var g=createjs.DisplayObject._hitTestContext;return g.setTransform(e.a,e.b,e.c,e.d,e.tx-b,e.ty-c),d.graphics.drawAsPath(g),g.fillStyle="#000",g.fill(),this._testHit(g)?(g.setTransform(1,0,0,1,0,0),g.clearRect(0,0,2,2),!0):!1},b._getBounds=function(a,b){var c=this.DisplayObject_getBounds();if(c)return this._transformBounds(c,a,b);var d=this._props.matrix;d=b?d.identity():this.getMatrix(d),a&&d.prependMatrix(a);for(var e=this.children.length,f=null,g=0;e>g;g++){var h=this.children[g];h.visible&&(c=h._getBounds(d))&&(f?f.extend(c.x,c.y,c.width,c.height):f=c.clone())}return f},createjs.Container=createjs.promote(a,"DisplayObject")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.Container_constructor(),this.autoClear=!0,this.canvas="string"==typeof a?document.getElementById(a):a,this.mouseX=0,this.mouseY=0,this.drawRect=null,this.snapToPixelEnabled=!1,this.mouseInBounds=!1,this.tickOnUpdate=!0,this.mouseMoveOutside=!1,this.preventSelection=!0,this._pointerData={},this._pointerCount=0,this._primaryPointerID=null,this._mouseOverIntervalID=null,this._nextStage=null,this._prevStage=null,this.enableDOMEvents(!0)}var b=createjs.extend(a,createjs.Container);b._get_nextStage=function(){return this._nextStage},b._set_nextStage=function(a){this._nextStage&&(this._nextStage._prevStage=null),a&&(a._prevStage=this),this._nextStage=a};try{Object.defineProperties(b,{nextStage:{get:b._get_nextStage,set:b._set_nextStage}})}catch(c){}b.update=function(a){if(this.canvas&&(this.tickOnUpdate&&this.tick(a),this.dispatchEvent("drawstart",!1,!0)!==!1)){createjs.DisplayObject._snapToPixelEnabled=this.snapToPixelEnabled;var b=this.drawRect,c=this.canvas.getContext("2d");c.setTransform(1,0,0,1,0,0),this.autoClear&&(b?c.clearRect(b.x,b.y,b.width,b.height):c.clearRect(0,0,this.canvas.width+1,this.canvas.height+1)),c.save(),this.drawRect&&(c.beginPath(),c.rect(b.x,b.y,b.width,b.height),c.clip()),this.updateContext(c),this.draw(c,!1),c.restore(),this.dispatchEvent("drawend")}},b.tick=function(a){if(this.tickEnabled&&this.dispatchEvent("tickstart",!1,!0)!==!1){var b=new createjs.Event("tick");if(a)for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);this._tick(b),this.dispatchEvent("tickend")}},b.handleEvent=function(a){"tick"==a.type&&this.update(a)},b.clear=function(){if(this.canvas){var a=this.canvas.getContext("2d");a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,this.canvas.width+1,this.canvas.height+1)}},b.toDataURL=function(a,b){var c,d=this.canvas.getContext("2d"),e=this.canvas.width,f=this.canvas.height;if(a){c=d.getImageData(0,0,e,f);var g=d.globalCompositeOperation;d.globalCompositeOperation="destination-over",d.fillStyle=a,d.fillRect(0,0,e,f)}var h=this.canvas.toDataURL(b||"image/png");return a&&(d.putImageData(c,0,0),d.globalCompositeOperation=g),h},b.enableMouseOver=function(a){if(this._mouseOverIntervalID&&(clearInterval(this._mouseOverIntervalID),this._mouseOverIntervalID=null,0==a&&this._testMouseOver(!0)),null==a)a=20;else if(0>=a)return;var b=this;this._mouseOverIntervalID=setInterval(function(){b._testMouseOver()},1e3/Math.min(50,a))},b.enableDOMEvents=function(a){null==a&&(a=!0);var b,c,d=this._eventListeners;if(!a&&d){for(b in d)c=d[b],c.t.removeEventListener(b,c.f,!1);this._eventListeners=null}else if(a&&!d&&this.canvas){var e=window.addEventListener?window:document,f=this;d=this._eventListeners={},d.mouseup={t:e,f:function(a){f._handleMouseUp(a)}},d.mousemove={t:e,f:function(a){f._handleMouseMove(a)}},d.dblclick={t:this.canvas,f:function(a){f._handleDoubleClick(a)}},d.mousedown={t:this.canvas,f:function(a){f._handleMouseDown(a)}};for(b in d)c=d[b],c.t.addEventListener(b,c.f,!1)}},b.clone=function(){throw"Stage cannot be cloned."},b.toString=function(){return"[Stage (name="+this.name+")]"},b._getElementRect=function(a){var b;try{b=a.getBoundingClientRect()}catch(c){b={top:a.offsetTop,left:a.offsetLeft,width:a.offsetWidth,height:a.offsetHeight}}var d=(window.pageXOffset||document.scrollLeft||0)-(document.clientLeft||document.body.clientLeft||0),e=(window.pageYOffset||document.scrollTop||0)-(document.clientTop||document.body.clientTop||0),f=window.getComputedStyle?getComputedStyle(a,null):a.currentStyle,g=parseInt(f.paddingLeft)+parseInt(f.borderLeftWidth),h=parseInt(f.paddingTop)+parseInt(f.borderTopWidth),i=parseInt(f.paddingRight)+parseInt(f.borderRightWidth),j=parseInt(f.paddingBottom)+parseInt(f.borderBottomWidth);return{left:b.left+d+g,right:b.right+d-i,top:b.top+e+h,bottom:b.bottom+e-j}},b._getPointerData=function(a){var b=this._pointerData[a];return b||(b=this._pointerData[a]={x:0,y:0}),b},b._handleMouseMove=function(a){a||(a=window.event),this._handlePointerMove(-1,a,a.pageX,a.pageY)},b._handlePointerMove=function(a,b,c,d,e){if((!this._prevStage||void 0!==e)&&this.canvas){var f=this._nextStage,g=this._getPointerData(a),h=g.inBounds;this._updatePointerPosition(a,b,c,d),(h||g.inBounds||this.mouseMoveOutside)&&(-1===a&&g.inBounds==!h&&this._dispatchMouseEvent(this,h?"mouseleave":"mouseenter",!1,a,g,b),this._dispatchMouseEvent(this,"stagemousemove",!1,a,g,b),this._dispatchMouseEvent(g.target,"pressmove",!0,a,g,b)),f&&f._handlePointerMove(a,b,c,d,null)}},b._updatePointerPosition=function(a,b,c,d){var e=this._getElementRect(this.canvas);c-=e.left,d-=e.top;var f=this.canvas.width,g=this.canvas.height;c/=(e.right-e.left)/f,d/=(e.bottom-e.top)/g;var h=this._getPointerData(a);(h.inBounds=c>=0&&d>=0&&f-1>=c&&g-1>=d)?(h.x=c,h.y=d):this.mouseMoveOutside&&(h.x=0>c?0:c>f-1?f-1:c,h.y=0>d?0:d>g-1?g-1:d),h.posEvtObj=b,h.rawX=c,h.rawY=d,(a===this._primaryPointerID||-1===a)&&(this.mouseX=h.x,this.mouseY=h.y,this.mouseInBounds=h.inBounds)},b._handleMouseUp=function(a){this._handlePointerUp(-1,a,!1)},b._handlePointerUp=function(a,b,c,d){var e=this._nextStage,f=this._getPointerData(a);if(!this._prevStage||void 0!==d){var g=null,h=f.target;d||!h&&!e||(g=this._getObjectsUnderPoint(f.x,f.y,null,!0)),f.down&&(this._dispatchMouseEvent(this,"stagemouseup",!1,a,f,b,g),f.down=!1),g==h&&this._dispatchMouseEvent(h,"click",!0,a,f,b),this._dispatchMouseEvent(h,"pressup",!0,a,f,b),c?(a==this._primaryPointerID&&(this._primaryPointerID=null),delete this._pointerData[a]):f.target=null,e&&e._handlePointerUp(a,b,c,d||g&&this)}},b._handleMouseDown=function(a){this._handlePointerDown(-1,a,a.pageX,a.pageY)},b._handlePointerDown=function(a,b,c,d,e){this.preventSelection&&b.preventDefault(),(null==this._primaryPointerID||-1===a)&&(this._primaryPointerID=a),null!=d&&this._updatePointerPosition(a,b,c,d);var f=null,g=this._nextStage,h=this._getPointerData(a);e||(f=h.target=this._getObjectsUnderPoint(h.x,h.y,null,!0)),h.inBounds&&(this._dispatchMouseEvent(this,"stagemousedown",!1,a,h,b,f),h.down=!0),this._dispatchMouseEvent(f,"mousedown",!0,a,h,b),g&&g._handlePointerDown(a,b,c,d,e||f&&this)},b._testMouseOver=function(a,b,c){if(!this._prevStage||void 0!==b){var d=this._nextStage;if(!this._mouseOverIntervalID)return void(d&&d._testMouseOver(a,b,c));var e=this._getPointerData(-1);if(e&&(a||this.mouseX!=this._mouseOverX||this.mouseY!=this._mouseOverY||!this.mouseInBounds)){var f,g,h,i=e.posEvtObj,j=c||i&&i.target==this.canvas,k=null,l=-1,m="";!b&&(a||this.mouseInBounds&&j)&&(k=this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,!0),this._mouseOverX=this.mouseX,this._mouseOverY=this.mouseY);var n=this._mouseOverTarget||[],o=n[n.length-1],p=this._mouseOverTarget=[];for(f=k;f;)p.unshift(f),m||(m=f.cursor),f=f.parent;for(this.canvas.style.cursor=m,!b&&c&&(c.canvas.style.cursor=m),g=0,h=p.length;h>g&&p[g]==n[g];g++)l=g;for(o!=k&&this._dispatchMouseEvent(o,"mouseout",!0,-1,e,i,k),g=n.length-1;g>l;g--)this._dispatchMouseEvent(n[g],"rollout",!1,-1,e,i,k);for(g=p.length-1;g>l;g--)this._dispatchMouseEvent(p[g],"rollover",!1,-1,e,i,o);o!=k&&this._dispatchMouseEvent(k,"mouseover",!0,-1,e,i,o),d&&d._testMouseOver(a,b||k&&this,c||j&&this)}}},b._handleDoubleClick=function(a,b){var c=null,d=this._nextStage,e=this._getPointerData(-1);b||(c=this._getObjectsUnderPoint(e.x,e.y,null,!0),this._dispatchMouseEvent(c,"dblclick",!0,-1,e,a)),d&&d._handleDoubleClick(a,b||c&&this)},b._dispatchMouseEvent=function(a,b,c,d,e,f,g){if(a&&(c||a.hasEventListener(b))){var h=new createjs.MouseEvent(b,c,!1,e.x,e.y,f,d,d===this._primaryPointerID||-1===d,e.rawX,e.rawY,g);a.dispatchEvent(h)}},createjs.Stage=createjs.promote(a,"Container")}(),this.createjs=this.createjs||{},function(){function a(a){this.DisplayObject_constructor(),"string"==typeof a?(this.image=document.createElement("img"),this.image.src=a):this.image=a,this.sourceRect=null}var b=createjs.extend(a,createjs.DisplayObject);b.initialize=a,b.isVisible=function(){var a=this.image,b=this.cacheCanvas||a&&(a.naturalWidth||a.getContext||a.readyState>=2);return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&b)},b.draw=function(a,b){if(this.DisplayObject_draw(a,b)||!this.image)return!0;var c=this.image,d=this.sourceRect;if(d){var e=d.x,f=d.y,g=e+d.width,h=f+d.height,i=0,j=0,k=c.width,l=c.height;0>e&&(i-=e,e=0),g>k&&(g=k),0>f&&(j-=f,f=0),h>l&&(h=l),a.drawImage(c,e,f,g-e,h-f,i,j,g-e,h-f)}else a.drawImage(c,0,0);return!0},b.getBounds=function(){var a=this.DisplayObject_getBounds();if(a)return a;var b=this.image,c=this.sourceRect||b,d=b&&(b.naturalWidth||b.getContext||b.readyState>=2);return d?this._rectangle.setValues(0,0,c.width,c.height):null},b.clone=function(){var b=new a(this.image);return this.sourceRect&&(b.sourceRect=this.sourceRect.clone()),this._cloneProps(b),b},b.toString=function(){return"[Bitmap (name="+this.name+")]"},createjs.Bitmap=createjs.promote(a,"DisplayObject")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b){this.DisplayObject_constructor(),this.currentFrame=0,this.currentAnimation=null,this.paused=!0,this.spriteSheet=a,this.currentAnimationFrame=0,this.framerate=0,this._animation=null,this._currentFrame=null,this._skipAdvance=!1,null!=b&&this.gotoAndPlay(b)}var b=createjs.extend(a,createjs.DisplayObject);b.initialize=a,b.isVisible=function(){var a=this.cacheCanvas||this.spriteSheet.complete;return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&a)},b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return!0;this._normalizeFrame();var c=this.spriteSheet.getFrame(0|this._currentFrame);if(!c)return!1;var d=c.rect;return d.width&&d.height&&a.drawImage(c.image,d.x,d.y,d.width,d.height,-c.regX,-c.regY,d.width,d.height),!0},b.play=function(){this.paused=!1},b.stop=function(){this.paused=!0},b.gotoAndPlay=function(a){this.paused=!1,this._skipAdvance=!0,this._goto(a)},b.gotoAndStop=function(a){this.paused=!0,this._goto(a)},b.advance=function(a){var b=this.framerate||this.spriteSheet.framerate,c=b&&null!=a?a/(1e3/b):1;this._normalizeFrame(c)},b.getBounds=function(){return this.DisplayObject_getBounds()||this.spriteSheet.getFrameBounds(this.currentFrame,this._rectangle)},b.clone=function(){return this._cloneProps(new a(this.spriteSheet))},b.toString=function(){return"[Sprite (name="+this.name+")]"},b._cloneProps=function(a){return this.DisplayObject__cloneProps(a),a.currentFrame=this.currentFrame,a.currentAnimation=this.currentAnimation,a.paused=this.paused,a.currentAnimationFrame=this.currentAnimationFrame,a.framerate=this.framerate,a._animation=this._animation,a._currentFrame=this._currentFrame,a._skipAdvance=this._skipAdvance,a},b._tick=function(a){this.paused||(this._skipAdvance||this.advance(a&&a.delta),this._skipAdvance=!1),this.DisplayObject__tick(a)},b._normalizeFrame=function(a){a=a||0;var b,c=this._animation,d=this.paused,e=this._currentFrame;if(c){var f=c.speed||1,g=this.currentAnimationFrame;if(b=c.frames.length,g+a*f>=b){var h=c.next;if(this._dispatchAnimationEnd(c,e,d,h,b-1))return;if(h)return this._goto(h,a-(b-g)/f);this.paused=!0,g=c.frames.length-1}else g+=a*f;this.currentAnimationFrame=g,this._currentFrame=c.frames[0|g]}else if(e=this._currentFrame+=a,b=this.spriteSheet.getNumFrames(),e>=b&&b>0&&!this._dispatchAnimationEnd(c,e,d,b-1)&&(this._currentFrame-=b)>=b)return this._normalizeFrame();e=0|this._currentFrame,this.currentFrame!=e&&(this.currentFrame=e,this.dispatchEvent("change"))},b._dispatchAnimationEnd=function(a,b,c,d,e){var f=a?a.name:null;if(this.hasEventListener("animationend")){var g=new createjs.Event("animationend");g.name=f,g.next=d,this.dispatchEvent(g)}var h=this._animation!=a||this._currentFrame!=b;return h||c||!this.paused||(this.currentAnimationFrame=e,h=!0),h},b._goto=function(a,b){if(this.currentAnimationFrame=0,isNaN(a)){var c=this.spriteSheet.getAnimation(a);c&&(this._animation=c,this.currentAnimation=a,this._normalizeFrame(b))}else this.currentAnimation=this._animation=null,this._currentFrame=a,this._normalizeFrame()},createjs.Sprite=createjs.promote(a,"DisplayObject")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.DisplayObject_constructor(),this.graphics=a?a:new createjs.Graphics}var b=createjs.extend(a,createjs.DisplayObject);b.isVisible=function(){var a=this.cacheCanvas||this.graphics&&!this.graphics.isEmpty();return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&a)},b.draw=function(a,b){return this.DisplayObject_draw(a,b)?!0:(this.graphics.draw(a,this),!0)},b.clone=function(b){var c=b&&this.graphics?this.graphics.clone():this.graphics;return this._cloneProps(new a(c))},b.toString=function(){return"[Shape (name="+this.name+")]"},createjs.Shape=createjs.promote(a,"DisplayObject")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c){this.DisplayObject_constructor(),this.text=a,this.font=b,this.color=c,this.textAlign="left",this.textBaseline="top",this.maxWidth=null,this.outline=0,this.lineHeight=0,this.lineWidth=null}var b=createjs.extend(a,createjs.DisplayObject),c=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");c.getContext&&(a._workingContext=c.getContext("2d"),c.width=c.height=1),a.H_OFFSETS={start:0,left:0,center:-.5,end:-1,right:-1},a.V_OFFSETS={top:0,hanging:-.01,middle:-.4,alphabetic:-.8,ideographic:-.85,bottom:-1},b.isVisible=function(){var a=this.cacheCanvas||null!=this.text&&""!==this.text;return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&a)},b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return!0;var c=this.color||"#000";return this.outline?(a.strokeStyle=c,a.lineWidth=1*this.outline):a.fillStyle=c,this._drawText(this._prepContext(a)),!0},b.getMeasuredWidth=function(){return this._getMeasuredWidth(this.text)},b.getMeasuredLineHeight=function(){return 1.2*this._getMeasuredWidth("M")},b.getMeasuredHeight=function(){return this._drawText(null,{}).height},b.getBounds=function(){var b=this.DisplayObject_getBounds();if(b)return b;if(null==this.text||""===this.text)return null;var c=this._drawText(null,{}),d=this.maxWidth&&this.maxWidthj;j++){var l=i[j],m=null;if(null!=this.lineWidth&&(m=b.measureText(l).width)>this.lineWidth){var n=l.split(/(\s)/);l=n[0],m=b.measureText(l).width;for(var o=1,p=n.length;p>o;o+=2){var q=b.measureText(n[o]+n[o+1]).width;m+q>this.lineWidth?(e&&this._drawTextLine(b,l,h*f),d&&d.push(l),m>g&&(g=m),l=n[o+1],m=b.measureText(l).width,h++):(l+=n[o]+n[o+1],m+=q)}}e&&this._drawTextLine(b,l,h*f),d&&d.push(l),c&&null==m&&(m=b.measureText(l).width),m>g&&(g=m),h++}return c&&(c.width=g,c.height=h*f),e||b.restore(),c},b._drawTextLine=function(a,b,c){this.outline?a.strokeText(b,0,c,this.maxWidth||65535):a.fillText(b,0,c,this.maxWidth||65535)},b._getMeasuredWidth=function(b){var c=a._workingContext;c.save();var d=this._prepContext(c).measureText(b).width;return c.restore(),d},createjs.Text=createjs.promote(a,"DisplayObject")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b){this.Container_constructor(),this.text=a||"",this.spriteSheet=b,this.lineHeight=0,this.letterSpacing=0,this.spaceWidth=0,this._oldProps={text:0,spriteSheet:0,lineHeight:0,letterSpacing:0,spaceWidth:0}}var b=createjs.extend(a,createjs.Container);a.maxPoolSize=100,a._spritePool=[],b.draw=function(a,b){this.DisplayObject_draw(a,b)||(this._updateText(),this.Container_draw(a,b))},b.getBounds=function(){return this._updateText(),this.Container_getBounds()},b.isVisible=function(){var a=this.cacheCanvas||this.spriteSheet&&this.spriteSheet.complete&&this.text;return!!(this.visible&&this.alpha>0&&0!==this.scaleX&&0!==this.scaleY&&a)},b.clone=function(){return this._cloneProps(new a(this.text,this.spriteSheet))},b.addChild=b.addChildAt=b.removeChild=b.removeChildAt=b.removeAllChildren=function(){},b._cloneProps=function(a){return this.Container__cloneProps(a),a.lineHeight=this.lineHeight,a.letterSpacing=this.letterSpacing,a.spaceWidth=this.spaceWidth,a},b._getFrameIndex=function(a,b){var c,d=b.getAnimation(a);return d||(a!=(c=a.toUpperCase())||a!=(c=a.toLowerCase())||(c=null),c&&(d=b.getAnimation(c))),d&&d.frames[0]},b._getFrame=function(a,b){var c=this._getFrameIndex(a,b);return null==c?c:b.getFrame(c)},b._getLineHeight=function(a){var b=this._getFrame("1",a)||this._getFrame("T",a)||this._getFrame("L",a)||a.getFrame(0);return b?b.rect.height:1},b._getSpaceWidth=function(a){var b=this._getFrame("1",a)||this._getFrame("l",a)||this._getFrame("e",a)||this._getFrame("a",a)||a.getFrame(0);return b?b.rect.width:1},b._updateText=function(){var b,c=0,d=0,e=this._oldProps,f=!1,g=this.spaceWidth,h=this.lineHeight,i=this.spriteSheet,j=a._spritePool,k=this.children,l=0,m=k.length;for(var n in e)e[n]!=this[n]&&(e[n]=this[n],f=!0);if(f){var o=!!this._getFrame(" ",i);o||g||(g=this._getSpaceWidth(i)),h||(h=this._getLineHeight(i));for(var p=0,q=this.text.length;q>p;p++){var r=this.text.charAt(p);if(" "!=r||o)if("\n"!=r&&"\r"!=r){var s=this._getFrameIndex(r,i);null!=s&&(m>l?b=k[l]:(k.push(b=j.length?j.pop():new createjs.Sprite),b.parent=this,m++),b.spriteSheet=i,b.gotoAndStop(s),b.x=c,b.y=d,l++,c+=b.getBounds().width+this.letterSpacing)}else"\r"==r&&"\n"==this.text.charAt(p+1)&&p++,c=0,d+=h;else c+=g}for(;m>l;)j.push(b=k.pop()),b.parent=null,m--;j.length>a.maxPoolSize&&(j.length=a.maxPoolSize)}},createjs.BitmapText=createjs.promote(a,"Container")}(),this.createjs=this.createjs||{},function(){"use strict";function a(b,c,d,e){this.Container_constructor(),!a.inited&&a.init(),this.mode=b||a.INDEPENDENT,this.startPosition=c||0,this.loop=d,this.currentFrame=0,this.timeline=new createjs.Timeline(null,e,{paused:!0,position:c,useTicks:!0}),this.paused=!1,this.actionsEnabled=!0,this.autoReset=!0,this.frameBounds=this.frameBounds||null,this.framerate=null,this._synchOffset=0,this._prevPos=-1,this._prevPosition=0,this._t=0,this._managed={}}function b(){throw"MovieClipPlugin cannot be instantiated."}var c=createjs.extend(a,createjs.Container);a.INDEPENDENT="independent",a.SINGLE_FRAME="single",a.SYNCHED="synched",a.inited=!1,a.init=function(){a.inited||(b.install(),a.inited=!0)},c.getLabels=function(){return this.timeline.getLabels()},c.getCurrentLabel=function(){return this._updateTimeline(),this.timeline.getCurrentLabel()},c.getDuration=function(){return this.timeline.duration};try{Object.defineProperties(c,{labels:{get:c.getLabels},currentLabel:{get:c.getCurrentLabel},totalFrames:{get:c.getDuration},duration:{get:c.getDuration}})}catch(d){}c.initialize=a,c.isVisible=function(){return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY)},c.draw=function(a,b){return this.DisplayObject_draw(a,b)?!0:(this._updateTimeline(),this.Container_draw(a,b),!0) -},c.play=function(){this.paused=!1},c.stop=function(){this.paused=!0},c.gotoAndPlay=function(a){this.paused=!1,this._goto(a)},c.gotoAndStop=function(a){this.paused=!0,this._goto(a)},c.advance=function(b){var c=a.INDEPENDENT;if(this.mode==c){for(var d=this,e=d.framerate;(d=d.parent)&&null==e;)d.mode==c&&(e=d._framerate);this._framerate=e;var f=null!=e&&-1!=e&&null!=b?b/(1e3/e)+this._t:1,g=0|f;for(this._t=f-g;!this.paused&&g--;)this._prevPosition=this._prevPos<0?0:this._prevPosition+1,this._updateTimeline()}},c.clone=function(){throw"MovieClip cannot be cloned."},c.toString=function(){return"[MovieClip (name="+this.name+")]"},c._tick=function(a){this.advance(a&&a.delta),this.Container__tick(a)},c._goto=function(a){var b=this.timeline.resolve(a);null!=b&&(-1==this._prevPos&&(this._prevPos=0/0),this._prevPosition=b,this._t=0,this._updateTimeline())},c._reset=function(){this._prevPos=-1,this._t=this.currentFrame=0,this.paused=!1},c._updateTimeline=function(){var b=this.timeline,c=this.mode!=a.INDEPENDENT;b.loop=null==this.loop?!0:this.loop;var d=c?this.startPosition+(this.mode==a.SINGLE_FRAME?0:this._synchOffset):this._prevPos<0?0:this._prevPosition,e=c||!this.actionsEnabled?createjs.Tween.NONE:null;if(this.currentFrame=b._calcPosition(d),b.setPosition(d,e),this._prevPosition=b._prevPosition,this._prevPos!=b._prevPos){this.currentFrame=this._prevPos=b._prevPos;for(var f in this._managed)this._managed[f]=1;for(var g=b._tweens,h=0,i=g.length;i>h;h++){var j=g[h],k=j._target;if(k!=this&&!j.passive){var l=j._stepPosition;k instanceof createjs.DisplayObject?this._addManagedChild(k,l):this._setState(k.state,l)}}var m=this.children;for(h=m.length-1;h>=0;h--){var n=m[h].id;1==this._managed[n]&&(this.removeChildAt(h),delete this._managed[n])}}},c._setState=function(a,b){if(a)for(var c=a.length-1;c>=0;c--){var d=a[c],e=d.t,f=d.p;for(var g in f)e[g]=f[g];this._addManagedChild(e,b)}},c._addManagedChild=function(b,c){b._off||(this.addChildAt(b,0),b instanceof a&&(b._synchOffset=c,b.mode==a.INDEPENDENT&&b.autoReset&&!this._managed[b.id]&&b._reset()),this._managed[b.id]=2)},c._getBounds=function(a,b){var c=this.DisplayObject_getBounds();return c||(this._updateTimeline(),this.frameBounds&&(c=this._rectangle.copy(this.frameBounds[this.currentFrame]))),c?this._transformBounds(c,a,b):this.Container__getBounds(a,b)},createjs.MovieClip=createjs.promote(a,"Container"),b.priority=100,b.install=function(){createjs.Tween.installPlugin(b,["startPosition"])},b.init=function(a,b,c){return c},b.step=function(){},b.tween=function(b,c,d,e,f,g){return b.target instanceof a?1==g?f[c]:e[c]:d}}(),this.createjs=this.createjs||{},function(){"use strict";function a(){throw"SpriteSheetUtils cannot be instantiated"}var b=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");b.getContext&&(a._workingCanvas=b,a._workingContext=b.getContext("2d"),b.width=b.height=1),a.addFlippedFrames=function(b,c,d,e){if(c||d||e){var f=0;c&&a._flip(b,++f,!0,!1),d&&a._flip(b,++f,!1,!0),e&&a._flip(b,++f,!0,!0)}},a.extractFrame=function(b,c){isNaN(c)&&(c=b.getAnimation(c).frames[0]);var d=b.getFrame(c);if(!d)return null;var e=d.rect,f=a._workingCanvas;f.width=e.width,f.height=e.height,a._workingContext.drawImage(d.image,e.x,e.y,e.width,e.height,0,0,e.width,e.height);var g=document.createElement("img");return g.src=f.toDataURL("image/png"),g},a.mergeAlpha=function(a,b,c){c||(c=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas")),c.width=Math.max(b.width,a.width),c.height=Math.max(b.height,a.height);var d=c.getContext("2d");return d.save(),d.drawImage(a,0,0),d.globalCompositeOperation="destination-in",d.drawImage(b,0,0),d.restore(),c},a._flip=function(b,c,d,e){for(var f=b._images,g=a._workingCanvas,h=a._workingContext,i=f.length/c,j=0;i>j;j++){var k=f[j];k.__tmp=j,h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,g.width+1,g.height+1),g.width=k.width,g.height=k.height,h.setTransform(d?-1:1,0,0,e?-1:1,d?k.width:0,e?k.height:0),h.drawImage(k,0,0);var l=document.createElement("img");l.src=g.toDataURL("image/png"),l.width=k.width,l.height=k.height,f.push(l)}var m=b._frames,n=m.length/c;for(j=0;n>j;j++){k=m[j];var o=k.rect.clone();l=f[k.image.__tmp+i*c];var p={image:l,rect:o,regX:k.regX,regY:k.regY};d&&(o.x=l.width-o.x-o.width,p.regX=o.width-k.regX),e&&(o.y=l.height-o.y-o.height,p.regY=o.height-k.regY),m.push(p)}var q="_"+(d?"h":"")+(e?"v":""),r=b._animations,s=b._data,t=r.length/c;for(j=0;t>j;j++){var u=r[j];k=s[u];var v={name:u+q,speed:k.speed,next:k.next,frames:[]};k.next&&(v.next+=q),m=k.frames;for(var w=0,x=m.length;x>w;w++)v.frames.push(m[w]+n*c);s[v.name]=v,r.push(v.name)}},createjs.SpriteSheetUtils=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.EventDispatcher_constructor(),this.maxWidth=2048,this.maxHeight=2048,this.spriteSheet=null,this.scale=1,this.padding=1,this.timeSlice=.3,this.progress=-1,this.framerate=a||0,this._frames=[],this._animations={},this._data=null,this._nextFrameIndex=0,this._index=0,this._timerID=null,this._scale=1}var b=createjs.extend(a,createjs.EventDispatcher);a.ERR_DIMENSIONS="frame dimensions exceed max spritesheet dimensions",a.ERR_RUNNING="a build is already running",b.addFrame=function(b,c,d,e,f){if(this._data)throw a.ERR_RUNNING;var g=c||b.bounds||b.nominalBounds;return!g&&b.getBounds&&(g=b.getBounds()),g?(d=d||1,this._frames.push({source:b,sourceRect:g,scale:d,funct:e,data:f,index:this._frames.length,height:g.height*d})-1):null},b.addAnimation=function(b,c,d,e){if(this._data)throw a.ERR_RUNNING;this._animations[b]={frames:c,next:d,speed:e}},b.addMovieClip=function(b,c,d,e,f,g){if(this._data)throw a.ERR_RUNNING;var h=b.frameBounds,i=c||b.bounds||b.nominalBounds;if(!i&&b.getBounds&&(i=b.getBounds()),i||h){var j,k,l=this._frames.length,m=b.timeline.duration;for(j=0;m>j;j++){var n=h&&h[j]?h[j]:i;this.addFrame(b,n,d,this._setupMovieClipFrame,{i:j,f:e,d:f})}var o=b.timeline._labels,p=[];for(var q in o)p.push({index:o[q],label:q});if(p.length)for(p.sort(function(a,b){return a.index-b.index}),j=0,k=p.length;k>j;j++){for(var r=p[j].label,s=l+p[j].index,t=l+(j==k-1?m:p[j+1].index),u=[],v=s;t>v;v++)u.push(v);(!g||(r=g(r,b,s,t)))&&this.addAnimation(r,u,!0)}}},b.build=function(){if(this._data)throw a.ERR_RUNNING;for(this._startBuild();this._drawNext(););return this._endBuild(),this.spriteSheet},b.buildAsync=function(b){if(this._data)throw a.ERR_RUNNING;this.timeSlice=b,this._startBuild();var c=this;this._timerID=setTimeout(function(){c._run()},50-50*Math.max(.01,Math.min(.99,this.timeSlice||.3)))},b.stopAsync=function(){clearTimeout(this._timerID),this._data=null},b.clone=function(){throw"SpriteSheetBuilder cannot be cloned."},b.toString=function(){return"[SpriteSheetBuilder]"},b._startBuild=function(){var b=this.padding||0;this.progress=0,this.spriteSheet=null,this._index=0,this._scale=this.scale;var c=[];this._data={images:[],frames:c,framerate:this.framerate,animations:this._animations};var d=this._frames.slice();if(d.sort(function(a,b){return a.height<=b.height?-1:1}),d[d.length-1].height+2*b>this.maxHeight)throw a.ERR_DIMENSIONS;for(var e=0,f=0,g=0;d.length;){var h=this._fillRow(d,e,g,c,b);if(h.w>f&&(f=h.w),e+=h.h,!h.h||!d.length){var i=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");i.width=this._getSize(f,this.maxWidth),i.height=this._getSize(e,this.maxHeight),this._data.images[g]=i,h.h||(f=e=0,g++)}}},b._setupMovieClipFrame=function(a,b){var c=a.actionsEnabled;a.actionsEnabled=!1,a.gotoAndStop(b.i),a.actionsEnabled=c,b.f&&b.f(a,b.d,b.i)},b._getSize=function(a,b){for(var c=4;Math.pow(2,++c)=0;l--){var m=b[l],n=this._scale*m.scale,o=m.sourceRect,p=m.source,q=Math.floor(n*o.x-f),r=Math.floor(n*o.y-f),s=Math.ceil(n*o.height+2*f),t=Math.ceil(n*o.width+2*f);if(t>g)throw a.ERR_DIMENSIONS;s>i||j+t>g||(m.img=d,m.rect=new createjs.Rectangle(j,c,t,s),k=k||s,b.splice(l,1),e[m.index]=[j,c,t,s,d,Math.round(-q+n*p.regX-f),Math.round(-r+n*p.regY-f)],j+=t)}return{w:j,h:k}},b._endBuild=function(){this.spriteSheet=new createjs.SpriteSheet(this._data),this._data=null,this.progress=1,this.dispatchEvent("complete")},b._run=function(){for(var a=50*Math.max(.01,Math.min(.99,this.timeSlice||.3)),b=(new Date).getTime()+a,c=!1;b>(new Date).getTime();)if(!this._drawNext()){c=!0;break}if(c)this._endBuild();else{var d=this;this._timerID=setTimeout(function(){d._run()},50-a)}var e=this.progress=this._index/this._frames.length;if(this.hasEventListener("progress")){var f=new createjs.Event("progress");f.progress=e,this.dispatchEvent(f)}},b._drawNext=function(){var a=this._frames[this._index],b=a.scale*this._scale,c=a.rect,d=a.sourceRect,e=this._data.images[a.img],f=e.getContext("2d");return a.funct&&a.funct(a.source,a.data),f.save(),f.beginPath(),f.rect(c.x,c.y,c.width,c.height),f.clip(),f.translate(Math.ceil(c.x-d.x*b),Math.ceil(c.y-d.y*b)),f.scale(b,b),a.source.draw(f),f.restore(),++this._indexa)&&(a=0),(isNaN(b)||0>b)&&(b=0),(isNaN(c)||1>c)&&(c=1),this.blurX=0|a,this.blurY=0|b,this.quality=0|c}var b=createjs.extend(a,createjs.Filter);a.MUL_TABLE=[1,171,205,293,57,373,79,137,241,27,391,357,41,19,283,265,497,469,443,421,25,191,365,349,335,161,155,149,9,278,269,261,505,245,475,231,449,437,213,415,405,395,193,377,369,361,353,345,169,331,325,319,313,307,301,37,145,285,281,69,271,267,263,259,509,501,493,243,479,118,465,459,113,446,55,435,429,423,209,413,51,403,199,393,97,3,379,375,371,367,363,359,355,351,347,43,85,337,333,165,327,323,5,317,157,311,77,305,303,75,297,294,73,289,287,71,141,279,277,275,68,135,67,133,33,262,260,129,511,507,503,499,495,491,61,121,481,477,237,235,467,232,115,457,227,451,7,445,221,439,218,433,215,427,425,211,419,417,207,411,409,203,202,401,399,396,197,49,389,387,385,383,95,189,47,187,93,185,23,183,91,181,45,179,89,177,11,175,87,173,345,343,341,339,337,21,167,83,331,329,327,163,81,323,321,319,159,79,315,313,39,155,309,307,153,305,303,151,75,299,149,37,295,147,73,291,145,289,287,143,285,71,141,281,35,279,139,69,275,137,273,17,271,135,269,267,133,265,33,263,131,261,130,259,129,257,1],a.SHG_TABLE=[0,9,10,11,9,12,10,11,12,9,13,13,10,9,13,13,14,14,14,14,10,13,14,14,14,13,13,13,9,14,14,14,15,14,15,14,15,15,14,15,15,15,14,15,15,15,15,15,14,15,15,15,15,15,15,12,14,15,15,13,15,15,15,15,16,16,16,15,16,14,16,16,14,16,13,16,16,16,15,16,13,16,15,16,14,9,16,16,16,16,16,16,16,16,16,13,14,16,16,15,16,16,10,16,15,16,14,16,16,14,16,16,14,16,16,14,15,16,16,16,14,15,14,15,13,16,16,15,17,17,17,17,17,17,14,15,17,17,16,16,17,16,15,17,16,17,11,17,16,17,16,17,16,17,17,16,17,17,16,17,17,16,16,17,17,17,16,14,17,17,17,17,15,16,14,16,15,16,13,16,15,16,14,16,15,16,12,16,15,16,17,17,17,17,17,13,16,15,17,17,17,16,15,17,17,17,16,15,17,17,14,16,17,17,16,17,17,16,15,17,16,14,17,16,15,17,16,17,17,16,17,15,16,17,14,17,16,15,17,16,17,13,17,16,17,17,16,17,14,17,16,17,16,17,16,17,9],b.getBounds=function(a){var b=0|this.blurX,c=0|this.blurY;if(0>=b&&0>=c)return a;var d=Math.pow(this.quality,.2);return(a||new createjs.Rectangle).pad(b*d+1,c*d+1,b*d+1,c*d+1)},b.clone=function(){return new a(this.blurX,this.blurY,this.quality)},b.toString=function(){return"[BlurFilter]"},b._applyFilter=function(b){var c=this.blurX>>1;if(isNaN(c)||0>c)return!1;var d=this.blurY>>1;if(isNaN(d)||0>d)return!1;if(0==c&&0==d)return!1;var e=this.quality;(isNaN(e)||1>e)&&(e=1),e|=0,e>3&&(e=3),1>e&&(e=1);var f=b.data,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=c+c+1|0,w=d+d+1|0,x=0|b.width,y=0|b.height,z=x-1|0,A=y-1|0,B=c+1|0,C=d+1|0,D={r:0,b:0,g:0,a:0},E=D;for(i=1;v>i;i++)E=E.n={r:0,b:0,g:0,a:0};E.n=D;var F={r:0,b:0,g:0,a:0},G=F;for(i=1;w>i;i++)G=G.n={r:0,b:0,g:0,a:0};G.n=F;for(var H=null,I=0|a.MUL_TABLE[c],J=0|a.SHG_TABLE[c],K=0|a.MUL_TABLE[d],L=0|a.SHG_TABLE[d];e-->0;){m=l=0;var M=I,N=J;for(h=y;--h>-1;){for(n=B*(r=f[0|l]),o=B*(s=f[l+1|0]),p=B*(t=f[l+2|0]),q=B*(u=f[l+3|0]),E=D,i=B;--i>-1;)E.r=r,E.g=s,E.b=t,E.a=u,E=E.n;for(i=1;B>i;i++)j=l+((i>z?z:i)<<2)|0,n+=E.r=f[j],o+=E.g=f[j+1],p+=E.b=f[j+2],q+=E.a=f[j+3],E=E.n;for(H=D,g=0;x>g;g++)f[l++]=n*M>>>N,f[l++]=o*M>>>N,f[l++]=p*M>>>N,f[l++]=q*M>>>N,j=m+((j=g+c+1)g;g++){for(l=g<<2|0,n=C*(r=f[l])|0,o=C*(s=f[l+1|0])|0,p=C*(t=f[l+2|0])|0,q=C*(u=f[l+3|0])|0,G=F,i=0;C>i;i++)G.r=r,G.g=s,G.b=t,G.a=u,G=G.n;for(k=x,i=1;d>=i;i++)l=k+g<<2,n+=G.r=f[l],o+=G.g=f[l+1],p+=G.b=f[l+2],q+=G.a=f[l+3],G=G.n,A>i&&(k+=x);if(l=g,H=F,e>0)for(h=0;y>h;h++)j=l<<2,f[j+3]=u=q*M>>>N,u>0?(f[j]=n*M>>>N,f[j+1]=o*M>>>N,f[j+2]=p*M>>>N):f[j]=f[j+1]=f[j+2]=0,j=g+((j=h+C)h;h++)j=l<<2,f[j+3]=u=q*M>>>N,u>0?(u=255/u,f[j]=(n*M>>>N)*u,f[j+1]=(o*M>>>N)*u,f[j+2]=(p*M>>>N)*u):f[j]=f[j+1]=f[j+2]=0,j=g+((j=h+C)d;d+=4)b[d+3]=c[d]||0;return!0},b._prepAlphaMap=function(){if(!this.alphaMap)return!1;if(this.alphaMap==this._alphaMap&&this._mapData)return!0;this._mapData=null;var a,b=this._alphaMap=this.alphaMap,c=b;b instanceof HTMLCanvasElement?a=c.getContext("2d"):(c=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas"),c.width=b.width,c.height=b.height,a=c.getContext("2d"),a.drawImage(b,0,0));try{var d=a.getImageData(0,0,b.width,b.height)}catch(e){return!1}return this._mapData=d.data,!0},createjs.AlphaMapFilter=createjs.promote(a,"Filter")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.mask=a}var b=createjs.extend(a,createjs.Filter);b.applyFilter=function(a,b,c,d,e,f,g,h){return this.mask?(f=f||a,null==g&&(g=b),null==h&&(h=c),f.save(),a!=f?!1:(f.globalCompositeOperation="destination-in",f.drawImage(this.mask,g,h),f.restore(),!0)):!0},b.clone=function(){return new a(this.mask)},b.toString=function(){return"[AlphaMaskFilter]"},createjs.AlphaMaskFilter=createjs.promote(a,"Filter")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d,e,f,g,h){this.redMultiplier=null!=a?a:1,this.greenMultiplier=null!=b?b:1,this.blueMultiplier=null!=c?c:1,this.alphaMultiplier=null!=d?d:1,this.redOffset=e||0,this.greenOffset=f||0,this.blueOffset=g||0,this.alphaOffset=h||0}var b=createjs.extend(a,createjs.Filter);b.toString=function(){return"[ColorFilter]"},b.clone=function(){return new a(this.redMultiplier,this.greenMultiplier,this.blueMultiplier,this.alphaMultiplier,this.redOffset,this.greenOffset,this.blueOffset,this.alphaOffset)},b._applyFilter=function(a){for(var b=a.data,c=b.length,d=0;c>d;d+=4)b[d]=b[d]*this.redMultiplier+this.redOffset,b[d+1]=b[d+1]*this.greenMultiplier+this.greenOffset,b[d+2]=b[d+2]*this.blueMultiplier+this.blueOffset,b[d+3]=b[d+3]*this.alphaMultiplier+this.alphaOffset;return!0},createjs.ColorFilter=createjs.promote(a,"Filter")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d){this.setColor(a,b,c,d)}var b=a.prototype;a.DELTA_INDEX=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10],a.IDENTITY_MATRIX=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],a.LENGTH=a.IDENTITY_MATRIX.length,b.setColor=function(a,b,c,d){return this.reset().adjustColor(a,b,c,d)},b.reset=function(){return this.copy(a.IDENTITY_MATRIX)},b.adjustColor=function(a,b,c,d){return this.adjustHue(d),this.adjustContrast(b),this.adjustBrightness(a),this.adjustSaturation(c)},b.adjustBrightness=function(a){return 0==a||isNaN(a)?this:(a=this._cleanValue(a,255),this._multiplyMatrix([1,0,0,0,a,0,1,0,0,a,0,0,1,0,a,0,0,0,1,0,0,0,0,0,1]),this)},b.adjustContrast=function(b){if(0==b||isNaN(b))return this;b=this._cleanValue(b,100);var c;return 0>b?c=127+b/100*127:(c=b%1,c=0==c?a.DELTA_INDEX[b]:a.DELTA_INDEX[b<<0]*(1-c)+a.DELTA_INDEX[(b<<0)+1]*c,c=127*c+127),this._multiplyMatrix([c/127,0,0,0,.5*(127-c),0,c/127,0,0,.5*(127-c),0,0,c/127,0,.5*(127-c),0,0,0,1,0,0,0,0,0,1]),this},b.adjustSaturation=function(a){if(0==a||isNaN(a))return this;a=this._cleanValue(a,100);var b=1+(a>0?3*a/100:a/100),c=.3086,d=.6094,e=.082;return this._multiplyMatrix([c*(1-b)+b,d*(1-b),e*(1-b),0,0,c*(1-b),d*(1-b)+b,e*(1-b),0,0,c*(1-b),d*(1-b),e*(1-b)+b,0,0,0,0,0,1,0,0,0,0,0,1]),this},b.adjustHue=function(a){if(0==a||isNaN(a))return this;a=this._cleanValue(a,180)/180*Math.PI;var b=Math.cos(a),c=Math.sin(a),d=.213,e=.715,f=.072;return this._multiplyMatrix([d+b*(1-d)+c*-d,e+b*-e+c*-e,f+b*-f+c*(1-f),0,0,d+b*-d+.143*c,e+b*(1-e)+.14*c,f+b*-f+c*-.283,0,0,d+b*-d+c*-(1-d),e+b*-e+c*e,f+b*(1-f)+c*f,0,0,0,0,0,1,0,0,0,0,0,1]),this},b.concat=function(b){return b=this._fixMatrix(b),b.length!=a.LENGTH?this:(this._multiplyMatrix(b),this)},b.clone=function(){return(new a).copy(this)},b.toArray=function(){for(var b=[],c=0,d=a.LENGTH;d>c;c++)b[c]=this[c];return b},b.copy=function(b){for(var c=a.LENGTH,d=0;c>d;d++)this[d]=b[d];return this},b.toString=function(){return"[ColorMatrix]"},b._multiplyMatrix=function(a){var b,c,d,e=[];for(b=0;5>b;b++){for(c=0;5>c;c++)e[c]=this[c+5*b];for(c=0;5>c;c++){var f=0;for(d=0;5>d;d++)f+=a[c+5*d]*e[d];this[c+5*b]=f}}},b._cleanValue=function(a,b){return Math.min(b,Math.max(-b,a))},b._fixMatrix=function(b){return b instanceof a&&(b=b.toArray()),b.lengtha.LENGTH&&(b=b.slice(0,a.LENGTH)),b},createjs.ColorMatrix=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.matrix=a}var b=createjs.extend(a,createjs.Filter);b.toString=function(){return"[ColorMatrixFilter]"},b.clone=function(){return new a(this.matrix)},b._applyFilter=function(a){for(var b,c,d,e,f=a.data,g=f.length,h=this.matrix,i=h[0],j=h[1],k=h[2],l=h[3],m=h[4],n=h[5],o=h[6],p=h[7],q=h[8],r=h[9],s=h[10],t=h[11],u=h[12],v=h[13],w=h[14],x=h[15],y=h[16],z=h[17],A=h[18],B=h[19],C=0;g>C;C+=4)b=f[C],c=f[C+1],d=f[C+2],e=f[C+3],f[C]=b*i+c*j+d*k+e*l+m,f[C+1]=b*n+c*o+d*p+e*q+r,f[C+2]=b*s+c*t+d*u+e*v+w,f[C+3]=b*x+c*y+d*z+e*A+B;return!0},createjs.ColorMatrixFilter=createjs.promote(a,"Filter")}(),this.createjs=this.createjs||{},function(){"use strict";function a(){throw"Touch cannot be instantiated"}a.isSupported=function(){return!!("ontouchstart"in window||window.navigator.msPointerEnabled&&window.navigator.msMaxTouchPoints>0||window.navigator.pointerEnabled&&window.navigator.maxTouchPoints>0)},a.enable=function(b,c,d){return b&&b.canvas&&a.isSupported()?b.__touch?!0:(b.__touch={pointers:{},multitouch:!c,preventDefault:!d,count:0},"ontouchstart"in window?a._IOS_enable(b):(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&a._IE_enable(b),!0):!1},a.disable=function(b){b&&("ontouchstart"in window?a._IOS_disable(b):(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&a._IE_disable(b),delete b.__touch)},a._IOS_enable=function(b){var c=b.canvas,d=b.__touch.f=function(c){a._IOS_handleEvent(b,c)};c.addEventListener("touchstart",d,!1),c.addEventListener("touchmove",d,!1),c.addEventListener("touchend",d,!1),c.addEventListener("touchcancel",d,!1)},a._IOS_disable=function(a){var b=a.canvas;if(b){var c=a.__touch.f;b.removeEventListener("touchstart",c,!1),b.removeEventListener("touchmove",c,!1),b.removeEventListener("touchend",c,!1),b.removeEventListener("touchcancel",c,!1)}},a._IOS_handleEvent=function(a,b){if(a){a.__touch.preventDefault&&b.preventDefault&&b.preventDefault();for(var c=b.changedTouches,d=b.type,e=0,f=c.length;f>e;e++){var g=c[e],h=g.identifier;g.target==a.canvas&&("touchstart"==d?this._handleStart(a,h,b,g.pageX,g.pageY):"touchmove"==d?this._handleMove(a,h,b,g.pageX,g.pageY):("touchend"==d||"touchcancel"==d)&&this._handleEnd(a,h,b))}}},a._IE_enable=function(b){var c=b.canvas,d=b.__touch.f=function(c){a._IE_handleEvent(b,c)};void 0===window.navigator.pointerEnabled?(c.addEventListener("MSPointerDown",d,!1),window.addEventListener("MSPointerMove",d,!1),window.addEventListener("MSPointerUp",d,!1),window.addEventListener("MSPointerCancel",d,!1),b.__touch.preventDefault&&(c.style.msTouchAction="none")):(c.addEventListener("pointerdown",d,!1),window.addEventListener("pointermove",d,!1),window.addEventListener("pointerup",d,!1),window.addEventListener("pointercancel",d,!1),b.__touch.preventDefault&&(c.style.touchAction="none")),b.__touch.activeIDs={}},a._IE_disable=function(a){var b=a.__touch.f;void 0===window.navigator.pointerEnabled?(window.removeEventListener("MSPointerMove",b,!1),window.removeEventListener("MSPointerUp",b,!1),window.removeEventListener("MSPointerCancel",b,!1),a.canvas&&a.canvas.removeEventListener("MSPointerDown",b,!1)):(window.removeEventListener("pointermove",b,!1),window.removeEventListener("pointerup",b,!1),window.removeEventListener("pointercancel",b,!1),a.canvas&&a.canvas.removeEventListener("pointerdown",b,!1))},a._IE_handleEvent=function(a,b){if(a){a.__touch.preventDefault&&b.preventDefault&&b.preventDefault();var c=b.type,d=b.pointerId,e=a.__touch.activeIDs;if("MSPointerDown"==c||"pointerdown"==c){if(b.srcElement!=a.canvas)return;e[d]=!0,this._handleStart(a,d,b,b.pageX,b.pageY)}else e[d]&&("MSPointerMove"==c||"pointermove"==c?this._handleMove(a,d,b,b.pageX,b.pageY):("MSPointerUp"==c||"MSPointerCancel"==c||"pointerup"==c||"pointercancel"==c)&&(delete e[d],this._handleEnd(a,d,b)))}},a._handleStart=function(a,b,c,d,e){var f=a.__touch;if(f.multitouch||!f.count){var g=f.pointers;g[b]||(g[b]=!0,f.count++,a._handlePointerDown(b,c,d,e))}},a._handleMove=function(a,b,c,d,e){a.__touch.pointers[b]&&a._handlePointerMove(b,c,d,e)},a._handleEnd=function(a,b,c){var d=a.__touch,e=d.pointers;e[b]&&(d.count--,a._handlePointerUp(b,c,!0),delete e[b])},createjs.Touch=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=createjs.EaselJS=createjs.EaselJS||{};a.version="NEXT",a.buildDate="Thu, 19 Nov 2015 21:53:41 GMT"}(); \ No newline at end of file +this.createjs=this.createjs||{},createjs.extend=function(a,b){"use strict";function c(){this.constructor=a}return c.prototype=b.prototype,a.prototype=new c},this.createjs=this.createjs||{},createjs.promote=function(a,b){"use strict";var c=a.prototype,d=Object.getPrototypeOf&&Object.getPrototypeOf(c)||c.__proto__;if(d){c[(b+="_")+"constructor"]=d.constructor;for(var e in d)c.hasOwnProperty(e)&&"function"==typeof d[e]&&(c[b+e]=d[e])}return a},this.createjs=this.createjs||{},createjs.indexOf=function(a,b){"use strict";for(var c=0,d=a.length;d>c;c++)if(b===a[c])return c;return-1},this.createjs=this.createjs||{},function(){"use strict";function a(){throw"UID cannot be instantiated"}a._nextID=0,a.get=function(){return a._nextID++},createjs.UID=a}(),this.createjs=this.createjs||{},createjs.deprecate=function(a,b){"use strict";return function(){var c="Deprecated property or method '"+b+"'. See docs for info.";return console&&(console.warn?console.warn(c):console.log(c)),a&&a.apply(this,arguments)}},this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c){this.type=a,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!b,this.cancelable=!!c,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var b=a.prototype;b.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},b.stopPropagation=function(){this.propagationStopped=!0},b.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},b.remove=function(){this.removed=!0},b.clone=function(){return new a(this.type,this.bubbles,this.cancelable)},b.set=function(a){for(var b in a)this[b]=a[b];return this},b.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(){this._listeners=null,this._captureListeners=null}var b=a.prototype;a.initialize=function(a){a.addEventListener=b.addEventListener,a.on=b.on,a.removeEventListener=a.off=b.removeEventListener,a.removeAllEventListeners=b.removeAllEventListeners,a.hasEventListener=b.hasEventListener,a.dispatchEvent=b.dispatchEvent,a._dispatchEvent=b._dispatchEvent,a.willTrigger=b.willTrigger},b.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},b.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},b.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},b.off=b.removeEventListener,b.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},b.dispatchEvent=function(a,b,c){if("string"==typeof a){var d=this._listeners;if(!(b||d&&d[a]))return!0;a=new createjs.Event(a,b,c)}else a.target&&a.clone&&(a=a.clone());try{a.target=this}catch(e){}if(a.bubbles&&this.parent){for(var f=this,g=[f];f.parent;)g.push(f=f.parent);var h,i=g.length;for(h=i-1;h>=0&&!a.propagationStopped;h--)g[h]._dispatchEvent(a,1+(0==h));for(h=1;i>h&&!a.propagationStopped;h++)g[h]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return!a.defaultPrevented},b.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},b.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1},b.toString=function(){return"[EventDispatcher]"},b._dispatchEvent=function(a,b){var c,d,e=2>=b?this._captureListeners:this._listeners;if(a&&e&&(d=e[a.type])&&(c=d.length)){try{a.currentTarget=this}catch(f){}try{a.eventPhase=0|b}catch(f){}a.removed=!1,d=d.slice();for(var g=0;c>g&&!a.immediatePropagationStopped;g++){var h=d[g];h.handleEvent?h.handleEvent(a):h(a),a.removed&&(this.off(a.type,h,1==b),a.removed=!1)}}2===b&&this._dispatchEvent(a,2.1)},createjs.EventDispatcher=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(){throw"Ticker cannot be instantiated."}a.RAF_SYNCHED="synched",a.RAF="raf",a.TIMEOUT="timeout",a.timingMode=null,a.maxDelta=0,a.paused=!1,a.removeEventListener=null,a.removeAllEventListeners=null,a.dispatchEvent=null,a.hasEventListener=null,a._listeners=null,createjs.EventDispatcher.initialize(a),a._addEventListener=a.addEventListener,a.addEventListener=function(){return!a._inited&&a.init(),a._addEventListener.apply(a,arguments)},a._inited=!1,a._startTime=0,a._pausedTime=0,a._ticks=0,a._pausedTicks=0,a._interval=50,a._lastTime=0,a._times=null,a._tickTimes=null,a._timerId=null,a._raf=!0,a._setInterval=function(b){a._interval=b,a._inited&&a._setupTick()},a.setInterval=createjs.deprecate(a._setInterval,"Ticker.setInterval"),a._getInterval=function(){return a._interval},a.getInterval=createjs.deprecate(a._getInterval,"Ticker.getInterval"),a._setFPS=function(b){a._setInterval(1e3/b)},a.setFPS=createjs.deprecate(a._setFPS,"Ticker.setFPS"),a._getFPS=function(){return 1e3/a._interval},a.getFPS=createjs.deprecate(a._getFPS,"Ticker.getFPS");try{Object.defineProperties(a,{interval:{get:a._getInterval,set:a._setInterval},framerate:{get:a._getFPS,set:a._setFPS}})}catch(b){console.log(b)}a.init=function(){a._inited||(a._inited=!0,a._times=[],a._tickTimes=[],a._startTime=a._getTime(),a._times.push(a._lastTime=0),a.interval=a._interval)},a.reset=function(){if(a._raf){var b=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame;b&&b(a._timerId)}else clearTimeout(a._timerId);a.removeAllEventListeners("tick"),a._timerId=a._times=a._tickTimes=null,a._startTime=a._lastTime=a._ticks=a._pausedTime=0,a._inited=!1},a.getMeasuredTickTime=function(b){var c=0,d=a._tickTimes;if(!d||d.length<1)return-1;b=Math.min(d.length,b||0|a._getFPS());for(var e=0;b>e;e++)c+=d[e];return c/b},a.getMeasuredFPS=function(b){var c=a._times;return!c||c.length<2?-1:(b=Math.min(c.length-1,b||0|a._getFPS()),1e3/((c[0]-c[b])/b))},a.getTime=function(b){return a._startTime?a._getTime()-(b?a._pausedTime:0):-1},a.getEventTime=function(b){return a._startTime?(a._lastTime||a._startTime)-(b?a._pausedTime:0):-1},a.getTicks=function(b){return a._ticks-(b?a._pausedTicks:0)},a._handleSynch=function(){a._timerId=null,a._setupTick(),a._getTime()-a._lastTime>=.97*(a._interval-1)&&a._tick()},a._handleRAF=function(){a._timerId=null,a._setupTick(),a._tick()},a._handleTimeout=function(){a._timerId=null,a._setupTick(),a._tick()},a._setupTick=function(){if(null==a._timerId){var b=a.timingMode;if(b==a.RAF_SYNCHED||b==a.RAF){var c=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(c)return a._timerId=c(b==a.RAF?a._handleRAF:a._handleSynch),void(a._raf=!0)}a._raf=!1,a._timerId=setTimeout(a._handleTimeout,a._interval)}},a._tick=function(){var b=a.paused,c=a._getTime(),d=c-a._lastTime;if(a._lastTime=c,a._ticks++,b&&(a._pausedTicks++,a._pausedTime+=d),a.hasEventListener("tick")){var e=new createjs.Event("tick"),f=a.maxDelta;e.delta=f&&d>f?f:d,e.paused=b,e.time=c,e.runTime=c-a._pausedTime,a.dispatchEvent(e)}for(a._tickTimes.unshift(a._getTime()-c);a._tickTimes.length>100;)a._tickTimes.pop();for(a._times.unshift(c);a._times.length>100;)a._times.pop()};var c=window,d=c.performance.now||c.performance.mozNow||c.performance.msNow||c.performance.oNow||c.performance.webkitNow;a._getTime=function(){return(d&&d.call(c.performance)||(new Date).getTime())-a._startTime},createjs.Ticker=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.readyState=a.readyState,this._video=a,this._canvas=null,this._lastTime=-1,this.readyState<2&&a.addEventListener("canplaythrough",this._videoReady.bind(this))}var b=a.prototype;b.getImage=function(){if(!(this.readyState<2)){var a=this._canvas,b=this._video;if(a||(a=this._canvas=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas"),a.width=b.videoWidth,a.height=b.videoHeight),b.readyState>=2&&b.currentTime!==this._lastTime){var c=a.getContext("2d");c.clearRect(0,0,a.width,a.height),c.drawImage(b,0,0,a.width,a.height),this._lastTime=b.currentTime}return a}},b._videoReady=function(){this.readyState=2},createjs.VideoBuffer=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d,e,f,g,h,i,j,k){this.Event_constructor(a,b,c),this.stageX=d,this.stageY=e,this.rawX=null==i?d:i,this.rawY=null==j?e:j,this.nativeEvent=f,this.pointerID=g,this.primary=!!h,this.relatedTarget=k}var b=createjs.extend(a,createjs.Event);b._get_localX=function(){return this.currentTarget.globalToLocal(this.rawX,this.rawY).x},b._get_localY=function(){return this.currentTarget.globalToLocal(this.rawX,this.rawY).y},b._get_isTouch=function(){return-1!==this.pointerID};try{Object.defineProperties(b,{localX:{get:b._get_localX},localY:{get:b._get_localY},isTouch:{get:b._get_isTouch}})}catch(c){}b.clone=function(){return new a(this.type,this.bubbles,this.cancelable,this.stageX,this.stageY,this.nativeEvent,this.pointerID,this.primary,this.rawX,this.rawY)},b.toString=function(){return"[MouseEvent (type="+this.type+" stageX="+this.stageX+" stageY="+this.stageY+")]"},createjs.MouseEvent=createjs.promote(a,"Event")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d,e,f){this.setValues(a,b,c,d,e,f)}var b=a.prototype;a.DEG_TO_RAD=Math.PI/180,a.identity=null,b.setValues=function(a,b,c,d,e,f){return this.a=null==a?1:a,this.b=b||0,this.c=c||0,this.d=null==d?1:d,this.tx=e||0,this.ty=f||0,this},b.append=function(a,b,c,d,e,f){var g=this.a,h=this.b,i=this.c,j=this.d;return(1!=a||0!=b||0!=c||1!=d)&&(this.a=g*a+i*b,this.b=h*a+j*b,this.c=g*c+i*d,this.d=h*c+j*d),this.tx=g*e+i*f+this.tx,this.ty=h*e+j*f+this.ty,this},b.prepend=function(a,b,c,d,e,f){var g=this.a,h=this.c,i=this.tx;return this.a=a*g+c*this.b,this.b=b*g+d*this.b,this.c=a*h+c*this.d,this.d=b*h+d*this.d,this.tx=a*i+c*this.ty+e,this.ty=b*i+d*this.ty+f,this},b.appendMatrix=function(a){return this.append(a.a,a.b,a.c,a.d,a.tx,a.ty)},b.prependMatrix=function(a){return this.prepend(a.a,a.b,a.c,a.d,a.tx,a.ty)},b.appendTransform=function(b,c,d,e,f,g,h,i,j){if(f%360)var k=f*a.DEG_TO_RAD,l=Math.cos(k),m=Math.sin(k);else l=1,m=0;return g||h?(g*=a.DEG_TO_RAD,h*=a.DEG_TO_RAD,this.append(Math.cos(h),Math.sin(h),-Math.sin(g),Math.cos(g),b,c),this.append(l*d,m*d,-m*e,l*e,0,0)):this.append(l*d,m*d,-m*e,l*e,b,c),(i||j)&&(this.tx-=i*this.a+j*this.c,this.ty-=i*this.b+j*this.d),this},b.prependTransform=function(b,c,d,e,f,g,h,i,j){if(f%360)var k=f*a.DEG_TO_RAD,l=Math.cos(k),m=Math.sin(k);else l=1,m=0;return(i||j)&&(this.tx-=i,this.ty-=j),g||h?(g*=a.DEG_TO_RAD,h*=a.DEG_TO_RAD,this.prepend(l*d,m*d,-m*e,l*e,0,0),this.prepend(Math.cos(h),Math.sin(h),-Math.sin(g),Math.cos(g),b,c)):this.prepend(l*d,m*d,-m*e,l*e,b,c),this},b.rotate=function(b){b*=a.DEG_TO_RAD;var c=Math.cos(b),d=Math.sin(b),e=this.a,f=this.b;return this.a=e*c+this.c*d,this.b=f*c+this.d*d,this.c=-e*d+this.c*c,this.d=-f*d+this.d*c,this},b.skew=function(b,c){return b*=a.DEG_TO_RAD,c*=a.DEG_TO_RAD,this.append(Math.cos(c),Math.sin(c),-Math.sin(b),Math.cos(b),0,0),this},b.scale=function(a,b){return this.a*=a,this.b*=a,this.c*=b,this.d*=b,this},b.translate=function(a,b){return this.tx+=this.a*a+this.c*b,this.ty+=this.b*a+this.d*b,this},b.identity=function(){return this.a=this.d=1,this.b=this.c=this.tx=this.ty=0,this},b.invert=function(){var a=this.a,b=this.b,c=this.c,d=this.d,e=this.tx,f=a*d-b*c;return this.a=d/f,this.b=-b/f,this.c=-c/f,this.d=a/f,this.tx=(c*this.ty-d*e)/f,this.ty=-(a*this.ty-b*e)/f,this},b.isIdentity=function(){return 0===this.tx&&0===this.ty&&1===this.a&&0===this.b&&0===this.c&&1===this.d},b.equals=function(a){return this.tx===a.tx&&this.ty===a.ty&&this.a===a.a&&this.b===a.b&&this.c===a.c&&this.d===a.d},b.transformPoint=function(a,b,c){return c=c||{},c.x=a*this.a+b*this.c+this.tx,c.y=a*this.b+b*this.d+this.ty,c},b.decompose=function(b){null==b&&(b={}),b.x=this.tx,b.y=this.ty,b.scaleX=Math.sqrt(this.a*this.a+this.b*this.b),b.scaleY=Math.sqrt(this.c*this.c+this.d*this.d);var c=Math.atan2(-this.c,this.d),d=Math.atan2(this.b,this.a),e=Math.abs(1-c/d);return 1e-5>e?(b.rotation=d/a.DEG_TO_RAD,this.a<0&&this.d>=0&&(b.rotation+=b.rotation<=0?180:-180),b.skewX=b.skewY=0):(b.skewX=c/a.DEG_TO_RAD,b.skewY=d/a.DEG_TO_RAD),b},b.copy=function(a){return this.setValues(a.a,a.b,a.c,a.d,a.tx,a.ty)},b.clone=function(){return new a(this.a,this.b,this.c,this.d,this.tx,this.ty)},b.toString=function(){return"[Matrix2D (a="+this.a+" b="+this.b+" c="+this.c+" d="+this.d+" tx="+this.tx+" ty="+this.ty+")]"},a.identity=new a,createjs.Matrix2D=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d,e){this.setValues(a,b,c,d,e)}var b=a.prototype;b.setValues=function(a,b,c,d,e){return this.visible=null==a?!0:!!a,this.alpha=null==b?1:b,this.shadow=c,this.compositeOperation=d,this.matrix=e||this.matrix&&this.matrix.identity()||new createjs.Matrix2D,this},b.append=function(a,b,c,d,e){return this.alpha*=b,this.shadow=c||this.shadow,this.compositeOperation=d||this.compositeOperation,this.visible=this.visible&&a,e&&this.matrix.appendMatrix(e),this},b.prepend=function(a,b,c,d,e){return this.alpha*=b,this.shadow=this.shadow||c,this.compositeOperation=this.compositeOperation||d,this.visible=this.visible&&a,e&&this.matrix.prependMatrix(e),this},b.identity=function(){return this.visible=!0,this.alpha=1,this.shadow=this.compositeOperation=null,this.matrix.identity(),this},b.clone=function(){return new a(this.alpha,this.shadow,this.compositeOperation,this.visible,this.matrix.clone())},createjs.DisplayProps=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b){this.setValues(a,b)}var b=a.prototype;b.setValues=function(a,b){return this.x=a||0,this.y=b||0,this},b.copy=function(a){return this.x=a.x,this.y=a.y,this},b.clone=function(){return new a(this.x,this.y)},b.toString=function(){return"[Point (x="+this.x+" y="+this.y+")]"},createjs.Point=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d){this.setValues(a,b,c,d)}var b=a.prototype;b.setValues=function(a,b,c,d){return this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0,this},b.extend=function(a,b,c,d){return c=c||0,d=d||0,a+c>this.x+this.width&&(this.width=a+c-this.x),b+d>this.y+this.height&&(this.height=b+d-this.y),a=this.x&&a+c<=this.x+this.width&&b>=this.y&&b+d<=this.y+this.height},b.union=function(a){return this.clone().extend(a.x,a.y,a.width,a.height)},b.intersection=function(b){var c=b.x,d=b.y,e=c+b.width,f=d+b.height;return this.x>c&&(c=this.x),this.y>d&&(d=this.y),this.x+this.width=e||d>=f?null:new a(c,d,e-c,f-d)},b.intersects=function(a){return a.x<=this.x+this.width&&this.x<=a.x+a.width&&a.y<=this.y+this.height&&this.y<=a.y+a.height},b.isEmpty=function(){return this.width<=0||this.height<=0},b.clone=function(){return new a(this.x,this.y,this.width,this.height)},b.toString=function(){return"[Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")]"},createjs.Rectangle=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d,e,f,g){a.addEventListener&&(this.target=a,this.overLabel=null==c?"over":c,this.outLabel=null==b?"out":b,this.downLabel=null==d?"down":d,this.play=e,this._isPressed=!1,this._isOver=!1,this._enabled=!1,a.mouseChildren=!1,this.enabled=!0,this.handleEvent({}),f&&(g&&(f.actionsEnabled=!1,f.gotoAndStop&&f.gotoAndStop(g)),a.hitArea=f))}var b=a.prototype;b._setEnabled=function(a){if(a!=this._enabled){var b=this.target;this._enabled=a,a?(b.cursor="pointer",b.addEventListener("rollover",this),b.addEventListener("rollout",this),b.addEventListener("mousedown",this),b.addEventListener("pressup",this),b._reset&&(b.__reset=b._reset,b._reset=this._reset)):(b.cursor=null,b.removeEventListener("rollover",this),b.removeEventListener("rollout",this),b.removeEventListener("mousedown",this),b.removeEventListener("pressup",this),b.__reset&&(b._reset=b.__reset,delete b.__reset))}},b.setEnabled=createjs.deprecate(b._setEnabled,"ButtonHelper.setEnabled"),b._getEnabled=function(){return this._enabled},b.getEnabled=createjs.deprecate(b._getEnabled,"ButtonHelper.getEnabled");try{Object.defineProperties(b,{enabled:{get:b._getEnabled,set:b._setEnabled}})}catch(c){}b.toString=function(){return"[ButtonHelper]"},b.handleEvent=function(a){var b,c=this.target,d=a.type;"mousedown"==d?(this._isPressed=!0,b=this.downLabel):"pressup"==d?(this._isPressed=!1,b=this._isOver?this.overLabel:this.outLabel):"rollover"==d?(this._isOver=!0,b=this._isPressed?this.downLabel:this.overLabel):(this._isOver=!1,b=this._isPressed?this.overLabel:this.outLabel),this.play?c.gotoAndPlay&&c.gotoAndPlay(b):c.gotoAndStop&&c.gotoAndStop(b)},b._reset=function(){var a=this.paused;this.__reset(),this.paused=a},createjs.ButtonHelper=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d){this.color=a||"black",this.offsetX=b||0,this.offsetY=c||0,this.blur=d||0}var b=a.prototype;a.identity=new a("transparent",0,0,0),b.toString=function(){return"[Shadow]"},b.clone=function(){return new a(this.color,this.offsetX,this.offsetY,this.blur)},createjs.Shadow=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.EventDispatcher_constructor(),this.complete=!0,this.framerate=0,this._animations=null,this._frames=null,this._images=null,this._data=null,this._loadCount=0,this._frameHeight=0,this._frameWidth=0,this._numFrames=0,this._regX=0,this._regY=0,this._spacing=0,this._margin=0,this._parseData(a)}var b=createjs.extend(a,createjs.EventDispatcher);b._getAnimations=function(){return this._animations.slice()},b.getAnimations=createjs.deprecate(b._getAnimations,"SpriteSheet.getAnimations");try{Object.defineProperties(b,{animations:{get:b._getAnimations}})}catch(c){}b.getNumFrames=function(a){if(null==a)return this._frames?this._frames.length:this._numFrames||0;var b=this._data[a];return null==b?0:b.frames.length},b.getAnimation=function(a){return this._data[a]},b.getFrame=function(a){var b;return this._frames&&(b=this._frames[a])?b:null},b.getFrameBounds=function(a,b){var c=this.getFrame(a);return c?(b||new createjs.Rectangle).setValues(-c.regX,-c.regY,c.rect.width,c.rect.height):null},b.toString=function(){return"[SpriteSheet]"},b.clone=function(){throw"SpriteSheet cannot be cloned."},b._parseData=function(a){var b,c,d,e;if(null!=a){if(this.framerate=a.framerate||0,a.images&&(c=a.images.length)>0)for(e=this._images=[],b=0;c>b;b++){var f=a.images[b];if("string"==typeof f){var g=f;f=document.createElement("img"),f.src=g}e.push(f),f.getContext||f.naturalWidth||(this._loadCount++,this.complete=!1,function(a,b){f.onload=function(){a._handleImageLoad(b)}}(this,g),function(a,b){f.onerror=function(){a._handleImageError(b)}}(this,g))}if(null==a.frames);else if(Array.isArray(a.frames))for(this._frames=[],e=a.frames,b=0,c=e.length;c>b;b++){var h=e[b];this._frames.push({image:this._images[h[4]?h[4]:0],rect:new createjs.Rectangle(h[0],h[1],h[2],h[3]),regX:h[5]||0,regY:h[6]||0})}else d=a.frames,this._frameWidth=d.width,this._frameHeight=d.height,this._regX=d.regX||0,this._regY=d.regY||0,this._spacing=d.spacing||0,this._margin=d.margin||0,this._numFrames=d.count,0==this._loadCount&&this._calculateFrames();if(this._animations=[],null!=(d=a.animations)){this._data={};var i;for(i in d){var j={name:i},k=d[i];if("number"==typeof k)e=j.frames=[k];else if(Array.isArray(k))if(1==k.length)j.frames=[k[0]];else for(j.speed=k[3],j.next=k[2],e=j.frames=[],b=k[0];b<=k[1];b++)e.push(b);else{j.speed=k.speed,j.next=k.next;var l=k.frames;e=j.frames="number"==typeof l?[l]:l.slice(0)}(j.next===!0||void 0===j.next)&&(j.next=i),(j.next===!1||e.length<2&&j.next==i)&&(j.next=null),j.speed||(j.speed=1),this._animations.push(i),this._data[i]=j}}}},b._handleImageLoad=function(){0==--this._loadCount&&(this._calculateFrames(),this.complete=!0,this.dispatchEvent("complete"))},b._handleImageError=function(a){var b=new createjs.Event("error");b.src=a,this.dispatchEvent(b),0==--this._loadCount&&this.dispatchEvent("complete")},b._calculateFrames=function(){if(!this._frames&&0!=this._frameWidth){this._frames=[];var a=this._numFrames||1e5,b=0,c=this._frameWidth,d=this._frameHeight,e=this._spacing,f=this._margin;a:for(var g=0,h=this._images;g=l;){for(var m=f;j-f-c>=m;){if(b>=a)break a;b++,this._frames.push({image:i,rect:new createjs.Rectangle(m,l,c,d),regX:this._regX,regY:this._regY}),m+=c+e}l+=d+e}this._numFrames=b}},createjs.SpriteSheet=createjs.promote(a,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function a(){this.command=null,this._stroke=null,this._strokeStyle=null,this._oldStrokeStyle=null,this._strokeDash=null,this._oldStrokeDash=null,this._strokeIgnoreScale=!1,this._fill=null,this._instructions=[],this._commitIndex=0,this._activeInstructions=[],this._dirty=!1,this._storeIndex=0,this.clear()}var b=a.prototype,c=a;a.getRGB=function(a,b,c,d){return null!=a&&null==c&&(d=b,c=255&a,b=a>>8&255,a=a>>16&255),null==d?"rgb("+a+","+b+","+c+")":"rgba("+a+","+b+","+c+","+d+")"},a.getHSL=function(a,b,c,d){return null==d?"hsl("+a%360+","+b+"%,"+c+"%)":"hsla("+a%360+","+b+"%,"+c+"%,"+d+")"},a.BASE_64={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,a:26,b:27,c:28,d:29,e:30,f:31,g:32,h:33,i:34,j:35,k:36,l:37,m:38,n:39,o:40,p:41,q:42,r:43,s:44,t:45,u:46,v:47,w:48,x:49,y:50,z:51,0:52,1:53,2:54,3:55,4:56,5:57,6:58,7:59,8:60,9:61,"+":62,"/":63},a.STROKE_CAPS_MAP=["butt","round","square"],a.STROKE_JOINTS_MAP=["miter","round","bevel"];var d=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");d.getContext&&(a._ctx=d.getContext("2d"),d.width=d.height=1),b._getInstructions=function(){return this._updateInstructions(),this._instructions},b.getInstructions=createjs.deprecate(b._getInstructions,"Graphics.getInstructions");try{Object.defineProperties(b,{instructions:{get:b._getInstructions}})}catch(e){}b.isEmpty=function(){return!(this._instructions.length||this._activeInstructions.length)},b.draw=function(a,b){this._updateInstructions();for(var c=this._instructions,d=this._storeIndex,e=c.length;e>d;d++)c[d].exec(a,b)},b.drawAsPath=function(a){this._updateInstructions();for(var b,c=this._instructions,d=this._storeIndex,e=c.length;e>d;d++)(b=c[d]).path!==!1&&b.exec(a)},b.moveTo=function(a,b){return this.append(new c.MoveTo(a,b),!0)},b.lineTo=function(a,b){return this.append(new c.LineTo(a,b))},b.arcTo=function(a,b,d,e,f){return this.append(new c.ArcTo(a,b,d,e,f))},b.arc=function(a,b,d,e,f,g){return this.append(new c.Arc(a,b,d,e,f,g))},b.quadraticCurveTo=function(a,b,d,e){return this.append(new c.QuadraticCurveTo(a,b,d,e))},b.bezierCurveTo=function(a,b,d,e,f,g){return this.append(new c.BezierCurveTo(a,b,d,e,f,g))},b.rect=function(a,b,d,e){return this.append(new c.Rect(a,b,d,e))},b.closePath=function(){return this._activeInstructions.length?this.append(new c.ClosePath):this},b.clear=function(){return this._instructions.length=this._activeInstructions.length=this._commitIndex=0,this._strokeStyle=this._oldStrokeStyle=this._stroke=this._fill=this._strokeDash=this._oldStrokeDash=null,this._dirty=this._strokeIgnoreScale=!1,this},b.beginFill=function(a){return this._setFill(a?new c.Fill(a):null)},b.beginLinearGradientFill=function(a,b,d,e,f,g){return this._setFill((new c.Fill).linearGradient(a,b,d,e,f,g))},b.beginRadialGradientFill=function(a,b,d,e,f,g,h,i){return this._setFill((new c.Fill).radialGradient(a,b,d,e,f,g,h,i))},b.beginBitmapFill=function(a,b,d){return this._setFill(new c.Fill(null,d).bitmap(a,b))},b.endFill=function(){return this.beginFill()},b.setStrokeStyle=function(a,b,d,e,f){return this._updateInstructions(!0),this._strokeStyle=this.command=new c.StrokeStyle(a,b,d,e,f),this._stroke&&(this._stroke.ignoreScale=f),this._strokeIgnoreScale=f,this},b.setStrokeDash=function(a,b){return this._updateInstructions(!0),this._strokeDash=this.command=new c.StrokeDash(a,b),this},b.beginStroke=function(a){return this._setStroke(a?new c.Stroke(a):null)},b.beginLinearGradientStroke=function(a,b,d,e,f,g){return this._setStroke((new c.Stroke).linearGradient(a,b,d,e,f,g))},b.beginRadialGradientStroke=function(a,b,d,e,f,g,h,i){return this._setStroke((new c.Stroke).radialGradient(a,b,d,e,f,g,h,i))},b.beginBitmapStroke=function(a,b){return this._setStroke((new c.Stroke).bitmap(a,b))},b.endStroke=function(){return this.beginStroke()},b.curveTo=b.quadraticCurveTo,b.drawRect=b.rect,b.drawRoundRect=function(a,b,c,d,e){return this.drawRoundRectComplex(a,b,c,d,e,e,e,e)},b.drawRoundRectComplex=function(a,b,d,e,f,g,h,i){return this.append(new c.RoundRect(a,b,d,e,f,g,h,i))},b.drawCircle=function(a,b,d){return this.append(new c.Circle(a,b,d))},b.drawEllipse=function(a,b,d,e){return this.append(new c.Ellipse(a,b,d,e))},b.drawPolyStar=function(a,b,d,e,f,g){return this.append(new c.PolyStar(a,b,d,e,f,g))},b.append=function(a,b){return this._activeInstructions.push(a),this.command=a,b||(this._dirty=!0),this},b.decodePath=function(b){for(var c=[this.moveTo,this.lineTo,this.quadraticCurveTo,this.bezierCurveTo,this.closePath],d=[2,2,4,6,0],e=0,f=b.length,g=[],h=0,i=0,j=a.BASE_64;f>e;){var k=b.charAt(e),l=j[k],m=l>>3,n=c[m];if(!n||3&l)throw"bad path data (@"+e+"): "+k;var o=d[m];m||(h=i=0),g.length=0,e++;for(var p=(l>>2&1)+2,q=0;o>q;q++){var r=j[b.charAt(e)],s=r>>5?-1:1;r=(31&r)<<6|j[b.charAt(e+1)],3==p&&(r=r<<6|j[b.charAt(e+2)]),r=s*r/10,q%2?h=r+=h:i=r+=i,g[q]=r,e+=p}n.apply(this,g)}return this},b.store=function(){return this._updateInstructions(!0),this._storeIndex=this._instructions.length,this},b.unstore=function(){return this._storeIndex=0,this},b.clone=function(){var b=new a;return b.command=this.command,b._stroke=this._stroke,b._strokeStyle=this._strokeStyle,b._strokeDash=this._strokeDash,b._strokeIgnoreScale=this._strokeIgnoreScale,b._fill=this._fill,b._instructions=this._instructions.slice(),b._commitIndex=this._commitIndex,b._activeInstructions=this._activeInstructions.slice(),b._dirty=this._dirty,b._storeIndex=this._storeIndex,b},b.toString=function(){return"[Graphics]"},b.mt=b.moveTo,b.lt=b.lineTo,b.at=b.arcTo,b.bt=b.bezierCurveTo,b.qt=b.quadraticCurveTo,b.a=b.arc,b.r=b.rect,b.cp=b.closePath,b.c=b.clear,b.f=b.beginFill,b.lf=b.beginLinearGradientFill,b.rf=b.beginRadialGradientFill,b.bf=b.beginBitmapFill,b.ef=b.endFill,b.ss=b.setStrokeStyle,b.sd=b.setStrokeDash,b.s=b.beginStroke,b.ls=b.beginLinearGradientStroke,b.rs=b.beginRadialGradientStroke,b.bs=b.beginBitmapStroke,b.es=b.endStroke,b.dr=b.drawRect,b.rr=b.drawRoundRect,b.rc=b.drawRoundRectComplex,b.dc=b.drawCircle,b.de=b.drawEllipse,b.dp=b.drawPolyStar,b.p=b.decodePath,b._updateInstructions=function(b){var c=this._instructions,d=this._activeInstructions,e=this._commitIndex;if(this._dirty&&d.length){c.length=e,c.push(a.beginCmd);var f=d.length,g=c.length;c.length=g+f;for(var h=0;f>h;h++)c[h+g]=d[h];this._fill&&c.push(this._fill),this._stroke&&(this._strokeDash!==this._oldStrokeDash&&c.push(this._strokeDash),this._strokeStyle!==this._oldStrokeStyle&&c.push(this._strokeStyle),b&&(this._oldStrokeStyle=this._strokeStyle,this._oldStrokeDash=this._strokeDash),c.push(this._stroke)),this._dirty=!1}b&&(d.length=0,this._commitIndex=c.length)},b._setFill=function(a){return this._updateInstructions(!0),this.command=this._fill=a,this},b._setStroke=function(a){return this._updateInstructions(!0),(this.command=this._stroke=a)&&(a.ignoreScale=this._strokeIgnoreScale),this},(c.LineTo=function(a,b){this.x=a,this.y=b}).prototype.exec=function(a){a.lineTo(this.x,this.y)},(c.MoveTo=function(a,b){this.x=a,this.y=b}).prototype.exec=function(a){a.moveTo(this.x,this.y)},(c.ArcTo=function(a,b,c,d,e){this.x1=a,this.y1=b,this.x2=c,this.y2=d,this.radius=e}).prototype.exec=function(a){a.arcTo(this.x1,this.y1,this.x2,this.y2,this.radius)},(c.Arc=function(a,b,c,d,e,f){this.x=a,this.y=b,this.radius=c,this.startAngle=d,this.endAngle=e,this.anticlockwise=!!f}).prototype.exec=function(a){a.arc(this.x,this.y,this.radius,this.startAngle,this.endAngle,this.anticlockwise)},(c.QuadraticCurveTo=function(a,b,c,d){this.cpx=a,this.cpy=b,this.x=c,this.y=d}).prototype.exec=function(a){a.quadraticCurveTo(this.cpx,this.cpy,this.x,this.y)},(c.BezierCurveTo=function(a,b,c,d,e,f){this.cp1x=a,this.cp1y=b,this.cp2x=c,this.cp2y=d,this.x=e,this.y=f}).prototype.exec=function(a){a.bezierCurveTo(this.cp1x,this.cp1y,this.cp2x,this.cp2y,this.x,this.y)},(c.Rect=function(a,b,c,d){this.x=a,this.y=b,this.w=c,this.h=d}).prototype.exec=function(a){a.rect(this.x,this.y,this.w,this.h)},(c.ClosePath=function(){}).prototype.exec=function(a){a.closePath()},(c.BeginPath=function(){}).prototype.exec=function(a){a.beginPath()},b=(c.Fill=function(a,b){this.style=a,this.matrix=b}).prototype,b.exec=function(a){if(this.style){a.fillStyle=this.style;var b=this.matrix;b&&(a.save(),a.transform(b.a,b.b,b.c,b.d,b.tx,b.ty)),a.fill(),b&&a.restore()}},b.linearGradient=function(b,c,d,e,f,g){for(var h=this.style=a._ctx.createLinearGradient(d,e,f,g),i=0,j=b.length;j>i;i++)h.addColorStop(c[i],b[i]);return h.props={colors:b,ratios:c,x0:d,y0:e,x1:f,y1:g,type:"linear"},this},b.radialGradient=function(b,c,d,e,f,g,h,i){for(var j=this.style=a._ctx.createRadialGradient(d,e,f,g,h,i),k=0,l=b.length;l>k;k++)j.addColorStop(c[k],b[k]);return j.props={colors:b,ratios:c,x0:d,y0:e,r0:f,x1:g,y1:h,r1:i,type:"radial"},this},b.bitmap=function(b,c){if(b.naturalWidth||b.getContext||b.readyState>=2){var d=this.style=a._ctx.createPattern(b,c||"");d.props={image:b,repetition:c,type:"bitmap"}}return this},b.path=!1,b=(c.Stroke=function(a,b){this.style=a,this.ignoreScale=b}).prototype,b.exec=function(a){this.style&&(a.strokeStyle=this.style,this.ignoreScale&&(a.save(),a.setTransform(1,0,0,1,0,0)),a.stroke(),this.ignoreScale&&a.restore())},b.linearGradient=c.Fill.prototype.linearGradient,b.radialGradient=c.Fill.prototype.radialGradient,b.bitmap=c.Fill.prototype.bitmap,b.path=!1,b=(c.StrokeStyle=function(a,b,c,d,e){this.width=a,this.caps=b,this.joints=c,this.miterLimit=d,this.ignoreScale=e}).prototype,b.exec=function(b){b.lineWidth=null==this.width?"1":this.width,b.lineCap=null==this.caps?"butt":isNaN(this.caps)?this.caps:a.STROKE_CAPS_MAP[this.caps],b.lineJoin=null==this.joints?"miter":isNaN(this.joints)?this.joints:a.STROKE_JOINTS_MAP[this.joints],b.miterLimit=null==this.miterLimit?"10":this.miterLimit,b.ignoreScale=null==this.ignoreScale?!1:this.ignoreScale},b.path=!1,(c.StrokeDash=function(a,b){this.segments=a,this.offset=b||0}).prototype.exec=function(a){a.setLineDash&&(a.setLineDash(this.segments||c.StrokeDash.EMPTY_SEGMENTS),a.lineDashOffset=this.offset||0)},c.StrokeDash.EMPTY_SEGMENTS=[],(c.RoundRect=function(a,b,c,d,e,f,g,h){this.x=a,this.y=b,this.w=c,this.h=d,this.radiusTL=e,this.radiusTR=f,this.radiusBR=g,this.radiusBL=h}).prototype.exec=function(a){var b=(j>i?i:j)/2,c=0,d=0,e=0,f=0,g=this.x,h=this.y,i=this.w,j=this.h,k=this.radiusTL,l=this.radiusTR,m=this.radiusBR,n=this.radiusBL;0>k&&(k*=c=-1),k>b&&(k=b),0>l&&(l*=d=-1),l>b&&(l=b),0>m&&(m*=e=-1),m>b&&(m=b),0>n&&(n*=f=-1),n>b&&(n=b),a.moveTo(g+i-l,h),a.arcTo(g+i+l*d,h-l*d,g+i,h+l,l),a.lineTo(g+i,h+j-m),a.arcTo(g+i+m*e,h+j+m*e,g+i-m,h+j,m),a.lineTo(g+n,h+j),a.arcTo(g-n*f,h+j+n*f,g,h+j-n,n),a.lineTo(g,h+k),a.arcTo(g-k*c,h-k*c,g+k,h,k),a.closePath() +},(c.Circle=function(a,b,c){this.x=a,this.y=b,this.radius=c}).prototype.exec=function(a){a.arc(this.x,this.y,this.radius,0,2*Math.PI)},(c.Ellipse=function(a,b,c,d){this.x=a,this.y=b,this.w=c,this.h=d}).prototype.exec=function(a){var b=this.x,c=this.y,d=this.w,e=this.h,f=.5522848,g=d/2*f,h=e/2*f,i=b+d,j=c+e,k=b+d/2,l=c+e/2;a.moveTo(b,l),a.bezierCurveTo(b,l-h,k-g,c,k,c),a.bezierCurveTo(k+g,c,i,l-h,i,l),a.bezierCurveTo(i,l+h,k+g,j,k,j),a.bezierCurveTo(k-g,j,b,l+h,b,l)},(c.PolyStar=function(a,b,c,d,e,f){this.x=a,this.y=b,this.radius=c,this.sides=d,this.pointSize=e,this.angle=f}).prototype.exec=function(a){var b=this.x,c=this.y,d=this.radius,e=(this.angle||0)/180*Math.PI,f=this.sides,g=1-(this.pointSize||0),h=Math.PI/f;a.moveTo(b+Math.cos(e)*d,c+Math.sin(e)*d);for(var i=0;f>i;i++)e+=h,1!=g&&a.lineTo(b+Math.cos(e)*d*g,c+Math.sin(e)*d*g),e+=h,a.lineTo(b+Math.cos(e)*d,c+Math.sin(e)*d);a.closePath()},a.beginCmd=new c.BeginPath,createjs.Graphics=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(){this.EventDispatcher_constructor(),this.alpha=1,this.cacheCanvas=null,this.bitmapCache=null,this.id=createjs.UID.get(),this.mouseEnabled=!0,this.tickEnabled=!0,this.name=null,this.parent=null,this.regX=0,this.regY=0,this.rotation=0,this.scaleX=1,this.scaleY=1,this.skewX=0,this.skewY=0,this.shadow=null,this.visible=!0,this.x=0,this.y=0,this.transformMatrix=null,this.compositeOperation=null,this.snapToPixel=!0,this.filters=null,this.mask=null,this.hitArea=null,this.cursor=null,this._props=new createjs.DisplayProps,this._rectangle=new createjs.Rectangle,this._bounds=null,this._webGLRenderStyle=a._StageGL_NONE}var b=createjs.extend(a,createjs.EventDispatcher);a._MOUSE_EVENTS=["click","dblclick","mousedown","mouseout","mouseover","pressmove","pressup","rollout","rollover"],a.suppressCrossDomainErrors=!1,a._snapToPixelEnabled=!1,a._StageGL_NONE=0,a._StageGL_SPRITE=1,a._StageGL_BITMAP=2;var c=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");c.getContext&&(a._hitTestCanvas=c,a._hitTestContext=c.getContext("2d"),c.width=c.height=1),b._getStage=function(){for(var a=this,b=createjs.Stage;a.parent;)a=a.parent;return a instanceof b?a:null},b.getStage=createjs.deprecate(b._getStage,"DisplayObject.getStage");try{Object.defineProperties(b,{stage:{get:b._getStage},cacheID:{get:function(){return this.bitmapCache&&this.bitmapCache.cacheID},set:function(a){this.bitmapCache&&(this.bitmapCache.cacheID=a)}},scale:{get:function(){return this.scaleX},set:function(a){this.scaleX=this.scaleY=a}}})}catch(d){}b.isVisible=function(){return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY)},b.draw=function(a,b){var c=this.bitmapCache;return c&&!b?c.draw(a):!1},b.updateContext=function(b){var c=this,d=c.mask,e=c._props.matrix;d&&d.graphics&&!d.graphics.isEmpty()&&(d.getMatrix(e),b.transform(e.a,e.b,e.c,e.d,e.tx,e.ty),d.graphics.drawAsPath(b),b.clip(),e.invert(),b.transform(e.a,e.b,e.c,e.d,e.tx,e.ty)),this.getMatrix(e);var f=e.tx,g=e.ty;a._snapToPixelEnabled&&c.snapToPixel&&(f=f+(0>f?-.5:.5)|0,g=g+(0>g?-.5:.5)|0),b.transform(e.a,e.b,e.c,e.d,f,g),b.globalAlpha*=c.alpha,c.compositeOperation&&(b.globalCompositeOperation=c.compositeOperation),c.shadow&&this._applyShadow(b,c.shadow)},b.cache=function(a,b,c,d,e,f){this.bitmapCache||(this.bitmapCache=new createjs.BitmapCache),this.bitmapCache.define(this,a,b,c,d,e,f)},b.updateCache=function(a){if(!this.bitmapCache)throw"cache() must be called before updateCache()";this.bitmapCache.update(a)},b.uncache=function(){this.bitmapCache&&(this.bitmapCache.release(),this.bitmapCache=void 0)},b.getCacheDataURL=function(){return this.bitmapCache?this.bitmapCache.getDataURL():null},b.localToGlobal=function(a,b,c){return this.getConcatenatedMatrix(this._props.matrix).transformPoint(a,b,c||new createjs.Point)},b.globalToLocal=function(a,b,c){return this.getConcatenatedMatrix(this._props.matrix).invert().transformPoint(a,b,c||new createjs.Point)},b.localToLocal=function(a,b,c,d){return d=this.localToGlobal(a,b,d),c.globalToLocal(d.x,d.y,d)},b.setTransform=function(a,b,c,d,e,f,g,h,i){return this.x=a||0,this.y=b||0,this.scaleX=null==c?1:c,this.scaleY=null==d?1:d,this.rotation=e||0,this.skewX=f||0,this.skewY=g||0,this.regX=h||0,this.regY=i||0,this},b.getMatrix=function(a){var b=this,c=a&&a.identity()||new createjs.Matrix2D;return b.transformMatrix?c.copy(b.transformMatrix):c.appendTransform(b.x,b.y,b.scaleX,b.scaleY,b.rotation,b.skewX,b.skewY,b.regX,b.regY)},b.getConcatenatedMatrix=function(a){for(var b=this,c=this.getMatrix(a);b=b.parent;)c.prependMatrix(b.getMatrix(b._props.matrix));return c},b.getConcatenatedDisplayProps=function(a){a=a?a.identity():new createjs.DisplayProps;var b=this,c=b.getMatrix(a.matrix);do a.prepend(b.visible,b.alpha,b.shadow,b.compositeOperation),b!=this&&c.prependMatrix(b.getMatrix(b._props.matrix));while(b=b.parent);return a},b.hitTest=function(b,c){var d=a._hitTestContext;d.setTransform(1,0,0,1,-b,-c),this.draw(d);var e=this._testHit(d);return d.setTransform(1,0,0,1,0,0),d.clearRect(0,0,2,2),e},b.set=function(a){for(var b in a)this[b]=a[b];return this},b.getBounds=function(){if(this._bounds)return this._rectangle.copy(this._bounds);var a=this.cacheCanvas;if(a){var b=this._cacheScale;return this._rectangle.setValues(this._cacheOffsetX,this._cacheOffsetY,a.width/b,a.height/b)}return null},b.getTransformedBounds=function(){return this._getBounds()},b.setBounds=function(a,b,c,d){return null==a?void(this._bounds=a):void(this._bounds=(this._bounds||new createjs.Rectangle).setValues(a,b,c,d))},b.clone=function(){return this._cloneProps(new a)},b.toString=function(){return"[DisplayObject (name="+this.name+")]"},b._updateState=null,b._cloneProps=function(a){return a.alpha=this.alpha,a.mouseEnabled=this.mouseEnabled,a.tickEnabled=this.tickEnabled,a.name=this.name,a.regX=this.regX,a.regY=this.regY,a.rotation=this.rotation,a.scaleX=this.scaleX,a.scaleY=this.scaleY,a.shadow=this.shadow,a.skewX=this.skewX,a.skewY=this.skewY,a.visible=this.visible,a.x=this.x,a.y=this.y,a.compositeOperation=this.compositeOperation,a.snapToPixel=this.snapToPixel,a.filters=null==this.filters?null:this.filters.slice(0),a.mask=this.mask,a.hitArea=this.hitArea,a.cursor=this.cursor,a._bounds=this._bounds,a},b._applyShadow=function(a,b){b=b||Shadow.identity,a.shadowColor=b.color,a.shadowOffsetX=b.offsetX,a.shadowOffsetY=b.offsetY,a.shadowBlur=b.blur},b._tick=function(a){var b=this._listeners;b&&b.tick&&(a.target=null,a.propagationStopped=a.immediatePropagationStopped=!1,this.dispatchEvent(a))},b._testHit=function(b){try{var c=b.getImageData(0,0,1,1).data[3]>1}catch(d){if(!a.suppressCrossDomainErrors)throw"An error has occurred. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images."}return c},b._getBounds=function(a,b){return this._transformBounds(this.getBounds(),a,b)},b._transformBounds=function(a,b,c){if(!a)return a;var d=a.x,e=a.y,f=a.width,g=a.height,h=this._props.matrix;h=c?h.identity():this.getMatrix(h),(d||e)&&h.appendTransform(0,0,1,1,0,0,0,-d,-e),b&&h.prependMatrix(b);var i=f*h.a,j=f*h.b,k=g*h.c,l=g*h.d,m=h.tx,n=h.ty,o=m,p=m,q=n,r=n;return(d=i+m)p&&(p=d),(d=i+k+m)p&&(p=d),(d=k+m)p&&(p=d),(e=j+n)r&&(r=e),(e=j+l+n)r&&(r=e),(e=l+n)r&&(r=e),a.setValues(o,q,p-o,r-q)},b._hasMouseEventListener=function(){for(var b=a._MOUSE_EVENTS,c=0,d=b.length;d>c;c++)if(this.hasEventListener(b[c]))return!0;return!!this.cursor},createjs.DisplayObject=createjs.promote(a,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function a(){this.DisplayObject_constructor(),this.children=[],this.mouseChildren=!0,this.tickChildren=!0}var b=createjs.extend(a,createjs.DisplayObject);b._getNumChildren=function(){return this.children.length},b.getNumChildren=createjs.deprecate(b._getNumChildren,"Container.getNumChildren");try{Object.defineProperties(b,{numChildren:{get:b._getNumChildren}})}catch(c){}b.initialize=a,b.isVisible=function(){var a=this.cacheCanvas||this.children.length;return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&a)},b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return!0;for(var c=this.children.slice(),d=0,e=c.length;e>d;d++){var f=c[d];f.isVisible()&&(a.save(),f.updateContext(a),f.draw(a),a.restore())}return!0},b.addChild=function(a){if(null==a)return a;var b=arguments.length;if(b>1){for(var c=0;b>c;c++)this.addChild(arguments[c]);return arguments[b-1]}var d=a.parent,e=d===this;return d&&d._removeChildAt(createjs.indexOf(d.children,a),e),a.parent=this,this.children.push(a),e||a.dispatchEvent("added"),a},b.addChildAt=function(a,b){var c=arguments.length,d=arguments[c-1];if(0>d||d>this.children.length)return arguments[c-2];if(c>2){for(var e=0;c-1>e;e++)this.addChildAt(arguments[e],d+e);return arguments[c-2]}var f=a.parent,g=f===this;return f&&f._removeChildAt(createjs.indexOf(f.children,a),g),a.parent=this,this.children.splice(b,0,a),g||a.dispatchEvent("added"),a},b.removeChild=function(a){var b=arguments.length;if(b>1){for(var c=!0,d=0;b>d;d++)c=c&&this.removeChild(arguments[d]);return c}return this._removeChildAt(createjs.indexOf(this.children,a))},b.removeChildAt=function(a){var b=arguments.length;if(b>1){for(var c=[],d=0;b>d;d++)c[d]=arguments[d];c.sort(function(a,b){return b-a});for(var e=!0,d=0;b>d;d++)e=e&&this._removeChildAt(c[d]);return e}return this._removeChildAt(a)},b.removeAllChildren=function(){for(var a=this.children;a.length;)this._removeChildAt(0)},b.getChildAt=function(a){return this.children[a]},b.getChildByName=function(a){for(var b=this.children,c=0,d=b.length;d>c;c++)if(b[c].name==a)return b[c];return null},b.sortChildren=function(a){this.children.sort(a)},b.getChildIndex=function(a){return createjs.indexOf(this.children,a)},b.swapChildrenAt=function(a,b){var c=this.children,d=c[a],e=c[b];d&&e&&(c[a]=e,c[b]=d)},b.swapChildren=function(a,b){for(var c,d,e=this.children,f=0,g=e.length;g>f&&(e[f]==a&&(c=f),e[f]==b&&(d=f),null==c||null==d);f++);f!=g&&(e[c]=b,e[d]=a)},b.setChildIndex=function(a,b){var c=this.children,d=c.length;if(!(a.parent!=this||0>b||b>=d)){for(var e=0;d>e&&c[e]!=a;e++);e!=d&&e!=b&&(c.splice(e,1),c.splice(b,0,a))}},b.contains=function(a){for(;a;){if(a==this)return!0;a=a.parent}return!1},b.hitTest=function(a,b){return null!=this.getObjectUnderPoint(a,b)},b.getObjectsUnderPoint=function(a,b,c){var d=[],e=this.localToGlobal(a,b);return this._getObjectsUnderPoint(e.x,e.y,d,c>0,1==c),d},b.getObjectUnderPoint=function(a,b,c){var d=this.localToGlobal(a,b);return this._getObjectsUnderPoint(d.x,d.y,null,c>0,1==c)},b.getBounds=function(){return this._getBounds(null,!0)},b.getTransformedBounds=function(){return this._getBounds()},b.clone=function(b){var c=this._cloneProps(new a);return b&&this._cloneChildren(c),c},b.toString=function(){return"[Container (name="+this.name+")]"},b._tick=function(a){if(this.tickChildren)for(var b=this.children.length-1;b>=0;b--){var c=this.children[b];c.tickEnabled&&c._tick&&c._tick(a)}this.DisplayObject__tick(a)},b._cloneChildren=function(a){a.children.length&&a.removeAllChildren();for(var b=a.children,c=0,d=this.children.length;d>c;c++){var e=this.children[c].clone(!0);e.parent=a,b.push(e)}},b._removeChildAt=function(a,b){if(0>a||a>this.children.length-1)return!1;var c=this.children[a];return c&&(c.parent=null),this.children.splice(a,1),b||c.dispatchEvent("removed"),!0},b._getObjectsUnderPoint=function(b,c,d,e,f,g){if(g=g||0,!g&&!this._testMask(this,b,c))return null;var h,i=createjs.DisplayObject._hitTestContext;f=f||e&&this._hasMouseEventListener();for(var j=this.children,k=j.length,l=k-1;l>=0;l--){var m=j[l],n=m.hitArea;if(m.visible&&(n||m.isVisible())&&(!e||m.mouseEnabled)&&(n||this._testMask(m,b,c)))if(!n&&m instanceof a){var o=m._getObjectsUnderPoint(b,c,d,e,f,g+1);if(!d&&o)return e&&!this.mouseChildren?this:o}else{if(e&&!f&&!m._hasMouseEventListener())continue;var p=m.getConcatenatedDisplayProps(m._props);if(h=p.matrix,n&&(h.appendMatrix(n.getMatrix(n._props.matrix)),p.alpha=n.alpha),i.globalAlpha=p.alpha,i.setTransform(h.a,h.b,h.c,h.d,h.tx-b,h.ty-c),(n||m).draw(i),!this._testHit(i))continue;if(i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,2,2),!d)return e&&!this.mouseChildren?this:m;d.push(m)}}return null},b._testMask=function(a,b,c){var d=a.mask;if(!d||!d.graphics||d.graphics.isEmpty())return!0;var e=this._props.matrix,f=a.parent;e=f?f.getConcatenatedMatrix(e):e.identity(),e=d.getMatrix(d._props.matrix).prependMatrix(e);var g=createjs.DisplayObject._hitTestContext;return g.setTransform(e.a,e.b,e.c,e.d,e.tx-b,e.ty-c),d.graphics.drawAsPath(g),g.fillStyle="#000",g.fill(),this._testHit(g)?(g.setTransform(1,0,0,1,0,0),g.clearRect(0,0,2,2),!0):!1},b._getBounds=function(a,b){var c=this.DisplayObject_getBounds();if(c)return this._transformBounds(c,a,b);var d=this._props.matrix;d=b?d.identity():this.getMatrix(d),a&&d.prependMatrix(a);for(var e=this.children.length,f=null,g=0;e>g;g++){var h=this.children[g];h.visible&&(c=h._getBounds(d))&&(f?f.extend(c.x,c.y,c.width,c.height):f=c.clone())}return f},createjs.Container=createjs.promote(a,"DisplayObject")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.Container_constructor(),this.autoClear=!0,this.canvas="string"==typeof a?document.getElementById(a):a,this.mouseX=0,this.mouseY=0,this.drawRect=null,this.snapToPixelEnabled=!1,this.mouseInBounds=!1,this.tickOnUpdate=!0,this.mouseMoveOutside=!1,this.preventSelection=!0,this._pointerData={},this._pointerCount=0,this._primaryPointerID=null,this._mouseOverIntervalID=null,this._nextStage=null,this._prevStage=null,this.enableDOMEvents(!0)}var b=createjs.extend(a,createjs.Container);b._get_nextStage=function(){return this._nextStage},b._set_nextStage=function(a){this._nextStage&&(this._nextStage._prevStage=null),a&&(a._prevStage=this),this._nextStage=a};try{Object.defineProperties(b,{nextStage:{get:b._get_nextStage,set:b._set_nextStage}})}catch(c){}b.update=function(a){if(this.canvas&&(this.tickOnUpdate&&this.tick(a),this.dispatchEvent("drawstart",!1,!0)!==!1)){createjs.DisplayObject._snapToPixelEnabled=this.snapToPixelEnabled;var b=this.drawRect,c=this.canvas.getContext("2d");c.setTransform(1,0,0,1,0,0),this.autoClear&&(b?c.clearRect(b.x,b.y,b.width,b.height):c.clearRect(0,0,this.canvas.width+1,this.canvas.height+1)),c.save(),this.drawRect&&(c.beginPath(),c.rect(b.x,b.y,b.width,b.height),c.clip()),this.updateContext(c),this.draw(c,!1),c.restore(),this.dispatchEvent("drawend")}},b.tick=function(a){if(this.tickEnabled&&this.dispatchEvent("tickstart",!1,!0)!==!1){var b=new createjs.Event("tick");if(a)for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);this._tick(b),this.dispatchEvent("tickend")}},b.handleEvent=function(a){"tick"==a.type&&this.update(a)},b.clear=function(){if(this.canvas){var a=this.canvas.getContext("2d");a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,this.canvas.width+1,this.canvas.height+1)}},b.toDataURL=function(a,b){var c,d=this.canvas.getContext("2d"),e=this.canvas.width,f=this.canvas.height;if(a){c=d.getImageData(0,0,e,f);var g=d.globalCompositeOperation;d.globalCompositeOperation="destination-over",d.fillStyle=a,d.fillRect(0,0,e,f)}var h=this.canvas.toDataURL(b||"image/png");return a&&(d.putImageData(c,0,0),d.globalCompositeOperation=g),h},b.enableMouseOver=function(a){if(this._mouseOverIntervalID&&(clearInterval(this._mouseOverIntervalID),this._mouseOverIntervalID=null,0==a&&this._testMouseOver(!0)),null==a)a=20;else if(0>=a)return;var b=this;this._mouseOverIntervalID=setInterval(function(){b._testMouseOver()},1e3/Math.min(50,a))},b.enableDOMEvents=function(a){null==a&&(a=!0);var b,c,d=this._eventListeners;if(!a&&d){for(b in d)c=d[b],c.t.removeEventListener(b,c.f,!1);this._eventListeners=null}else if(a&&!d&&this.canvas){var e=window.addEventListener?window:document,f=this;d=this._eventListeners={},d.mouseup={t:e,f:function(a){f._handleMouseUp(a)}},d.mousemove={t:e,f:function(a){f._handleMouseMove(a)}},d.dblclick={t:this.canvas,f:function(a){f._handleDoubleClick(a)}},d.mousedown={t:this.canvas,f:function(a){f._handleMouseDown(a)}};for(b in d)c=d[b],c.t.addEventListener(b,c.f,!1)}},b.clone=function(){throw"Stage cannot be cloned."},b.toString=function(){return"[Stage (name="+this.name+")]"},b._getElementRect=function(a){var b;try{b=a.getBoundingClientRect()}catch(c){b={top:a.offsetTop,left:a.offsetLeft,width:a.offsetWidth,height:a.offsetHeight}}var d=(window.pageXOffset||document.scrollLeft||0)-(document.clientLeft||document.body.clientLeft||0),e=(window.pageYOffset||document.scrollTop||0)-(document.clientTop||document.body.clientTop||0),f=window.getComputedStyle?getComputedStyle(a,null):a.currentStyle,g=parseInt(f.paddingLeft)+parseInt(f.borderLeftWidth),h=parseInt(f.paddingTop)+parseInt(f.borderTopWidth),i=parseInt(f.paddingRight)+parseInt(f.borderRightWidth),j=parseInt(f.paddingBottom)+parseInt(f.borderBottomWidth);return{left:b.left+d+g,right:b.right+d-i,top:b.top+e+h,bottom:b.bottom+e-j}},b._getPointerData=function(a){var b=this._pointerData[a];return b||(b=this._pointerData[a]={x:0,y:0}),b},b._handleMouseMove=function(a){a||(a=window.event),this._handlePointerMove(-1,a,a.pageX,a.pageY)},b._handlePointerMove=function(a,b,c,d,e){if((!this._prevStage||void 0!==e)&&this.canvas){var f=this._nextStage,g=this._getPointerData(a),h=g.inBounds;this._updatePointerPosition(a,b,c,d),(h||g.inBounds||this.mouseMoveOutside)&&(-1===a&&g.inBounds==!h&&this._dispatchMouseEvent(this,h?"mouseleave":"mouseenter",!1,a,g,b),this._dispatchMouseEvent(this,"stagemousemove",!1,a,g,b),this._dispatchMouseEvent(g.target,"pressmove",!0,a,g,b)),f&&f._handlePointerMove(a,b,c,d,null)}},b._updatePointerPosition=function(a,b,c,d){var e=this._getElementRect(this.canvas);c-=e.left,d-=e.top;var f=this.canvas.width,g=this.canvas.height;c/=(e.right-e.left)/f,d/=(e.bottom-e.top)/g;var h=this._getPointerData(a);(h.inBounds=c>=0&&d>=0&&f-1>=c&&g-1>=d)?(h.x=c,h.y=d):this.mouseMoveOutside&&(h.x=0>c?0:c>f-1?f-1:c,h.y=0>d?0:d>g-1?g-1:d),h.posEvtObj=b,h.rawX=c,h.rawY=d,(a===this._primaryPointerID||-1===a)&&(this.mouseX=h.x,this.mouseY=h.y,this.mouseInBounds=h.inBounds)},b._handleMouseUp=function(a){this._handlePointerUp(-1,a,!1)},b._handlePointerUp=function(a,b,c,d){var e=this._nextStage,f=this._getPointerData(a);if(!this._prevStage||void 0!==d){var g=null,h=f.target;d||!h&&!e||(g=this._getObjectsUnderPoint(f.x,f.y,null,!0)),f.down&&(this._dispatchMouseEvent(this,"stagemouseup",!1,a,f,b,g),f.down=!1),g==h&&this._dispatchMouseEvent(h,"click",!0,a,f,b),this._dispatchMouseEvent(h,"pressup",!0,a,f,b),c?(a==this._primaryPointerID&&(this._primaryPointerID=null),delete this._pointerData[a]):f.target=null,e&&e._handlePointerUp(a,b,c,d||g&&this)}},b._handleMouseDown=function(a){this._handlePointerDown(-1,a,a.pageX,a.pageY)},b._handlePointerDown=function(a,b,c,d,e){this.preventSelection&&b.preventDefault(),(null==this._primaryPointerID||-1===a)&&(this._primaryPointerID=a),null!=d&&this._updatePointerPosition(a,b,c,d);var f=null,g=this._nextStage,h=this._getPointerData(a);e||(f=h.target=this._getObjectsUnderPoint(h.x,h.y,null,!0)),h.inBounds&&(this._dispatchMouseEvent(this,"stagemousedown",!1,a,h,b,f),h.down=!0),this._dispatchMouseEvent(f,"mousedown",!0,a,h,b),g&&g._handlePointerDown(a,b,c,d,e||f&&this)},b._testMouseOver=function(a,b,c){if(!this._prevStage||void 0!==b){var d=this._nextStage;if(!this._mouseOverIntervalID)return void(d&&d._testMouseOver(a,b,c));var e=this._getPointerData(-1);if(e&&(a||this.mouseX!=this._mouseOverX||this.mouseY!=this._mouseOverY||!this.mouseInBounds)){var f,g,h,i=e.posEvtObj,j=c||i&&i.target==this.canvas,k=null,l=-1,m="";!b&&(a||this.mouseInBounds&&j)&&(k=this._getObjectsUnderPoint(this.mouseX,this.mouseY,null,!0),this._mouseOverX=this.mouseX,this._mouseOverY=this.mouseY);var n=this._mouseOverTarget||[],o=n[n.length-1],p=this._mouseOverTarget=[];for(f=k;f;)p.unshift(f),m||(m=f.cursor),f=f.parent;for(this.canvas.style.cursor=m,!b&&c&&(c.canvas.style.cursor=m),g=0,h=p.length;h>g&&p[g]==n[g];g++)l=g;for(o!=k&&this._dispatchMouseEvent(o,"mouseout",!0,-1,e,i,k),g=n.length-1;g>l;g--)this._dispatchMouseEvent(n[g],"rollout",!1,-1,e,i,k);for(g=p.length-1;g>l;g--)this._dispatchMouseEvent(p[g],"rollover",!1,-1,e,i,o);o!=k&&this._dispatchMouseEvent(k,"mouseover",!0,-1,e,i,o),d&&d._testMouseOver(a,b||k&&this,c||j&&this)}}},b._handleDoubleClick=function(a,b){var c=null,d=this._nextStage,e=this._getPointerData(-1);b||(c=this._getObjectsUnderPoint(e.x,e.y,null,!0),this._dispatchMouseEvent(c,"dblclick",!0,-1,e,a)),d&&d._handleDoubleClick(a,b||c&&this)},b._dispatchMouseEvent=function(a,b,c,d,e,f,g){if(a&&(c||a.hasEventListener(b))){var h=new createjs.MouseEvent(b,c,!1,e.x,e.y,f,d,d===this._primaryPointerID||-1===d,e.rawX,e.rawY,g);a.dispatchEvent(h)}},createjs.Stage=createjs.promote(a,"Container")}(),this.createjs=this.createjs||{},function(){"use strict";function a(b,c){if(this.Stage_constructor(b),void 0!==c){if("object"!=typeof c)throw"Invalid options object";var d=c.premultiply,e=c.transparent,f=c.antialias,g=c.preserveBuffer,h=c.autoPurge}this.vocalDebug=!1,this._preserveBuffer=g||!1,this._antialias=f||!1,this._transparent=e||!1,this._premultiply=d||!1,this._autoPurge=void 0,this.autoPurge=h,this._viewportWidth=0,this._viewportHeight=0,this._projectionMatrix=null,this._webGLContext=null,this._clearColor={r:.5,g:.5,b:.5,a:0},this._maxCardsPerBatch=a.DEFAULT_MAX_BATCH_SIZE,this._activeShader=null,this._vertices=null,this._vertexPositionBuffer=null,this._uvs=null,this._uvPositionBuffer=null,this._indices=null,this._textureIndexBuffer=null,this._alphas=null,this._alphaBuffer=null,this._textureDictionary=[],this._textureIDs={},this._batchTextures=[],this._baseTextures=[],this._batchTextureCount=8,this._lastTextureInsert=-1,this._batchID=0,this._drawID=0,this._slotBlacklist=[],this._isDrawing=0,this._lastTrackedCanvas=0,this.isCacheControlled=!1,this._cacheContainer=new createjs.Container,this._initializeWebGL()}var b=createjs.extend(a,createjs.Stage);a.buildUVRects=function(a,b,c){if(!a||!a._frames)return null;void 0===b&&(b=-1),void 0===c&&(c=!1);for(var d=-1!=b&&c?b:0,e=-1!=b&&c?b+1:a._frames.length,f=d;e>f;f++){var g=a._frames[f];if(!(g.uvRect||g.image.width<=0||g.image.height<=0)){var h=g.rect;g.uvRect={t:h.y/g.image.height,l:h.x/g.image.width,b:(h.y+h.height)/g.image.height,r:(h.x+h.width)/g.image.width}}}return a._frames[-1!=b?b:0].uvRect||{t:0,l:0,b:1,r:1}},a.isWebGLActive=function(a){return a&&a instanceof WebGLRenderingContext&&"undefined"!=typeof WebGLRenderingContext},a.VERTEX_PROPERTY_COUNT=6,a.INDICIES_PER_CARD=6,a.DEFAULT_MAX_BATCH_SIZE=1e4,a.WEBGL_MAX_INDEX_NUM=Math.pow(2,16),a.UV_RECT={t:0,l:0,b:1,r:1};try{a.COVER_VERT=new Float32Array([-1,1,1,1,-1,-1,1,1,1,-1,-1,-1]),a.COVER_UV=new Float32Array([0,0,1,0,0,1,1,0,1,1,0,1]),a.COVER_UV_FLIP=new Float32Array([0,1,1,1,0,0,1,1,1,0,0,0])}catch(c){}a.REGULAR_VARYING_HEADER="precision mediump float;varying vec2 vTextureCoord;varying lowp float indexPicker;varying lowp float alphaValue;",a.REGULAR_VERTEX_HEADER=a.REGULAR_VARYING_HEADER+"attribute vec2 vertexPosition;attribute vec2 uvPosition;attribute lowp float textureIndex;attribute lowp float objectAlpha;uniform mat4 pMatrix;",a.REGULAR_FRAGMENT_HEADER=a.REGULAR_VARYING_HEADER+"uniform sampler2D uSampler[{{count}}];",a.REGULAR_VERTEX_BODY="void main(void) {gl_Position = vec4((vertexPosition.x * pMatrix[0][0]) + pMatrix[3][0],(vertexPosition.y * pMatrix[1][1]) + pMatrix[3][1],pMatrix[3][2],1.0);alphaValue = objectAlpha;indexPicker = textureIndex;vTextureCoord = uvPosition;}",a.REGULAR_FRAGMENT_BODY="void main(void) {vec4 color = vec4(1.0, 0.0, 0.0, 1.0);if (indexPicker <= 0.5) {color = texture2D(uSampler[0], vTextureCoord);{{alternates}}}{{fragColor}}}",a.REGULAR_FRAG_COLOR_NORMAL="gl_FragColor = vec4(color.rgb, color.a * alphaValue);",a.REGULAR_FRAG_COLOR_PREMULTIPLY="if(color.a > 0.0035) {gl_FragColor = vec4(color.rgb/color.a, color.a * alphaValue);} else {gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);}",a.PARTICLE_VERTEX_BODY=a.REGULAR_VERTEX_BODY,a.PARTICLE_FRAGMENT_BODY=a.REGULAR_FRAGMENT_BODY,a.COVER_VARYING_HEADER="precision mediump float;varying highp vec2 vRenderCoord;varying highp vec2 vTextureCoord;",a.COVER_VERTEX_HEADER=a.COVER_VARYING_HEADER+"attribute vec2 vertexPosition;attribute vec2 uvPosition;uniform float uUpright;",a.COVER_FRAGMENT_HEADER=a.COVER_VARYING_HEADER+"uniform sampler2D uSampler;",a.COVER_VERTEX_BODY="void main(void) {gl_Position = vec4(vertexPosition.x, vertexPosition.y, 0.0, 1.0);vRenderCoord = uvPosition;vTextureCoord = vec2(uvPosition.x, abs(uUpright - uvPosition.y));}",a.COVER_FRAGMENT_BODY="void main(void) {vec4 color = texture2D(uSampler, vRenderCoord);gl_FragColor = color;}",b._get_isWebGL=function(){return!!this._webGLContext},b._set_autoPurge=function(a){a=isNaN(a)?1200:a,-1!=a&&(a=10>a?10:a),this._autoPurge=a},b._get_autoPurge=function(){return Number(this._autoPurge)};try{Object.defineProperties(b,{isWebGL:{get:b._get_isWebGL},autoPurge:{get:b._get_autoPurge,set:b._set_autoPurge}})}catch(c){}b._initializeWebGL=function(){if(this.canvas){if(!this._webGLContext||this._webGLContext.canvas!==this.canvas){var a={depth:!1,alpha:this._transparent,stencil:!0,antialias:this._antialias,premultipliedAlpha:this._premultiply,preserveDrawingBuffer:this._preserveBuffer},b=this._webGLContext=this._fetchWebGLContext(this.canvas,a);if(!b)return null;this.updateSimultaneousTextureCount(b.getParameter(b.MAX_TEXTURE_IMAGE_UNITS)),this._maxTextureSlots=b.getParameter(b.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this._createBuffers(b),this._initTextures(b),b.disable(b.DEPTH_TEST),b.enable(b.BLEND),b.blendFuncSeparate(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA,b.ONE,b.ONE_MINUS_SRC_ALPHA),b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiply),this._webGLContext.clearColor(this._clearColor.r,this._clearColor.g,this._clearColor.b,this._clearColor.a),this.updateViewport(this._viewportWidth||this.canvas.width,this._viewportHeight||this.canvas.height)}}else this._webGLContext=null;return this._webGLContext},b.update=function(a){if(this.canvas){if(this.tickOnUpdate&&this.tick(a),this.dispatchEvent("drawstart"),this.autoClear&&this.clear(),this._webGLContext)this._batchDraw(this,this._webGLContext),-1==this._autoPurge||this._drawID%(this._autoPurge/2|0)||this.purgeTextures(this._autoPurge);else{var b=this.canvas.getContext("2d");b.save(),this.updateContext(b),this.draw(b,!1),b.restore()}this.dispatchEvent("drawend")}},b.clear=function(){if(this.canvas)if(a.isWebGLActive(this._webGLContext)){var b=this._webGLContext,c=this._clearColor,d=this._transparent?c.a:1;this._webGLContext.clearColor(c.r*d,c.g*d,c.b*d,d),b.clear(b.COLOR_BUFFER_BIT),this._webGLContext.clearColor(c.r,c.g,c.b,c.a)}else this.Stage_clear()},b.draw=function(b,c){if(b===this._webGLContext&&a.isWebGLActive(this._webGLContext)){var d=this._webGLContext;return this._batchDraw(this,d,c),!0}return this.Stage_draw(b,c)},b.cacheDraw=function(b,c,d){if(a.isWebGLActive(this._webGLContext)){var e=this._webGLContext;return this._cacheDraw(e,b,c,d),!0}return!1},b.protectTextureSlot=function(a,b){if(a>this._maxTextureSlots||0>a)throw"Slot outside of acceptable range";this._slotBlacklist[a]=!!b},b.getTargetRenderTexture=function(a,b,c){var d,e=!1,f=this._webGLContext;if(void 0!==a.__lastRT&&a.__lastRT===a.__rtA&&(e=!0),e?(void 0===a.__rtB?a.__rtB=this.getRenderBufferTexture(b,c):((b!=a.__rtB._width||c!=a.__rtB._height)&&this.resizeTexture(a.__rtB,b,c),this.setTextureParams(f)),d=a.__rtB):(void 0===a.__rtA?a.__rtA=this.getRenderBufferTexture(b,c):((b!=a.__rtA._width||c!=a.__rtA._height)&&this.resizeTexture(a.__rtA,b,c),this.setTextureParams(f)),d=a.__rtA),!d)throw"Problems creating render textures, known causes include using too much VRAM by not releasing WebGL texture instances";return a.__lastRT=d,d},b.releaseTexture=function(a){var b,c;if(a){if(a.children)for(b=0,c=a.children.length;c>b;b++)this.releaseTexture(a.children[b]);a.cacheCanvas&&a.uncache();var d=void 0;if(void 0!==a._storeID){if(a===this._textureDictionary[a._storeID])return this._killTextureObject(a),void(a._storeID=void 0);d=a}else if(2===a._webGLRenderStyle)d=a.image;else if(1===a._webGLRenderStyle){for(b=0,c=a.spriteSheet._images.length;c>b;b++)this.releaseTexture(a.spriteSheet._images[b]);return}if(void 0===d)return void(this.vocalDebug&&console.log("No associated texture found on release"));this._killTextureObject(this._textureDictionary[d._storeID]),d._storeID=void 0}},b.purgeTextures=function(a){void 0==a&&(a=100);for(var b=this._textureDictionary,c=b.length,d=0;c>d;d++){var e=b[d];e&&e._drawID+a<=this._drawID&&this._killTextureObject(e)}},b.updateSimultaneousTextureCount=function(a){var b=this._webGLContext,c=!1;for((1>a||isNaN(a))&&(a=1),this._batchTextureCount=a;!c;)try{this._activeShader=this._fetchShaderProgram(b),c=!0}catch(d){if(1==this._batchTextureCount)throw"Cannot compile shader "+d;this._batchTextureCount-=4,this._batchTextureCount<1&&(this._batchTextureCount=1),this.vocalDebug&&console.log("Reducing desired texture count due to errors: "+this._batchTextureCount)}},b.updateViewport=function(a,b){this._viewportWidth=0|a,this._viewportHeight=0|b;var c=this._webGLContext;c&&(c.viewport(0,0,this._viewportWidth,this._viewportHeight),this._projectionMatrix=new Float32Array([2/this._viewportWidth,0,0,0,0,-2/this._viewportHeight,1,0,0,0,1,0,-1,1,.1,0]),this._projectionMatrixFlip=new Float32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),this._projectionMatrixFlip.set(this._projectionMatrix),this._projectionMatrixFlip[5]*=-1,this._projectionMatrixFlip[13]*=-1)},b.getFilterShader=function(a){a||(a=this);var b=this._webGLContext,c=this._activeShader;if(a._builtShader)c=a._builtShader,a.shaderParamSetup&&(b.useProgram(c),a.shaderParamSetup(b,this,c));else try{c=this._fetchShaderProgram(b,"filter",a.VTX_SHADER_BODY,a.FRAG_SHADER_BODY,a.shaderParamSetup&&a.shaderParamSetup.bind(a)),a._builtShader=c,c._name=a.toString()}catch(d){console&&console.log("SHADER SWITCH FAILURE",d)}return c},b.getBaseTexture=function(a,b){var c=Math.ceil(a>0?a:1)||1,d=Math.ceil(b>0?b:1)||1,e=this._webGLContext,f=e.createTexture();return this.resizeTexture(f,c,d),this.setTextureParams(e,!1),f},b.resizeTexture=function(a,b,c){var d=this._webGLContext;d.bindTexture(d.TEXTURE_2D,a),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,b,c,0,d.RGBA,d.UNSIGNED_BYTE,null),a.width=b,a.height=c},b.getRenderBufferTexture=function(a,b){var c=this._webGLContext,d=this.getBaseTexture(a,b);if(!d)return null;var e=c.createFramebuffer();return e?(d.width=a,d.height=b,c.bindFramebuffer(c.FRAMEBUFFER,e),c.framebufferTexture2D(c.FRAMEBUFFER,c.COLOR_ATTACHMENT0,c.TEXTURE_2D,d,0),e._renderTexture=d,d._frameBuffer=e,d._storeID=this._textureDictionary.length,this._textureDictionary[d._storeID]=d,c.bindFramebuffer(c.FRAMEBUFFER,null),d):null},b.setTextureParams=function(a,b){b&&this._antialias?(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR)):(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST)),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE)},b.setClearColor=function(a){var b,c,d,e,f;"string"==typeof a?0==a.indexOf("#")?(4==a.length&&(a="#"+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2)+a.charAt(3)+a.charAt(3)),b=Number("0x"+a.slice(1,3))/255,c=Number("0x"+a.slice(3,5))/255,d=Number("0x"+a.slice(5,7))/255,e=Number("0x"+a.slice(7,9))/255):0==a.indexOf("rgba(")&&(f=a.slice(5,-1).split(","),b=Number(f[0])/255,c=Number(f[1])/255,d=Number(f[2])/255,e=Number(f[3])):(b=((4278190080&a)>>>24)/255,c=((16711680&a)>>>16)/255,d=((65280&a)>>>8)/255,e=(255&a)/255),this._clearColor.r=b||0,this._clearColor.g=c||0,this._clearColor.b=d||0,this._clearColor.a=e||0,this._webGLContext&&this._webGLContext.clearColor(this._clearColor.r,this._clearColor.g,this._clearColor.b,this._clearColor.a)},b.toString=function(){return"[StageGL (name="+this.name+")]" +},b._fetchWebGLContext=function(a,b){var c;try{c=a.getContext("webgl",b)||a.getContext("experimental-webgl",b)}catch(d){}if(c)c.viewportWidth=a.width,c.viewportHeight=a.height;else{var e="Could not initialize WebGL";console.error?console.error(e):console.log(e)}return c},b._fetchShaderProgram=function(b,c,d,e,f){b.useProgram(null);var g,h;switch(c){case"filter":h=a.COVER_VERTEX_HEADER+(d||a.COVER_VERTEX_BODY),g=a.COVER_FRAGMENT_HEADER+(e||a.COVER_FRAGMENT_BODY);break;case"particle":h=a.REGULAR_VERTEX_HEADER+a.PARTICLE_VERTEX_BODY,g=a.REGULAR_FRAGMENT_HEADER+a.PARTICLE_FRAGMENT_BODY;break;case"override":h=a.REGULAR_VERTEX_HEADER+(d||a.REGULAR_VERTEX_BODY),g=a.REGULAR_FRAGMENT_HEADER+(e||a.REGULAR_FRAGMENT_BODY);break;case"regular":default:h=a.REGULAR_VERTEX_HEADER+a.REGULAR_VERTEX_BODY,g=a.REGULAR_FRAGMENT_HEADER+a.REGULAR_FRAGMENT_BODY}var i=this._createShader(b,b.VERTEX_SHADER,h),j=this._createShader(b,b.FRAGMENT_SHADER,g),k=b.createProgram();if(b.attachShader(k,i),b.attachShader(k,j),b.linkProgram(k),k._type=c,!b.getProgramParameter(k,b.LINK_STATUS))throw b.useProgram(this._activeShader),b.getProgramInfoLog(k);switch(b.useProgram(k),c){case"filter":k.vertexPositionAttribute=b.getAttribLocation(k,"vertexPosition"),b.enableVertexAttribArray(k.vertexPositionAttribute),k.uvPositionAttribute=b.getAttribLocation(k,"uvPosition"),b.enableVertexAttribArray(k.uvPositionAttribute),k.samplerUniform=b.getUniformLocation(k,"uSampler"),b.uniform1i(k.samplerUniform,0),k.uprightUniform=b.getUniformLocation(k,"uUpright"),b.uniform1f(k.uprightUniform,0),f&&f(b,this,k);break;case"override":case"particle":case"regular":default:k.vertexPositionAttribute=b.getAttribLocation(k,"vertexPosition"),b.enableVertexAttribArray(k.vertexPositionAttribute),k.uvPositionAttribute=b.getAttribLocation(k,"uvPosition"),b.enableVertexAttribArray(k.uvPositionAttribute),k.textureIndexAttribute=b.getAttribLocation(k,"textureIndex"),b.enableVertexAttribArray(k.textureIndexAttribute),k.alphaAttribute=b.getAttribLocation(k,"objectAlpha"),b.enableVertexAttribArray(k.alphaAttribute);for(var l=[],m=0;md;d+=c)h[d]=h[d+1]=0;b.bufferData(b.ARRAY_BUFFER,h,b.DYNAMIC_DRAW),g.itemSize=c,g.numItems=f;var i=this._uvPositionBuffer=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,i),c=2;var j=this._uvs=new Float32Array(f*c);for(d=0,e=j.length;e>d;d+=c)j[d]=j[d+1]=0;b.bufferData(b.ARRAY_BUFFER,j,b.DYNAMIC_DRAW),i.itemSize=c,i.numItems=f;var k=this._textureIndexBuffer=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,k),c=1;var l=this._indices=new Float32Array(f*c);for(d=0,e=l.length;e>d;d++)l[d]=0;b.bufferData(b.ARRAY_BUFFER,l,b.DYNAMIC_DRAW),k.itemSize=c,k.numItems=f;var m=this._alphaBuffer=b.createBuffer();b.bindBuffer(b.ARRAY_BUFFER,m),c=1;var n=this._alphas=new Float32Array(f*c);for(d=0,e=n.length;e>d;d++)n[d]=1;b.bufferData(b.ARRAY_BUFFER,n,b.DYNAMIC_DRAW),m.itemSize=c,m.numItems=f},b._initTextures=function(){this._lastTextureInsert=-1,this._textureDictionary=[],this._textureIDs={},this._baseTextures=[],this._batchTextures=[];for(var a=0;aa.MAX_TEXTURE_SIZE||b.height>a.MAX_TEXTURE_SIZE)&&console&&console.error("Oversized Texture: "+b.width+"x"+b.height+" vs "+a.MAX_TEXTURE_SIZE+"max"))},b._insertTextureInBatch=function(a,b){if(this._batchTextures[b._activeIndex]!==b){var c=-1,d=(this._lastTextureInsert+1)%this._batchTextureCount,e=d;do{if(this._batchTextures[e]._batchID!=this._batchID&&!this._slotBlacklist[e]){c=e;break}e=(e+1)%this._batchTextureCount}while(e!==d);-1===c&&(this.batchReason="textureOverflow",this._drawBuffers(a),this.batchCardCount=0,c=d),this._batchTextures[c]=b,b._activeIndex=c;var f=b._imageData;f&&f._invalid&&void 0!==b._drawID?this._updateTextureImageData(a,f):(a.activeTexture(a.TEXTURE0+c),a.bindTexture(a.TEXTURE_2D,b),this.setTextureParams(a)),this._lastTextureInsert=c}else{var f=b._imageData;void 0!=b._storeID&&f&&f._invalid&&this._updateTextureImageData(a,f)}b._drawID=this._drawID,b._batchID=this._batchID},b._killTextureObject=function(a){if(a){var b=this._webGLContext;if(void 0!==a._storeID&&a._storeID>=0){this._textureDictionary[a._storeID]=void 0;for(var c in this._textureIDs)this._textureIDs[c]==a._storeID&&delete this._textureIDs[c];a._imageData&&(a._imageData._storeID=void 0),a._imageData=a._storeID=void 0}void 0!==a._activeIndex&&this._batchTextures[a._activeIndex]===a&&(this._batchTextures[a._activeIndex]=this._baseTextures[a._activeIndex]);try{a._frameBuffer&&b.deleteFramebuffer(a._frameBuffer),a._frameBuffer=void 0}catch(d){this.vocalDebug&&console.log(d)}try{b.deleteTexture(a)}catch(d){this.vocalDebug&&console.log(d)}}},b._backupBatchTextures=function(a,b){var c=this._webGLContext;this._backupTextures||(this._backupTextures=[]),void 0===b&&(b=this._backupTextures);for(var d=0;d0&&this._drawBuffers(b),this._isDrawing++,this._drawID++,this.batchCardCount=0,this.depth=0,this._appendToBatchGroup(a,b,new createjs.Matrix2D,this.alpha,c),this.batchReason="drawFinish",this._drawBuffers(b),this._isDrawing--},b._cacheDraw=function(a,b,c,d){var e,f=this._activeShader,g=this._slotBlacklist,h=this._maxTextureSlots-1,i=this._viewportWidth,j=this._viewportHeight;this.protectTextureSlot(h,!0);var k=b.getMatrix();k=k.clone(),k.scale(1/d.scale,1/d.scale),k=k.invert(),k.translate(-d.offX/d.scale*b.scaleX,-d.offY/d.scale*b.scaleY);var l=this._cacheContainer;l.children=[b],l.transformMatrix=k,this._backupBatchTextures(!1),c&&c.length?this._drawFilters(b,c,d):this.isCacheControlled?(a.clear(a.COLOR_BUFFER_BIT),this._batchDraw(l,a,!0)):(a.activeTexture(a.TEXTURE0+h),b.cacheCanvas=this.getTargetRenderTexture(b,d._drawWidth,d._drawHeight),e=b.cacheCanvas,a.bindFramebuffer(a.FRAMEBUFFER,e._frameBuffer),this.updateViewport(d._drawWidth,d._drawHeight),this._projectionMatrix=this._projectionMatrixFlip,a.clear(a.COLOR_BUFFER_BIT),this._batchDraw(l,a,!0),a.bindFramebuffer(a.FRAMEBUFFER,null),this.updateViewport(i,j)),this._backupBatchTextures(!0),this.protectTextureSlot(h,!1),this._activeShader=f,this._slotBlacklist=g},b._drawFilters=function(a,b,c){var d,e=this._webGLContext,f=this._maxTextureSlots-1,g=this._viewportWidth,h=this._viewportHeight,i=this._cacheContainer,j=b.length;e.activeTexture(e.TEXTURE0+f),d=this.getTargetRenderTexture(a,c._drawWidth,c._drawHeight),e.bindFramebuffer(e.FRAMEBUFFER,d._frameBuffer),this.updateViewport(c._drawWidth,c._drawHeight),e.clear(e.COLOR_BUFFER_BIT),this._batchDraw(i,e,!0),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,d),this.setTextureParams(e);var k=!1,l=0,m=b[l];do this._activeShader=this.getFilterShader(m),this._activeShader&&(e.activeTexture(e.TEXTURE0+f),d=this.getTargetRenderTexture(a,c._drawWidth,c._drawHeight),e.bindFramebuffer(e.FRAMEBUFFER,d._frameBuffer),e.viewport(0,0,c._drawWidth,c._drawHeight),e.clear(e.COLOR_BUFFER_BIT),this._drawCover(e,k),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,d),this.setTextureParams(e),(j>1||b[0]._multiPass)&&(k=!k),m=null!==m._multiPass?m._multiPass:b[++l]);while(m);this.isCacheControlled?(e.bindFramebuffer(e.FRAMEBUFFER,null),this.updateViewport(g,h),this._activeShader=this.getFilterShader(this),e.clear(e.COLOR_BUFFER_BIT),this._drawCover(e,k)):(k&&(e.activeTexture(e.TEXTURE0+f),d=this.getTargetRenderTexture(a,c._drawWidth,c._drawHeight),e.bindFramebuffer(e.FRAMEBUFFER,d._frameBuffer),this._activeShader=this.getFilterShader(this),e.viewport(0,0,c._drawWidth,c._drawHeight),e.clear(e.COLOR_BUFFER_BIT),this._drawCover(e,!k)),e.bindFramebuffer(e.FRAMEBUFFER,null),this.updateViewport(g,h),a.cacheCanvas=d)},b._appendToBatchGroup=function(b,c,d,e,f){b._glMtx||(b._glMtx=new createjs.Matrix2D);var g=b._glMtx;g.copy(d),b.transformMatrix?g.appendMatrix(b.transformMatrix):g.appendTransform(b.x,b.y,b.scaleX,b.scaleY,b.rotation,b.skewX,b.skewY,b.regX,b.regY);for(var h,i,j,k,l=b.children.length,m=0;l>m;m++){var n=b.children[m];if(n.visible&&e)if(n.cacheCanvas&&!f||(n._updateState&&n._updateState(),!n.children)){this.batchCardCount+1>this._maxCardsPerBatch&&(this.batchReason="vertexOverflow",this._drawBuffers(c),this.batchCardCount=0),n._glMtx||(n._glMtx=new createjs.Matrix2D);var o=n._glMtx;o.copy(g),n.transformMatrix?o.appendMatrix(n.transformMatrix):o.appendTransform(n.x,n.y,n.scaleX,n.scaleY,n.rotation,n.skewX,n.skewY,n.regX,n.regY);var p,q,r,s,t,u,v=n.cacheCanvas&&!f;if(2===n._webGLRenderStyle||v)r=(f?!1:n.cacheCanvas)||n.image;else{if(1!==n._webGLRenderStyle)continue;if(s=n.spriteSheet.getFrame(n.currentFrame),null===s)continue;r=s.image}var w=this._uvs,x=this._vertices,y=this._indices,z=this._alphas;if(r){if(void 0===r._storeID)t=this._loadTextureImage(c,r),this._insertTextureInBatch(c,t);else{if(t=this._textureDictionary[r._storeID],!t){this.vocalDebug&&console.log("Texture should not be looked up while not being stored.");continue}t._batchID!==this._batchID&&this._insertTextureInBatch(c,t)}if(q=t._activeIndex,2===n._webGLRenderStyle||v)!v&&n.sourceRect?(n._uvRect||(n._uvRect={}),u=n.sourceRect,p=n._uvRect,p.t=u.y/r.height,p.l=u.x/r.width,p.b=(u.y+u.height)/r.height,p.r=(u.x+u.width)/r.width,h=0,i=0,j=u.width+h,k=u.height+i):(p=a.UV_RECT,v?(u=n.bitmapCache,h=u.x+u._filterOffX/u.scale,i=u.y+u._filterOffY/u.scale,j=u._drawWidth/u.scale+h,k=u._drawHeight/u.scale+i):(h=0,i=0,j=r.width+h,k=r.height+i));else if(1===n._webGLRenderStyle){var A=s.rect;p=s.uvRect,p||(p=a.buildUVRects(n.spriteSheet,n.currentFrame,!1)),h=-s.regX,i=-s.regY,j=A.width-s.regX,k=A.height-s.regY}var B=this.batchCardCount*a.INDICIES_PER_CARD,C=2*B;x[C]=h*o.a+i*o.c+o.tx,x[C+1]=h*o.b+i*o.d+o.ty,x[C+2]=h*o.a+k*o.c+o.tx,x[C+3]=h*o.b+k*o.d+o.ty,x[C+4]=j*o.a+i*o.c+o.tx,x[C+5]=j*o.b+i*o.d+o.ty,x[C+6]=x[C+2],x[C+7]=x[C+3],x[C+8]=x[C+4],x[C+9]=x[C+5],x[C+10]=j*o.a+k*o.c+o.tx,x[C+11]=j*o.b+k*o.d+o.ty,w[C]=p.l,w[C+1]=p.t,w[C+2]=p.l,w[C+3]=p.b,w[C+4]=p.r,w[C+5]=p.t,w[C+6]=p.l,w[C+7]=p.b,w[C+8]=p.r,w[C+9]=p.t,w[C+10]=p.r,w[C+11]=p.b,y[B]=y[B+1]=y[B+2]=y[B+3]=y[B+4]=y[B+5]=q,z[B]=z[B+1]=z[B+2]=z[B+3]=z[B+4]=z[B+5]=n.alpha*e,this.batchCardCount++}}else this._appendToBatchGroup(n,c,g,n.alpha*e)}},b._drawBuffers=function(b){if(!(this.batchCardCount<=0)){this.vocalDebug&&console.log("Draw["+this._drawID+":"+this._batchID+"] : "+this.batchReason);var c=this._activeShader,d=this._vertexPositionBuffer,e=this._textureIndexBuffer,f=this._uvPositionBuffer,g=this._alphaBuffer;b.useProgram(c),b.bindBuffer(b.ARRAY_BUFFER,d),b.vertexAttribPointer(c.vertexPositionAttribute,d.itemSize,b.FLOAT,!1,0,0),b.bufferSubData(b.ARRAY_BUFFER,0,this._vertices),b.bindBuffer(b.ARRAY_BUFFER,e),b.vertexAttribPointer(c.textureIndexAttribute,e.itemSize,b.FLOAT,!1,0,0),b.bufferSubData(b.ARRAY_BUFFER,0,this._indices),b.bindBuffer(b.ARRAY_BUFFER,f),b.vertexAttribPointer(c.uvPositionAttribute,f.itemSize,b.FLOAT,!1,0,0),b.bufferSubData(b.ARRAY_BUFFER,0,this._uvs),b.bindBuffer(b.ARRAY_BUFFER,g),b.vertexAttribPointer(c.alphaAttribute,g.itemSize,b.FLOAT,!1,0,0),b.bufferSubData(b.ARRAY_BUFFER,0,this._alphas),b.uniformMatrix4fv(c.pMatrixUniform,b.FALSE,this._projectionMatrix);for(var h=0;h0&&this._drawBuffers(b),this.vocalDebug&&console.log("Draw["+this._drawID+":"+this._batchID+"] : Cover");var d=this._activeShader,e=this._vertexPositionBuffer,f=this._uvPositionBuffer;b.clear(b.COLOR_BUFFER_BIT),b.useProgram(d),b.bindBuffer(b.ARRAY_BUFFER,e),b.vertexAttribPointer(d.vertexPositionAttribute,e.itemSize,b.FLOAT,!1,0,0),b.bufferSubData(b.ARRAY_BUFFER,0,a.COVER_VERT),b.bindBuffer(b.ARRAY_BUFFER,f),b.vertexAttribPointer(d.uvPositionAttribute,f.itemSize,b.FLOAT,!1,0,0),b.bufferSubData(b.ARRAY_BUFFER,0,c?a.COVER_UV_FLIP:a.COVER_UV),b.uniform1i(d.samplerUniform,0),b.uniform1f(d.uprightUniform,c?0:1),b.drawArrays(b.TRIANGLES,0,a.INDICIES_PER_CARD)},createjs.StageGL=createjs.promote(a,"Stage")}(),this.createjs=this.createjs||{},function(){function a(a){this.DisplayObject_constructor(),"string"==typeof a?(this.image=document.createElement("img"),this.image.src=a):this.image=a,this.sourceRect=null,this._webGLRenderStyle=createjs.DisplayObject._StageGL_BITMAP}var b=createjs.extend(a,createjs.DisplayObject);b.initialize=a,b.isVisible=function(){var a=this.image,b=this.cacheCanvas||a&&(a.naturalWidth||a.getContext||a.readyState>=2);return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&b)},b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return!0;var c=this.image,d=this.sourceRect;if(c.getImage&&(c=c.getImage()),!c)return!0;if(d){var e=d.x,f=d.y,g=e+d.width,h=f+d.height,i=0,j=0,k=c.width,l=c.height;0>e&&(i-=e,e=0),g>k&&(g=k),0>f&&(j-=f,f=0),h>l&&(h=l),a.drawImage(c,e,f,g-e,h-f,i,j,g-e,h-f)}else a.drawImage(c,0,0);return!0},b.getBounds=function(){var a=this.DisplayObject_getBounds();if(a)return a;var b=this.image,c=this.sourceRect||b,d=b&&(b.naturalWidth||b.getContext||b.readyState>=2);return d?this._rectangle.setValues(0,0,c.width,c.height):null},b.clone=function(b){var c=this.image;c&&b&&(c=c.cloneNode());var d=new a(c);return this.sourceRect&&(d.sourceRect=this.sourceRect.clone()),this._cloneProps(d),d},b.toString=function(){return"[Bitmap (name="+this.name+")]"},createjs.Bitmap=createjs.promote(a,"DisplayObject")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b){this.DisplayObject_constructor(),this.currentFrame=0,this.currentAnimation=null,this.paused=!0,this.spriteSheet=a,this.currentAnimationFrame=0,this.framerate=0,this._animation=null,this._currentFrame=null,this._skipAdvance=!1,this._webGLRenderStyle=createjs.DisplayObject._StageGL_SPRITE,null!=b&&this.gotoAndPlay(b)}var b=createjs.extend(a,createjs.DisplayObject);b.initialize=a,b.isVisible=function(){var a=this.cacheCanvas||this.spriteSheet.complete;return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&a)},b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return!0;this._normalizeFrame();var c=this.spriteSheet.getFrame(0|this._currentFrame);if(!c)return!1;var d=c.rect;return d.width&&d.height&&a.drawImage(c.image,d.x,d.y,d.width,d.height,-c.regX,-c.regY,d.width,d.height),!0},b.play=function(){this.paused=!1},b.stop=function(){this.paused=!0},b.gotoAndPlay=function(a){this.paused=!1,this._skipAdvance=!0,this._goto(a)},b.gotoAndStop=function(a){this.paused=!0,this._goto(a)},b.advance=function(a){var b=this.framerate||this.spriteSheet.framerate,c=b&&null!=a?a/(1e3/b):1;this._normalizeFrame(c)},b.getBounds=function(){return this.DisplayObject_getBounds()||this.spriteSheet.getFrameBounds(this.currentFrame,this._rectangle)},b.clone=function(){return this._cloneProps(new a(this.spriteSheet))},b.toString=function(){return"[Sprite (name="+this.name+")]"},b._cloneProps=function(a){return this.DisplayObject__cloneProps(a),a.currentFrame=this.currentFrame,a.currentAnimation=this.currentAnimation,a.paused=this.paused,a.currentAnimationFrame=this.currentAnimationFrame,a.framerate=this.framerate,a._animation=this._animation,a._currentFrame=this._currentFrame,a._skipAdvance=this._skipAdvance,a},b._tick=function(a){this.paused||(this._skipAdvance||this.advance(a&&a.delta),this._skipAdvance=!1),this.DisplayObject__tick(a)},b._normalizeFrame=function(a){a=a||0;var b,c=this._animation,d=this.paused,e=this._currentFrame;if(c){var f=c.speed||1,g=this.currentAnimationFrame;if(b=c.frames.length,g+a*f>=b){var h=c.next;if(this._dispatchAnimationEnd(c,e,d,h,b-1))return;if(h)return this._goto(h,a-(b-g)/f);this.paused=!0,g=c.frames.length-1}else g+=a*f;this.currentAnimationFrame=g,this._currentFrame=c.frames[0|g]}else if(e=this._currentFrame+=a,b=this.spriteSheet.getNumFrames(),e>=b&&b>0&&!this._dispatchAnimationEnd(c,e,d,b-1)&&(this._currentFrame-=b)>=b)return this._normalizeFrame();e=0|this._currentFrame,this.currentFrame!=e&&(this.currentFrame=e,this.dispatchEvent("change"))},b._dispatchAnimationEnd=function(a,b,c,d,e){var f=a?a.name:null;if(this.hasEventListener("animationend")){var g=new createjs.Event("animationend");g.name=f,g.next=d,this.dispatchEvent(g)}var h=this._animation!=a||this._currentFrame!=b;return h||c||!this.paused||(this.currentAnimationFrame=e,h=!0),h},b._goto=function(a,b){if(this.currentAnimationFrame=0,isNaN(a)){var c=this.spriteSheet.getAnimation(a);c&&(this._animation=c,this.currentAnimation=a,this._normalizeFrame(b))}else this.currentAnimation=this._animation=null,this._currentFrame=a,this._normalizeFrame()},createjs.Sprite=createjs.promote(a,"DisplayObject")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.DisplayObject_constructor(),this.graphics=a?a:new createjs.Graphics}var b=createjs.extend(a,createjs.DisplayObject);b.isVisible=function(){var a=this.cacheCanvas||this.graphics&&!this.graphics.isEmpty();return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&a)},b.draw=function(a,b){return this.DisplayObject_draw(a,b)?!0:(this.graphics.draw(a,this),!0)},b.clone=function(b){var c=b&&this.graphics?this.graphics.clone():this.graphics;return this._cloneProps(new a(c))},b.toString=function(){return"[Shape (name="+this.name+")]"},createjs.Shape=createjs.promote(a,"DisplayObject")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c){this.DisplayObject_constructor(),this.text=a,this.font=b,this.color=c,this.textAlign="left",this.textBaseline="top",this.maxWidth=null,this.outline=0,this.lineHeight=0,this.lineWidth=null}var b=createjs.extend(a,createjs.DisplayObject),c=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");c.getContext&&(a._workingContext=c.getContext("2d"),c.width=c.height=1),a.H_OFFSETS={start:0,left:0,center:-.5,end:-1,right:-1},a.V_OFFSETS={top:0,hanging:-.01,middle:-.4,alphabetic:-.8,ideographic:-.85,bottom:-1},b.isVisible=function(){var a=this.cacheCanvas||null!=this.text&&""!==this.text;return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY&&a)},b.draw=function(a,b){if(this.DisplayObject_draw(a,b))return!0;var c=this.color||"#000";return this.outline?(a.strokeStyle=c,a.lineWidth=1*this.outline):a.fillStyle=c,this._drawText(this._prepContext(a)),!0},b.getMeasuredWidth=function(){return this._getMeasuredWidth(this.text)},b.getMeasuredLineHeight=function(){return 1.2*this._getMeasuredWidth("M")},b.getMeasuredHeight=function(){return this._drawText(null,{}).height},b.getBounds=function(){var b=this.DisplayObject_getBounds();if(b)return b;if(null==this.text||""===this.text)return null;var c=this._drawText(null,{}),d=this.maxWidth&&this.maxWidthj;j++){var l=i[j],m=null;if(null!=this.lineWidth&&(m=b.measureText(l).width)>this.lineWidth){var n=l.split(/(\s)/);l=n[0],m=b.measureText(l).width;for(var o=1,p=n.length;p>o;o+=2){var q=b.measureText(n[o]+n[o+1]).width;m+q>this.lineWidth?(e&&this._drawTextLine(b,l,h*f),d&&d.push(l),m>g&&(g=m),l=n[o+1],m=b.measureText(l).width,h++):(l+=n[o]+n[o+1],m+=q)}}e&&this._drawTextLine(b,l,h*f),d&&d.push(l),c&&null==m&&(m=b.measureText(l).width),m>g&&(g=m),h++}return c&&(c.width=g,c.height=h*f),e||b.restore(),c},b._drawTextLine=function(a,b,c){this.outline?a.strokeText(b,0,c,this.maxWidth||65535):a.fillText(b,0,c,this.maxWidth||65535)},b._getMeasuredWidth=function(b){var c=a._workingContext;c.save();var d=this._prepContext(c).measureText(b).width;return c.restore(),d},createjs.Text=createjs.promote(a,"DisplayObject")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b){this.Container_constructor(),this.text=a||"",this.spriteSheet=b,this.lineHeight=0,this.letterSpacing=0,this.spaceWidth=0,this._oldProps={text:0,spriteSheet:0,lineHeight:0,letterSpacing:0,spaceWidth:0},this._oldStage=null,this._drawAction=null}var b=createjs.extend(a,createjs.Container);a.maxPoolSize=100,a._spritePool=[],b.draw=function(a,b){this.DisplayObject_draw(a,b)||(this._updateState(),this.Container_draw(a,b))},b.getBounds=function(){return this._updateText(),this.Container_getBounds()},b.isVisible=function(){var a=this.cacheCanvas||this.spriteSheet&&this.spriteSheet.complete&&this.text;return!!(this.visible&&this.alpha>0&&0!==this.scaleX&&0!==this.scaleY&&a)},b.clone=function(){return this._cloneProps(new a(this.text,this.spriteSheet))},b.addChild=b.addChildAt=b.removeChild=b.removeChildAt=b.removeAllChildren=function(){},b._updateState=function(){this._updateText()},b._cloneProps=function(a){return this.Container__cloneProps(a),a.lineHeight=this.lineHeight,a.letterSpacing=this.letterSpacing,a.spaceWidth=this.spaceWidth,a},b._getFrameIndex=function(a,b){var c,d=b.getAnimation(a);return d||(a!=(c=a.toUpperCase())||a!=(c=a.toLowerCase())||(c=null),c&&(d=b.getAnimation(c))),d&&d.frames[0]},b._getFrame=function(a,b){var c=this._getFrameIndex(a,b);return null==c?c:b.getFrame(c)},b._getLineHeight=function(a){var b=this._getFrame("1",a)||this._getFrame("T",a)||this._getFrame("L",a)||a.getFrame(0);return b?b.rect.height:1},b._getSpaceWidth=function(a){var b=this._getFrame("1",a)||this._getFrame("l",a)||this._getFrame("e",a)||this._getFrame("a",a)||a.getFrame(0);return b?b.rect.width:1},b._updateText=function(){var b,c=0,d=0,e=this._oldProps,f=!1,g=this.spaceWidth,h=this.lineHeight,i=this.spriteSheet,j=a._spritePool,k=this.children,l=0,m=k.length;for(var n in e)e[n]!=this[n]&&(e[n]=this[n],f=!0);if(f){var o=!!this._getFrame(" ",i);o||g||(g=this._getSpaceWidth(i)),h||(h=this._getLineHeight(i));for(var p=0,q=this.text.length;q>p;p++){var r=this.text.charAt(p);if(" "!=r||o)if("\n"!=r&&"\r"!=r){var s=this._getFrameIndex(r,i);null!=s&&(m>l?b=k[l]:(k.push(b=j.length?j.pop():new createjs.Sprite),b.parent=this,m++),b.spriteSheet=i,b.gotoAndStop(s),b.x=c,b.y=d,l++,c+=b.getBounds().width+this.letterSpacing)}else"\r"==r&&"\n"==this.text.charAt(p+1)&&p++,c=0,d+=h;else c+=g}for(;m>l;)j.push(b=k.pop()),b.parent=null,m--;j.length>a.maxPoolSize&&(j.length=a.maxPoolSize)}},createjs.BitmapText=createjs.promote(a,"Container")}(),this.createjs=this.createjs||{},function(){"use strict";function a(b){this.Container_constructor(),!a.inited&&a.init();var c,d,e,f;b instanceof String||arguments.length>1?(c=b,d=arguments[1],e=arguments[2],f=arguments[3],null==e&&(e=-1),b=null):b&&(c=b.mode,d=b.startPosition,e=b.loop,f=b.labels),b||(b={labels:f}),this.mode=c||a.INDEPENDENT,this.startPosition=d||0,this.loop=e===!0?-1:e||0,this.currentFrame=0,this.paused=b.paused||!1,this.actionsEnabled=!0,this.autoReset=!0,this.frameBounds=this.frameBounds||b.frameBounds,this.framerate=null,b.useTicks=b.paused=!0,this.timeline=new createjs.Timeline(b),this._synchOffset=0,this._rawPosition=-1,this._bound_resolveState=this._resolveState.bind(this),this._t=0,this._managed={}}function b(){throw"MovieClipPlugin cannot be instantiated."}var c=createjs.extend(a,createjs.Container);a.INDEPENDENT="independent",a.SINGLE_FRAME="single",a.SYNCHED="synched",a.inited=!1,a.init=function(){a.inited||(b.install(),a.inited=!0)},c._getLabels=function(){return this.timeline.getLabels()},c.getLabels=createjs.deprecate(c._getLabels,"MovieClip.getLabels"),c._getCurrentLabel=function(){return this.timeline.currentLabel},c.getCurrentLabel=createjs.deprecate(c._getCurrentLabel,"MovieClip.getCurrentLabel"),c._getDuration=function(){return this.timeline.duration},c.getDuration=createjs.deprecate(c._getDuration,"MovieClip.getDuration");try{Object.defineProperties(c,{labels:{get:c._getLabels},currentLabel:{get:c._getCurrentLabel},totalFrames:{get:c._getDuration},duration:{get:c._getDuration}})}catch(d){}c.initialize=a,c.isVisible=function(){return!!(this.visible&&this.alpha>0&&0!=this.scaleX&&0!=this.scaleY)},c.draw=function(a,b){return this.DisplayObject_draw(a,b)?!0:(this._updateState(),this.Container_draw(a,b),!0)},c.play=function(){this.paused=!1},c.stop=function(){this.paused=!0},c.gotoAndPlay=function(a){this.paused=!1,this._goto(a)},c.gotoAndStop=function(a){this.paused=!0,this._goto(a)},c.advance=function(b){var c=a.INDEPENDENT;if(this.mode===c){for(var d=this,e=d.framerate;(d=d.parent)&&null===e;)d.mode===c&&(e=d._framerate);if(this._framerate=e,!this.paused){var f=null!==e&&-1!==e&&null!==b?b/(1e3/e)+this._t:1,g=0|f;for(this._t=f-g;g--;)this._updateTimeline(this._rawPosition+1,!1)}}},c.clone=function(){throw"MovieClip cannot be cloned."},c.toString=function(){return"[MovieClip (name="+this.name+")]"},c._updateState=function(){(-1===this._rawPosition||this.mode!==a.INDEPENDENT)&&this._updateTimeline(-1)},c._tick=function(a){this.advance(a&&a.delta),this.Container__tick(a)},c._goto=function(a){var b=this.timeline.resolve(a);null!=b&&(this._t=0,this._updateTimeline(b,!0))},c._reset=function(){this._rawPosition=-1,this._t=this.currentFrame=0,this.paused=!1},c._updateTimeline=function(b,c){var d=this.mode!==a.INDEPENDENT,e=this.timeline;d&&(b=this.startPosition+(this.mode===a.SINGLE_FRAME?0:this._synchOffset)),0>b&&(b=0),(this._rawPosition!==b||d)&&(this._rawPosition=b,e.loop=this.loop,e.setPosition(b,d||!this.actionsEnabled,c,this._bound_resolveState))},c._renderFirstFrame=function(){var a=this.timeline,b=a.rawPosition;a.setPosition(0,!0,!0,this._bound_resolveState),a.rawPosition=b},c._resolveState=function(){var a=this.timeline;this.currentFrame=a.position;for(var b in this._managed)this._managed[b]=1;for(var c=a.tweens,d=0,e=c.length;e>d;d++){var f=c[d],g=f.target;if(g!==this&&!f.passive){var h=f._stepPosition;g instanceof createjs.DisplayObject?this._addManagedChild(g,h):this._setState(g.state,h)}}var i=this.children;for(d=i.length-1;d>=0;d--){var j=i[d].id;1===this._managed[j]&&(this.removeChildAt(d),delete this._managed[j])}},c._setState=function(a,b){if(a)for(var c=a.length-1;c>=0;c--){var d=a[c],e=d.t,f=d.p;for(var g in f)e[g]=f[g];this._addManagedChild(e,b)}},c._addManagedChild=function(b,c){b._off||(this.addChildAt(b,0),b instanceof a&&(b._synchOffset=c,b.mode===a.INDEPENDENT&&b.autoReset&&!this._managed[b.id]&&b._reset()),this._managed[b.id]=2)},c._getBounds=function(a,b){var c=this.DisplayObject_getBounds();return c||this.frameBounds&&(c=this._rectangle.copy(this.frameBounds[this.currentFrame])),c?this._transformBounds(c,a,b):this.Container__getBounds(a,b)},createjs.MovieClip=createjs.promote(a,"Container"),b.priority=100,b.ID="MovieClip",b.install=function(){createjs.Tween._installPlugin(b)},b.init=function(c,d){"startPosition"===d&&c.target instanceof a&&c._addPlugin(b)},b.step=function(){},b.change=function(a,b,c,d,e){return"startPosition"===c?1===e?b.props[c]:b.prev.props[c]:void 0}}(),this.createjs=this.createjs||{},function(){"use strict";function a(){throw"SpriteSheetUtils cannot be instantiated"}var b=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");b.getContext&&(a._workingCanvas=b,a._workingContext=b.getContext("2d"),b.width=b.height=1),a.extractFrame=function(b,c){isNaN(c)&&(c=b.getAnimation(c).frames[0]);var d=b.getFrame(c);if(!d)return null;var e=d.rect,f=a._workingCanvas;f.width=e.width,f.height=e.height,a._workingContext.drawImage(d.image,e.x,e.y,e.width,e.height,0,0,e.width,e.height);var g=document.createElement("img");return g.src=f.toDataURL("image/png"),g},a.addFlippedFrames=createjs.deprecate(null,"SpriteSheetUtils.addFlippedFrames"),a.mergeAlpha=createjs.deprecate(null,"SpriteSheetUtils.mergeAlpha"),a._flip=function(b,c,d,e){for(var f=b._images,g=a._workingCanvas,h=a._workingContext,i=f.length/c,j=0;i>j;j++){var k=f[j];k.__tmp=j,h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,g.width+1,g.height+1),g.width=k.width,g.height=k.height,h.setTransform(d?-1:1,0,0,e?-1:1,d?k.width:0,e?k.height:0),h.drawImage(k,0,0);var l=document.createElement("img");l.src=g.toDataURL("image/png"),l.width=k.width||k.naturalWidth,l.height=k.height||k.naturalHeight,f.push(l)}var m=b._frames,n=m.length/c;for(j=0;n>j;j++){k=m[j]; +var o=k.rect.clone();l=f[k.image.__tmp+i*c];var p={image:l,rect:o,regX:k.regX,regY:k.regY};d&&(o.x=(l.width||l.naturalWidth)-o.x-o.width,p.regX=o.width-k.regX),e&&(o.y=(l.height||l.naturalHeight)-o.y-o.height,p.regY=o.height-k.regY),m.push(p)}var q="_"+(d?"h":"")+(e?"v":""),r=b._animations,s=b._data,t=r.length/c;for(j=0;t>j;j++){var u=r[j];k=s[u];var v={name:u+q,speed:k.speed,next:k.next,frames:[]};k.next&&(v.next+=q),m=k.frames;for(var w=0,x=m.length;x>w;w++)v.frames.push(m[w]+n*c);s[v.name]=v,r.push(v.name)}},createjs.SpriteSheetUtils=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.EventDispatcher_constructor(),this.maxWidth=2048,this.maxHeight=2048,this.spriteSheet=null,this.scale=1,this.padding=1,this.timeSlice=.3,this.progress=-1,this.framerate=a||0,this._frames=[],this._animations={},this._data=null,this._nextFrameIndex=0,this._index=0,this._timerID=null,this._scale=1}var b=createjs.extend(a,createjs.EventDispatcher);a.ERR_DIMENSIONS="frame dimensions exceed max spritesheet dimensions",a.ERR_RUNNING="a build is already running",b.addFrame=function(b,c,d,e,f){if(this._data)throw a.ERR_RUNNING;var g=c||b.bounds||b.nominalBounds;return!g&&b.getBounds&&(g=b.getBounds()),g?(d=d||1,this._frames.push({source:b,sourceRect:g,scale:d,funct:e,data:f,index:this._frames.length,height:g.height*d})-1):null},b.addAnimation=function(b,c,d,e){if(this._data)throw a.ERR_RUNNING;this._animations[b]={frames:c,next:d,speed:e}},b.addMovieClip=function(b,c,d,e,f,g){if(this._data)throw a.ERR_RUNNING;var h=b.frameBounds,i=c||b.bounds||b.nominalBounds;if(!i&&b.getBounds&&(i=b.getBounds()),i||h){var j,k,l=this._frames.length,m=b.timeline.duration;for(j=0;m>j;j++){var n=h&&h[j]?h[j]:i;this.addFrame(b,n,d,this._setupMovieClipFrame,{i:j,f:e,d:f})}var o=b.timeline._labels,p=[];for(var q in o)p.push({index:o[q],label:q});if(p.length)for(p.sort(function(a,b){return a.index-b.index}),j=0,k=p.length;k>j;j++){for(var r=p[j].label,s=l+p[j].index,t=l+(j==k-1?m:p[j+1].index),u=[],v=s;t>v;v++)u.push(v);(!g||(r=g(r,b,s,t)))&&this.addAnimation(r,u,!0)}}},b.build=function(){if(this._data)throw a.ERR_RUNNING;for(this._startBuild();this._drawNext(););return this._endBuild(),this.spriteSheet},b.buildAsync=function(b){if(this._data)throw a.ERR_RUNNING;this.timeSlice=b,this._startBuild();var c=this;this._timerID=setTimeout(function(){c._run()},50-50*Math.max(.01,Math.min(.99,this.timeSlice||.3)))},b.stopAsync=function(){clearTimeout(this._timerID),this._data=null},b.clone=function(){throw"SpriteSheetBuilder cannot be cloned."},b.toString=function(){return"[SpriteSheetBuilder]"},b._startBuild=function(){var b=this.padding||0;this.progress=0,this.spriteSheet=null,this._index=0,this._scale=this.scale;var c=[];this._data={images:[],frames:c,framerate:this.framerate,animations:this._animations};var d=this._frames.slice();if(d.sort(function(a,b){return a.height<=b.height?-1:1}),d[d.length-1].height+2*b>this.maxHeight)throw a.ERR_DIMENSIONS;for(var e=0,f=0,g=0;d.length;){var h=this._fillRow(d,e,g,c,b);if(h.w>f&&(f=h.w),e+=h.h,!h.h||!d.length){var i=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas");i.width=this._getSize(f,this.maxWidth),i.height=this._getSize(e,this.maxHeight),this._data.images[g]=i,h.h||(f=e=0,g++)}}},b._setupMovieClipFrame=function(a,b){var c=a.actionsEnabled;a.actionsEnabled=!1,a.gotoAndStop(b.i),a.actionsEnabled=c,b.f&&b.f(a,b.d,b.i)},b._getSize=function(a,b){for(var c=4;Math.pow(2,++c)=0;l--){var m=b[l],n=this._scale*m.scale,o=m.sourceRect,p=m.source,q=Math.floor(n*o.x-f),r=Math.floor(n*o.y-f),s=Math.ceil(n*o.height+2*f),t=Math.ceil(n*o.width+2*f);if(t>g)throw a.ERR_DIMENSIONS;s>i||j+t>g||(m.img=d,m.rect=new createjs.Rectangle(j,c,t,s),k=k||s,b.splice(l,1),e[m.index]=[j,c,t,s,d,Math.round(-q+n*p.regX-f),Math.round(-r+n*p.regY-f)],j+=t)}return{w:j,h:k}},b._endBuild=function(){this.spriteSheet=new createjs.SpriteSheet(this._data),this._data=null,this.progress=1,this.dispatchEvent("complete")},b._run=function(){for(var a=50*Math.max(.01,Math.min(.99,this.timeSlice||.3)),b=(new Date).getTime()+a,c=!1;b>(new Date).getTime();)if(!this._drawNext()){c=!0;break}if(c)this._endBuild();else{var d=this;this._timerID=setTimeout(function(){d._run()},50-a)}var e=this.progress=this._index/this._frames.length;if(this.hasEventListener("progress")){var f=new createjs.Event("progress");f.progress=e,this.dispatchEvent(f)}},b._drawNext=function(){var a=this._frames[this._index],b=a.scale*this._scale,c=a.rect,d=a.sourceRect,e=this._data.images[a.img],f=e.getContext("2d");return a.funct&&a.funct(a.source,a.data),f.save(),f.beginPath(),f.rect(c.x,c.y,c.width,c.height),f.clip(),f.translate(Math.ceil(c.x-d.x*b),Math.ceil(c.y-d.y*b)),f.scale(b,b),a.source.draw(f),f.restore(),++this._index=!!d)return b;for(var e=0;d>e;e++){var f=c[e];if(f&&f.getBounds){var g=f.getBounds();g&&(0==e?b.setValues(g.x,g.y,g.width,g.height):b.extend(g.x,g.y,g.width,g.height))}}return b},b.toString=function(){return"[BitmapCache]"},b.define=function(a,b,c,d,e,f,g){if(!a)throw"No symbol to cache";this._options=g,this.target=a,this.width=d>=1?d:1,this.height=e>=1?e:1,this.x=b||0,this.y=c||0,this.scale=f||1,this.update()},b.update=function(b){if(!this.target)throw"define() must be called before update()";var c=a.getFilterBounds(this.target),d=this.target.cacheCanvas;this._drawWidth=Math.ceil(this.width*this.scale)+c.width,this._drawHeight=Math.ceil(this.height*this.scale)+c.height,d&&this._drawWidth==d.width&&this._drawHeight==d.height||this._updateSurface(),this._filterOffX=c.x,this._filterOffY=c.y,this.offX=this.x*this.scale+this._filterOffX,this.offY=this.y*this.scale+this._filterOffY,this._drawToCache(b),this.cacheID=this.cacheID?this.cacheID+1:1},b.release=function(){if(this._webGLCache)this._webGLCache.isCacheControlled||(this.__lastRT&&(this.__lastRT=void 0),this.__rtA&&this._webGLCache._killTextureObject(this.__rtA),this.__rtB&&this._webGLCache._killTextureObject(this.__rtB),this.target&&this.target.cacheCanvas&&this._webGLCache._killTextureObject(this.target.cacheCanvas)),this._webGLCache=!1;else{var a=this.target.stage;a instanceof createjs.StageGL&&a.releaseTexture(this.target.cacheCanvas)}this.target=this.target.cacheCanvas=null,this.cacheID=this._cacheDataURLID=this._cacheDataURL=void 0,this.width=this.height=this.x=this.y=this.offX=this.offY=0,this.scale=1},b.getCacheDataURL=function(){var a=this.target&&this.target.cacheCanvas;return a?(this.cacheID!=this._cacheDataURLID&&(this._cacheDataURLID=this.cacheID,this._cacheDataURL=a.toDataURL?a.toDataURL():null),this._cacheDataURL):null},b.draw=function(a){return this.target?(a.drawImage(this.target.cacheCanvas,this.x+this._filterOffX/this.scale,this.y+this._filterOffY/this.scale,this._drawWidth/this.scale,this._drawHeight/this.scale),!0):!1},b._updateSurface=function(){if(!this._options||!this._options.useGL){var a=this.target.cacheCanvas;return a||(a=this.target.cacheCanvas=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas")),a.width=this._drawWidth,void(a.height=this._drawHeight)}if(!this._webGLCache)if("stage"===this._options.useGL){if(!this.target.stage||!this.target.stage.isWebGL){var b="Cannot use 'stage' for cache because the object's parent stage is ";throw b+=this.target.stage?"non WebGL.":"not set, please addChild to the correct stage."}this.target.cacheCanvas=!0,this._webGLCache=this.target.stage}else if("new"===this._options.useGL)this.target.cacheCanvas=document.createElement("canvas"),this._webGLCache=new createjs.StageGL(this.target.cacheCanvas,{antialias:!0,transparent:!0,autoPurge:-1}),this._webGLCache.isCacheControlled=!0;else{if(!(this._options.useGL instanceof createjs.StageGL))throw"Invalid option provided to useGL, expected ['stage', 'new', StageGL, undefined], got "+this._options.useGL;this.target.cacheCanvas=!0,this._webGLCache=this._options.useGL,this._webGLCache.isCacheControlled=!0}var a=this.target.cacheCanvas,c=this._webGLCache;c.isCacheControlled&&(a.width=this._drawWidth,a.height=this._drawHeight,c.updateViewport(this._drawWidth,this._drawHeight)),this.target.filters?(c.getTargetRenderTexture(this.target,this._drawWidth,this._drawHeight),c.getTargetRenderTexture(this.target,this._drawWidth,this._drawHeight)):c.isCacheControlled||c.getTargetRenderTexture(this.target,this._drawWidth,this._drawHeight)},b._drawToCache=function(a){var b=this.target.cacheCanvas,c=this.target,d=this._webGLCache;if(d)d.cacheDraw(c,c.filters,this),b=this.target.cacheCanvas,b.width=this._drawWidth,b.height=this._drawHeight;else{var e=b.getContext("2d");a||e.clearRect(0,0,this._drawWidth+1,this._drawHeight+1),e.save(),e.globalCompositeOperation=a,e.setTransform(this.scale,0,0,this.scale,-this._filterOffX,-this._filterOffY),e.translate(-this.x,-this.y),c.draw(e,!0),e.restore(),c.filters&&c.filters.length&&this._applyFilters(e)}b._invalid=!0},b._applyFilters=function(a){var b,c=this.target.filters,d=this._drawWidth,e=this._drawHeight,f=0,g=c[f];do g.usesContext?(b&&(a.putImageData(b,0,0),b=null),g.applyFilter(a,0,0,d,e)):(b||(b=a.getImageData(0,0,d,e)),g._applyFilter(b)),g=null!==g._multiPass?g._multiPass:c[++f];while(g);b&&a.putImageData(b,0,0)},createjs.BitmapCache=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c){this.Filter_constructor(),this._blurX=a,this._blurXTable=[],this._lastBlurX=null,this._blurY=b,this._blurYTable=[],this._lastBlurY=null,this._quality,this._lastQuality=null,this.FRAG_SHADER_TEMPLATE="uniform float xWeight[{{blurX}}];uniform float yWeight[{{blurY}}];uniform vec2 textureOffset;void main(void) {vec4 color = vec4(0.0);float xAdj = ({{blurX}}.0-1.0)/2.0;float yAdj = ({{blurY}}.0-1.0)/2.0;vec2 sampleOffset;for(int i=0; i<{{blurX}}; i++) {for(int j=0; j<{{blurY}}; j++) {sampleOffset = vRenderCoord + (textureOffset * vec2(float(i)-xAdj, float(j)-yAdj));color += texture2D(uSampler, sampleOffset) * (xWeight[i] * yWeight[j]);}}gl_FragColor = color.rgba;}",(isNaN(c)||1>c)&&(c=1),this.setQuality(0|c)}var b=createjs.extend(a,createjs.Filter);b.getBlurX=function(){return this._blurX},b.getBlurY=function(){return this._blurY},b.setBlurX=function(a){(isNaN(a)||0>a)&&(a=0),this._blurX=a},b.setBlurY=function(a){(isNaN(a)||0>a)&&(a=0),this._blurY=a},b.getQuality=function(){return this._quality},b.setQuality=function(a){(isNaN(a)||0>a)&&(a=0),this._quality=0|a},b._getShader=function(){var a=this._lastBlurX!==this._blurX,b=this._lastBlurY!==this._blurY,c=this._lastQuality!==this._quality;return a||b||c?((a||c)&&(this._blurXTable=this._getTable(this._blurX*this._quality)),(b||c)&&(this._blurYTable=this._getTable(this._blurY*this._quality)),this._updateShader(),this._lastBlurX=this._blurX,this._lastBlurY=this._blurY,void(this._lastQuality=this._quality)):this._compiledShader},b._setShader=function(){this._compiledShader};try{Object.defineProperties(b,{blurX:{get:b.getBlurX,set:b.setBlurX},blurY:{get:b.getBlurY,set:b.setBlurY},quality:{get:b.getQuality,set:b.setQuality},_builtShader:{get:b._getShader,set:b._setShader}})}catch(c){console.log(c)}b._getTable=function(a){var b=4.2;if(1>=a)return[1];var c=[],d=Math.ceil(2*a);d+=d%2?0:1;for(var e=d/2|0,f=-e;e>=f;f++){var g=f/e*b;c.push(1/Math.sqrt(2*Math.PI)*Math.pow(Math.E,-(Math.pow(g,2)/4)))}var h=c.reduce(function(a,b){return a+b});return c.map(function(a){return a/h})},b._updateShader=function(){if(void 0!==this._blurX&&void 0!==this._blurY){var a=this.FRAG_SHADER_TEMPLATE;a=a.replace(/\{\{blurX\}\}/g,this._blurXTable.length.toFixed(0)),a=a.replace(/\{\{blurY\}\}/g,this._blurYTable.length.toFixed(0)),this.FRAG_SHADER_BODY=a}},b.shaderParamSetup=function(a,b,c){a.uniform1fv(a.getUniformLocation(c,"xWeight"),this._blurXTable),a.uniform1fv(a.getUniformLocation(c,"yWeight"),this._blurYTable),a.uniform2f(a.getUniformLocation(c,"textureOffset"),2/(b._viewportWidth*this._quality),2/(b._viewportHeight*this._quality))},a.MUL_TABLE=[1,171,205,293,57,373,79,137,241,27,391,357,41,19,283,265,497,469,443,421,25,191,365,349,335,161,155,149,9,278,269,261,505,245,475,231,449,437,213,415,405,395,193,377,369,361,353,345,169,331,325,319,313,307,301,37,145,285,281,69,271,267,263,259,509,501,493,243,479,118,465,459,113,446,55,435,429,423,209,413,51,403,199,393,97,3,379,375,371,367,363,359,355,351,347,43,85,337,333,165,327,323,5,317,157,311,77,305,303,75,297,294,73,289,287,71,141,279,277,275,68,135,67,133,33,262,260,129,511,507,503,499,495,491,61,121,481,477,237,235,467,232,115,457,227,451,7,445,221,439,218,433,215,427,425,211,419,417,207,411,409,203,202,401,399,396,197,49,389,387,385,383,95,189,47,187,93,185,23,183,91,181,45,179,89,177,11,175,87,173,345,343,341,339,337,21,167,83,331,329,327,163,81,323,321,319,159,79,315,313,39,155,309,307,153,305,303,151,75,299,149,37,295,147,73,291,145,289,287,143,285,71,141,281,35,279,139,69,275,137,273,17,271,135,269,267,133,265,33,263,131,261,130,259,129,257,1],a.SHG_TABLE=[0,9,10,11,9,12,10,11,12,9,13,13,10,9,13,13,14,14,14,14,10,13,14,14,14,13,13,13,9,14,14,14,15,14,15,14,15,15,14,15,15,15,14,15,15,15,15,15,14,15,15,15,15,15,15,12,14,15,15,13,15,15,15,15,16,16,16,15,16,14,16,16,14,16,13,16,16,16,15,16,13,16,15,16,14,9,16,16,16,16,16,16,16,16,16,13,14,16,16,15,16,16,10,16,15,16,14,16,16,14,16,16,14,16,16,14,15,16,16,16,14,15,14,15,13,16,16,15,17,17,17,17,17,17,14,15,17,17,16,16,17,16,15,17,16,17,11,17,16,17,16,17,16,17,17,16,17,17,16,17,17,16,16,17,17,17,16,14,17,17,17,17,15,16,14,16,15,16,13,16,15,16,14,16,15,16,12,16,15,16,17,17,17,17,17,13,16,15,17,17,17,16,15,17,17,17,16,15,17,17,14,16,17,17,16,17,17,16,15,17,16,14,17,16,15,17,16,17,17,16,17,15,16,17,14,17,16,15,17,16,17,13,17,16,17,17,16,17,14,17,16,17,16,17,16,17,9],b.getBounds=function(a){var b=0|this.blurX,c=0|this.blurY;if(0>=b&&0>=c)return a;var d=Math.pow(this.quality,.2);return(a||new createjs.Rectangle).pad(c*d+1,b*d+1,c*d+1,b*d+1)},b.clone=function(){return new a(this.blurX,this.blurY,this.quality)},b.toString=function(){return"[BlurFilter]"},b._applyFilter=function(b){var c=this._blurX>>1;if(isNaN(c)||0>c)return!1;var d=this._blurY>>1;if(isNaN(d)||0>d)return!1;if(0==c&&0==d)return!1;var e=this.quality;(isNaN(e)||1>e)&&(e=1),e|=0,e>3&&(e=3),1>e&&(e=1);var f=b.data,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=c+c+1|0,w=d+d+1|0,x=0|b.width,y=0|b.height,z=x-1|0,A=y-1|0,B=c+1|0,C=d+1|0,D={r:0,b:0,g:0,a:0},E=D;for(i=1;v>i;i++)E=E.n={r:0,b:0,g:0,a:0};E.n=D;var F={r:0,b:0,g:0,a:0},G=F;for(i=1;w>i;i++)G=G.n={r:0,b:0,g:0,a:0};G.n=F;for(var H=null,I=0|a.MUL_TABLE[c],J=0|a.SHG_TABLE[c],K=0|a.MUL_TABLE[d],L=0|a.SHG_TABLE[d];e-->0;){m=l=0;var M=I,N=J;for(h=y;--h>-1;){for(n=B*(r=f[0|l]),o=B*(s=f[l+1|0]),p=B*(t=f[l+2|0]),q=B*(u=f[l+3|0]),E=D,i=B;--i>-1;)E.r=r,E.g=s,E.b=t,E.a=u,E=E.n;for(i=1;B>i;i++)j=l+((i>z?z:i)<<2)|0,n+=E.r=f[j],o+=E.g=f[j+1],p+=E.b=f[j+2],q+=E.a=f[j+3],E=E.n;for(H=D,g=0;x>g;g++)f[l++]=n*M>>>N,f[l++]=o*M>>>N,f[l++]=p*M>>>N,f[l++]=q*M>>>N,j=m+((j=g+c+1)g;g++){for(l=g<<2|0,n=C*(r=f[l])|0,o=C*(s=f[l+1|0])|0,p=C*(t=f[l+2|0])|0,q=C*(u=f[l+3|0])|0,G=F,i=0;C>i;i++)G.r=r,G.g=s,G.b=t,G.a=u,G=G.n;for(k=x,i=1;d>=i;i++)l=k+g<<2,n+=G.r=f[l],o+=G.g=f[l+1],p+=G.b=f[l+2],q+=G.a=f[l+3],G=G.n,A>i&&(k+=x);if(l=g,H=F,e>0)for(h=0;y>h;h++)j=l<<2,f[j+3]=u=q*M>>>N,u>0?(f[j]=n*M>>>N,f[j+1]=o*M>>>N,f[j+2]=p*M>>>N):f[j]=f[j+1]=f[j+2]=0,j=g+((j=h+C)h;h++)j=l<<2,f[j+3]=u=q*M>>>N,u>0?(u=255/u,f[j]=(n*M>>>N)*u,f[j+1]=(o*M>>>N)*u,f[j+2]=(p*M>>>N)*u):f[j]=f[j+1]=f[j+2]=0,j=g+((j=h+C)d;d+=4)b[d+3]=c[d]||0;return!0},b._prepAlphaMap=function(){if(!this.alphaMap)return!1;if(this.alphaMap==this._alphaMap&&this._mapData)return!0;this._mapData=null;var a,b=this._alphaMap=this.alphaMap,c=b;b instanceof HTMLCanvasElement?a=c.getContext("2d"):(c=createjs.createCanvas?createjs.createCanvas():document.createElement("canvas"),c.width=b.width,c.height=b.height,a=c.getContext("2d"),a.drawImage(b,0,0));try{var d=a.getImageData(0,0,b.width,b.height)}catch(e){return!1}return this._mapData=d.data,!0},createjs.AlphaMapFilter=createjs.promote(a,"Filter")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.Filter_constructor(),this.mask=a,this.usesContext=!0,this.FRAG_SHADER_BODY="uniform sampler2D uAlphaSampler;void main(void) {vec4 color = texture2D(uSampler, vRenderCoord);vec4 alphaMap = texture2D(uAlphaSampler, vTextureCoord);gl_FragColor = vec4(color.rgb, color.a * alphaMap.a);}"}var b=createjs.extend(a,createjs.Filter);b.shaderParamSetup=function(a,b,c){this._mapTexture||(this._mapTexture=a.createTexture()),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,this._mapTexture),b.setTextureParams(a),a.texImage2D(a.TEXTURE_2D,0,a.RGBA,a.RGBA,a.UNSIGNED_BYTE,this.mask),a.uniform1i(a.getUniformLocation(c,"uAlphaSampler"),1)},b.applyFilter=function(a,b,c,d,e,f,g,h){return this.mask?(f=f||a,null==g&&(g=b),null==h&&(h=c),f.save(),a!=f?!1:(f.globalCompositeOperation="destination-in",f.drawImage(this.mask,g,h),f.restore(),!0)):!0},b.clone=function(){return new a(this.mask)},b.toString=function(){return"[AlphaMaskFilter]"},createjs.AlphaMaskFilter=createjs.promote(a,"Filter")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d,e,f,g,h){this.Filter_constructor(),this.redMultiplier=null!=a?a:1,this.greenMultiplier=null!=b?b:1,this.blueMultiplier=null!=c?c:1,this.alphaMultiplier=null!=d?d:1,this.redOffset=e||0,this.greenOffset=f||0,this.blueOffset=g||0,this.alphaOffset=h||0,this.FRAG_SHADER_BODY="uniform vec4 uColorMultiplier;uniform vec4 uColorOffset;void main(void) {vec4 color = texture2D(uSampler, vRenderCoord);gl_FragColor = (color * uColorMultiplier) + uColorOffset;}"}var b=createjs.extend(a,createjs.Filter);b.shaderParamSetup=function(a,b,c){a.uniform4f(a.getUniformLocation(c,"uColorMultiplier"),this.redMultiplier,this.greenMultiplier,this.blueMultiplier,this.alphaMultiplier),a.uniform4f(a.getUniformLocation(c,"uColorOffset"),this.redOffset/255,this.greenOffset/255,this.blueOffset/255,this.alphaOffset/255)},b.toString=function(){return"[ColorFilter]"},b.clone=function(){return new a(this.redMultiplier,this.greenMultiplier,this.blueMultiplier,this.alphaMultiplier,this.redOffset,this.greenOffset,this.blueOffset,this.alphaOffset)},b._applyFilter=function(a){for(var b=a.data,c=b.length,d=0;c>d;d+=4)b[d]=b[d]*this.redMultiplier+this.redOffset,b[d+1]=b[d+1]*this.greenMultiplier+this.greenOffset,b[d+2]=b[d+2]*this.blueMultiplier+this.blueOffset,b[d+3]=b[d+3]*this.alphaMultiplier+this.alphaOffset;return!0},createjs.ColorFilter=createjs.promote(a,"Filter")}(),this.createjs=this.createjs||{},function(){"use strict";function a(a,b,c,d){this.setColor(a,b,c,d)}var b=a.prototype;a.DELTA_INDEX=[0,.01,.02,.04,.05,.06,.07,.08,.1,.11,.12,.14,.15,.16,.17,.18,.2,.21,.22,.24,.25,.27,.28,.3,.32,.34,.36,.38,.4,.42,.44,.46,.48,.5,.53,.56,.59,.62,.65,.68,.71,.74,.77,.8,.83,.86,.89,.92,.95,.98,1,1.06,1.12,1.18,1.24,1.3,1.36,1.42,1.48,1.54,1.6,1.66,1.72,1.78,1.84,1.9,1.96,2,2.12,2.25,2.37,2.5,2.62,2.75,2.87,3,3.2,3.4,3.6,3.8,4,4.3,4.7,4.9,5,5.5,6,6.5,6.8,7,7.3,7.5,7.8,8,8.4,8.7,9,9.4,9.6,9.8,10],a.IDENTITY_MATRIX=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1],a.LENGTH=a.IDENTITY_MATRIX.length,b.setColor=function(a,b,c,d){return this.reset().adjustColor(a,b,c,d)},b.reset=function(){return this.copy(a.IDENTITY_MATRIX)},b.adjustColor=function(a,b,c,d){return this.adjustHue(d),this.adjustContrast(b),this.adjustBrightness(a),this.adjustSaturation(c)},b.adjustBrightness=function(a){return 0==a||isNaN(a)?this:(a=this._cleanValue(a,255),this._multiplyMatrix([1,0,0,0,a,0,1,0,0,a,0,0,1,0,a,0,0,0,1,0,0,0,0,0,1]),this)},b.adjustContrast=function(b){if(0==b||isNaN(b))return this;b=this._cleanValue(b,100);var c;return 0>b?c=127+b/100*127:(c=b%1,c=0==c?a.DELTA_INDEX[b]:a.DELTA_INDEX[b<<0]*(1-c)+a.DELTA_INDEX[(b<<0)+1]*c,c=127*c+127),this._multiplyMatrix([c/127,0,0,0,.5*(127-c),0,c/127,0,0,.5*(127-c),0,0,c/127,0,.5*(127-c),0,0,0,1,0,0,0,0,0,1]),this},b.adjustSaturation=function(a){if(0==a||isNaN(a))return this;a=this._cleanValue(a,100);var b=1+(a>0?3*a/100:a/100),c=.3086,d=.6094,e=.082;return this._multiplyMatrix([c*(1-b)+b,d*(1-b),e*(1-b),0,0,c*(1-b),d*(1-b)+b,e*(1-b),0,0,c*(1-b),d*(1-b),e*(1-b)+b,0,0,0,0,0,1,0,0,0,0,0,1]),this},b.adjustHue=function(a){if(0==a||isNaN(a))return this;a=this._cleanValue(a,180)/180*Math.PI;var b=Math.cos(a),c=Math.sin(a),d=.213,e=.715,f=.072;return this._multiplyMatrix([d+b*(1-d)+c*-d,e+b*-e+c*-e,f+b*-f+c*(1-f),0,0,d+b*-d+.143*c,e+b*(1-e)+.14*c,f+b*-f+c*-.283,0,0,d+b*-d+c*-(1-d),e+b*-e+c*e,f+b*(1-f)+c*f,0,0,0,0,0,1,0,0,0,0,0,1]),this},b.concat=function(b){return b=this._fixMatrix(b),b.length!=a.LENGTH?this:(this._multiplyMatrix(b),this)},b.clone=function(){return(new a).copy(this)},b.toArray=function(){for(var b=[],c=0,d=a.LENGTH;d>c;c++)b[c]=this[c];return b},b.copy=function(b){for(var c=a.LENGTH,d=0;c>d;d++)this[d]=b[d];return this},b.toString=function(){return"[ColorMatrix]"},b._multiplyMatrix=function(a){var b,c,d,e=[];for(b=0;5>b;b++){for(c=0;5>c;c++)e[c]=this[c+5*b];for(c=0;5>c;c++){var f=0;for(d=0;5>d;d++)f+=a[c+5*d]*e[d];this[c+5*b]=f}}},b._cleanValue=function(a,b){return Math.min(b,Math.max(-b,a))},b._fixMatrix=function(b){return b instanceof a&&(b=b.toArray()),b.lengtha.LENGTH&&(b=b.slice(0,a.LENGTH)),b},createjs.ColorMatrix=a}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.Filter_constructor(),this.matrix=a,this.FRAG_SHADER_BODY="uniform mat4 uColorMatrix;uniform vec4 uColorMatrixOffset;void main(void) {vec4 color = texture2D(uSampler, vRenderCoord);mat4 m = uColorMatrix;vec4 newColor = vec4(0,0,0,0);newColor.r = color.r*m[0][0] + color.g*m[0][1] + color.b*m[0][2] + color.a*m[0][3];newColor.g = color.r*m[1][0] + color.g*m[1][1] + color.b*m[1][2] + color.a*m[1][3];newColor.b = color.r*m[2][0] + color.g*m[2][1] + color.b*m[2][2] + color.a*m[2][3];newColor.a = color.r*m[3][0] + color.g*m[3][1] + color.b*m[3][2] + color.a*m[3][3];gl_FragColor = newColor + uColorMatrixOffset;}"}var b=createjs.extend(a,createjs.Filter);b.shaderParamSetup=function(a,b,c){var d=this.matrix,e=new Float32Array([d[0],d[1],d[2],d[3],d[5],d[6],d[7],d[8],d[10],d[11],d[12],d[13],d[15],d[16],d[17],d[18]]);a.uniformMatrix4fv(a.getUniformLocation(c,"uColorMatrix"),!1,e),a.uniform4f(a.getUniformLocation(c,"uColorMatrixOffset"),d[4]/255,d[9]/255,d[14]/255,d[19]/255)},b.toString=function(){return"[ColorMatrixFilter]"},b.clone=function(){return new a(this.matrix)},b._applyFilter=function(a){for(var b,c,d,e,f=a.data,g=f.length,h=this.matrix,i=h[0],j=h[1],k=h[2],l=h[3],m=h[4],n=h[5],o=h[6],p=h[7],q=h[8],r=h[9],s=h[10],t=h[11],u=h[12],v=h[13],w=h[14],x=h[15],y=h[16],z=h[17],A=h[18],B=h[19],C=0;g>C;C+=4)b=f[C],c=f[C+1],d=f[C+2],e=f[C+3],f[C]=b*i+c*j+d*k+e*l+m,f[C+1]=b*n+c*o+d*p+e*q+r,f[C+2]=b*s+c*t+d*u+e*v+w,f[C+3]=b*x+c*y+d*z+e*A+B;return!0},createjs.ColorMatrixFilter=createjs.promote(a,"Filter")}(),this.createjs=this.createjs||{},function(){"use strict";function a(){throw"Touch cannot be instantiated"}a.isSupported=function(){return!!("ontouchstart"in window||window.navigator.msPointerEnabled&&window.navigator.msMaxTouchPoints>0||window.navigator.pointerEnabled&&window.navigator.maxTouchPoints>0)},a.enable=function(b,c,d){return b&&b.canvas&&a.isSupported()?b.__touch?!0:(b.__touch={pointers:{},multitouch:!c,preventDefault:!d,count:0},"ontouchstart"in window?a._IOS_enable(b):(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&a._IE_enable(b),!0):!1},a.disable=function(b){b&&("ontouchstart"in window?a._IOS_disable(b):(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&a._IE_disable(b),delete b.__touch)},a._IOS_enable=function(b){var c=b.canvas,d=b.__touch.f=function(c){a._IOS_handleEvent(b,c)};c.addEventListener("touchstart",d,!1),c.addEventListener("touchmove",d,!1),c.addEventListener("touchend",d,!1),c.addEventListener("touchcancel",d,!1)},a._IOS_disable=function(a){var b=a.canvas;if(b){var c=a.__touch.f;b.removeEventListener("touchstart",c,!1),b.removeEventListener("touchmove",c,!1),b.removeEventListener("touchend",c,!1),b.removeEventListener("touchcancel",c,!1)}},a._IOS_handleEvent=function(a,b){if(a){a.__touch.preventDefault&&b.preventDefault&&b.preventDefault();for(var c=b.changedTouches,d=b.type,e=0,f=c.length;f>e;e++){var g=c[e],h=g.identifier;g.target==a.canvas&&("touchstart"==d?this._handleStart(a,h,b,g.pageX,g.pageY):"touchmove"==d?this._handleMove(a,h,b,g.pageX,g.pageY):("touchend"==d||"touchcancel"==d)&&this._handleEnd(a,h,b))}}},a._IE_enable=function(b){var c=b.canvas,d=b.__touch.f=function(c){a._IE_handleEvent(b,c)};void 0===window.navigator.pointerEnabled?(c.addEventListener("MSPointerDown",d,!1),window.addEventListener("MSPointerMove",d,!1),window.addEventListener("MSPointerUp",d,!1),window.addEventListener("MSPointerCancel",d,!1),b.__touch.preventDefault&&(c.style.msTouchAction="none")):(c.addEventListener("pointerdown",d,!1),window.addEventListener("pointermove",d,!1),window.addEventListener("pointerup",d,!1),window.addEventListener("pointercancel",d,!1),b.__touch.preventDefault&&(c.style.touchAction="none")),b.__touch.activeIDs={}},a._IE_disable=function(a){var b=a.__touch.f;void 0===window.navigator.pointerEnabled?(window.removeEventListener("MSPointerMove",b,!1),window.removeEventListener("MSPointerUp",b,!1),window.removeEventListener("MSPointerCancel",b,!1),a.canvas&&a.canvas.removeEventListener("MSPointerDown",b,!1)):(window.removeEventListener("pointermove",b,!1),window.removeEventListener("pointerup",b,!1),window.removeEventListener("pointercancel",b,!1),a.canvas&&a.canvas.removeEventListener("pointerdown",b,!1))},a._IE_handleEvent=function(a,b){if(a){a.__touch.preventDefault&&b.preventDefault&&b.preventDefault();var c=b.type,d=b.pointerId,e=a.__touch.activeIDs;if("MSPointerDown"==c||"pointerdown"==c){if(b.srcElement!=a.canvas)return;e[d]=!0,this._handleStart(a,d,b,b.pageX,b.pageY)}else e[d]&&("MSPointerMove"==c||"pointermove"==c?this._handleMove(a,d,b,b.pageX,b.pageY):("MSPointerUp"==c||"MSPointerCancel"==c||"pointerup"==c||"pointercancel"==c)&&(delete e[d],this._handleEnd(a,d,b)))}},a._handleStart=function(a,b,c,d,e){var f=a.__touch;if(f.multitouch||!f.count){var g=f.pointers;g[b]||(g[b]=!0,f.count++,a._handlePointerDown(b,c,d,e))}},a._handleMove=function(a,b,c,d,e){a.__touch.pointers[b]&&a._handlePointerMove(b,c,d,e)},a._handleEnd=function(a,b,c){var d=a.__touch,e=d.pointers;e[b]&&(d.count--,a._handlePointerUp(b,c,!0),delete e[b])},createjs.Touch=a}(),this.createjs=this.createjs||{},function(){"use strict";var a=createjs.EaselJS=createjs.EaselJS||{};a.version="NEXT",a.buildDate="Thu, 14 Sep 2017 22:19:48 GMT"}(); \ No newline at end of file diff --git a/_assets/libs/preloadjs-NEXT.min.js b/_assets/libs/preloadjs-NEXT.min.js index 2d16bf3f..b241a03f 100644 --- a/_assets/libs/preloadjs-NEXT.min.js +++ b/_assets/libs/preloadjs-NEXT.min.js @@ -9,5 +9,6 @@ * * This notice shall be included in all copies or substantial portions of the Software. */ -this.createjs=this.createjs||{},function(){"use strict";var a=createjs.PreloadJS=createjs.PreloadJS||{};a.version="NEXT",a.buildDate="Thu, 26 Nov 2015 20:40:05 GMT"}(),this.createjs=this.createjs||{},createjs.extend=function(a,b){"use strict";function c(){this.constructor=a}return c.prototype=b.prototype,a.prototype=new c},this.createjs=this.createjs||{},createjs.promote=function(a,b){"use strict";var c=a.prototype,d=Object.getPrototypeOf&&Object.getPrototypeOf(c)||c.__proto__;if(d){c[(b+="_")+"constructor"]=d.constructor;for(var e in d)c.hasOwnProperty(e)&&"function"==typeof d[e]&&(c[b+e]=d[e])}return a},this.createjs=this.createjs||{},createjs.indexOf=function(a,b){"use strict";for(var c=0,d=a.length;d>c;c++)if(b===a[c])return c;return-1},this.createjs=this.createjs||{},function(){"use strict";createjs.proxy=function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,Array.prototype.slice.call(arguments,0).concat(c))}}}(),this.createjs=this.createjs||{},function(){"use strict";function Event(a,b,c){this.type=a,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!b,this.cancelable=!!c,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var a=Event.prototype;a.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},a.stopPropagation=function(){this.propagationStopped=!0},a.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},a.remove=function(){this.removed=!0},a.clone=function(){return new Event(this.type,this.bubbles,this.cancelable)},a.set=function(a){for(var b in a)this[b]=a[b];return this},a.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=Event}(),this.createjs=this.createjs||{},function(){"use strict";function ErrorEvent(a,b,c){this.Event_constructor("error"),this.title=a,this.message=b,this.data=c}var a=createjs.extend(ErrorEvent,createjs.Event);a.clone=function(){return new createjs.ErrorEvent(this.title,this.message,this.data)},createjs.ErrorEvent=createjs.promote(ErrorEvent,"Event")}(),this.createjs=this.createjs||{},function(){"use strict";function EventDispatcher(){this._listeners=null,this._captureListeners=null}var a=EventDispatcher.prototype;EventDispatcher.initialize=function(b){b.addEventListener=a.addEventListener,b.on=a.on,b.removeEventListener=b.off=a.removeEventListener,b.removeAllEventListeners=a.removeAllEventListeners,b.hasEventListener=a.hasEventListener,b.dispatchEvent=a.dispatchEvent,b._dispatchEvent=a._dispatchEvent,b.willTrigger=a.willTrigger},a.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},a.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},a.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},a.off=a.removeEventListener,a.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},a.dispatchEvent=function(a,b,c){if("string"==typeof a){var d=this._listeners;if(!(b||d&&d[a]))return!0;a=new createjs.Event(a,b,c)}else a.target&&a.clone&&(a=a.clone());try{a.target=this}catch(e){}if(a.bubbles&&this.parent){for(var f=this,g=[f];f.parent;)g.push(f=f.parent);var h,i=g.length;for(h=i-1;h>=0&&!a.propagationStopped;h--)g[h]._dispatchEvent(a,1+(0==h));for(h=1;i>h&&!a.propagationStopped;h++)g[h]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return!a.defaultPrevented},a.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},a.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1},a.toString=function(){return"[EventDispatcher]"},a._dispatchEvent=function(a,b){var c,d=1==b?this._captureListeners:this._listeners;if(a&&d){var e=d[a.type];if(!e||!(c=e.length))return;try{a.currentTarget=this}catch(f){}try{a.eventPhase=b}catch(f){}a.removed=!1,e=e.slice();for(var g=0;c>g&&!a.immediatePropagationStopped;g++){var h=e[g];h.handleEvent?h.handleEvent(a):h(a),a.removed&&(this.off(a.type,h,1==b),a.removed=!1)}}},createjs.EventDispatcher=EventDispatcher}(),this.createjs=this.createjs||{},function(){"use strict";function ProgressEvent(a,b){this.Event_constructor("progress"),this.loaded=a,this.total=null==b?1:b,this.progress=0==b?0:this.loaded/this.total}var a=createjs.extend(ProgressEvent,createjs.Event);a.clone=function(){return new createjs.ProgressEvent(this.loaded,this.total)},createjs.ProgressEvent=createjs.promote(ProgressEvent,"Event")}(window),function(){function a(b,d){function f(a){if(f[a]!==q)return f[a];var b;if("bug-string-char-index"==a)b="a"!="a"[0];else if("json"==a)b=f("json-stringify")&&f("json-parse");else{var c,e='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==a){var i=d.stringify,k="function"==typeof i&&t;if(k){(c=function(){return 1}).toJSON=c;try{k="0"===i(0)&&"0"===i(new g)&&'""'==i(new h)&&i(s)===q&&i(q)===q&&i()===q&&"1"===i(c)&&"[1]"==i([c])&&"[null]"==i([q])&&"null"==i(null)&&"[null,null,null]"==i([q,s,null])&&i({a:[c,!0,!1,null,"\x00\b\n\f\r "]})==e&&"1"===i(null,c)&&"[\n 1,\n 2\n]"==i([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==i(new j(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==i(new j(864e13))&&'"-000001-01-01T00:00:00.000Z"'==i(new j(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==i(new j(-1))}catch(l){k=!1}}b=k}if("json-parse"==a){var m=d.parse;if("function"==typeof m)try{if(0===m("0")&&!m(!1)){c=m(e);var n=5==c.a.length&&1===c.a[0];if(n){try{n=!m('" "')}catch(l){}if(n)try{n=1!==m("01")}catch(l){}if(n)try{n=1!==m("1.")}catch(l){}}}}catch(l){n=!1}b=n}}return f[a]=!!b}b||(b=e.Object()),d||(d=e.Object());var g=b.Number||e.Number,h=b.String||e.String,i=b.Object||e.Object,j=b.Date||e.Date,k=b.SyntaxError||e.SyntaxError,l=b.TypeError||e.TypeError,m=b.Math||e.Math,n=b.JSON||e.JSON;"object"==typeof n&&n&&(d.stringify=n.stringify,d.parse=n.parse);var o,p,q,r=i.prototype,s=r.toString,t=new j(-0xc782b5b800cec);try{t=-109252==t.getUTCFullYear()&&0===t.getUTCMonth()&&1===t.getUTCDate()&&10==t.getUTCHours()&&37==t.getUTCMinutes()&&6==t.getUTCSeconds()&&708==t.getUTCMilliseconds()}catch(u){}if(!f("json")){var v="[object Function]",w="[object Date]",x="[object Number]",y="[object String]",z="[object Array]",A="[object Boolean]",B=f("bug-string-char-index");if(!t)var C=m.floor,D=[0,31,59,90,120,151,181,212,243,273,304,334],E=function(a,b){return D[b]+365*(a-1970)+C((a-1969+(b=+(b>1)))/4)-C((a-1901+b)/100)+C((a-1601+b)/400)};if((o=r.hasOwnProperty)||(o=function(a){var b,c={};return(c.__proto__=null,c.__proto__={toString:1},c).toString!=s?o=function(a){var b=this.__proto__,c=a in(this.__proto__=null,this);return this.__proto__=b,c}:(b=c.constructor,o=function(a){var c=(this.constructor||b).prototype;return a in this&&!(a in c&&this[a]===c[a])}),c=null,o.call(this,a)}),p=function(a,b){var d,e,f,g=0;(d=function(){this.valueOf=0}).prototype.valueOf=0,e=new d;for(f in e)o.call(e,f)&&g++;return d=e=null,g?p=2==g?function(a,b){var c,d={},e=s.call(a)==v;for(c in a)e&&"prototype"==c||o.call(d,c)||!(d[c]=1)||!o.call(a,c)||b(c)}:function(a,b){var c,d,e=s.call(a)==v;for(c in a)e&&"prototype"==c||!o.call(a,c)||(d="constructor"===c)||b(c);(d||o.call(a,c="constructor"))&&b(c)}:(e=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],p=function(a,b){var d,f,g=s.call(a)==v,h=!g&&"function"!=typeof a.constructor&&c[typeof a.hasOwnProperty]&&a.hasOwnProperty||o;for(d in a)g&&"prototype"==d||!h.call(a,d)||b(d);for(f=e.length;d=e[--f];h.call(a,d)&&b(d));}),p(a,b)},!f("json-stringify")){var F={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},G="000000",H=function(a,b){return(G+(b||0)).slice(-a)},I="\\u00",J=function(a){for(var b='"',c=0,d=a.length,e=!B||d>10,f=e&&(B?a.split(""):a);d>c;c++){var g=a.charCodeAt(c);switch(g){case 8:case 9:case 10:case 12:case 13:case 34:case 92:b+=F[g];break;default:if(32>g){b+=I+H(2,g.toString(16));break}b+=e?f[c]:a.charAt(c)}}return b+'"'},K=function(a,b,c,d,e,f,g){var h,i,j,k,m,n,r,t,u,v,B,D,F,G,I,L;try{h=b[a]}catch(M){}if("object"==typeof h&&h)if(i=s.call(h),i!=w||o.call(h,"toJSON"))"function"==typeof h.toJSON&&(i!=x&&i!=y&&i!=z||o.call(h,"toJSON"))&&(h=h.toJSON(a));else if(h>-1/0&&1/0>h){if(E){for(m=C(h/864e5),j=C(m/365.2425)+1970-1;E(j+1,0)<=m;j++);for(k=C((m-E(j,0))/30.42);E(j,k+1)<=m;k++);m=1+m-E(j,k),n=(h%864e5+864e5)%864e5,r=C(n/36e5)%24,t=C(n/6e4)%60,u=C(n/1e3)%60,v=n%1e3}else j=h.getUTCFullYear(),k=h.getUTCMonth(),m=h.getUTCDate(),r=h.getUTCHours(),t=h.getUTCMinutes(),u=h.getUTCSeconds(),v=h.getUTCMilliseconds();h=(0>=j||j>=1e4?(0>j?"-":"+")+H(6,0>j?-j:j):H(4,j))+"-"+H(2,k+1)+"-"+H(2,m)+"T"+H(2,r)+":"+H(2,t)+":"+H(2,u)+"."+H(3,v)+"Z"}else h=null;if(c&&(h=c.call(b,a,h)),null===h)return"null";if(i=s.call(h),i==A)return""+h;if(i==x)return h>-1/0&&1/0>h?""+h:"null";if(i==y)return J(""+h);if("object"==typeof h){for(G=g.length;G--;)if(g[G]===h)throw l();if(g.push(h),B=[],I=f,f+=e,i==z){for(F=0,G=h.length;G>F;F++)D=K(F,h,c,d,e,f,g),B.push(D===q?"null":D);L=B.length?e?"[\n"+f+B.join(",\n"+f)+"\n"+I+"]":"["+B.join(",")+"]":"[]"}else p(d||h,function(a){var b=K(a,h,c,d,e,f,g);b!==q&&B.push(J(a)+":"+(e?" ":"")+b)}),L=B.length?e?"{\n"+f+B.join(",\n"+f)+"\n"+I+"}":"{"+B.join(",")+"}":"{}";return g.pop(),L}};d.stringify=function(a,b,d){var e,f,g,h;if(c[typeof b]&&b)if((h=s.call(b))==v)f=b;else if(h==z){g={};for(var i,j=0,k=b.length;k>j;i=b[j++],h=s.call(i),(h==y||h==x)&&(g[i]=1));}if(d)if((h=s.call(d))==x){if((d-=d%1)>0)for(e="",d>10&&(d=10);e.lengthL;)switch(e=f.charCodeAt(L)){case 9:case 10:case 13:case 32:L++;break;case 123:case 125:case 91:case 93:case 58:case 44:return a=B?f.charAt(L):f[L],L++,a;case 34:for(a="@",L++;g>L;)if(e=f.charCodeAt(L),32>e)P();else if(92==e)switch(e=f.charCodeAt(++L)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:a+=O[e],L++;break;case 117:for(b=++L,c=L+4;c>L;L++)e=f.charCodeAt(L),e>=48&&57>=e||e>=97&&102>=e||e>=65&&70>=e||P();a+=N("0x"+f.slice(b,L));break;default:P()}else{if(34==e)break;for(e=f.charCodeAt(L),b=L;e>=32&&92!=e&&34!=e;)e=f.charCodeAt(++L);a+=f.slice(b,L)}if(34==f.charCodeAt(L))return L++,a;P();default:if(b=L,45==e&&(d=!0,e=f.charCodeAt(++L)),e>=48&&57>=e){for(48==e&&(e=f.charCodeAt(L+1),e>=48&&57>=e)&&P(),d=!1;g>L&&(e=f.charCodeAt(L),e>=48&&57>=e);L++);if(46==f.charCodeAt(L)){for(c=++L;g>c&&(e=f.charCodeAt(c),e>=48&&57>=e);c++);c==L&&P(),L=c}if(e=f.charCodeAt(L),101==e||69==e){for(e=f.charCodeAt(++L),(43==e||45==e)&&L++,c=L;g>c&&(e=f.charCodeAt(c),e>=48&&57>=e);c++);c==L&&P(),L=c}return+f.slice(b,L)}if(d&&P(),"true"==f.slice(L,L+4))return L+=4,!0;if("false"==f.slice(L,L+5))return L+=5,!1;if("null"==f.slice(L,L+4))return L+=4,null;P()}return"$"},R=function(a){var b,c;if("$"==a&&P(),"string"==typeof a){if("@"==(B?a.charAt(0):a[0]))return a.slice(1);if("["==a){for(b=[];a=Q(),"]"!=a;c||(c=!0))c&&(","==a?(a=Q(),"]"==a&&P()):P()),","==a&&P(),b.push(R(a));return b}if("{"==a){for(b={};a=Q(),"}"!=a;c||(c=!0))c&&(","==a?(a=Q(),"}"==a&&P()):P()),(","==a||"string"!=typeof a||"@"!=(B?a.charAt(0):a[0])||":"!=Q())&&P(),b[a.slice(1)]=R(Q());return b}P()}return a},S=function(a,b,c){var d=T(a,b,c);d===q?delete a[b]:a[b]=d},T=function(a,b,c){var d,e=a[b];if("object"==typeof e&&e)if(s.call(e)==z)for(d=e.length;d--;)S(e,d,c);else p(e,function(a){S(e,a,c)});return c.call(a,b,e)};d.parse=function(a,b){var c,d;return L=0,M=""+a,c=R(Q()),"$"!=Q()&&P(),L=M=null,b&&s.call(b)==v?T((d={},d[""]=c,d),"",b):c}}}return d.runInContext=a,d}var b="function"==typeof define&&define.amd,c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType&&exports,e=c[typeof window]&&window||this,f=d&&c[typeof module]&&module&&!module.nodeType&&"object"==typeof global&&global;if(!f||f.global!==f&&f.window!==f&&f.self!==f||(e=f),d&&!b)a(e,d);else{var g=e.JSON,h=e.JSON3,i=!1,j=a(e,e.JSON3={noConflict:function(){return i||(i=!0,e.JSON=g,e.JSON3=h,g=h=null),j}});e.JSON={parse:j.parse,stringify:j.stringify}}b&&define(function(){return j})}.call(this),function(){var a={};a.appendToHead=function(b){a.getHead().appendChild(b)},a.getHead=function(){return document.head||document.getElementsByTagName("head")[0]},a.getBody=function(){return document.body||document.getElementsByTagName("body")[0]},createjs.DomUtils=a}(),function(){var a={};a.parseXML=function(a,b){var c=null;try{if(window.DOMParser){var d=new DOMParser;c=d.parseFromString(a,b)}}catch(e){}if(!c)try{c=new ActiveXObject("Microsoft.XMLDOM"),c.async=!1,c.loadXML(a)}catch(e){c=null}return c},a.parseJSON=function(a){if(null==a)return null;try{return JSON.parse(a)}catch(b){throw b}},createjs.DataUtils=a}(),this.createjs=this.createjs||{},function(){"use strict";function LoadItem(){this.src=null,this.type=null,this.id=null,this.maintainOrder=!1,this.callback=null,this.data=null,this.method=createjs.LoadItem.GET,this.values=null,this.headers=null,this.withCredentials=!1,this.mimeType=null,this.crossOrigin=null,this.loadTimeout=b.LOAD_TIMEOUT_DEFAULT}var a=LoadItem.prototype={},b=LoadItem;b.LOAD_TIMEOUT_DEFAULT=8e3,b.create=function(a){if("string"==typeof a){var c=new LoadItem;return c.src=a,c}if(a instanceof b)return a;if(a instanceof Object&&a.src)return null==a.loadTimeout&&(a.loadTimeout=b.LOAD_TIMEOUT_DEFAULT),a;throw new Error("Type not recognized.")},a.set=function(a){for(var b in a)this[b]=a[b];return this},createjs.LoadItem=b}(),function(){var a={};a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[.\/]*?\//i,a.EXTENSION_PATT=/\/?[^\/]+\.(\w{1,5})$/i,a.parseURI=function(b){var c={absolute:!1,relative:!1};if(null==b)return c;var d=b.indexOf("?");d>-1&&(b=b.substr(0,d));var e;return a.ABSOLUTE_PATT.test(b)?c.absolute=!0:a.RELATIVE_PATT.test(b)&&(c.relative=!0),(e=b.match(a.EXTENSION_PATT))&&(c.extension=e[1].toLowerCase()),c},a.formatQueryString=function(a,b){if(null==a)throw new Error("You must specify data.");var c=[];for(var d in a)c.push(d+"="+escape(a[d]));return b&&(c=c.concat(b)),c.join("&")},a.buildPath=function(a,b){if(null==b)return a;var c=[],d=a.indexOf("?");if(-1!=d){var e=a.slice(d+1);c=c.concat(e.split("&"))}return-1!=d?a.slice(0,d)+"?"+this.formatQueryString(b,c):a+"?"+this.formatQueryString(b,c)},a.isCrossDomain=function(a){var b=document.createElement("a");b.href=a.src;var c=document.createElement("a");c.href=location.href;var d=""!=b.hostname&&(b.port!=c.port||b.protocol!=c.protocol||b.hostname!=c.hostname);return d},a.isLocal=function(a){var b=document.createElement("a");return b.href=a.src,""==b.hostname&&"file:"==b.protocol},a.isBinary=function(a){switch(a){case createjs.AbstractLoader.IMAGE:case createjs.AbstractLoader.BINARY:return!0;default:return!1}},a.isImageTag=function(a){return a instanceof HTMLImageElement},a.isAudioTag=function(a){return window.HTMLAudioElement?a instanceof HTMLAudioElement:!1},a.isVideoTag=function(a){return window.HTMLVideoElement?a instanceof HTMLVideoElement:!1},a.isText=function(a){switch(a){case createjs.AbstractLoader.TEXT:case createjs.AbstractLoader.JSON:case createjs.AbstractLoader.MANIFEST:case createjs.AbstractLoader.XML:case createjs.AbstractLoader.CSS:case createjs.AbstractLoader.SVG:case createjs.AbstractLoader.JAVASCRIPT:case createjs.AbstractLoader.SPRITESHEET:return!0;default:return!1}},a.getTypeByExtension=function(a){if(null==a)return createjs.AbstractLoader.TEXT;switch(a.toLowerCase()){case"jpeg":case"jpg":case"gif":case"png":case"webp":case"bmp":return createjs.AbstractLoader.IMAGE;case"ogg":case"mp3":case"webm":return createjs.AbstractLoader.SOUND;case"mp4":case"webm":case"ts":return createjs.AbstractLoader.VIDEO;case"json":return createjs.AbstractLoader.JSON;case"xml":return createjs.AbstractLoader.XML;case"css":return createjs.AbstractLoader.CSS;case"js":return createjs.AbstractLoader.JAVASCRIPT;case"svg":return createjs.AbstractLoader.SVG;default:return createjs.AbstractLoader.TEXT}},createjs.RequestUtils=a}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractLoader(a,b,c){this.EventDispatcher_constructor(),this.loaded=!1,this.canceled=!1,this.progress=0,this.type=c,this.resultFormatter=null,this._item=a?createjs.LoadItem.create(a):null,this._preferXHR=b,this._result=null,this._rawResult=null,this._loadedItems=null,this._tagSrcAttribute=null,this._tag=null}var a=createjs.extend(AbstractLoader,createjs.EventDispatcher),b=AbstractLoader;b.POST="POST",b.GET="GET",b.BINARY="binary",b.CSS="css",b.IMAGE="image",b.JAVASCRIPT="javascript",b.JSON="json",b.JSONP="jsonp",b.MANIFEST="manifest",b.SOUND="sound",b.VIDEO="video",b.SPRITESHEET="spritesheet",b.SVG="svg",b.TEXT="text",b.XML="xml",a.getItem=function(){return this._item},a.getResult=function(a){return a?this._rawResult:this._result},a.getTag=function(){return this._tag},a.setTag=function(a){this._tag=a},a.load=function(){this._createRequest(),this._request.on("complete",this,this),this._request.on("progress",this,this),this._request.on("loadStart",this,this),this._request.on("abort",this,this),this._request.on("timeout",this,this),this._request.on("error",this,this);var a=new createjs.Event("initialize");a.loader=this._request,this.dispatchEvent(a),this._request.load()},a.cancel=function(){this.canceled=!0,this.destroy()},a.destroy=function(){this._request&&(this._request.removeAllEventListeners(),this._request.destroy()),this._request=null,this._item=null,this._rawResult=null,this._result=null,this._loadItems=null,this.removeAllEventListeners()},a.getLoadedItems=function(){return this._loadedItems},a._createRequest=function(){this._request=this._preferXHR?new createjs.XHRRequest(this._item):new createjs.TagRequest(this._item,this._tag||this._createTag(),this._tagSrcAttribute)},a._createTag=function(){return null},a._sendLoadStart=function(){this._isCanceled()||this.dispatchEvent("loadstart")},a._sendProgress=function(a){if(!this._isCanceled()){var b=null;"number"==typeof a?(this.progress=a,b=new createjs.ProgressEvent(this.progress)):(b=a,this.progress=a.loaded/a.total,b.progress=this.progress,(isNaN(this.progress)||1/0==this.progress)&&(this.progress=0)),this.hasEventListener("progress")&&this.dispatchEvent(b)}},a._sendComplete=function(){if(!this._isCanceled()){this.loaded=!0;var a=new createjs.Event("complete");a.rawResult=this._rawResult,null!=this._result&&(a.result=this._result),this.dispatchEvent(a)}},a._sendError=function(a){!this._isCanceled()&&this.hasEventListener("error")&&(null==a&&(a=new createjs.ErrorEvent("PRELOAD_ERROR_EMPTY")),this.dispatchEvent(a))},a._isCanceled=function(){return null==window.createjs||this.canceled?!0:!1},a.resultFormatter=null,a.handleEvent=function(a){switch(a.type){case"complete":this._rawResult=a.target._response;var b=this.resultFormatter&&this.resultFormatter(this);b instanceof Function?b.call(this,createjs.proxy(this._resultFormatSuccess,this),createjs.proxy(this._resultFormatFailed,this)):(this._result=b||this._rawResult,this._sendComplete());break;case"progress":this._sendProgress(a);break;case"error":this._sendError(a);break;case"loadstart":this._sendLoadStart();break;case"abort":case"timeout":this._isCanceled()||this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_"+a.type.toUpperCase()+"_ERROR"))}},a._resultFormatSuccess=function(a){this._result=a,this._sendComplete()},a._resultFormatFailed=function(a){this._sendError(a)},a.buildPath=function(a,b){return createjs.RequestUtils.buildPath(a,b)},a.toString=function(){return"[PreloadJS AbstractLoader]"},createjs.AbstractLoader=createjs.promote(AbstractLoader,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractMediaLoader(a,b,c){this.AbstractLoader_constructor(a,b,c),this.resultFormatter=this._formatResult,this._tagSrcAttribute="src",this.on("initialize",this._updateXHR,this)}var a=createjs.extend(AbstractMediaLoader,createjs.AbstractLoader);a.load=function(){this._tag||(this._tag=this._createTag(this._item.src)),this._tag.preload="auto",this._tag.load(),this.AbstractLoader_load()},a._createTag=function(){},a._createRequest=function(){this._request=this._preferXHR?new createjs.XHRRequest(this._item):new createjs.MediaTagRequest(this._item,this._tag||this._createTag(),this._tagSrcAttribute)},a._updateXHR=function(a){a.loader.setResponseType&&a.loader.setResponseType("blob")},a._formatResult=function(a){if(this._tag.removeEventListener&&this._tag.removeEventListener("canplaythrough",this._loadedHandler),this._tag.onstalled=null,this._preferXHR){var b=window.URL||window.webkitURL,c=a.getResult(!0);a.getTag().src=b.createObjectURL(c)}return a.getTag()},createjs.AbstractMediaLoader=createjs.promote(AbstractMediaLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";var AbstractRequest=function(a){this._item=a},a=createjs.extend(AbstractRequest,createjs.EventDispatcher);a.load=function(){},a.destroy=function(){},a.cancel=function(){},createjs.AbstractRequest=createjs.promote(AbstractRequest,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function TagRequest(a,b,c){this.AbstractRequest_constructor(a),this._tag=b,this._tagSrcAttribute=c,this._loadedHandler=createjs.proxy(this._handleTagComplete,this),this._addedToDOM=!1,this._startTagDisplay=null}var a=createjs.extend(TagRequest,createjs.AbstractRequest);a.load=function(){this._tag.onload=createjs.proxy(this._handleTagComplete,this),this._tag.onreadystatechange=createjs.proxy(this._handleReadyStateChange,this),this._tag.onerror=createjs.proxy(this._handleError,this);var a=new createjs.Event("initialize");a.loader=this._tag,this.dispatchEvent(a),this._hideTag(),this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout),this._tag[this._tagSrcAttribute]=this._item.src,null==this._tag.parentNode&&(window.document.body.appendChild(this._tag),this._addedToDOM=!0)},a.destroy=function(){this._clean(),this._tag=null,this.AbstractRequest_destroy()},a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this._tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleTagComplete()},a._handleError=function(){this._clean(),this.dispatchEvent("error")},a._handleTagComplete=function(){this._rawResult=this._tag,this._result=this.resultFormatter&&this.resultFormatter(this)||this._rawResult,this._clean(),this._showTag(),this.dispatchEvent("complete")},a._handleTimeout=function(){this._clean(),this.dispatchEvent(new createjs.Event("timeout"))},a._clean=function(){this._tag.onload=null,this._tag.onreadystatechange=null,this._tag.onerror=null,this._addedToDOM&&null!=this._tag.parentNode&&this._tag.parentNode.removeChild(this._tag),clearTimeout(this._loadTimeout)},a._hideTag=function(){this._startTagDisplay=this._tag.style.display,this._tag.style.display="none"},a._showTag=function(){this._tag.style.display=this._startTagDisplay},a._handleStalled=function(){},createjs.TagRequest=createjs.promote(TagRequest,"AbstractRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function MediaTagRequest(a,b,c){this.AbstractRequest_constructor(a),this._tag=b,this._tagSrcAttribute=c,this._loadedHandler=createjs.proxy(this._handleTagComplete,this)}var a=createjs.extend(MediaTagRequest,createjs.TagRequest);a.load=function(){var a=createjs.proxy(this._handleStalled,this);this._stalledCallback=a;var b=createjs.proxy(this._handleProgress,this);this._handleProgress=b,this._tag.addEventListener("stalled",a),this._tag.addEventListener("progress",b),this._tag.addEventListener&&this._tag.addEventListener("canplaythrough",this._loadedHandler,!1),this.TagRequest_load()},a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this._tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleTagComplete()},a._handleStalled=function(){},a._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.ProgressEvent(a.loaded,a.total);this.dispatchEvent(b)}},a._clean=function(){this._tag.removeEventListener&&this._tag.removeEventListener("canplaythrough",this._loadedHandler),this._tag.removeEventListener("stalled",this._stalledCallback),this._tag.removeEventListener("progress",this._progressCallback),this.TagRequest__clean()},createjs.MediaTagRequest=createjs.promote(MediaTagRequest,"TagRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function XHRRequest(a){this.AbstractRequest_constructor(a),this._request=null,this._loadTimeout=null,this._xhrLevel=1,this._response=null,this._rawResponse=null,this._canceled=!1,this._handleLoadStartProxy=createjs.proxy(this._handleLoadStart,this),this._handleProgressProxy=createjs.proxy(this._handleProgress,this),this._handleAbortProxy=createjs.proxy(this._handleAbort,this),this._handleErrorProxy=createjs.proxy(this._handleError,this),this._handleTimeoutProxy=createjs.proxy(this._handleTimeout,this),this._handleLoadProxy=createjs.proxy(this._handleLoad,this),this._handleReadyStateChangeProxy=createjs.proxy(this._handleReadyStateChange,this),!this._createXHR(a)}var a=createjs.extend(XHRRequest,createjs.AbstractRequest);XHRRequest.ACTIVEX_VERSIONS=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],a.getResult=function(a){return a&&this._rawResponse?this._rawResponse:this._response},a.cancel=function(){this.canceled=!0,this._clean(),this._request.abort()},a.load=function(){if(null==this._request)return void this._handleError();null!=this._request.addEventListener?(this._request.addEventListener("loadstart",this._handleLoadStartProxy,!1),this._request.addEventListener("progress",this._handleProgressProxy,!1),this._request.addEventListener("abort",this._handleAbortProxy,!1),this._request.addEventListener("error",this._handleErrorProxy,!1),this._request.addEventListener("timeout",this._handleTimeoutProxy,!1),this._request.addEventListener("load",this._handleLoadProxy,!1),this._request.addEventListener("readystatechange",this._handleReadyStateChangeProxy,!1)):(this._request.onloadstart=this._handleLoadStartProxy,this._request.onprogress=this._handleProgressProxy,this._request.onabort=this._handleAbortProxy,this._request.onerror=this._handleErrorProxy,this._request.ontimeout=this._handleTimeoutProxy,this._request.onload=this._handleLoadProxy,this._request.onreadystatechange=this._handleReadyStateChangeProxy),1==this._xhrLevel&&(this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout));try{this._item.values&&this._item.method!=createjs.AbstractLoader.GET?this._item.method==createjs.AbstractLoader.POST&&this._request.send(createjs.RequestUtils.formatQueryString(this._item.values)):this._request.send()}catch(a){this.dispatchEvent(new createjs.ErrorEvent("XHR_SEND",null,a))}},a.setResponseType=function(a){"blob"===a&&(a=window.URL?"blob":"arraybuffer",this._responseType=a),this._request.responseType=a},a.getAllResponseHeaders=function(){return this._request.getAllResponseHeaders instanceof Function?this._request.getAllResponseHeaders():null},a.getResponseHeader=function(a){return this._request.getResponseHeader instanceof Function?this._request.getResponseHeader(a):null},a._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.ProgressEvent(a.loaded,a.total);this.dispatchEvent(b)}},a._handleLoadStart=function(){clearTimeout(this._loadTimeout),this.dispatchEvent("loadstart")},a._handleAbort=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent("XHR_ABORTED",null,a))},a._handleError=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent(a.message))},a._handleReadyStateChange=function(){4==this._request.readyState&&this._handleLoad()},a._handleLoad=function(){if(!this.loaded){this.loaded=!0;var a=this._checkError();if(a)return void this._handleError(a);if(this._response=this._getResponse(),"arraybuffer"===this._responseType)try{this._response=new Blob([this._response])}catch(b){if(window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,"TypeError"===b.name&&window.BlobBuilder){var c=new BlobBuilder;c.append(this._response),this._response=c.getBlob()}}this._clean(),this.dispatchEvent(new createjs.Event("complete"))}},a._handleTimeout=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_TIMEOUT",null,a))},a._checkError=function(){var a=parseInt(this._request.status);switch(a){case 404:case 0:return new Error(a)}return null},a._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(a){}return null},a._createXHR=function(a){var b=createjs.RequestUtils.isCrossDomain(a),c={},d=null;if(window.XMLHttpRequest)d=new XMLHttpRequest,b&&void 0===d.withCredentials&&window.XDomainRequest&&(d=new XDomainRequest);else{for(var e=0,f=s.ACTIVEX_VERSIONS.length;f>e;e++){var g=s.ACTIVEX_VERSIONS[e];try{d=new ActiveXObject(g);break}catch(h){}}if(null==d)return!1}null==a.mimeType&&createjs.RequestUtils.isText(a.type)&&(a.mimeType="text/plain; charset=utf-8"),a.mimeType&&d.overrideMimeType&&d.overrideMimeType(a.mimeType),this._xhrLevel="string"==typeof d.responseType?2:1;var i=null;if(i=a.method==createjs.AbstractLoader.GET?createjs.RequestUtils.buildPath(a.src,a.values):a.src,d.open(a.method||createjs.AbstractLoader.GET,i,!0),b&&d instanceof XMLHttpRequest&&1==this._xhrLevel&&(c.Origin=location.origin),a.values&&a.method==createjs.AbstractLoader.POST&&(c["Content-Type"]="application/x-www-form-urlencoded"),b||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest"),a.headers)for(var j in a.headers)c[j]=a.headers[j];for(j in c)d.setRequestHeader(j,c[j]);return d instanceof XMLHttpRequest&&void 0!==a.withCredentials&&(d.withCredentials=a.withCredentials),this._request=d,!0},a._clean=function(){clearTimeout(this._loadTimeout),null!=this._request.removeEventListener?(this._request.removeEventListener("loadstart",this._handleLoadStartProxy),this._request.removeEventListener("progress",this._handleProgressProxy),this._request.removeEventListener("abort",this._handleAbortProxy),this._request.removeEventListener("error",this._handleErrorProxy),this._request.removeEventListener("timeout",this._handleTimeoutProxy),this._request.removeEventListener("load",this._handleLoadProxy),this._request.removeEventListener("readystatechange",this._handleReadyStateChangeProxy)):(this._request.onloadstart=null,this._request.onprogress=null,this._request.onabort=null,this._request.onerror=null,this._request.ontimeout=null,this._request.onload=null,this._request.onreadystatechange=null)},a.toString=function(){return"[PreloadJS XHRRequest]"},createjs.XHRRequest=createjs.promote(XHRRequest,"AbstractRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function LoadQueue(a,b,c){this.AbstractLoader_constructor(),this._plugins=[],this._typeCallbacks={},this._extensionCallbacks={},this.next=null,this.maintainScriptOrder=!0,this.stopOnError=!1,this._maxConnections=1,this._availableLoaders=[createjs.ImageLoader,createjs.JavaScriptLoader,createjs.CSSLoader,createjs.JSONLoader,createjs.JSONPLoader,createjs.SoundLoader,createjs.ManifestLoader,createjs.SpriteSheetLoader,createjs.XMLLoader,createjs.SVGLoader,createjs.BinaryLoader,createjs.VideoLoader,createjs.TextLoader],this._defaultLoaderLength=this._availableLoaders.length,this.init(a,b,c) -}var a=createjs.extend(LoadQueue,createjs.AbstractLoader),b=LoadQueue;a.init=function(a,b,c){this.useXHR=!0,this.preferXHR=!0,this._preferXHR=!0,this.setPreferXHR(a),this._paused=!1,this._basePath=b,this._crossOrigin=c,this._loadStartWasDispatched=!1,this._currentlyLoadingScript=null,this._currentLoads=[],this._loadQueue=[],this._loadQueueBackup=[],this._loadItemsById={},this._loadItemsBySrc={},this._loadedResults={},this._loadedRawResults={},this._numItems=0,this._numItemsLoaded=0,this._scriptOrder=[],this._loadedScripts=[],this._lastProgress=0/0},b.loadTimeout=8e3,b.LOAD_TIMEOUT=0,b.BINARY=createjs.AbstractLoader.BINARY,b.CSS=createjs.AbstractLoader.CSS,b.IMAGE=createjs.AbstractLoader.IMAGE,b.JAVASCRIPT=createjs.AbstractLoader.JAVASCRIPT,b.JSON=createjs.AbstractLoader.JSON,b.JSONP=createjs.AbstractLoader.JSONP,b.MANIFEST=createjs.AbstractLoader.MANIFEST,b.SOUND=createjs.AbstractLoader.SOUND,b.VIDEO=createjs.AbstractLoader.VIDEO,b.SVG=createjs.AbstractLoader.SVG,b.TEXT=createjs.AbstractLoader.TEXT,b.XML=createjs.AbstractLoader.XML,b.POST=createjs.AbstractLoader.POST,b.GET=createjs.AbstractLoader.GET,a.registerLoader=function(a){if(!a||!a.canLoadItem)throw new Error("loader is of an incorrect type.");if(-1!=this._availableLoaders.indexOf(a))throw new Error("loader already exists.");this._availableLoaders.unshift(a)},a.unregisterLoader=function(a){var b=this._availableLoaders.indexOf(a);-1!=b&&b0)return;var c=!1;if(b){for(;b.length;){var d=b.pop(),e=this.getResult(d);for(f=this._loadQueue.length-1;f>=0;f--)if(g=this._loadQueue[f].getItem(),g.id==d||g.src==d){this._loadQueue.splice(f,1)[0].cancel();break}for(f=this._loadQueueBackup.length-1;f>=0;f--)if(g=this._loadQueueBackup[f].getItem(),g.id==d||g.src==d){this._loadQueueBackup.splice(f,1)[0].cancel();break}if(e)this._disposeItem(this.getItem(d));else for(var f=this._currentLoads.length-1;f>=0;f--){var g=this._currentLoads[f].getItem();if(g.id==d||g.src==d){this._currentLoads.splice(f,1)[0].cancel(),c=!0;break}}}c&&this._loadNext()}else{this.close();for(var h in this._loadItemsById)this._disposeItem(this._loadItemsById[h]);this.init(this.preferXHR,this._basePath)}},a.reset=function(){this.close();for(var a in this._loadItemsById)this._disposeItem(this._loadItemsById[a]);for(var b=[],c=0,d=this._loadQueueBackup.length;d>c;c++)b.push(this._loadQueueBackup[c].getItem());this.loadManifest(b,!1)},a.installPlugin=function(a){if(null!=a&&null!=a.getPreloadHandlers){this._plugins.push(a);var b=a.getPreloadHandlers();if(b.scope=a,null!=b.types)for(var c=0,d=b.types.length;d>c;c++)this._typeCallbacks[b.types[c]]=b;if(null!=b.extensions)for(c=0,d=b.extensions.length;d>c;c++)this._extensionCallbacks[b.extensions[c]]=b}},a.setMaxConnections=function(a){this._maxConnections=a,!this._paused&&this._loadQueue.length>0&&this._loadNext()},a.loadFile=function(a,b,c){if(null==a){var d=new createjs.ErrorEvent("PRELOAD_NO_FILE");return void this._sendError(d)}this._addItem(a,null,c),this.setPaused(b!==!1?!1:!0)},a.loadManifest=function(a,c,d){var e=null,f=null;if(Array.isArray(a)){if(0==a.length){var g=new createjs.ErrorEvent("PRELOAD_MANIFEST_EMPTY");return void this._sendError(g)}e=a}else if("string"==typeof a)e=[{src:a,type:b.MANIFEST}];else{if("object"!=typeof a){var g=new createjs.ErrorEvent("PRELOAD_MANIFEST_NULL");return void this._sendError(g)}if(void 0!==a.src){if(null==a.type)a.type=b.MANIFEST;else if(a.type!=b.MANIFEST){var g=new createjs.ErrorEvent("PRELOAD_MANIFEST_TYPE");this._sendError(g)}e=[a]}else void 0!==a.manifest&&(e=a.manifest,f=a.path)}for(var h=0,i=e.length;i>h;h++)this._addItem(e[h],f,d);this.setPaused(c!==!1?!1:!0)},a.load=function(){this.setPaused(!1)},a.getItem=function(a){return this._loadItemsById[a]||this._loadItemsBySrc[a]},a.getResult=function(a,b){var c=this._loadItemsById[a]||this._loadItemsBySrc[a];if(null==c)return null;var d=c.id;return b&&this._loadedRawResults[d]?this._loadedRawResults[d]:this._loadedResults[d]},a.getItems=function(a){var b=[];for(var c in this._loadItemsById){var d=this._loadItemsById[c],e=this.getResult(c);(a!==!0||null!=e)&&b.push({item:d,result:e,rawResult:this.getResult(c,!0)})}return b},a.setPaused=function(a){this._paused=a,this._paused||this._loadNext()},a.close=function(){for(;this._currentLoads.length;)this._currentLoads.pop().cancel();this._scriptOrder.length=0,this._loadedScripts.length=0,this.loadStartWasDispatched=!1,this._itemCount=0,this._lastProgress=0/0},a._addItem=function(a,b,c){var d=this._createLoadItem(a,b,c);if(null!=d){var e=this._createLoader(d);null!=e&&("plugins"in e&&(e.plugins=this._plugins),d._loader=e,this._loadQueue.push(e),this._loadQueueBackup.push(e),this._numItems++,this._updateProgress(),(this.maintainScriptOrder&&d.type==createjs.LoadQueue.JAVASCRIPT||d.maintainOrder===!0)&&(this._scriptOrder.push(d),this._loadedScripts.push(null)))}},a._createLoadItem=function(a,b,c){var d=createjs.LoadItem.create(a);if(null==d)return null;var e="",f=c||this._basePath;if(d.src instanceof Object){if(!d.type)return null;if(b){e=b;var g=createjs.RequestUtils.parseURI(b);null==f||g.absolute||g.relative||(e=f+e)}else null!=f&&(e=f)}else{var h=createjs.RequestUtils.parseURI(d.src);h.extension&&(d.ext=h.extension),null==d.type&&(d.type=createjs.RequestUtils.getTypeByExtension(d.ext));var i=d.src;if(!h.absolute&&!h.relative)if(b){e=b;var g=createjs.RequestUtils.parseURI(b);i=b+i,null==f||g.absolute||g.relative||(e=f+e)}else null!=f&&(e=f);d.src=e+d.src}d.path=e,(void 0===d.id||null===d.id||""===d.id)&&(d.id=i);var j=this._typeCallbacks[d.type]||this._extensionCallbacks[d.ext];if(j){var k=j.callback.call(j.scope,d,this);if(k===!1)return null;k===!0||null!=k&&(d._loader=k),h=createjs.RequestUtils.parseURI(d.src),null!=h.extension&&(d.ext=h.extension)}return this._loadItemsById[d.id]=d,this._loadItemsBySrc[d.src]=d,null==d.crossOrigin&&(d.crossOrigin=this._crossOrigin),d},a._createLoader=function(a){if(null!=a._loader)return a._loader;for(var b=this.preferXHR,c=0;c=this._maxConnections);a++){var b=this._loadQueue[a];this._canStartLoad(b)&&(this._loadQueue.splice(a,1),a--,this._loadItem(b))}}},a._loadItem=function(a){a.on("fileload",this._handleFileLoad,this),a.on("progress",this._handleProgress,this),a.on("complete",this._handleFileComplete,this),a.on("error",this._handleError,this),a.on("fileerror",this._handleFileError,this),this._currentLoads.push(a),this._sendFileStart(a.getItem()),a.load()},a._handleFileLoad=function(a){a.target=null,this.dispatchEvent(a)},a._handleFileError=function(a){var b=new createjs.ErrorEvent("FILE_LOAD_ERROR",null,a.item);this._sendError(b)},a._handleError=function(a){var b=a.target;this._numItemsLoaded++,this._finishOrderedItem(b,!0),this._updateProgress();var c=new createjs.ErrorEvent("FILE_LOAD_ERROR",null,b.getItem());this._sendError(c),this.stopOnError?this.setPaused(!0):(this._removeLoadItem(b),this._cleanLoadItem(b),this._loadNext())},a._handleFileComplete=function(a){var b=a.target,c=b.getItem(),d=b.getResult();this._loadedResults[c.id]=d;var e=b.getResult(!0);null!=e&&e!==d&&(this._loadedRawResults[c.id]=e),this._saveLoadedItems(b),this._removeLoadItem(b),this._finishOrderedItem(b)||this._processFinishedLoad(c,b),this._cleanLoadItem(b)},a._saveLoadedItems=function(a){var b=a.getLoadedItems();if(null!==b)for(var c=0;cb;b++){var c=this._loadedScripts[b];if(null===c)break;if(c!==!0){var d=this._loadedResults[c.id];c.type==createjs.LoadQueue.JAVASCRIPT&&createjs.DomUtils.appendToHead(d);var e=c._loader;this._processFinishedLoad(c,e),this._loadedScripts[b]=!0}}},a._processFinishedLoad=function(a,b){if(this._numItemsLoaded++,!this.maintainScriptOrder&&a.type==createjs.LoadQueue.JAVASCRIPT){var c=b.getTag();createjs.DomUtils.appendToHead(c)}this._updateProgress(),this._sendFileComplete(a,b),this._loadNext()},a._canStartLoad=function(a){if(!this.maintainScriptOrder||a.preferXHR)return!0;var b=a.getItem();if(b.type!=createjs.LoadQueue.JAVASCRIPT)return!0;if(this._currentlyLoadingScript)return!1;for(var c=this._scriptOrder.indexOf(b),d=0;c>d;){var e=this._loadedScripts[d];if(null==e)return!1;d++}return this._currentlyLoadingScript=!0,!0},a._removeLoadItem=function(a){for(var b=this._currentLoads.length,c=0;b>c;c++)if(this._currentLoads[c]==a){this._currentLoads.splice(c,1);break}},a._cleanLoadItem=function(a){var b=a.getItem();b&&delete b._loader},a._handleProgress=function(a){var b=a.target;this._sendFileProgress(b.getItem(),b.progress),this._updateProgress()},a._updateProgress=function(){var a=this._numItemsLoaded/this._numItems,b=this._numItems-this._numItemsLoaded;if(b>0){for(var c=0,d=0,e=this._currentLoads.length;e>d;d++)c+=this._currentLoads[d].progress;a+=c/b*(b/this._numItems)}this._lastProgress!=a&&(this._sendProgress(a),this._lastProgress=a)},a._disposeItem=function(a){delete this._loadedResults[a.id],delete this._loadedRawResults[a.id],delete this._loadItemsById[a.id],delete this._loadItemsBySrc[a.src]},a._sendFileProgress=function(a,b){if(!this._isCanceled()&&!this._paused&&this.hasEventListener("fileprogress")){var c=new createjs.Event("fileprogress");c.progress=b,c.loaded=b,c.total=1,c.item=a,this.dispatchEvent(c)}},a._sendFileComplete=function(a,b){if(!this._isCanceled()&&!this._paused){var c=new createjs.Event("fileload");c.loader=b,c.item=a,c.result=this._loadedResults[a.id],c.rawResult=this._loadedRawResults[a.id],a.completeHandler&&a.completeHandler(c),this.hasEventListener("fileload")&&this.dispatchEvent(c)}},a._sendFileStart=function(a){var b=new createjs.Event("filestart");b.item=a,this.hasEventListener("filestart")&&this.dispatchEvent(b)},a.toString=function(){return"[PreloadJS LoadQueue]"},createjs.LoadQueue=createjs.promote(LoadQueue,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function TextLoader(a){this.AbstractLoader_constructor(a,!0,createjs.AbstractLoader.TEXT)}var a=(createjs.extend(TextLoader,createjs.AbstractLoader),TextLoader);a.canLoadItem=function(a){return a.type==createjs.AbstractLoader.TEXT},createjs.TextLoader=createjs.promote(TextLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function BinaryLoader(a){this.AbstractLoader_constructor(a,!0,createjs.AbstractLoader.BINARY),this.on("initialize",this._updateXHR,this)}var a=createjs.extend(BinaryLoader,createjs.AbstractLoader),b=BinaryLoader;b.canLoadItem=function(a){return a.type==createjs.AbstractLoader.BINARY},a._updateXHR=function(a){a.loader.setResponseType("arraybuffer")},createjs.BinaryLoader=createjs.promote(BinaryLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function CSSLoader(a,b){this.AbstractLoader_constructor(a,b,createjs.AbstractLoader.CSS),this.resultFormatter=this._formatResult,this._tagSrcAttribute="href",this._tag=document.createElement(b?"style":"link"),this._tag.rel="stylesheet",this._tag.type="text/css"}var a=createjs.extend(CSSLoader,createjs.AbstractLoader),b=CSSLoader;b.canLoadItem=function(a){return a.type==createjs.AbstractLoader.CSS},a._formatResult=function(a){if(this._preferXHR){var b=a.getTag();if(b.styleSheet)b.styleSheet.cssText=a.getResult(!0);else{var c=document.createTextNode(a.getResult(!0));b.appendChild(c)}}else b=this._tag;return createjs.DomUtils.appendToHead(b),b},createjs.CSSLoader=createjs.promote(CSSLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function ImageLoader(a,b){this.AbstractLoader_constructor(a,b,createjs.AbstractLoader.IMAGE),this.resultFormatter=this._formatResult,this._tagSrcAttribute="src",createjs.RequestUtils.isImageTag(a)?this._tag=a:createjs.RequestUtils.isImageTag(a.src)?this._tag=a.src:createjs.RequestUtils.isImageTag(a.tag)&&(this._tag=a.tag),null!=this._tag?this._preferXHR=!1:this._tag=document.createElement("img"),this.on("initialize",this._updateXHR,this)}var a=createjs.extend(ImageLoader,createjs.AbstractLoader),b=ImageLoader;b.canLoadItem=function(a){return a.type==createjs.AbstractLoader.IMAGE},a.load=function(){if(""!=this._tag.src&&this._tag.complete)return void this._sendComplete();var a=this._item.crossOrigin;1==a&&(a="Anonymous"),null==a||createjs.RequestUtils.isLocal(this._item.src)||(this._tag.crossOrigin=a),this.AbstractLoader_load()},a._updateXHR=function(a){a.loader.mimeType="text/plain; charset=x-user-defined-binary",a.loader.setResponseType&&a.loader.setResponseType("blob")},a._formatResult=function(){return this._formatImage},a._formatImage=function(a,b){var c=this._tag,d=window.URL||window.webkitURL;if(this._preferXHR)if(d){var e=d.createObjectURL(this.getResult(!0));c.src=e,c.addEventListener("load",this._cleanUpURL,!1),c.addEventListener("error",this._cleanUpURL,!1)}else c.src=loader.getItem().src;else;c.complete?a(c):(c.addEventListener("load",createjs.proxy(function(){a(this._tag)},this),!1),c.addEventListener("error",createjs.proxy(function(){b(this._tag)},this),!1))},a._cleanUpURL=function(a){var b=window.URL||window.webkitURL;b.revokeObjectURL(a.target.src)},createjs.ImageLoader=createjs.promote(ImageLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function JavaScriptLoader(a,b){this.AbstractLoader_constructor(a,b,createjs.AbstractLoader.JAVASCRIPT),this.resultFormatter=this._formatResult,this._tagSrcAttribute="src",this.setTag(document.createElement("script"))}var a=createjs.extend(JavaScriptLoader,createjs.AbstractLoader),b=JavaScriptLoader;b.canLoadItem=function(a){return a.type==createjs.AbstractLoader.JAVASCRIPT},a._formatResult=function(a){var b=a.getTag();return this._preferXHR&&(b.text=a.getResult(!0)),b},createjs.JavaScriptLoader=createjs.promote(JavaScriptLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function JSONLoader(a){this.AbstractLoader_constructor(a,!0,createjs.AbstractLoader.JSON),this.resultFormatter=this._formatResult}var a=createjs.extend(JSONLoader,createjs.AbstractLoader),b=JSONLoader;b.canLoadItem=function(a){return a.type==createjs.AbstractLoader.JSON},a._formatResult=function(a){var b=null;try{b=createjs.DataUtils.parseJSON(a.getResult(!0))}catch(c){var d=new createjs.ErrorEvent("JSON_FORMAT",null,c);return this._sendError(d),c}return b},createjs.JSONLoader=createjs.promote(JSONLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function JSONPLoader(a){this.AbstractLoader_constructor(a,!1,createjs.AbstractLoader.JSONP),this.setTag(document.createElement("script")),this.getTag().type="text/javascript"}var a=createjs.extend(JSONPLoader,createjs.AbstractLoader),b=JSONPLoader;b.canLoadItem=function(a){return a.type==createjs.AbstractLoader.JSONP},a.cancel=function(){this.AbstractLoader_cancel(),this._dispose()},a.load=function(){if(null==this._item.callback)throw new Error("callback is required for loading JSONP requests.");if(null!=window[this._item.callback])throw new Error("JSONP callback '"+this._item.callback+"' already exists on window. You need to specify a different callback or re-name the current one.");window[this._item.callback]=createjs.proxy(this._handleLoad,this),window.document.body.appendChild(this._tag),this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout),this._tag.src=this._item.src},a._handleLoad=function(a){this._result=this._rawResult=a,this._sendComplete(),this._dispose()},a._handleTimeout=function(){this._dispose(),this.dispatchEvent(new createjs.ErrorEvent("timeout"))},a._dispose=function(){window.document.body.removeChild(this._tag),delete window[this._item.callback],clearTimeout(this._loadTimeout)},createjs.JSONPLoader=createjs.promote(JSONPLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function ManifestLoader(a){this.AbstractLoader_constructor(a,null,createjs.AbstractLoader.MANIFEST),this.plugins=null,this._manifestQueue=null}var a=createjs.extend(ManifestLoader,createjs.AbstractLoader),b=ManifestLoader;b.MANIFEST_PROGRESS=.25,b.canLoadItem=function(a){return a.type==createjs.AbstractLoader.MANIFEST},a.load=function(){this.AbstractLoader_load()},a._createRequest=function(){var a=this._item.callback;this._request=null!=a?new createjs.JSONPLoader(this._item):new createjs.JSONLoader(this._item)},a.handleEvent=function(a){switch(a.type){case"complete":return this._rawResult=a.target.getResult(!0),this._result=a.target.getResult(),this._sendProgress(b.MANIFEST_PROGRESS),void this._loadManifest(this._result);case"progress":return a.loaded*=b.MANIFEST_PROGRESS,this.progress=a.loaded/a.total,(isNaN(this.progress)||1/0==this.progress)&&(this.progress=0),void this._sendProgress(a)}this.AbstractLoader_handleEvent(a)},a.destroy=function(){this.AbstractLoader_destroy(),this._manifestQueue.close()},a._loadManifest=function(a){if(a&&a.manifest){var b=this._manifestQueue=new createjs.LoadQueue;b.on("fileload",this._handleManifestFileLoad,this),b.on("progress",this._handleManifestProgress,this),b.on("complete",this._handleManifestComplete,this,!0),b.on("error",this._handleManifestError,this,!0);for(var c=0,d=this.plugins.length;d>c;c++)b.installPlugin(this.plugins[c]);b.loadManifest(a)}else this._sendComplete()},a._handleManifestFileLoad=function(a){a.target=null,this.dispatchEvent(a)},a._handleManifestComplete=function(){this._loadedItems=this._manifestQueue.getItems(!0),this._sendComplete()},a._handleManifestProgress=function(a){this.progress=a.progress*(1-b.MANIFEST_PROGRESS)+b.MANIFEST_PROGRESS,this._sendProgress(this.progress)},a._handleManifestError=function(a){var b=new createjs.Event("fileerror");b.item=a.data,this.dispatchEvent(b)},createjs.ManifestLoader=createjs.promote(ManifestLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function SoundLoader(a,b){this.AbstractMediaLoader_constructor(a,b,createjs.AbstractLoader.SOUND),createjs.RequestUtils.isAudioTag(a)?this._tag=a:createjs.RequestUtils.isAudioTag(a.src)?this._tag=a:createjs.RequestUtils.isAudioTag(a.tag)&&(this._tag=createjs.RequestUtils.isAudioTag(a)?a:a.src),null!=this._tag&&(this._preferXHR=!1)}var a=createjs.extend(SoundLoader,createjs.AbstractMediaLoader),b=SoundLoader;b.canLoadItem=function(a){return a.type==createjs.AbstractLoader.SOUND},a._createTag=function(a){var b=document.createElement("audio");return b.autoplay=!1,b.preload="none",b.src=a,b},createjs.SoundLoader=createjs.promote(SoundLoader,"AbstractMediaLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function VideoLoader(a,b){this.AbstractMediaLoader_constructor(a,b,createjs.AbstractLoader.VIDEO),createjs.RequestUtils.isVideoTag(a)||createjs.RequestUtils.isVideoTag(a.src)?(this.setTag(createjs.RequestUtils.isVideoTag(a)?a:a.src),this._preferXHR=!1):this.setTag(this._createTag())}var a=createjs.extend(VideoLoader,createjs.AbstractMediaLoader),b=VideoLoader;a._createTag=function(){return document.createElement("video")},b.canLoadItem=function(a){return a.type==createjs.AbstractLoader.VIDEO},createjs.VideoLoader=createjs.promote(VideoLoader,"AbstractMediaLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function SpriteSheetLoader(a,b){this.AbstractLoader_constructor(a,b,createjs.AbstractLoader.SPRITESHEET),this._manifestQueue=null}var a=createjs.extend(SpriteSheetLoader,createjs.AbstractLoader),b=SpriteSheetLoader;b.SPRITESHEET_PROGRESS=.25,b.canLoadItem=function(a){return a.type==createjs.AbstractLoader.SPRITESHEET},a.destroy=function(){this.AbstractLoader_destroy,this._manifestQueue.close()},a._createRequest=function(){var a=this._item.callback;this._request=null!=a?new createjs.JSONPLoader(this._item):new createjs.JSONLoader(this._item)},a.handleEvent=function(a){switch(a.type){case"complete":return this._rawResult=a.target.getResult(!0),this._result=a.target.getResult(),this._sendProgress(b.SPRITESHEET_PROGRESS),void this._loadManifest(this._result);case"progress":return a.loaded*=b.SPRITESHEET_PROGRESS,this.progress=a.loaded/a.total,(isNaN(this.progress)||1/0==this.progress)&&(this.progress=0),void this._sendProgress(a)}this.AbstractLoader_handleEvent(a)},a._loadManifest=function(a){if(a&&a.images){var b=this._manifestQueue=new createjs.LoadQueue(this._preferXHR,this._item.path,this._item.crossOrigin);b.on("complete",this._handleManifestComplete,this,!0),b.on("fileload",this._handleManifestFileLoad,this),b.on("progress",this._handleManifestProgress,this),b.on("error",this._handleManifestError,this,!0),b.loadManifest(a.images)}},a._handleManifestFileLoad=function(a){var b=a.result;if(null!=b){var c=this.getResult().images,d=c.indexOf(a.item.src);c[d]=b}},a._handleManifestComplete=function(){this._result=new createjs.SpriteSheet(this._result),this._loadedItems=this._manifestQueue.getItems(!0),this._sendComplete()},a._handleManifestProgress=function(a){this.progress=a.progress*(1-b.SPRITESHEET_PROGRESS)+b.SPRITESHEET_PROGRESS,this._sendProgress(this.progress)},a._handleManifestError=function(a){var b=new createjs.Event("fileerror");b.item=a.data,this.dispatchEvent(b)},createjs.SpriteSheetLoader=createjs.promote(SpriteSheetLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function SVGLoader(a,b){this.AbstractLoader_constructor(a,b,createjs.AbstractLoader.SVG),this.resultFormatter=this._formatResult,this._tagSrcAttribute="data",b?this.setTag(document.createElement("svg")):(this.setTag(document.createElement("object")),this.getTag().type="image/svg+xml")}var a=createjs.extend(SVGLoader,createjs.AbstractLoader),b=SVGLoader;b.canLoadItem=function(a){return a.type==createjs.AbstractLoader.SVG},a._formatResult=function(a){var b=createjs.DataUtils.parseXML(a.getResult(!0),"text/xml"),c=a.getTag();return!this._preferXHR&&document.body.contains(c)&&document.body.removeChild(c),null!=b.documentElement?(c.appendChild(b.documentElement),c.style.visibility="visible",c):b},createjs.SVGLoader=createjs.promote(SVGLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function XMLLoader(a){this.AbstractLoader_constructor(a,!0,createjs.AbstractLoader.XML),this.resultFormatter=this._formatResult}var a=createjs.extend(XMLLoader,createjs.AbstractLoader),b=XMLLoader;b.canLoadItem=function(a){return a.type==createjs.AbstractLoader.XML},a._formatResult=function(a){return createjs.DataUtils.parseXML(a.getResult(!0),"text/xml")},createjs.XMLLoader=createjs.promote(XMLLoader,"AbstractLoader")}(); \ No newline at end of file +this.createjs=this.createjs||{},function(){"use strict";var a=createjs.PreloadJS=createjs.PreloadJS||{};a.version="NEXT",a.buildDate="Thu, 14 Sep 2017 22:19:45 GMT"}(),this.createjs=this.createjs||{},createjs.extend=function(a,b){"use strict";function c(){this.constructor=a}return c.prototype=b.prototype,a.prototype=new c},this.createjs=this.createjs||{},createjs.promote=function(a,b){"use strict";var c=a.prototype,d=Object.getPrototypeOf&&Object.getPrototypeOf(c)||c.__proto__;if(d){c[(b+="_")+"constructor"]=d.constructor;for(var e in d)c.hasOwnProperty(e)&&"function"==typeof d[e]&&(c[b+e]=d[e])}return a},this.createjs=this.createjs||{},createjs.deprecate=function(a,b){"use strict";return function(){var c="Deprecated property or method '"+b+"'. See docs for info.";return console&&(console.warn?console.warn(c):console.log(c)),a&&a.apply(this,arguments)}},this.createjs=this.createjs||{},function(){"use strict";createjs.proxy=function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,Array.prototype.slice.call(arguments,0).concat(c))}}}(),this.createjs=this.createjs||{},createjs.indexOf=function(a,b){"use strict";for(var c=0,d=a.length;d>c;c++)if(b===a[c])return c;return-1},this.createjs=this.createjs||{},function(){"use strict";function Event(a,b,c){this.type=a,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!b,this.cancelable=!!c,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var a=Event.prototype;a.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},a.stopPropagation=function(){this.propagationStopped=!0},a.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},a.remove=function(){this.removed=!0},a.clone=function(){return new Event(this.type,this.bubbles,this.cancelable)},a.set=function(a){for(var b in a)this[b]=a[b];return this},a.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=Event}(),this.createjs=this.createjs||{},function(){"use strict";function ErrorEvent(a,b,c){this.Event_constructor("error"),this.title=a,this.message=b,this.data=c}var a=createjs.extend(ErrorEvent,createjs.Event);a.clone=function(){return new createjs.ErrorEvent(this.title,this.message,this.data)},createjs.ErrorEvent=createjs.promote(ErrorEvent,"Event")}(),this.createjs=this.createjs||{},function(){"use strict";function EventDispatcher(){this._listeners=null,this._captureListeners=null}var a=EventDispatcher.prototype;EventDispatcher.initialize=function(b){b.addEventListener=a.addEventListener,b.on=a.on,b.removeEventListener=b.off=a.removeEventListener,b.removeAllEventListeners=a.removeAllEventListeners,b.hasEventListener=a.hasEventListener,b.dispatchEvent=a.dispatchEvent,b._dispatchEvent=a._dispatchEvent,b.willTrigger=a.willTrigger},a.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},a.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},a.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},a.off=a.removeEventListener,a.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},a.dispatchEvent=function(a,b,c){if("string"==typeof a){var d=this._listeners;if(!(b||d&&d[a]))return!0;a=new createjs.Event(a,b,c)}else a.target&&a.clone&&(a=a.clone());try{a.target=this}catch(e){}if(a.bubbles&&this.parent){for(var f=this,g=[f];f.parent;)g.push(f=f.parent);var h,i=g.length;for(h=i-1;h>=0&&!a.propagationStopped;h--)g[h]._dispatchEvent(a,1+(0==h));for(h=1;i>h&&!a.propagationStopped;h++)g[h]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return!a.defaultPrevented},a.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},a.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1},a.toString=function(){return"[EventDispatcher]"},a._dispatchEvent=function(a,b){var c,d,e=2>=b?this._captureListeners:this._listeners;if(a&&e&&(d=e[a.type])&&(c=d.length)){try{a.currentTarget=this}catch(f){}try{a.eventPhase=0|b}catch(f){}a.removed=!1,d=d.slice();for(var g=0;c>g&&!a.immediatePropagationStopped;g++){var h=d[g];h.handleEvent?h.handleEvent(a):h(a),a.removed&&(this.off(a.type,h,1==b),a.removed=!1)}}2===b&&this._dispatchEvent(a,2.1)},createjs.EventDispatcher=EventDispatcher}(),this.createjs=this.createjs||{},function(){"use strict";function ProgressEvent(a,b){this.Event_constructor("progress"),this.loaded=a,this.total=null==b?1:b,this.progress=0==b?0:this.loaded/this.total}var a=createjs.extend(ProgressEvent,createjs.Event);a.clone=function(){return new createjs.ProgressEvent(this.loaded,this.total)},createjs.ProgressEvent=createjs.promote(ProgressEvent,"Event")}(window),function(){function a(b,d){function f(a){if(f[a]!==q)return f[a];var b;if("bug-string-char-index"==a)b="a"!="a"[0];else if("json"==a)b=f("json-stringify")&&f("json-parse");else{var c,e='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==a){var i=d.stringify,k="function"==typeof i&&t;if(k){(c=function(){return 1}).toJSON=c;try{k="0"===i(0)&&"0"===i(new g)&&'""'==i(new h)&&i(s)===q&&i(q)===q&&i()===q&&"1"===i(c)&&"[1]"==i([c])&&"[null]"==i([q])&&"null"==i(null)&&"[null,null,null]"==i([q,s,null])&&i({a:[c,!0,!1,null,"\x00\b\n\f\r "]})==e&&"1"===i(null,c)&&"[\n 1,\n 2\n]"==i([1,2],null,1)&&'"-271821-04-20T00:00:00.000Z"'==i(new j(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==i(new j(864e13))&&'"-000001-01-01T00:00:00.000Z"'==i(new j(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==i(new j(-1))}catch(l){k=!1}}b=k}if("json-parse"==a){var m=d.parse;if("function"==typeof m)try{if(0===m("0")&&!m(!1)){c=m(e);var n=5==c.a.length&&1===c.a[0];if(n){try{n=!m('" "')}catch(l){}if(n)try{n=1!==m("01")}catch(l){}if(n)try{n=1!==m("1.")}catch(l){}}}}catch(l){n=!1}b=n}}return f[a]=!!b}b||(b=e.Object()),d||(d=e.Object());var g=b.Number||e.Number,h=b.String||e.String,i=b.Object||e.Object,j=b.Date||e.Date,k=b.SyntaxError||e.SyntaxError,l=b.TypeError||e.TypeError,m=b.Math||e.Math,n=b.JSON||e.JSON;"object"==typeof n&&n&&(d.stringify=n.stringify,d.parse=n.parse);var o,p,q,r=i.prototype,s=r.toString,t=new j(-0xc782b5b800cec);try{t=-109252==t.getUTCFullYear()&&0===t.getUTCMonth()&&1===t.getUTCDate()&&10==t.getUTCHours()&&37==t.getUTCMinutes()&&6==t.getUTCSeconds()&&708==t.getUTCMilliseconds()}catch(u){}if(!f("json")){var v="[object Function]",w="[object Date]",x="[object Number]",y="[object String]",z="[object Array]",A="[object Boolean]",B=f("bug-string-char-index");if(!t)var C=m.floor,D=[0,31,59,90,120,151,181,212,243,273,304,334],E=function(a,b){return D[b]+365*(a-1970)+C((a-1969+(b=+(b>1)))/4)-C((a-1901+b)/100)+C((a-1601+b)/400)};if((o=r.hasOwnProperty)||(o=function(a){var b,c={};return(c.__proto__=null,c.__proto__={toString:1},c).toString!=s?o=function(a){var b=this.__proto__,c=a in(this.__proto__=null,this);return this.__proto__=b,c}:(b=c.constructor,o=function(a){var c=(this.constructor||b).prototype;return a in this&&!(a in c&&this[a]===c[a])}),c=null,o.call(this,a)}),p=function(a,b){var d,e,f,g=0;(d=function(){this.valueOf=0}).prototype.valueOf=0,e=new d;for(f in e)o.call(e,f)&&g++;return d=e=null,g?p=2==g?function(a,b){var c,d={},e=s.call(a)==v;for(c in a)e&&"prototype"==c||o.call(d,c)||!(d[c]=1)||!o.call(a,c)||b(c)}:function(a,b){var c,d,e=s.call(a)==v;for(c in a)e&&"prototype"==c||!o.call(a,c)||(d="constructor"===c)||b(c);(d||o.call(a,c="constructor"))&&b(c)}:(e=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],p=function(a,b){var d,f,g=s.call(a)==v,h=!g&&"function"!=typeof a.constructor&&c[typeof a.hasOwnProperty]&&a.hasOwnProperty||o;for(d in a)g&&"prototype"==d||!h.call(a,d)||b(d);for(f=e.length;d=e[--f];h.call(a,d)&&b(d));}),p(a,b)},!f("json-stringify")){var F={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},G="000000",H=function(a,b){return(G+(b||0)).slice(-a)},I="\\u00",J=function(a){for(var b='"',c=0,d=a.length,e=!B||d>10,f=e&&(B?a.split(""):a);d>c;c++){var g=a.charCodeAt(c);switch(g){case 8:case 9:case 10:case 12:case 13:case 34:case 92:b+=F[g];break;default:if(32>g){b+=I+H(2,g.toString(16));break}b+=e?f[c]:a.charAt(c)}}return b+'"'},K=function(a,b,c,d,e,f,g){var h,i,j,k,m,n,r,t,u,v,B,D,F,G,I,L;try{h=b[a]}catch(M){}if("object"==typeof h&&h)if(i=s.call(h),i!=w||o.call(h,"toJSON"))"function"==typeof h.toJSON&&(i!=x&&i!=y&&i!=z||o.call(h,"toJSON"))&&(h=h.toJSON(a));else if(h>-1/0&&1/0>h){if(E){for(m=C(h/864e5),j=C(m/365.2425)+1970-1;E(j+1,0)<=m;j++);for(k=C((m-E(j,0))/30.42);E(j,k+1)<=m;k++);m=1+m-E(j,k),n=(h%864e5+864e5)%864e5,r=C(n/36e5)%24,t=C(n/6e4)%60,u=C(n/1e3)%60,v=n%1e3}else j=h.getUTCFullYear(),k=h.getUTCMonth(),m=h.getUTCDate(),r=h.getUTCHours(),t=h.getUTCMinutes(),u=h.getUTCSeconds(),v=h.getUTCMilliseconds();h=(0>=j||j>=1e4?(0>j?"-":"+")+H(6,0>j?-j:j):H(4,j))+"-"+H(2,k+1)+"-"+H(2,m)+"T"+H(2,r)+":"+H(2,t)+":"+H(2,u)+"."+H(3,v)+"Z"}else h=null;if(c&&(h=c.call(b,a,h)),null===h)return"null";if(i=s.call(h),i==A)return""+h;if(i==x)return h>-1/0&&1/0>h?""+h:"null";if(i==y)return J(""+h);if("object"==typeof h){for(G=g.length;G--;)if(g[G]===h)throw l();if(g.push(h),B=[],I=f,f+=e,i==z){for(F=0,G=h.length;G>F;F++)D=K(F,h,c,d,e,f,g),B.push(D===q?"null":D);L=B.length?e?"[\n"+f+B.join(",\n"+f)+"\n"+I+"]":"["+B.join(",")+"]":"[]"}else p(d||h,function(a){var b=K(a,h,c,d,e,f,g);b!==q&&B.push(J(a)+":"+(e?" ":"")+b)}),L=B.length?e?"{\n"+f+B.join(",\n"+f)+"\n"+I+"}":"{"+B.join(",")+"}":"{}";return g.pop(),L}};d.stringify=function(a,b,d){var e,f,g,h;if(c[typeof b]&&b)if((h=s.call(b))==v)f=b;else if(h==z){g={};for(var i,j=0,k=b.length;k>j;i=b[j++],h=s.call(i),(h==y||h==x)&&(g[i]=1));}if(d)if((h=s.call(d))==x){if((d-=d%1)>0)for(e="",d>10&&(d=10);e.lengthL;)switch(e=f.charCodeAt(L)){case 9:case 10:case 13:case 32:L++;break;case 123:case 125:case 91:case 93:case 58:case 44:return a=B?f.charAt(L):f[L],L++,a;case 34:for(a="@",L++;g>L;)if(e=f.charCodeAt(L),32>e)P();else if(92==e)switch(e=f.charCodeAt(++L)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:a+=O[e],L++;break;case 117:for(b=++L,c=L+4;c>L;L++)e=f.charCodeAt(L),e>=48&&57>=e||e>=97&&102>=e||e>=65&&70>=e||P();a+=N("0x"+f.slice(b,L));break;default:P()}else{if(34==e)break;for(e=f.charCodeAt(L),b=L;e>=32&&92!=e&&34!=e;)e=f.charCodeAt(++L);a+=f.slice(b,L)}if(34==f.charCodeAt(L))return L++,a;P();default:if(b=L,45==e&&(d=!0,e=f.charCodeAt(++L)),e>=48&&57>=e){for(48==e&&(e=f.charCodeAt(L+1),e>=48&&57>=e)&&P(),d=!1;g>L&&(e=f.charCodeAt(L),e>=48&&57>=e);L++);if(46==f.charCodeAt(L)){for(c=++L;g>c&&(e=f.charCodeAt(c),e>=48&&57>=e);c++);c==L&&P(),L=c}if(e=f.charCodeAt(L),101==e||69==e){for(e=f.charCodeAt(++L),(43==e||45==e)&&L++,c=L;g>c&&(e=f.charCodeAt(c),e>=48&&57>=e);c++);c==L&&P(),L=c}return+f.slice(b,L)}if(d&&P(),"true"==f.slice(L,L+4))return L+=4,!0;if("false"==f.slice(L,L+5))return L+=5,!1;if("null"==f.slice(L,L+4))return L+=4,null;P()}return"$"},R=function(a){var b,c;if("$"==a&&P(),"string"==typeof a){if("@"==(B?a.charAt(0):a[0]))return a.slice(1);if("["==a){for(b=[];a=Q(),"]"!=a;c||(c=!0))c&&(","==a?(a=Q(),"]"==a&&P()):P()),","==a&&P(),b.push(R(a));return b}if("{"==a){for(b={};a=Q(),"}"!=a;c||(c=!0))c&&(","==a?(a=Q(),"}"==a&&P()):P()),(","==a||"string"!=typeof a||"@"!=(B?a.charAt(0):a[0])||":"!=Q())&&P(),b[a.slice(1)]=R(Q());return b}P()}return a},S=function(a,b,c){var d=T(a,b,c);d===q?delete a[b]:a[b]=d},T=function(a,b,c){var d,e=a[b];if("object"==typeof e&&e)if(s.call(e)==z)for(d=e.length;d--;)S(e,d,c);else p(e,function(a){S(e,a,c)});return c.call(a,b,e)};d.parse=function(a,b){var c,d;return L=0,M=""+a,c=R(Q()),"$"!=Q()&&P(),L=M=null,b&&s.call(b)==v?T((d={},d[""]=c,d),"",b):c}}}return d.runInContext=a,d}var b="function"==typeof define&&define.amd,c={"function":!0,object:!0},d=c[typeof exports]&&exports&&!exports.nodeType&&exports,e=c[typeof window]&&window||this,f=d&&c[typeof module]&&module&&!module.nodeType&&"object"==typeof global&&global;if(!f||f.global!==f&&f.window!==f&&f.self!==f||(e=f),d&&!b)a(e,d);else{var g=e.JSON,h=e.JSON3,i=!1,j=a(e,e.JSON3={noConflict:function(){return i||(i=!0,e.JSON=g,e.JSON3=h,g=h=null),j}});e.JSON={parse:j.parse,stringify:j.stringify}}b&&define(function(){return j})}.call(this),function(){var a={};a.a=function(){return a.el("a")},a.svg=function(){return a.el("svg")},a.object=function(){return a.el("object")},a.image=function(){return a.el("image")},a.img=function(){return a.el("img")},a.style=function(){return a.el("style")},a.link=function(){return a.el("link")},a.script=function(){return a.el("script")},a.audio=function(){return a.el("audio")},a.video=function(){return a.el("video")},a.text=function(a){return document.createTextNode(a)},a.el=function(a){return document.createElement(a)},createjs.Elements=a}(),function(){var a={};a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[.\/]*?\//i,a.EXTENSION_PATT=/\/?[^\/]+\.(\w{1,5})$/i,a.parseURI=function(b){var c={absolute:!1,relative:!1,protocol:null,hostname:null,port:null,pathname:null,search:null,hash:null,host:null};if(null==b)return c;var d=createjs.Elements.a();d.href=b;for(var e in c)e in d&&(c[e]=d[e]);var f=b.indexOf("?");f>-1&&(b=b.substr(0,f));var g;return a.ABSOLUTE_PATT.test(b)?c.absolute=!0:a.RELATIVE_PATT.test(b)&&(c.relative=!0),(g=b.match(a.EXTENSION_PATT))&&(c.extension=g[1].toLowerCase()),c},a.formatQueryString=function(a,b){if(null==a)throw new Error("You must specify data.");var c=[];for(var d in a)c.push(d+"="+escape(a[d]));return b&&(c=c.concat(b)),c.join("&")},a.buildURI=function(a,b){if(null==b)return a;var c=[],d=a.indexOf("?");if(-1!=d){var e=a.slice(d+1);c=c.concat(e.split("&"))}return-1!=d?a.slice(0,d)+"?"+this.formatQueryString(b,c):a+"?"+this.formatQueryString(b,c)},a.isCrossDomain=function(a){var b=createjs.Elements.a();b.href=a.src;var c=createjs.Elements.a();c.href=location.href;var d=""!=b.hostname&&(b.port!=c.port||b.protocol!=c.protocol||b.hostname!=c.hostname);return d},a.isLocal=function(a){var b=createjs.Elements.a();return b.href=a.src,""==b.hostname&&"file:"==b.protocol},createjs.URLUtils=a}(),function(){var a={container:null};a.appendToHead=function(b){a.getHead().appendChild(b)},a.appendToBody=function(b){if(null==a.container){a.container=document.createElement("div"),a.container.id="preloadjs-container";var c=a.container.style;c.visibility="hidden",c.position="absolute",c.width=a.container.style.height="10px",c.overflow="hidden",c.transform=c.msTransform=c.webkitTransform=c.oTransform="translate(-10px, -10px)",a.getBody().appendChild(a.container)}a.container.appendChild(b)},a.getHead=function(){return document.head||document.getElementsByTagName("head")[0]},a.getBody=function(){return document.body||document.getElementsByTagName("body")[0]},a.removeChild=function(a){a.parent&&a.parent.removeChild(a)},a.isImageTag=function(a){return a instanceof HTMLImageElement},a.isAudioTag=function(a){return window.HTMLAudioElement?a instanceof HTMLAudioElement:!1},a.isVideoTag=function(a){return window.HTMLVideoElement?a instanceof HTMLVideoElement:!1},createjs.DomUtils=a}(),function(){var a={};a.parseXML=function(a){var b=null;try{if(window.DOMParser){var c=new DOMParser;b=c.parseFromString(a,"text/xml")}}catch(d){}if(!b)try{b=new ActiveXObject("Microsoft.XMLDOM"),b.async=!1,b.loadXML(a)}catch(d){b=null}return b},a.parseJSON=function(a){if(null==a)return null;try{return JSON.parse(a)}catch(b){throw b}},createjs.DataUtils=a}(),this.createjs=this.createjs||{},function(){var a={};a.BINARY="binary",a.CSS="css",a.FONT="font",a.FONTCSS="fontcss",a.IMAGE="image",a.JAVASCRIPT="javascript",a.JSON="json",a.JSONP="jsonp",a.MANIFEST="manifest",a.SOUND="sound",a.VIDEO="video",a.SPRITESHEET="spritesheet",a.SVG="svg",a.TEXT="text",a.XML="xml",createjs.Types=a}(),this.createjs=this.createjs||{},function(){var a={};a.POST="POST",a.GET="GET",createjs.Methods=a}(),this.createjs=this.createjs||{},function(){"use strict";function LoadItem(){this.src=null,this.type=null,this.id=null,this.maintainOrder=!1,this.callback=null,this.data=null,this.method=createjs.Methods.GET,this.values=null,this.headers=null,this.withCredentials=!1,this.mimeType=null,this.crossOrigin=null,this.loadTimeout=b.LOAD_TIMEOUT_DEFAULT}var a=LoadItem.prototype={},b=LoadItem;b.LOAD_TIMEOUT_DEFAULT=8e3,b.create=function(a){if("string"==typeof a){var c=new LoadItem;return c.src=a,c}if(a instanceof b)return a;if(a instanceof Object&&a.src)return null==a.loadTimeout&&(a.loadTimeout=b.LOAD_TIMEOUT_DEFAULT),a;throw new Error("Type not recognized.")},a.set=function(a){for(var b in a)this[b]=a[b];return this},createjs.LoadItem=b}(),function(){var a={};a.isBinary=function(a){switch(a){case createjs.Types.IMAGE:case createjs.Types.BINARY:return!0;default:return!1}},a.isText=function(a){switch(a){case createjs.Types.TEXT:case createjs.Types.JSON:case createjs.Types.MANIFEST:case createjs.Types.XML:case createjs.Types.CSS:case createjs.Types.SVG:case createjs.Types.JAVASCRIPT:case createjs.Types.SPRITESHEET:return!0;default:return!1}},a.getTypeByExtension=function(a){if(null==a)return createjs.Types.TEXT;switch(a.toLowerCase()){case"jpeg":case"jpg":case"gif":case"png":case"webp":case"bmp":return createjs.Types.IMAGE;case"ogg":case"mp3":case"webm":return createjs.Types.SOUND;case"mp4":case"webm":case"ts":return createjs.Types.VIDEO;case"json":return createjs.Types.JSON;case"xml":return createjs.Types.XML;case"css":return createjs.Types.CSS;case"js":return createjs.Types.JAVASCRIPT;case"svg":return createjs.Types.SVG;default:return createjs.Types.TEXT}},createjs.RequestUtils=a}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractLoader(a,b,c){this.EventDispatcher_constructor(),this.loaded=!1,this.canceled=!1,this.progress=0,this.type=c,this.resultFormatter=null,this._item=a?createjs.LoadItem.create(a):null,this._preferXHR=b,this._result=null,this._rawResult=null,this._loadedItems=null,this._tagSrcAttribute=null,this._tag=null}var a=createjs.extend(AbstractLoader,createjs.EventDispatcher),b=AbstractLoader;try{Object.defineProperties(b,{POST:{get:createjs.deprecate(function(){return createjs.Methods.POST},"AbstractLoader.POST")},GET:{get:createjs.deprecate(function(){return createjs.Methods.GET},"AbstractLoader.GET")},BINARY:{get:createjs.deprecate(function(){return createjs.Types.BINARY},"AbstractLoader.BINARY")},CSS:{get:createjs.deprecate(function(){return createjs.Types.CSS},"AbstractLoader.CSS")},FONT:{get:createjs.deprecate(function(){return createjs.Types.FONT},"AbstractLoader.FONT")},FONTCSS:{get:createjs.deprecate(function(){return createjs.Types.FONTCSS},"AbstractLoader.FONTCSS")},IMAGE:{get:createjs.deprecate(function(){return createjs.Types.IMAGE},"AbstractLoader.IMAGE")},JAVASCRIPT:{get:createjs.deprecate(function(){return createjs.Types.JAVASCRIPT},"AbstractLoader.JAVASCRIPT")},JSON:{get:createjs.deprecate(function(){return createjs.Types.JSON},"AbstractLoader.JSON")},JSONP:{get:createjs.deprecate(function(){return createjs.Types.JSONP},"AbstractLoader.JSONP")},MANIFEST:{get:createjs.deprecate(function(){return createjs.Types.MANIFEST},"AbstractLoader.MANIFEST")},SOUND:{get:createjs.deprecate(function(){return createjs.Types.SOUND},"AbstractLoader.SOUND")},VIDEO:{get:createjs.deprecate(function(){return createjs.Types.VIDEO},"AbstractLoader.VIDEO")},SPRITESHEET:{get:createjs.deprecate(function(){return createjs.Types.SPRITESHEET},"AbstractLoader.SPRITESHEET")},SVG:{get:createjs.deprecate(function(){return createjs.Types.SVG},"AbstractLoader.SVG")},TEXT:{get:createjs.deprecate(function(){return createjs.Types.TEXT},"AbstractLoader.TEXT")},XML:{get:createjs.deprecate(function(){return createjs.Types.XML},"AbstractLoader.XML")}})}catch(c){}a.getItem=function(){return this._item},a.getResult=function(a){return a?this._rawResult:this._result},a.getTag=function(){return this._tag},a.setTag=function(a){this._tag=a},a.load=function(){this._createRequest(),this._request.on("complete",this,this),this._request.on("progress",this,this),this._request.on("loadStart",this,this),this._request.on("abort",this,this),this._request.on("timeout",this,this),this._request.on("error",this,this);var a=new createjs.Event("initialize");a.loader=this._request,this.dispatchEvent(a),this._request.load()},a.cancel=function(){this.canceled=!0,this.destroy()},a.destroy=function(){this._request&&(this._request.removeAllEventListeners(),this._request.destroy()),this._request=null,this._item=null,this._rawResult=null,this._result=null,this._loadItems=null,this.removeAllEventListeners()},a.getLoadedItems=function(){return this._loadedItems},a._createRequest=function(){this._request=this._preferXHR?new createjs.XHRRequest(this._item):new createjs.TagRequest(this._item,this._tag||this._createTag(),this._tagSrcAttribute)},a._createTag=function(){return null},a._sendLoadStart=function(){this._isCanceled()||this.dispatchEvent("loadstart")},a._sendProgress=function(a){if(!this._isCanceled()){var b=null;"number"==typeof a?(this.progress=a,b=new createjs.ProgressEvent(this.progress)):(b=a,this.progress=a.loaded/a.total,b.progress=this.progress,(isNaN(this.progress)||1/0==this.progress)&&(this.progress=0)),this.hasEventListener("progress")&&this.dispatchEvent(b)}},a._sendComplete=function(){if(!this._isCanceled()){this.loaded=!0;var a=new createjs.Event("complete");a.rawResult=this._rawResult,null!=this._result&&(a.result=this._result),this.dispatchEvent(a)}},a._sendError=function(a){!this._isCanceled()&&this.hasEventListener("error")&&(null==a&&(a=new createjs.ErrorEvent("PRELOAD_ERROR_EMPTY")),this.dispatchEvent(a))},a._isCanceled=function(){return null==window.createjs||this.canceled?!0:!1},a.resultFormatter=null,a.handleEvent=function(a){switch(a.type){case"complete":this._rawResult=a.target._response;var b=this.resultFormatter&&this.resultFormatter(this);b instanceof Function?b.call(this,createjs.proxy(this._resultFormatSuccess,this),createjs.proxy(this._resultFormatFailed,this)):(this._result=b||this._rawResult,this._sendComplete());break;case"progress":this._sendProgress(a);break;case"error":this._sendError(a);break;case"loadstart":this._sendLoadStart();break;case"abort":case"timeout":this._isCanceled()||this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_"+a.type.toUpperCase()+"_ERROR"))}},a._resultFormatSuccess=function(a){this._result=a,this._sendComplete()},a._resultFormatFailed=function(a){this._sendError(a)},a.toString=function(){return"[PreloadJS AbstractLoader]"},createjs.AbstractLoader=createjs.promote(AbstractLoader,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractMediaLoader(a,b,c){this.AbstractLoader_constructor(a,b,c),this.resultFormatter=this._formatResult,this._tagSrcAttribute="src",this.on("initialize",this._updateXHR,this)}var a=createjs.extend(AbstractMediaLoader,createjs.AbstractLoader);a.load=function(){this._tag||(this._tag=this._createTag(this._item.src)),this._tag.preload="auto",this._tag.load(),this.AbstractLoader_load()},a._createTag=function(){},a._createRequest=function(){this._request=this._preferXHR?new createjs.XHRRequest(this._item):new createjs.MediaTagRequest(this._item,this._tag||this._createTag(),this._tagSrcAttribute)},a._updateXHR=function(a){a.loader.setResponseType&&a.loader.setResponseType("blob")},a._formatResult=function(a){if(this._tag.removeEventListener&&this._tag.removeEventListener("canplaythrough",this._loadedHandler),this._tag.onstalled=null,this._preferXHR){var b=window.URL||window.webkitURL,c=a.getResult(!0);a.getTag().src=b.createObjectURL(c)}return a.getTag()},createjs.AbstractMediaLoader=createjs.promote(AbstractMediaLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";var AbstractRequest=function(a){this._item=a},a=createjs.extend(AbstractRequest,createjs.EventDispatcher);a.load=function(){},a.destroy=function(){},a.cancel=function(){},createjs.AbstractRequest=createjs.promote(AbstractRequest,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function TagRequest(a,b,c){this.AbstractRequest_constructor(a),this._tag=b,this._tagSrcAttribute=c,this._loadedHandler=createjs.proxy(this._handleTagComplete,this),this._addedToDOM=!1}var a=createjs.extend(TagRequest,createjs.AbstractRequest);a.load=function(){this._tag.onload=createjs.proxy(this._handleTagComplete,this),this._tag.onreadystatechange=createjs.proxy(this._handleReadyStateChange,this),this._tag.onerror=createjs.proxy(this._handleError,this);var a=new createjs.Event("initialize");a.loader=this._tag,this.dispatchEvent(a),this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout),this._tag[this._tagSrcAttribute]=this._item.src,null==this._tag.parentNode&&(createjs.DomUtils.appendToBody(this._tag),this._addedToDOM=!0)},a.destroy=function(){this._clean(),this._tag=null,this.AbstractRequest_destroy()},a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this._tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleTagComplete()},a._handleError=function(){this._clean(),this.dispatchEvent("error")},a._handleTagComplete=function(){this._rawResult=this._tag,this._result=this.resultFormatter&&this.resultFormatter(this)||this._rawResult,this._clean(),this.dispatchEvent("complete")},a._handleTimeout=function(){this._clean(),this.dispatchEvent(new createjs.Event("timeout"))},a._clean=function(){this._tag.onload=null,this._tag.onreadystatechange=null,this._tag.onerror=null,this._addedToDOM&&null!=this._tag.parentNode&&this._tag.parentNode.removeChild(this._tag),clearTimeout(this._loadTimeout)},a._handleStalled=function(){},createjs.TagRequest=createjs.promote(TagRequest,"AbstractRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function MediaTagRequest(a,b,c){this.AbstractRequest_constructor(a),this._tag=b,this._tagSrcAttribute=c,this._loadedHandler=createjs.proxy(this._handleTagComplete,this)}var a=createjs.extend(MediaTagRequest,createjs.TagRequest);a.load=function(){var a=createjs.proxy(this._handleStalled,this);this._stalledCallback=a;var b=createjs.proxy(this._handleProgress,this);this._handleProgress=b,this._tag.addEventListener("stalled",a),this._tag.addEventListener("progress",b),this._tag.addEventListener&&this._tag.addEventListener("canplaythrough",this._loadedHandler,!1),this.TagRequest_load()},a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this._tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleTagComplete()},a._handleStalled=function(){},a._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.ProgressEvent(a.loaded,a.total);this.dispatchEvent(b)}},a._clean=function(){this._tag.removeEventListener&&this._tag.removeEventListener("canplaythrough",this._loadedHandler),this._tag.removeEventListener("stalled",this._stalledCallback),this._tag.removeEventListener("progress",this._progressCallback),this.TagRequest__clean()},createjs.MediaTagRequest=createjs.promote(MediaTagRequest,"TagRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function XHRRequest(a){this.AbstractRequest_constructor(a),this._request=null,this._loadTimeout=null,this._xhrLevel=1,this._response=null,this._rawResponse=null,this._canceled=!1,this._handleLoadStartProxy=createjs.proxy(this._handleLoadStart,this),this._handleProgressProxy=createjs.proxy(this._handleProgress,this),this._handleAbortProxy=createjs.proxy(this._handleAbort,this),this._handleErrorProxy=createjs.proxy(this._handleError,this),this._handleTimeoutProxy=createjs.proxy(this._handleTimeout,this),this._handleLoadProxy=createjs.proxy(this._handleLoad,this),this._handleReadyStateChangeProxy=createjs.proxy(this._handleReadyStateChange,this),!this._createXHR(a)}var a=createjs.extend(XHRRequest,createjs.AbstractRequest);XHRRequest.ACTIVEX_VERSIONS=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],a.getResult=function(a){return a&&this._rawResponse?this._rawResponse:this._response},a.cancel=function(){this.canceled=!0,this._clean(),this._request.abort()},a.load=function(){if(null==this._request)return void this._handleError();null!=this._request.addEventListener?(this._request.addEventListener("loadstart",this._handleLoadStartProxy,!1),this._request.addEventListener("progress",this._handleProgressProxy,!1),this._request.addEventListener("abort",this._handleAbortProxy,!1),this._request.addEventListener("error",this._handleErrorProxy,!1),this._request.addEventListener("timeout",this._handleTimeoutProxy,!1),this._request.addEventListener("load",this._handleLoadProxy,!1),this._request.addEventListener("readystatechange",this._handleReadyStateChangeProxy,!1)):(this._request.onloadstart=this._handleLoadStartProxy,this._request.onprogress=this._handleProgressProxy,this._request.onabort=this._handleAbortProxy,this._request.onerror=this._handleErrorProxy,this._request.ontimeout=this._handleTimeoutProxy,this._request.onload=this._handleLoadProxy,this._request.onreadystatechange=this._handleReadyStateChangeProxy),1==this._xhrLevel&&(this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout));try{this._item.values?this._request.send(createjs.URLUtils.formatQueryString(this._item.values)):this._request.send()}catch(a){this.dispatchEvent(new createjs.ErrorEvent("XHR_SEND",null,a))}},a.setResponseType=function(a){"blob"===a&&(a=window.URL?"blob":"arraybuffer",this._responseType=a),this._request.responseType=a},a.getAllResponseHeaders=function(){return this._request.getAllResponseHeaders instanceof Function?this._request.getAllResponseHeaders():null},a.getResponseHeader=function(a){return this._request.getResponseHeader instanceof Function?this._request.getResponseHeader(a):null},a._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.ProgressEvent(a.loaded,a.total);this.dispatchEvent(b)}},a._handleLoadStart=function(){clearTimeout(this._loadTimeout),this.dispatchEvent("loadstart")},a._handleAbort=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent("XHR_ABORTED",null,a))},a._handleError=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent(a.message))},a._handleReadyStateChange=function(){4==this._request.readyState&&this._handleLoad()},a._handleLoad=function(){if(!this.loaded){this.loaded=!0;var a=this._checkError();if(a)return void this._handleError(a);if(this._response=this._getResponse(),"arraybuffer"===this._responseType)try{this._response=new Blob([this._response])}catch(b){if(window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,"TypeError"===b.name&&window.BlobBuilder){var c=new BlobBuilder;c.append(this._response),this._response=c.getBlob()}}this._clean(),this.dispatchEvent(new createjs.Event("complete"))}},a._handleTimeout=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_TIMEOUT",null,a))},a._checkError=function(){var a=parseInt(this._request.status);return a>=400&&599>=a?new Error(a):0==a&&/^https?:/.test(location.protocol)?new Error(0):null},a._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(a){}return null},a._createXHR=function(a){var b=createjs.URLUtils.isCrossDomain(a),c={},d=null;if(window.XMLHttpRequest)d=new XMLHttpRequest,b&&void 0===d.withCredentials&&window.XDomainRequest&&(d=new XDomainRequest);else{for(var e=0,f=s.ACTIVEX_VERSIONS.length;f>e;e++){var g=s.ACTIVEX_VERSIONS[e];try{d=new ActiveXObject(g);break}catch(h){}}if(null==d)return!1}null==a.mimeType&&createjs.RequestUtils.isText(a.type)&&(a.mimeType="text/plain; charset=utf-8"),a.mimeType&&d.overrideMimeType&&d.overrideMimeType(a.mimeType),this._xhrLevel="string"==typeof d.responseType?2:1;var i=null;if(i=a.method==createjs.Methods.GET?createjs.URLUtils.buildURI(a.src,a.values):a.src,d.open(a.method||createjs.Methods.GET,i,!0),b&&d instanceof XMLHttpRequest&&1==this._xhrLevel&&(c.Origin=location.origin),a.values&&a.method==createjs.Methods.POST&&(c["Content-Type"]="application/x-www-form-urlencoded"),b||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest"),a.headers)for(var j in a.headers)c[j]=a.headers[j];for(j in c)d.setRequestHeader(j,c[j]);return d instanceof XMLHttpRequest&&void 0!==a.withCredentials&&(d.withCredentials=a.withCredentials),this._request=d,!0},a._clean=function(){clearTimeout(this._loadTimeout),null!=this._request.removeEventListener?(this._request.removeEventListener("loadstart",this._handleLoadStartProxy),this._request.removeEventListener("progress",this._handleProgressProxy),this._request.removeEventListener("abort",this._handleAbortProxy),this._request.removeEventListener("error",this._handleErrorProxy),this._request.removeEventListener("timeout",this._handleTimeoutProxy),this._request.removeEventListener("load",this._handleLoadProxy),this._request.removeEventListener("readystatechange",this._handleReadyStateChangeProxy)):(this._request.onloadstart=null,this._request.onprogress=null,this._request.onabort=null,this._request.onerror=null,this._request.ontimeout=null,this._request.onload=null,this._request.onreadystatechange=null)},a.toString=function(){return"[PreloadJS XHRRequest]"},createjs.XHRRequest=createjs.promote(XHRRequest,"AbstractRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function LoadQueue(a,b,c){this.AbstractLoader_constructor(),this._plugins=[],this._typeCallbacks={},this._extensionCallbacks={},this.next=null,this.maintainScriptOrder=!0,this.stopOnError=!1,this._maxConnections=1,this._availableLoaders=[createjs.FontLoader,createjs.ImageLoader,createjs.JavaScriptLoader,createjs.CSSLoader,createjs.JSONLoader,createjs.JSONPLoader,createjs.SoundLoader,createjs.ManifestLoader,createjs.SpriteSheetLoader,createjs.XMLLoader,createjs.SVGLoader,createjs.BinaryLoader,createjs.VideoLoader,createjs.TextLoader],this._defaultLoaderLength=this._availableLoaders.length,this.init(a,b,c)}var a=createjs.extend(LoadQueue,createjs.AbstractLoader),b=LoadQueue;try{Object.defineProperties(b,{POST:{get:createjs.deprecate(function(){return createjs.Methods.POST},"AbstractLoader.POST")},GET:{get:createjs.deprecate(function(){return createjs.Methods.GET},"AbstractLoader.GET")},BINARY:{get:createjs.deprecate(function(){return createjs.Types.BINARY},"AbstractLoader.BINARY")},CSS:{get:createjs.deprecate(function(){return createjs.Types.CSS},"AbstractLoader.CSS")},FONT:{get:createjs.deprecate(function(){return createjs.Types.FONT},"AbstractLoader.FONT")},FONTCSS:{get:createjs.deprecate(function(){return createjs.Types.FONTCSS},"AbstractLoader.FONTCSS")},IMAGE:{get:createjs.deprecate(function(){return createjs.Types.IMAGE},"AbstractLoader.IMAGE")},JAVASCRIPT:{get:createjs.deprecate(function(){return createjs.Types.JAVASCRIPT},"AbstractLoader.JAVASCRIPT")},JSON:{get:createjs.deprecate(function(){return createjs.Types.JSON},"AbstractLoader.JSON")},JSONP:{get:createjs.deprecate(function(){return createjs.Types.JSONP},"AbstractLoader.JSONP")},MANIFEST:{get:createjs.deprecate(function(){return createjs.Types.MANIFEST},"AbstractLoader.MANIFEST")},SOUND:{get:createjs.deprecate(function(){return createjs.Types.SOUND},"AbstractLoader.SOUND")},VIDEO:{get:createjs.deprecate(function(){return createjs.Types.VIDEO},"AbstractLoader.VIDEO")},SPRITESHEET:{get:createjs.deprecate(function(){return createjs.Types.SPRITESHEET},"AbstractLoader.SPRITESHEET")},SVG:{get:createjs.deprecate(function(){return createjs.Types.SVG},"AbstractLoader.SVG")},TEXT:{get:createjs.deprecate(function(){return createjs.Types.TEXT},"AbstractLoader.TEXT")},XML:{get:createjs.deprecate(function(){return createjs.Types.XML},"AbstractLoader.XML")}})}catch(c){}a.init=function(a,b,c){this.preferXHR=!0,this._preferXHR=!0,this.setPreferXHR(a),this._paused=!1,this._basePath=b,this._crossOrigin=c,this._loadStartWasDispatched=!1,this._currentlyLoadingScript=null,this._currentLoads=[],this._loadQueue=[],this._loadQueueBackup=[],this._loadItemsById={},this._loadItemsBySrc={},this._loadedResults={},this._loadedRawResults={},this._numItems=0,this._numItemsLoaded=0,this._scriptOrder=[],this._loadedScripts=[],this._lastProgress=0/0},a.registerLoader=function(a){if(!a||!a.canLoadItem)throw new Error("loader is of an incorrect type.");if(-1!=this._availableLoaders.indexOf(a))throw new Error("loader already exists.");this._availableLoaders.unshift(a)},a.unregisterLoader=function(a){var b=this._availableLoaders.indexOf(a);-1!=b&&b0)return;var c=!1;if(b){for(;b.length;){var d=b.pop(),e=this.getResult(d);for(f=this._loadQueue.length-1;f>=0;f--)if(g=this._loadQueue[f].getItem(),g.id==d||g.src==d){this._loadQueue.splice(f,1)[0].cancel();break}for(f=this._loadQueueBackup.length-1;f>=0;f--)if(g=this._loadQueueBackup[f].getItem(),g.id==d||g.src==d){this._loadQueueBackup.splice(f,1)[0].cancel();break}if(e)this._disposeItem(this.getItem(d));else for(var f=this._currentLoads.length-1;f>=0;f--){var g=this._currentLoads[f].getItem();if(g.id==d||g.src==d){this._currentLoads.splice(f,1)[0].cancel(),c=!0;break}}}c&&this._loadNext()}else{this.close();for(var h in this._loadItemsById)this._disposeItem(this._loadItemsById[h]);this.init(this.preferXHR,this._basePath)}},a.reset=function(){this.close();for(var a in this._loadItemsById)this._disposeItem(this._loadItemsById[a]);for(var b=[],c=0,d=this._loadQueueBackup.length;d>c;c++)b.push(this._loadQueueBackup[c].getItem());this.loadManifest(b,!1)},a.installPlugin=function(a){if(null!=a&&null!=a.getPreloadHandlers){this._plugins.push(a);var b=a.getPreloadHandlers();if(b.scope=a,null!=b.types)for(var c=0,d=b.types.length;d>c;c++)this._typeCallbacks[b.types[c]]=b;if(null!=b.extensions)for(c=0,d=b.extensions.length;d>c;c++)this._extensionCallbacks[b.extensions[c]]=b}},a.setMaxConnections=function(a){this._maxConnections=a,!this._paused&&this._loadQueue.length>0&&this._loadNext()},a.loadFile=function(a,b,c){if(null==a){var d=new createjs.ErrorEvent("PRELOAD_NO_FILE");return void this._sendError(d)}this._addItem(a,null,c),this.setPaused(b!==!1?!1:!0)},a.loadManifest=function(a,c,d){var e=null,f=null;if(Array.isArray(a)){if(0==a.length){var g=new createjs.ErrorEvent("PRELOAD_MANIFEST_EMPTY");return void this._sendError(g)}e=a}else if("string"==typeof a)e=[{src:a,type:b.MANIFEST}];else{if("object"!=typeof a){var g=new createjs.ErrorEvent("PRELOAD_MANIFEST_NULL");return void this._sendError(g)}if(void 0!==a.src){if(null==a.type)a.type=b.MANIFEST;else if(a.type!=b.MANIFEST){var g=new createjs.ErrorEvent("PRELOAD_MANIFEST_TYPE");this._sendError(g)}e=[a]}else void 0!==a.manifest&&(e=a.manifest,f=a.path)}for(var h=0,i=e.length;i>h;h++)this._addItem(e[h],f,d);this.setPaused(c!==!1?!1:!0)},a.load=function(){this.setPaused(!1)},a.getItem=function(a){return this._loadItemsById[a]||this._loadItemsBySrc[a]},a.getResult=function(a,b){var c=this._loadItemsById[a]||this._loadItemsBySrc[a];if(null==c)return null;var d=c.id;return b&&this._loadedRawResults[d]?this._loadedRawResults[d]:this._loadedResults[d]},a.getItems=function(a){var b=[];for(var c in this._loadItemsById){var d=this._loadItemsById[c],e=this.getResult(c);(a!==!0||null!=e)&&b.push({item:d,result:e,rawResult:this.getResult(c,!0)})}return b},a.setPaused=function(a){this._paused=a,this._paused||this._loadNext()},a.close=function(){for(;this._currentLoads.length;)this._currentLoads.pop().cancel();this._scriptOrder.length=0,this._loadedScripts.length=0,this.loadStartWasDispatched=!1,this._itemCount=0,this._lastProgress=0/0},a._addItem=function(a,b,c){var d=this._createLoadItem(a,b,c);if(null!=d){var e=this._createLoader(d);null!=e&&("plugins"in e&&(e.plugins=this._plugins),d._loader=e,this._loadQueue.push(e),this._loadQueueBackup.push(e),this._numItems++,this._updateProgress(),(this.maintainScriptOrder&&d.type==createjs.Types.JAVASCRIPT||d.maintainOrder===!0)&&(this._scriptOrder.push(d),this._loadedScripts.push(null)))}},a._createLoadItem=function(a,b,c){var d=createjs.LoadItem.create(a);if(null==d)return null;var e="",f=c||this._basePath;if(d.src instanceof Object){if(!d.type)return null;if(b){e=b;var g=createjs.URLUtils.parseURI(b);null==f||g.absolute||g.relative||(e=f+e)}else null!=f&&(e=f)}else{var h=createjs.URLUtils.parseURI(d.src);h.extension&&(d.ext=h.extension),null==d.type&&(d.type=createjs.RequestUtils.getTypeByExtension(d.ext));var i=d.src;if(!h.absolute&&!h.relative)if(b){e=b;var g=createjs.URLUtils.parseURI(b);i=b+i,null==f||g.absolute||g.relative||(e=f+e)}else null!=f&&(e=f);d.src=e+d.src}d.path=e,(void 0===d.id||null===d.id||""===d.id)&&(d.id=i);var j=this._typeCallbacks[d.type]||this._extensionCallbacks[d.ext];if(j){var k=j.callback.call(j.scope,d,this);if(k===!1)return null;k===!0||null!=k&&(d._loader=k),h=createjs.URLUtils.parseURI(d.src),null!=h.extension&&(d.ext=h.extension)}return this._loadItemsById[d.id]=d,this._loadItemsBySrc[d.src]=d,null==d.crossOrigin&&(d.crossOrigin=this._crossOrigin),d},a._createLoader=function(a){if(null!=a._loader)return a._loader;for(var b=this.preferXHR,c=0;c=this._maxConnections);a++){var b=this._loadQueue[a];this._canStartLoad(b)&&(this._loadQueue.splice(a,1),a--,this._loadItem(b))}}},a._loadItem=function(a){a.on("fileload",this._handleFileLoad,this),a.on("progress",this._handleProgress,this),a.on("complete",this._handleFileComplete,this),a.on("error",this._handleError,this),a.on("fileerror",this._handleFileError,this),this._currentLoads.push(a),this._sendFileStart(a.getItem()),a.load()},a._handleFileLoad=function(a){a.target=null,this.dispatchEvent(a)},a._handleFileError=function(a){var b=new createjs.ErrorEvent("FILE_LOAD_ERROR",null,a.item);this._sendError(b)},a._handleError=function(a){var b=a.target;this._numItemsLoaded++,this._finishOrderedItem(b,!0),this._updateProgress();var c=new createjs.ErrorEvent("FILE_LOAD_ERROR",null,b.getItem());this._sendError(c),this.stopOnError?this.setPaused(!0):(this._removeLoadItem(b),this._cleanLoadItem(b),this._loadNext())},a._handleFileComplete=function(a){var b=a.target,c=b.getItem(),d=b.getResult();this._loadedResults[c.id]=d;var e=b.getResult(!0);null!=e&&e!==d&&(this._loadedRawResults[c.id]=e),this._saveLoadedItems(b),this._removeLoadItem(b),this._finishOrderedItem(b)||this._processFinishedLoad(c,b),this._cleanLoadItem(b)},a._saveLoadedItems=function(a){var b=a.getLoadedItems();if(null!==b)for(var c=0;cb;b++){var c=this._loadedScripts[b];if(null===c)break;if(c!==!0){var d=this._loadedResults[c.id];c.type==createjs.Types.JAVASCRIPT&&createjs.DomUtils.appendToHead(d);var e=c._loader;this._processFinishedLoad(c,e),this._loadedScripts[b]=!0}}},a._processFinishedLoad=function(a,b){if(this._numItemsLoaded++,!this.maintainScriptOrder&&a.type==createjs.Types.JAVASCRIPT){var c=b.getTag();createjs.DomUtils.appendToHead(c)}this._updateProgress(),this._sendFileComplete(a,b),this._loadNext()},a._canStartLoad=function(a){if(!this.maintainScriptOrder||a.preferXHR)return!0;var b=a.getItem();if(b.type!=createjs.Types.JAVASCRIPT)return!0;if(this._currentlyLoadingScript)return!1;for(var c=this._scriptOrder.indexOf(b),d=0;c>d;){var e=this._loadedScripts[d];if(null==e)return!1;d++}return this._currentlyLoadingScript=!0,!0},a._removeLoadItem=function(a){for(var b=this._currentLoads.length,c=0;b>c;c++)if(this._currentLoads[c]==a){this._currentLoads.splice(c,1);break}},a._cleanLoadItem=function(a){var b=a.getItem();b&&delete b._loader},a._handleProgress=function(a){var b=a.target;this._sendFileProgress(b.getItem(),b.progress),this._updateProgress()},a._updateProgress=function(){var a=this._numItemsLoaded/this._numItems,b=this._numItems-this._numItemsLoaded;if(b>0){for(var c=0,d=0,e=this._currentLoads.length;e>d;d++)c+=this._currentLoads[d].progress;a+=c/b*(b/this._numItems)}this._lastProgress!=a&&(this._sendProgress(a),this._lastProgress=a)},a._disposeItem=function(a){delete this._loadedResults[a.id],delete this._loadedRawResults[a.id],delete this._loadItemsById[a.id],delete this._loadItemsBySrc[a.src]},a._sendFileProgress=function(a,b){if(!this._isCanceled()&&!this._paused&&this.hasEventListener("fileprogress")){var c=new createjs.Event("fileprogress");c.progress=b,c.loaded=b,c.total=1,c.item=a,this.dispatchEvent(c)}},a._sendFileComplete=function(a,b){if(!this._isCanceled()&&!this._paused){var c=new createjs.Event("fileload");c.loader=b,c.item=a,c.result=this._loadedResults[a.id],c.rawResult=this._loadedRawResults[a.id],a.completeHandler&&a.completeHandler(c),this.hasEventListener("fileload")&&this.dispatchEvent(c)}},a._sendFileStart=function(a){var b=new createjs.Event("filestart");b.item=a,this.hasEventListener("filestart")&&this.dispatchEvent(b)},a.toString=function(){return"[PreloadJS LoadQueue]"},createjs.LoadQueue=createjs.promote(LoadQueue,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function TextLoader(a){this.AbstractLoader_constructor(a,!0,createjs.Types.TEXT)}var a=(createjs.extend(TextLoader,createjs.AbstractLoader),TextLoader);a.canLoadItem=function(a){return a.type==createjs.Types.TEXT},createjs.TextLoader=createjs.promote(TextLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function BinaryLoader(a){this.AbstractLoader_constructor(a,!0,createjs.Types.BINARY),this.on("initialize",this._updateXHR,this)}var a=createjs.extend(BinaryLoader,createjs.AbstractLoader),b=BinaryLoader;b.canLoadItem=function(a){return a.type==createjs.Types.BINARY},a._updateXHR=function(a){a.loader.setResponseType("arraybuffer")},createjs.BinaryLoader=createjs.promote(BinaryLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function CSSLoader(a,b){this.AbstractLoader_constructor(a,b,createjs.Types.CSS),this.resultFormatter=this._formatResult,this._tagSrcAttribute="href",this._tag=b?createjs.Elements.style():createjs.Elements.link(),this._tag.rel="stylesheet",this._tag.type="text/css"}var a=createjs.extend(CSSLoader,createjs.AbstractLoader),b=CSSLoader;b.canLoadItem=function(a){return a.type==createjs.Types.CSS},a._formatResult=function(a){if(this._preferXHR){var b=a.getTag();if(b.styleSheet)b.styleSheet.cssText=a.getResult(!0);else{var c=createjs.Elements.text(a.getResult(!0));b.appendChild(c)}}else b=this._tag;return createjs.DomUtils.appendToHead(b),b},createjs.CSSLoader=createjs.promote(CSSLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function FontLoader(a,b){this.AbstractLoader_constructor(a,b,a.type),this._faces={},this._watched=[],this._count=0,this._watchInterval=null,this._loadTimeout=null,this._injectCSS=void 0===a.injectCSS?!0:a.injectCSS,this.dispatchEvent("initialize")}var a=createjs.extend(FontLoader,createjs.AbstractLoader);FontLoader.canLoadItem=function(a){return a.type==createjs.Types.FONT||a.type==createjs.Types.FONTCSS},FontLoader.sampleText="abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ",FontLoader._ctx=document.createElement("canvas").getContext("2d"),FontLoader._referenceFonts=["serif","monospace"],FontLoader.WEIGHT_REGEX=/[- ._]*(thin|normal|book|regular|medium|black|heavy|[1-9]00|(?:extra|ultra|semi|demi)?[- ._]*(?:light|bold))[- ._]*/gi,FontLoader.STYLE_REGEX=/[- ._]*(italic|oblique)[- ._]*/gi,FontLoader.FONT_FORMAT={woff2:"woff2",woff:"woff",ttf:"truetype",otf:"truetype"},FontLoader.FONT_WEIGHT={thin:100,extralight:200,ultralight:200,light:300,semilight:300,demilight:300,book:"normal",regular:"normal",semibold:600,demibold:600,extrabold:800,ultrabold:800,black:900,heavy:900},FontLoader.WATCH_DURATION=10,a.load=function(){if(this.type==createjs.Types.FONTCSS){var a=this._watchCSS();if(!a)return void this.AbstractLoader_load()}else if(this._item.src instanceof Array)this._watchFontArray();else{var b=this._defFromSrc(this._item.src);this._watchFont(b),this._injectStyleTag(this._cssFromDef(b))}this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout),this.dispatchEvent("loadstart")},a._handleTimeout=function(){this._stopWatching(),this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_TIMEOUT"))},a._createRequest=function(){return this._request},a.handleEvent=function(a){switch(a.type){case"complete":this._rawResult=a.target._response,this._result=!0,this._parseCSS(this._rawResult);break;case"error":this._stopWatching(),this.AbstractLoader_handleEvent(a)}},a._watchCSS=function(){var a=this._item.src;return a instanceof HTMLStyleElement&&(this._injectCSS&&!a.parentNode&&(document.head||document.getElementsByTagName("head")[0]).appendChild(a),this._injectCSS=!1,a="\n"+a.textContent),-1!==a.search(/\n|\r|@font-face/i)?(this._parseCSS(a),!0):(this._request=new createjs.XHRRequest(this._item),!1)},a._parseCSS=function(a){for(var b=/@font-face\s*\{([^}]+)}/g;;){var c=b.exec(a);if(!c)break;this._watchFont(this._parseFontFace(c[1]))}this._injectStyleTag(a)},a._watchFontArray=function(){for(var a,b=this._item.src,c="",d=b.length-1;d>=0;d--){var e=b[d];a="string"==typeof e?this._defFromSrc(e):this._defFromObj(e),this._watchFont(a),c+=this._cssFromDef(a)+"\n"}this._injectStyleTag(c)},a._injectStyleTag=function(a){if(this._injectCSS){var b=document.head||document.getElementsByTagName("head")[0],c=document.createElement("style");c.type="text/css",c.styleSheet?c.styleSheet.cssText=a:c.appendChild(document.createTextNode(a)),b.appendChild(c)}},a._parseFontFace=function(a){var b=this._getCSSValue(a,"font-family"),c=this._getCSSValue(a,"src");return b&&c?this._defFromObj({family:b,src:c,style:this._getCSSValue(a,"font-style"),weight:this._getCSSValue(a,"font-weight")}):null},a._watchFont=function(a){a&&!this._faces[a.id]&&(this._faces[a.id]=a,this._watched.push(a),this._count++,this._calculateReferenceSizes(a),this._startWatching())},a._startWatching=function(){null==this._watchInterval&&(this._watchInterval=setInterval(createjs.proxy(this._watch,this),FontLoader.WATCH_DURATION))},a._stopWatching=function(){clearInterval(this._watchInterval),clearTimeout(this._loadTimeout),this._watchInterval=null},a._watch=function(){for(var a=this._watched,b=FontLoader._referenceFonts,c=a.length,d=c-1;d>=0;d--)for(var e=a[d],f=e.refs,g=f.length-1;g>=0;g--){var h=this._getTextWidth(e.family+","+b[g],e.weight,e.style);if(h!=f[g]){var i=new createjs.Event("fileload");e.type="font-family",i.item=e,this.dispatchEvent(i),a.splice(d,1);break}}if(c!==a.length){var i=new createjs.ProgressEvent(this._count-a.length,this._count);this.dispatchEvent(i)}0===c&&(this._stopWatching(),this._sendComplete())},a._calculateReferenceSizes=function(a){for(var b=FontLoader._referenceFonts,c=a.refs=[],d=0;dc;c++)b.installPlugin(this.plugins[c]);b.loadManifest(a)}else this._sendComplete()},a._handleManifestFileLoad=function(a){a.target=null,this.dispatchEvent(a)},a._handleManifestComplete=function(){this._loadedItems=this._manifestQueue.getItems(!0),this._sendComplete()},a._handleManifestProgress=function(a){this.progress=a.progress*(1-b.MANIFEST_PROGRESS)+b.MANIFEST_PROGRESS,this._sendProgress(this.progress)},a._handleManifestError=function(a){var b=new createjs.Event("fileerror");b.item=a.data,this.dispatchEvent(b)},createjs.ManifestLoader=createjs.promote(ManifestLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function SoundLoader(a,b){this.AbstractMediaLoader_constructor(a,b,createjs.Types.SOUND),createjs.DomUtils.isAudioTag(a)?this._tag=a:createjs.DomUtils.isAudioTag(a.src)?this._tag=a:createjs.DomUtils.isAudioTag(a.tag)&&(this._tag=createjs.DomUtils.isAudioTag(a)?a:a.src),null!=this._tag&&(this._preferXHR=!1)}var a=createjs.extend(SoundLoader,createjs.AbstractMediaLoader),b=SoundLoader;b.canLoadItem=function(a){return a.type==createjs.Types.SOUND},a._createTag=function(a){var b=createjs.Elements.audio();return b.autoplay=!1,b.preload="none",b.src=a,b},createjs.SoundLoader=createjs.promote(SoundLoader,"AbstractMediaLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function VideoLoader(a,b){this.AbstractMediaLoader_constructor(a,b,createjs.Types.VIDEO),createjs.DomUtils.isVideoTag(a)||createjs.DomUtils.isVideoTag(a.src)?(this.setTag(createjs.DomUtils.isVideoTag(a)?a:a.src),this._preferXHR=!1):this.setTag(this._createTag())}var a=createjs.extend(VideoLoader,createjs.AbstractMediaLoader),b=VideoLoader;a._createTag=function(){return createjs.Elements.video()},b.canLoadItem=function(a){return a.type==createjs.Types.VIDEO},createjs.VideoLoader=createjs.promote(VideoLoader,"AbstractMediaLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function SpriteSheetLoader(a,b){this.AbstractLoader_constructor(a,b,createjs.Types.SPRITESHEET),this._manifestQueue=null}var a=createjs.extend(SpriteSheetLoader,createjs.AbstractLoader),b=SpriteSheetLoader;b.SPRITESHEET_PROGRESS=.25,b.canLoadItem=function(a){return a.type==createjs.Types.SPRITESHEET},a.destroy=function(){this.AbstractLoader_destroy(),this._manifestQueue.close()},a._createRequest=function(){var a=this._item.callback;this._request=null!=a?new createjs.JSONPLoader(this._item):new createjs.JSONLoader(this._item)},a.handleEvent=function(a){switch(a.type){case"complete":return this._rawResult=a.target.getResult(!0),this._result=a.target.getResult(),this._sendProgress(b.SPRITESHEET_PROGRESS),void this._loadManifest(this._result);case"progress":return a.loaded*=b.SPRITESHEET_PROGRESS,this.progress=a.loaded/a.total,(isNaN(this.progress)||1/0==this.progress)&&(this.progress=0),void this._sendProgress(a)}this.AbstractLoader_handleEvent(a)},a._loadManifest=function(a){if(a&&a.images){var b=this._manifestQueue=new createjs.LoadQueue(this._preferXHR,this._item.path,this._item.crossOrigin);b.on("complete",this._handleManifestComplete,this,!0),b.on("fileload",this._handleManifestFileLoad,this),b.on("progress",this._handleManifestProgress,this),b.on("error",this._handleManifestError,this,!0),b.loadManifest(a.images)}},a._handleManifestFileLoad=function(a){var b=a.result;if(null!=b){var c=this.getResult().images,d=c.indexOf(a.item.src);c[d]=b}},a._handleManifestComplete=function(){this._result=new createjs.SpriteSheet(this._result),this._loadedItems=this._manifestQueue.getItems(!0),this._sendComplete()},a._handleManifestProgress=function(a){this.progress=a.progress*(1-b.SPRITESHEET_PROGRESS)+b.SPRITESHEET_PROGRESS,this._sendProgress(this.progress)},a._handleManifestError=function(a){var b=new createjs.Event("fileerror");b.item=a.data,this.dispatchEvent(b)},createjs.SpriteSheetLoader=createjs.promote(SpriteSheetLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function SVGLoader(a,b){this.AbstractLoader_constructor(a,b,createjs.Types.SVG),this.resultFormatter=this._formatResult,this._tagSrcAttribute="data",b?this.setTag(createjs.Elements.svg()):(this.setTag(createjs.Elements.object()),this.getTag().type="image/svg+xml") +}var a=createjs.extend(SVGLoader,createjs.AbstractLoader),b=SVGLoader;b.canLoadItem=function(a){return a.type==createjs.Types.SVG},a._formatResult=function(a){var b=createjs.DataUtils.parseXML(a.getResult(!0)),c=a.getTag();if(!this._preferXHR&&document.body.contains(c)&&document.body.removeChild(c),null!=b.documentElement){var d=b.documentElement;return document.importNode&&(d=document.importNode(d,!0)),c.appendChild(d),c}return b},createjs.SVGLoader=createjs.promote(SVGLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function XMLLoader(a){this.AbstractLoader_constructor(a,!0,createjs.Types.XML),this.resultFormatter=this._formatResult}var a=createjs.extend(XMLLoader,createjs.AbstractLoader),b=XMLLoader;b.canLoadItem=function(a){return a.type==createjs.Types.XML},a._formatResult=function(a){return createjs.DataUtils.parseXML(a.getResult(!0))},createjs.XMLLoader=createjs.promote(XMLLoader,"AbstractLoader")}(); \ No newline at end of file diff --git a/_assets/libs/tweenjs-NEXT.min.js b/_assets/libs/tweenjs-NEXT.min.js index c49f9d09..3fead898 100644 --- a/_assets/libs/tweenjs-NEXT.min.js +++ b/_assets/libs/tweenjs-NEXT.min.js @@ -9,4 +9,4 @@ * * This notice shall be included in all copies or substantial portions of the Software. */ -this.createjs=this.createjs||{},createjs.extend=function(a,b){"use strict";function c(){this.constructor=a}return c.prototype=b.prototype,a.prototype=new c},this.createjs=this.createjs||{},createjs.promote=function(a,b){"use strict";var c=a.prototype,d=Object.getPrototypeOf&&Object.getPrototypeOf(c)||c.__proto__;if(d){c[(b+="_")+"constructor"]=d.constructor;for(var e in d)c.hasOwnProperty(e)&&"function"==typeof d[e]&&(c[b+e]=d[e])}return a},this.createjs=this.createjs||{},function(){"use strict";function Event(a,b,c){this.type=a,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!b,this.cancelable=!!c,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var a=Event.prototype;a.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},a.stopPropagation=function(){this.propagationStopped=!0},a.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},a.remove=function(){this.removed=!0},a.clone=function(){return new Event(this.type,this.bubbles,this.cancelable)},a.set=function(a){for(var b in a)this[b]=a[b];return this},a.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=Event}(),this.createjs=this.createjs||{},function(){"use strict";function EventDispatcher(){this._listeners=null,this._captureListeners=null}var a=EventDispatcher.prototype;EventDispatcher.initialize=function(b){b.addEventListener=a.addEventListener,b.on=a.on,b.removeEventListener=b.off=a.removeEventListener,b.removeAllEventListeners=a.removeAllEventListeners,b.hasEventListener=a.hasEventListener,b.dispatchEvent=a.dispatchEvent,b._dispatchEvent=a._dispatchEvent,b.willTrigger=a.willTrigger},a.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},a.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},a.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},a.off=a.removeEventListener,a.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},a.dispatchEvent=function(a,b,c){if("string"==typeof a){var d=this._listeners;if(!(b||d&&d[a]))return!0;a=new createjs.Event(a,b,c)}else a.target&&a.clone&&(a=a.clone());try{a.target=this}catch(e){}if(a.bubbles&&this.parent){for(var f=this,g=[f];f.parent;)g.push(f=f.parent);var h,i=g.length;for(h=i-1;h>=0&&!a.propagationStopped;h--)g[h]._dispatchEvent(a,1+(0==h));for(h=1;i>h&&!a.propagationStopped;h++)g[h]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return!a.defaultPrevented},a.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},a.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1},a.toString=function(){return"[EventDispatcher]"},a._dispatchEvent=function(a,b){var c,d=1==b?this._captureListeners:this._listeners;if(a&&d){var e=d[a.type];if(!e||!(c=e.length))return;try{a.currentTarget=this}catch(f){}try{a.eventPhase=b}catch(f){}a.removed=!1,e=e.slice();for(var g=0;c>g&&!a.immediatePropagationStopped;g++){var h=e[g];h.handleEvent?h.handleEvent(a):h(a),a.removed&&(this.off(a.type,h,1==b),a.removed=!1)}}},createjs.EventDispatcher=EventDispatcher}(),this.createjs=this.createjs||{},function(){"use strict";function Ticker(){throw"Ticker cannot be instantiated."}Ticker.RAF_SYNCHED="synched",Ticker.RAF="raf",Ticker.TIMEOUT="timeout",Ticker.useRAF=!1,Ticker.timingMode=null,Ticker.maxDelta=0,Ticker.paused=!1,Ticker.removeEventListener=null,Ticker.removeAllEventListeners=null,Ticker.dispatchEvent=null,Ticker.hasEventListener=null,Ticker._listeners=null,createjs.EventDispatcher.initialize(Ticker),Ticker._addEventListener=Ticker.addEventListener,Ticker.addEventListener=function(){return!Ticker._inited&&Ticker.init(),Ticker._addEventListener.apply(Ticker,arguments)},Ticker._inited=!1,Ticker._startTime=0,Ticker._pausedTime=0,Ticker._ticks=0,Ticker._pausedTicks=0,Ticker._interval=50,Ticker._lastTime=0,Ticker._times=null,Ticker._tickTimes=null,Ticker._timerId=null,Ticker._raf=!0,Ticker.setInterval=function(a){Ticker._interval=a,Ticker._inited&&Ticker._setupTick()},Ticker.getInterval=function(){return Ticker._interval},Ticker.setFPS=function(a){Ticker.setInterval(1e3/a)},Ticker.getFPS=function(){return 1e3/Ticker._interval};try{Object.defineProperties(Ticker,{interval:{get:Ticker.getInterval,set:Ticker.setInterval},framerate:{get:Ticker.getFPS,set:Ticker.setFPS}})}catch(a){console.log(a)}Ticker.init=function(){Ticker._inited||(Ticker._inited=!0,Ticker._times=[],Ticker._tickTimes=[],Ticker._startTime=Ticker._getTime(),Ticker._times.push(Ticker._lastTime=0),Ticker.interval=Ticker._interval)},Ticker.reset=function(){if(Ticker._raf){var a=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame;a&&a(Ticker._timerId)}else clearTimeout(Ticker._timerId);Ticker.removeAllEventListeners("tick"),Ticker._timerId=Ticker._times=Ticker._tickTimes=null,Ticker._startTime=Ticker._lastTime=Ticker._ticks=0,Ticker._inited=!1},Ticker.getMeasuredTickTime=function(a){var b=0,c=Ticker._tickTimes;if(!c||c.length<1)return-1;a=Math.min(c.length,a||0|Ticker.getFPS());for(var d=0;a>d;d++)b+=c[d];return b/a},Ticker.getMeasuredFPS=function(a){var b=Ticker._times;return!b||b.length<2?-1:(a=Math.min(b.length-1,a||0|Ticker.getFPS()),1e3/((b[0]-b[a])/a))},Ticker.setPaused=function(a){Ticker.paused=a},Ticker.getPaused=function(){return Ticker.paused},Ticker.getTime=function(a){return Ticker._startTime?Ticker._getTime()-(a?Ticker._pausedTime:0):-1},Ticker.getEventTime=function(a){return Ticker._startTime?(Ticker._lastTime||Ticker._startTime)-(a?Ticker._pausedTime:0):-1},Ticker.getTicks=function(a){return Ticker._ticks-(a?Ticker._pausedTicks:0)},Ticker._handleSynch=function(){Ticker._timerId=null,Ticker._setupTick(),Ticker._getTime()-Ticker._lastTime>=.97*(Ticker._interval-1)&&Ticker._tick()},Ticker._handleRAF=function(){Ticker._timerId=null,Ticker._setupTick(),Ticker._tick()},Ticker._handleTimeout=function(){Ticker._timerId=null,Ticker._setupTick(),Ticker._tick()},Ticker._setupTick=function(){if(null==Ticker._timerId){var a=Ticker.timingMode||Ticker.useRAF&&Ticker.RAF_SYNCHED;if(a==Ticker.RAF_SYNCHED||a==Ticker.RAF){var b=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(b)return Ticker._timerId=b(a==Ticker.RAF?Ticker._handleRAF:Ticker._handleSynch),void(Ticker._raf=!0)}Ticker._raf=!1,Ticker._timerId=setTimeout(Ticker._handleTimeout,Ticker._interval)}},Ticker._tick=function(){var a=Ticker.paused,b=Ticker._getTime(),c=b-Ticker._lastTime;if(Ticker._lastTime=b,Ticker._ticks++,a&&(Ticker._pausedTicks++,Ticker._pausedTime+=c),Ticker.hasEventListener("tick")){var d=new createjs.Event("tick"),e=Ticker.maxDelta;d.delta=e&&c>e?e:c,d.paused=a,d.time=b,d.runTime=b-Ticker._pausedTime,Ticker.dispatchEvent(d)}for(Ticker._tickTimes.unshift(Ticker._getTime()-b);Ticker._tickTimes.length>100;)Ticker._tickTimes.pop();for(Ticker._times.unshift(b);Ticker._times.length>100;)Ticker._times.pop()};var b=window.performance&&(performance.now||performance.mozNow||performance.msNow||performance.oNow||performance.webkitNow);Ticker._getTime=function(){return(b&&b.call(performance)||(new Date).getTime())-Ticker._startTime},createjs.Ticker=Ticker}(),this.createjs=this.createjs||{},function(){"use strict";function Tween(a,b,c){this.ignoreGlobalPause=!1,this.loop=!1,this.duration=0,this.pluginData=c||{},this.target=a,this.position=null,this.passive=!1,this._paused=!1,this._curQueueProps={},this._initQueueProps={},this._steps=[],this._actions=[],this._prevPosition=0,this._stepPosition=0,this._prevPos=-1,this._target=a,this._useTicks=!1,this._inited=!1,this._registered=!1,b&&(this._useTicks=b.useTicks,this.ignoreGlobalPause=b.ignoreGlobalPause,this.loop=b.loop,b.onChange&&this.addEventListener("change",b.onChange),b.override&&Tween.removeTweens(a)),b&&b.paused?this._paused=!0:createjs.Tween._register(this,!0),b&&null!=b.position&&this.setPosition(b.position,Tween.NONE)}var a=createjs.extend(Tween,createjs.EventDispatcher);Tween.NONE=0,Tween.LOOP=1,Tween.REVERSE=2,Tween.IGNORE={},Tween._tweens=[],Tween._plugins={},Tween.get=function(a,b,c,d){return d&&Tween.removeTweens(a),new Tween(a,b,c)},Tween.tick=function(a,b){for(var c=Tween._tweens.slice(),d=c.length-1;d>=0;d--){var e=c[d];b&&!e.ignoreGlobalPause||e._paused||e.tick(e._useTicks?1:a)}},Tween.handleEvent=function(a){"tick"==a.type&&this.tick(a.delta,a.paused)},Tween.removeTweens=function(a){if(a.tweenjs_count){for(var b=Tween._tweens,c=b.length-1;c>=0;c--){var d=b[c];d._target==a&&(d._paused=!0,b.splice(c,1))}a.tweenjs_count=0}},Tween.removeAllTweens=function(){for(var a=Tween._tweens,b=0,c=a.length;c>b;b++){var d=a[b];d._paused=!0,d.target&&(d.target.tweenjs_count=0)}a.length=0},Tween.hasActiveTweens=function(a){return a?null!=a.tweenjs_count&&!!a.tweenjs_count:Tween._tweens&&!!Tween._tweens.length},Tween.installPlugin=function(a,b){var c=a.priority;null==c&&(a.priority=c=0);for(var d=0,e=b.length,f=Tween._plugins;e>d;d++){var g=b[d];if(f[g]){for(var h=f[g],i=0,j=h.length;j>i&&!(c=a)return this;var c=this._cloneProps(this._curQueueProps);return this._addStep({d:a,p0:c,e:this._linearEase,p1:c,v:b})},a.to=function(a,b,c){return(isNaN(b)||0>b)&&(b=0),this._addStep({d:b||0,p0:this._cloneProps(this._curQueueProps),e:c,p1:this._cloneProps(this._appendQueueProps(a))})},a.call=function(a,b,c){return this._addAction({f:a,p:b?b:[this],o:c?c:this._target})},a.set=function(a,b){return this._addAction({f:this._set,o:this,p:[a,b?b:this._target]})},a.play=function(a){return a||(a=this),this.call(a.setPaused,[!1],a)},a.pause=function(a){return a||(a=this),this.call(a.setPaused,[!0],a)},a.setPosition=function(a,b){0>a&&(a=0),null==b&&(b=1);var c=a,d=!1;if(c>=this.duration&&(this.loop?c%=this.duration:(c=this.duration,d=!0)),c==this._prevPos)return d;var e=this._prevPos;if(this.position=this._prevPos=c,this._prevPosition=a,this._target)if(d)this._updateTargetProps(null,1);else if(this._steps.length>0){for(var f=0,g=this._steps.length;g>f&&!(this._steps[f].t>c);f++);var h=this._steps[f-1];this._updateTargetProps(h,(this._stepPosition=c-h.t)/h.d)}return 0!=b&&this._actions.length>0&&(this._useTicks?this._runActions(c,c):1==b&&e>c?(e!=this.duration&&this._runActions(e,this.duration),this._runActions(0,c,!0)):this._runActions(e,c)),d&&this.setPaused(!0),this.dispatchEvent("change"),d},a.tick=function(a){this._paused||this.setPosition(this._prevPosition+a)},a.setPaused=function(a){return this._paused===!!a?this:(this._paused=!!a,Tween._register(this,!a),this)},a.w=a.wait,a.t=a.to,a.c=a.call,a.s=a.set,a.toString=function(){return"[Tween]"},a.clone=function(){throw"Tween can not be cloned."},a._updateTargetProps=function(a,b){var c,d,e,f,g,h;if(a||1!=b){if(this.passive=!!a.v,this.passive)return;a.e&&(b=a.e(b,0,1,1)),c=a.p0,d=a.p1}else this.passive=!1,c=d=this._curQueueProps;for(var i in this._initQueueProps){null==(f=c[i])&&(c[i]=f=this._initQueueProps[i]),null==(g=d[i])&&(d[i]=g=f),e=f==g||0==b||1==b||"number"!=typeof f?1==b?g:f:f+(g-f)*b;var j=!1;if(h=Tween._plugins[i])for(var k=0,l=h.length;l>k;k++){var m=h[k].tween(this,i,e,c,d,b,!!a&&c==d,!a);m==Tween.IGNORE?j=!0:e=m}j||(this._target[i]=e)}},a._runActions=function(a,b,c){var d=a,e=b,f=-1,g=this._actions.length,h=1;for(a>b&&(d=b,e=a,f=g,g=h=-1);(f+=h)!=g;){var i=this._actions[f],j=i.t;(j==e||j>d&&e>j||c&&j==a)&&i.f.apply(i.o,i.p)}},a._appendQueueProps=function(a){var b,c,d,e,f;for(var g in a)if(void 0===this._initQueueProps[g]){if(c=this._target[g],b=Tween._plugins[g])for(d=0,e=b.length;e>d;d++)c=b[d].init(this,g,c);this._initQueueProps[g]=this._curQueueProps[g]=void 0===c?null:c}else c=this._curQueueProps[g];for(var g in a){if(c=this._curQueueProps[g],b=Tween._plugins[g])for(f=f||{},d=0,e=b.length;e>d;d++)b[d].step&&b[d].step(this,g,c,a[g],f);this._curQueueProps[g]=a[g]}return f&&this._appendQueueProps(f),this._curQueueProps},a._cloneProps=function(a){var b={};for(var c in a)b[c]=a[c];return b},a._addStep=function(a){return a.d>0&&(this._steps.push(a),a.t=this.duration,this.duration+=a.d),this},a._addAction=function(a){return a.t=this.duration,this._actions.push(a),this},a._set=function(a,b){for(var c in a)b[c]=a[c]},createjs.Tween=createjs.promote(Tween,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function Timeline(a,b,c){this.EventDispatcher_constructor(),this.ignoreGlobalPause=!1,this.duration=0,this.loop=!1,this.position=null,this._paused=!1,this._tweens=[],this._labels=null,this._labelList=null,this._prevPosition=0,this._prevPos=-1,this._useTicks=!1,this._registered=!1,c&&(this._useTicks=c.useTicks,this.loop=c.loop,this.ignoreGlobalPause=c.ignoreGlobalPause,c.onChange&&this.addEventListener("change",c.onChange)),a&&this.addTween.apply(this,a),this.setLabels(b),c&&c.paused?this._paused=!0:createjs.Tween._register(this,!0),c&&null!=c.position&&this.setPosition(c.position,createjs.Tween.NONE)}var a=createjs.extend(Timeline,createjs.EventDispatcher);a.addTween=function(a){var b=arguments.length;if(b>1){for(var c=0;b>c;c++)this.addTween(arguments[c]);return arguments[0]}return 0==b?null:(this.removeTween(a),this._tweens.push(a),a.setPaused(!0),a._paused=!1,a._useTicks=this._useTicks,a.duration>this.duration&&(this.duration=a.duration),this._prevPos>=0&&a.setPosition(this._prevPos,createjs.Tween.NONE),a)},a.removeTween=function(a){var b=arguments.length;if(b>1){for(var c=!0,d=0;b>d;d++)c=c&&this.removeTween(arguments[d]);return c}if(0==b)return!1;for(var e=this._tweens,d=e.length;d--;)if(e[d]==a)return e.splice(d,1),a.duration>=this.duration&&this.updateDuration(),!0;return!1},a.addLabel=function(a,b){this._labels[a]=b;var c=this._labelList;if(c){for(var d=0,e=c.length;e>d&&!(bd&&!(b=this.duration;if(c==this._prevPos)return d;this._prevPosition=a,this.position=this._prevPos=c;for(var e=0,f=this._tweens.length;f>e;e++)if(this._tweens[e].setPosition(c,b),c!=this._prevPos)return!1;return d&&this.setPaused(!0),this.dispatchEvent("change"),d},a.setPaused=function(a){this._paused=!!a,createjs.Tween._register(this,!a)},a.updateDuration=function(){this.duration=0;for(var a=0,b=this._tweens.length;b>a;a++){var c=this._tweens[a];c.duration>this.duration&&(this.duration=c.duration)}},a.tick=function(a){this.setPosition(this._prevPosition+a)},a.resolve=function(a){var b=Number(a);return isNaN(b)&&(b=this._labels[a]),b},a.toString=function(){return"[Timeline]"},a.clone=function(){throw"Timeline can not be cloned."},a._goto=function(a){var b=this.resolve(a);null!=b&&this.setPosition(b)},a._calcPosition=function(a){return 0>a?0:aa&&(a=-1),a>1&&(a=1),function(b){return 0==a?b:0>a?b*(b*-a+1+a):b*((2-b)*a+(1-a))}},Ease.getPowIn=function(a){return function(b){return Math.pow(b,a)}},Ease.getPowOut=function(a){return function(b){return 1-Math.pow(1-b,a)}},Ease.getPowInOut=function(a){return function(b){return(b*=2)<1?.5*Math.pow(b,a):1-.5*Math.abs(Math.pow(2-b,a))}},Ease.quadIn=Ease.getPowIn(2),Ease.quadOut=Ease.getPowOut(2),Ease.quadInOut=Ease.getPowInOut(2),Ease.cubicIn=Ease.getPowIn(3),Ease.cubicOut=Ease.getPowOut(3),Ease.cubicInOut=Ease.getPowInOut(3),Ease.quartIn=Ease.getPowIn(4),Ease.quartOut=Ease.getPowOut(4),Ease.quartInOut=Ease.getPowInOut(4),Ease.quintIn=Ease.getPowIn(5),Ease.quintOut=Ease.getPowOut(5),Ease.quintInOut=Ease.getPowInOut(5),Ease.sineIn=function(a){return 1-Math.cos(a*Math.PI/2)},Ease.sineOut=function(a){return Math.sin(a*Math.PI/2)},Ease.sineInOut=function(a){return-.5*(Math.cos(Math.PI*a)-1)},Ease.getBackIn=function(a){return function(b){return b*b*((a+1)*b-a)}},Ease.backIn=Ease.getBackIn(1.7),Ease.getBackOut=function(a){return function(b){return--b*b*((a+1)*b+a)+1}},Ease.backOut=Ease.getBackOut(1.7),Ease.getBackInOut=function(a){return a*=1.525,function(b){return(b*=2)<1?.5*b*b*((a+1)*b-a):.5*((b-=2)*b*((a+1)*b+a)+2)}},Ease.backInOut=Ease.getBackInOut(1.7),Ease.circIn=function(a){return-(Math.sqrt(1-a*a)-1)},Ease.circOut=function(a){return Math.sqrt(1- --a*a)},Ease.circInOut=function(a){return(a*=2)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},Ease.bounceIn=function(a){return 1-Ease.bounceOut(1-a)},Ease.bounceOut=function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},Ease.bounceInOut=function(a){return.5>a?.5*Ease.bounceIn(2*a):.5*Ease.bounceOut(2*a-1)+.5},Ease.getElasticIn=function(a,b){var c=2*Math.PI;return function(d){if(0==d||1==d)return d;var e=b/c*Math.asin(1/a);return-(a*Math.pow(2,10*(d-=1))*Math.sin((d-e)*c/b))}},Ease.elasticIn=Ease.getElasticIn(1,.3),Ease.getElasticOut=function(a,b){var c=2*Math.PI;return function(d){if(0==d||1==d)return d;var e=b/c*Math.asin(1/a);return a*Math.pow(2,-10*d)*Math.sin((d-e)*c/b)+1}},Ease.elasticOut=Ease.getElasticOut(1,.3),Ease.getElasticInOut=function(a,b){var c=2*Math.PI;return function(d){var e=b/c*Math.asin(1/a);return(d*=2)<1?-.5*a*Math.pow(2,10*(d-=1))*Math.sin((d-e)*c/b):a*Math.pow(2,-10*(d-=1))*Math.sin((d-e)*c/b)*.5+1}},Ease.elasticInOut=Ease.getElasticInOut(1,.3*1.5),createjs.Ease=Ease}(),this.createjs=this.createjs||{},function(){"use strict";function MotionGuidePlugin(){throw"MotionGuidePlugin cannot be instantiated."}MotionGuidePlugin.priority=0,MotionGuidePlugin._rotOffS,MotionGuidePlugin._rotOffE,MotionGuidePlugin._rotNormS,MotionGuidePlugin._rotNormE,MotionGuidePlugin.install=function(){return createjs.Tween.installPlugin(MotionGuidePlugin,["guide","x","y","rotation"]),createjs.Tween.IGNORE},MotionGuidePlugin.init=function(a,b,c){var d=a.target;return d.hasOwnProperty("x")||(d.x=0),d.hasOwnProperty("y")||(d.y=0),d.hasOwnProperty("rotation")||(d.rotation=0),"rotation"==b&&(a.__needsRot=!0),"guide"==b?null:c},MotionGuidePlugin.step=function(a,b,c,d,e){if("rotation"==b&&(a.__rotGlobalS=c,a.__rotGlobalE=d,MotionGuidePlugin.testRotData(a,e)),"guide"!=b)return d;var f,g=d;g.hasOwnProperty("path")||(g.path=[]);var h=g.path;if(g.hasOwnProperty("end")||(g.end=1),g.hasOwnProperty("start")||(g.start=c&&c.hasOwnProperty("end")&&c.path===h?c.end:0),g.hasOwnProperty("_segments")&&g._length)return d;var i=h.length,j=10;if(!(i>=6&&(i-2)%4==0))throw"invalid 'path' data, please see documentation for valid paths";g._segments=[],g._length=0;for(var k=2;i>k;k+=4){for(var l,m,n=h[k-2],o=h[k-1],p=h[k+0],q=h[k+1],r=h[k+2],s=h[k+3],t=n,u=o,v=0,w=[],x=1;j>=x;x++){var y=x/j,z=1-y;l=z*z*n+2*z*y*p+y*y*r,m=z*z*o+2*z*y*q+y*y*s,v+=w[w.push(Math.sqrt((f=l-t)*f+(f=m-u)*f))-1],t=l,u=m}g._segments.push(v),g._segments.push(w),g._length+=v}f=g.orient,g.orient=!0;var A={};return MotionGuidePlugin.calc(g,g.start,A),a.__rotPathS=Number(A.rotation.toFixed(5)),MotionGuidePlugin.calc(g,g.end,A),a.__rotPathE=Number(A.rotation.toFixed(5)),g.orient=!1,MotionGuidePlugin.calc(g,g.end,e),g.orient=f,g.orient?(a.__guideData=g,MotionGuidePlugin.testRotData(a,e),d):d},MotionGuidePlugin.testRotData=function(a,b){if(void 0===a.__rotGlobalS||void 0===a.__rotGlobalE){if(a.__needsRot)return;a.__rotGlobalS=a.__rotGlobalE=void 0!==a._curQueueProps.rotation?a._curQueueProps.rotation:b.rotation=a.target.rotation||0}if(void 0!==a.__guideData){var c=a.__guideData,d=a.__rotGlobalE-a.__rotGlobalS,e=a.__rotPathE-a.__rotPathS,f=d-e;if("auto"==c.orient)f>180?f-=360:-180>f&&(f+=360);else if("cw"==c.orient){for(;0>f;)f+=360;0==f&&d>0&&180!=d&&(f+=360)}else if("ccw"==c.orient){for(f=d-(e>180?360-e:e);f>0;)f-=360;0==f&&0>d&&-180!=d&&(f-=360)}c.rotDelta=f,c.rotOffS=a.__rotGlobalS-a.__rotPathS,a.__rotGlobalS=a.__rotGlobalE=a.__guideData=a.__needsRot=void 0}},MotionGuidePlugin.tween=function(a,b,c,d,e,f,g){var h=e.guide;if(void 0==h||h===d.guide)return c;if(h.lastRatio!=f){var i=(h.end-h.start)*(g?h.end:f)+h.start;switch(MotionGuidePlugin.calc(h,i,a.target),h.orient){case"cw":case"ccw":case"auto":a.target.rotation+=h.rotOffS+h.rotDelta*f;break;case"fixed":default:a.target.rotation+=h.rotOffS}h.lastRatio=f}return"rotation"!=b||h.orient&&"false"!=h.orient?a.target[b]:c},MotionGuidePlugin.calc=function(a,b,c){if(void 0==a._segments)throw"Missing critical pre-calculated information, please file a bug";void 0==c&&(c={x:0,y:0,rotation:0});for(var d=a._segments,e=a.path,f=a._length*b,g=d.length-2,h=0;f>d[h]&&g>h;)f-=d[h],h+=2;var i=d[h+1],j=0;for(g=i.length-1;f>i[j]&&g>j;)f-=i[j],j++;var k=j/++g+f/(g*i[j]);h=2*h+2;var l=1-k;return c.x=l*l*e[h-2]+2*l*k*e[h+0]+k*k*e[h+2],c.y=l*l*e[h-1]+2*l*k*e[h+1]+k*k*e[h+3],a.orient&&(c.rotation=57.2957795*Math.atan2((e[h+1]-e[h-1])*l+(e[h+3]-e[h+1])*k,(e[h+0]-e[h-2])*l+(e[h+2]-e[h+0])*k)),c},createjs.MotionGuidePlugin=MotionGuidePlugin}(),this.createjs=this.createjs||{},function(){"use strict";var a=createjs.TweenJS=createjs.TweenJS||{};a.version="NEXT",a.buildDate="Wed, 25 Nov 2015 19:32:49 GMT"}(); \ No newline at end of file +this.createjs=this.createjs||{},createjs.extend=function(a,b){"use strict";function c(){this.constructor=a}return c.prototype=b.prototype,a.prototype=new c},this.createjs=this.createjs||{},createjs.promote=function(a,b){"use strict";var c=a.prototype,d=Object.getPrototypeOf&&Object.getPrototypeOf(c)||c.__proto__;if(d){c[(b+="_")+"constructor"]=d.constructor;for(var e in d)c.hasOwnProperty(e)&&"function"==typeof d[e]&&(c[b+e]=d[e])}return a},this.createjs=this.createjs||{},createjs.deprecate=function(a,b){"use strict";return function(){var c="Deprecated property or method '"+b+"'. See docs for info.";return console&&(console.warn?console.warn(c):console.log(c)),a&&a.apply(this,arguments)}},this.createjs=this.createjs||{},function(){"use strict";function Event(a,b,c){this.type=a,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!b,this.cancelable=!!c,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var a=Event.prototype;a.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},a.stopPropagation=function(){this.propagationStopped=!0},a.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},a.remove=function(){this.removed=!0},a.clone=function(){return new Event(this.type,this.bubbles,this.cancelable)},a.set=function(a){for(var b in a)this[b]=a[b];return this},a.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=Event}(),this.createjs=this.createjs||{},function(){"use strict";function EventDispatcher(){this._listeners=null,this._captureListeners=null}var a=EventDispatcher.prototype;EventDispatcher.initialize=function(b){b.addEventListener=a.addEventListener,b.on=a.on,b.removeEventListener=b.off=a.removeEventListener,b.removeAllEventListeners=a.removeAllEventListeners,b.hasEventListener=a.hasEventListener,b.dispatchEvent=a.dispatchEvent,b._dispatchEvent=a._dispatchEvent,b.willTrigger=a.willTrigger},a.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},a.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},a.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},a.off=a.removeEventListener,a.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},a.dispatchEvent=function(a,b,c){if("string"==typeof a){var d=this._listeners;if(!(b||d&&d[a]))return!0;a=new createjs.Event(a,b,c)}else a.target&&a.clone&&(a=a.clone());try{a.target=this}catch(e){}if(a.bubbles&&this.parent){for(var f=this,g=[f];f.parent;)g.push(f=f.parent);var h,i=g.length;for(h=i-1;h>=0&&!a.propagationStopped;h--)g[h]._dispatchEvent(a,1+(0==h));for(h=1;i>h&&!a.propagationStopped;h++)g[h]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return!a.defaultPrevented},a.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},a.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1},a.toString=function(){return"[EventDispatcher]"},a._dispatchEvent=function(a,b){var c,d,e=2>=b?this._captureListeners:this._listeners;if(a&&e&&(d=e[a.type])&&(c=d.length)){try{a.currentTarget=this}catch(f){}try{a.eventPhase=0|b}catch(f){}a.removed=!1,d=d.slice();for(var g=0;c>g&&!a.immediatePropagationStopped;g++){var h=d[g];h.handleEvent?h.handleEvent(a):h(a),a.removed&&(this.off(a.type,h,1==b),a.removed=!1)}}2===b&&this._dispatchEvent(a,2.1)},createjs.EventDispatcher=EventDispatcher}(),this.createjs=this.createjs||{},function(){"use strict";function Ticker(){throw"Ticker cannot be instantiated."}Ticker.RAF_SYNCHED="synched",Ticker.RAF="raf",Ticker.TIMEOUT="timeout",Ticker.timingMode=null,Ticker.maxDelta=0,Ticker.paused=!1,Ticker.removeEventListener=null,Ticker.removeAllEventListeners=null,Ticker.dispatchEvent=null,Ticker.hasEventListener=null,Ticker._listeners=null,createjs.EventDispatcher.initialize(Ticker),Ticker._addEventListener=Ticker.addEventListener,Ticker.addEventListener=function(){return!Ticker._inited&&Ticker.init(),Ticker._addEventListener.apply(Ticker,arguments)},Ticker._inited=!1,Ticker._startTime=0,Ticker._pausedTime=0,Ticker._ticks=0,Ticker._pausedTicks=0,Ticker._interval=50,Ticker._lastTime=0,Ticker._times=null,Ticker._tickTimes=null,Ticker._timerId=null,Ticker._raf=!0,Ticker._setInterval=function(a){Ticker._interval=a,Ticker._inited&&Ticker._setupTick()},Ticker.setInterval=createjs.deprecate(Ticker._setInterval,"Ticker.setInterval"),Ticker._getInterval=function(){return Ticker._interval},Ticker.getInterval=createjs.deprecate(Ticker._getInterval,"Ticker.getInterval"),Ticker._setFPS=function(a){Ticker._setInterval(1e3/a)},Ticker.setFPS=createjs.deprecate(Ticker._setFPS,"Ticker.setFPS"),Ticker._getFPS=function(){return 1e3/Ticker._interval},Ticker.getFPS=createjs.deprecate(Ticker._getFPS,"Ticker.getFPS");try{Object.defineProperties(Ticker,{interval:{get:Ticker._getInterval,set:Ticker._setInterval},framerate:{get:Ticker._getFPS,set:Ticker._setFPS}})}catch(a){console.log(a)}Ticker.init=function(){Ticker._inited||(Ticker._inited=!0,Ticker._times=[],Ticker._tickTimes=[],Ticker._startTime=Ticker._getTime(),Ticker._times.push(Ticker._lastTime=0),Ticker.interval=Ticker._interval)},Ticker.reset=function(){if(Ticker._raf){var a=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame;a&&a(Ticker._timerId)}else clearTimeout(Ticker._timerId);Ticker.removeAllEventListeners("tick"),Ticker._timerId=Ticker._times=Ticker._tickTimes=null,Ticker._startTime=Ticker._lastTime=Ticker._ticks=Ticker._pausedTime=0,Ticker._inited=!1},Ticker.getMeasuredTickTime=function(a){var b=0,c=Ticker._tickTimes;if(!c||c.length<1)return-1;a=Math.min(c.length,a||0|Ticker._getFPS());for(var d=0;a>d;d++)b+=c[d];return b/a},Ticker.getMeasuredFPS=function(a){var b=Ticker._times;return!b||b.length<2?-1:(a=Math.min(b.length-1,a||0|Ticker._getFPS()),1e3/((b[0]-b[a])/a))},Ticker.getTime=function(a){return Ticker._startTime?Ticker._getTime()-(a?Ticker._pausedTime:0):-1},Ticker.getEventTime=function(a){return Ticker._startTime?(Ticker._lastTime||Ticker._startTime)-(a?Ticker._pausedTime:0):-1},Ticker.getTicks=function(a){return Ticker._ticks-(a?Ticker._pausedTicks:0)},Ticker._handleSynch=function(){Ticker._timerId=null,Ticker._setupTick(),Ticker._getTime()-Ticker._lastTime>=.97*(Ticker._interval-1)&&Ticker._tick()},Ticker._handleRAF=function(){Ticker._timerId=null,Ticker._setupTick(),Ticker._tick()},Ticker._handleTimeout=function(){Ticker._timerId=null,Ticker._setupTick(),Ticker._tick()},Ticker._setupTick=function(){if(null==Ticker._timerId){var a=Ticker.timingMode;if(a==Ticker.RAF_SYNCHED||a==Ticker.RAF){var b=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(b)return Ticker._timerId=b(a==Ticker.RAF?Ticker._handleRAF:Ticker._handleSynch),void(Ticker._raf=!0)}Ticker._raf=!1,Ticker._timerId=setTimeout(Ticker._handleTimeout,Ticker._interval)}},Ticker._tick=function(){var a=Ticker.paused,b=Ticker._getTime(),c=b-Ticker._lastTime;if(Ticker._lastTime=b,Ticker._ticks++,a&&(Ticker._pausedTicks++,Ticker._pausedTime+=c),Ticker.hasEventListener("tick")){var d=new createjs.Event("tick"),e=Ticker.maxDelta;d.delta=e&&c>e?e:c,d.paused=a,d.time=b,d.runTime=b-Ticker._pausedTime,Ticker.dispatchEvent(d)}for(Ticker._tickTimes.unshift(Ticker._getTime()-b);Ticker._tickTimes.length>100;)Ticker._tickTimes.pop();for(Ticker._times.unshift(b);Ticker._times.length>100;)Ticker._times.pop()};var b=window,c=b.performance.now||b.performance.mozNow||b.performance.msNow||b.performance.oNow||b.performance.webkitNow;Ticker._getTime=function(){return(c&&c.call(b.performance)||(new Date).getTime())-Ticker._startTime},createjs.Ticker=Ticker}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractTween(a){this.EventDispatcher_constructor(),this.ignoreGlobalPause=!1,this.loop=0,this.useTicks=!1,this.reversed=!1,this.bounce=!1,this.timeScale=1,this.duration=0,this.position=0,this.rawPosition=-1,this._paused=!0,this._next=null,this._prev=null,this._parent=null,this._labels=null,this._labelList=null,a&&(this.useTicks=!!a.useTicks,this.ignoreGlobalPause=!!a.ignoreGlobalPause,this.loop=a.loop===!0?-1:a.loop||0,this.reversed=!!a.reversed,this.bounce=!!a.bounce,this.timeScale=a.timeScale||1,a.onChange&&this.addEventListener("change",a.onChange),a.onComplete&&this.addEventListener("complete",a.onComplete))}var a=createjs.extend(AbstractTween,createjs.EventDispatcher);a._setPaused=function(a){return createjs.Tween._register(this,a),this},a.setPaused=createjs.deprecate(a._setPaused,"AbstractTween.setPaused"),a._getPaused=function(){return this._paused},a.getPaused=createjs.deprecate(a._getPaused,"AbstactTween.getPaused"),a._getCurrentLabel=function(a){var b=this.getLabels();null==a&&(a=this.position);for(var c=0,d=b.length;d>c&&!(aa&&(a=0),0===e){if(j=!0,-1!==g)return j}else{if(h=a/e|0,i=a-h*e,j=-1!==f&&a>=f*e+e,j&&(a=(i=e)*(h=f)+e),a===g)return j;var k=!this.reversed!=!(this.bounce&&h%2);k&&(i=e-i)}this.position=i,this.rawPosition=a,this._updatePosition(c,j),j&&(this.paused=!0),d&&d(this),b||this._runActions(g,a,c,!c&&-1===g),this.dispatchEvent("change"),j&&this.dispatchEvent("complete")},a.calculatePosition=function(a){var b=this.duration,c=this.loop,d=0,e=0;if(0===b)return 0;-1!==c&&a>=c*b+b?(e=b,d=c):0>a?e=0:(d=a/b|0,e=a-d*b);var f=!this.reversed!=!(this.bounce&&d%2);return f?b-e:e},a.getLabels=function(){var a=this._labelList;if(!a){a=this._labelList=[];var b=this._labels;for(var c in b)a.push({label:c,position:b[c]});a.sort(function(a,b){return a.position-b.position})}return a},a.setLabels=function(a){this._labels=a,this._labelList=null},a.addLabel=function(a,b){this._labels||(this._labels={}),this._labels[a]=b;var c=this._labelList;if(c){for(var d=0,e=c.length;e>d&&!(bl&&(h=i,f=l),e>l&&(g=i,e=l)),c)return this._runActionsRange(h,h,c,d);if(e!==f||g!==h||c||d){-1===e&&(e=g=0);var m=b>=a,n=e;do{var o=!j!=!(k&&n%2),p=n===e?g:m?0:i,q=n===f?h:m?i:0;if(o&&(p=i-p,q=i-q),k&&n!==e&&p===q);else if(this._runActionsRange(p,q,c,d||n!==e&&!k))return!0;d=!1}while(m&&++n<=f||!m&&--n>=f)}}},a._runActionsRange=function(){},createjs.AbstractTween=createjs.promote(AbstractTween,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function Tween(b,c){this.AbstractTween_constructor(c),this.pluginData=null,this.target=b,this.passive=!1,this._stepHead=new a(null,0,0,{},null,!0),this._stepTail=this._stepHead,this._stepPosition=0,this._actionHead=null,this._actionTail=null,this._plugins=null,this._pluginIds=null,this._injected=null,c&&(this.pluginData=c.pluginData,c.override&&Tween.removeTweens(b)),this.pluginData||(this.pluginData={}),this._init(c)}function a(a,b,c,d,e,f){this.next=null,this.prev=a,this.t=b,this.d=c,this.props=d,this.ease=e,this.passive=f,this.index=a?a.index+1:0}function b(a,b,c,d,e){this.next=null,this.prev=a,this.t=b,this.d=0,this.scope=c,this.funct=d,this.params=e}var c=createjs.extend(Tween,createjs.AbstractTween);Tween.IGNORE={},Tween._tweens=[],Tween._plugins=null,Tween._tweenHead=null,Tween._tweenTail=null,Tween.get=function(a,b){return new Tween(a,b)},Tween.tick=function(a,b){for(var c=Tween._tweenHead;c;){var d=c._next;b&&!c.ignoreGlobalPause||c._paused||c.advance(c.useTicks?1:a),c=d}},Tween.handleEvent=function(a){"tick"===a.type&&this.tick(a.delta,a.paused)},Tween.removeTweens=function(a){if(a.tweenjs_count){for(var b=Tween._tweenHead;b;){var c=b._next;b.target===a&&Tween._register(b,!0),b=c}a.tweenjs_count=0}},Tween.removeAllTweens=function(){for(var a=Tween._tweenHead;a;){var b=a._next;a._paused=!0,a.target&&(a.target.tweenjs_count=0),a._next=a._prev=null,a=b}Tween._tweenHead=Tween._tweenTail=null},Tween.hasActiveTweens=function(a){return a?!!a.tweenjs_count:!!Tween._tweenHead},Tween._installPlugin=function(a){for(var b=a.priority=a.priority||0,c=Tween._plugins=Tween._plugins||[],d=0,e=c.length;e>d&&!(b0&&this._addStep(+a,this._stepTail.props,null,b),this},c.to=function(a,b,c){(null==b||0>b)&&(b=0);var d=this._addStep(+b,null,c);return this._appendProps(a,d),this},c.label=function(a){return this.addLabel(a,this.duration),this},c.call=function(a,b,c){return this._addAction(c||this.target,a,b||[this])},c.set=function(a,b){return this._addAction(b||this.target,this._set,[a])},c.play=function(a){return this._addAction(a||this,this._set,[{paused:!1}])},c.pause=function(a){return this._addAction(a||this,this._set,[{paused:!0}])},c.w=c.wait,c.t=c.to,c.c=c.call,c.s=c.set,c.toString=function(){return"[Tween]"},c.clone=function(){throw"Tween can not be cloned."},c._addPlugin=function(a){var b=this._pluginIds||(this._pluginIds={}),c=a.ID;if(c&&!b[c]){b[c]=!0;for(var d=this._plugins||(this._plugins=[]),e=a.priority||0,f=0,g=d.length;g>f;f++)if(e=1?f:e,j)for(var l=0,m=j.length;m>l;l++){var n=j[l].change(this,a,k,d,b,c);if(n===Tween.IGNORE)continue a;void 0!==n&&(d=n)}this.target[k]=d}}},c._runActionsRange=function(a,b,c,d){var e=a>b,f=e?this._actionTail:this._actionHead,g=b,h=a;e&&(g=a,h=b);for(var i=this.position;f;){var j=f.t;if((j===b||j>h&&g>j||d&&j===a)&&(f.funct.apply(f.scope,f.params),i!==this.position))return!0;f=e?f.prev:f.next}},c._appendProps=function(a,b,c){var d,e,f,g,h,i=this._stepHead.props,j=this.target,k=Tween._plugins,l=b.prev,m=l.props,n=b.props||(b.props=this._cloneProps(m)),o={};for(d in a)if(a.hasOwnProperty(d)&&(o[d]=n[d]=a[d],void 0===i[d])){if(g=void 0,k)for(e=k.length-1;e>=0;e--)if(f=k[e].init(this,d,g),void 0!==f&&(g=f),g===Tween.IGNORE){delete n[d],delete o[d];break}g!==Tween.IGNORE&&(void 0===g&&(g=j[d]),m[d]=void 0===g?null:g)}for(d in o){f=a[d];for(var p,q=l;(p=q)&&(q=p.prev);)if(q.props!==p.props){if(void 0!==q.props[d])break;q.props[d]=m[d]}}if(c!==!1&&(k=this._plugins))for(e=k.length-1;e>=0;e--)k[e].step(this,b,o);(h=this._injected)&&(this._injected=null,this._appendProps(h,b,!1))},c._injectProp=function(a,b){var c=this._injected||(this._injected={});c[a]=b},c._addStep=function(b,c,d,e){var f=new a(this._stepTail,this.duration,b,c,d,e||!1);return this.duration+=b,this._stepTail=this._stepTail.next=f},c._addAction=function(a,c,d){var e=new b(this._actionTail,this.duration,a,c,d);return this._actionTail?this._actionTail.next=e:this._actionHead=e,this._actionTail=e,this},c._set=function(a){for(var b in a)this[b]=a[b]},c._cloneProps=function(a){var b={};for(var c in a)b[c]=a[c];return b},createjs.Tween=createjs.promote(Tween,"AbstractTween")}(),this.createjs=this.createjs||{},function(){"use strict";function Timeline(a){var b,c;a instanceof Array||null==a&&arguments.length>1?(b=a,c=arguments[1],a=arguments[2]):a&&(b=a.tweens,c=a.labels),this.AbstractTween_constructor(a),this.tweens=[],b&&this.addTween.apply(this,b),this.setLabels(c),this._init(a)}var a=createjs.extend(Timeline,createjs.AbstractTween);a.addTween=function(a){a._parent&&a._parent.removeTween(a);var b=arguments.length;if(b>1){for(var c=0;b>c;c++)this.addTween(arguments[c]);return arguments[b-1]}if(0===b)return null;this.tweens.push(a),a._parent=this,a.paused=!0;var d=a.duration;return a.loop>0&&(d*=a.loop+1),d>this.duration&&(this.duration=d),this.rawPosition>=0&&a.setPosition(this.rawPosition),a},a.removeTween=function(a){var b=arguments.length;if(b>1){for(var c=!0,d=0;b>d;d++)c=c&&this.removeTween(arguments[d]);return c}if(0===b)return!0;for(var e=this.tweens,d=e.length;d--;)if(e[d]===a)return e.splice(d,1),a._parent=null,a.duration>=this.duration&&this.updateDuration(),!0;return!1},a.updateDuration=function(){this.duration=0;for(var a=0,b=this.tweens.length;b>a;a++){var c=this.tweens[a],d=c.duration;c.loop>0&&(d*=c.loop+1),d>this.duration&&(this.duration=d)}},a.toString=function(){return"[Timeline]"},a.clone=function(){throw"Timeline can not be cloned."},a._updatePosition=function(a){for(var b=this.position,c=0,d=this.tweens.length;d>c;c++)this.tweens[c].setPosition(b,!0,a)},a._runActionsRange=function(a,b,c,d){for(var e=this.position,f=0,g=this.tweens.length;g>f;f++)if(this.tweens[f]._runActions(a,b,c,d),e!==this.position)return!0},createjs.Timeline=createjs.promote(Timeline,"AbstractTween")}(),this.createjs=this.createjs||{},function(){"use strict";function Ease(){throw"Ease cannot be instantiated."}Ease.linear=function(a){return a},Ease.none=Ease.linear,Ease.get=function(a){return-1>a?a=-1:a>1&&(a=1),function(b){return 0==a?b:0>a?b*(b*-a+1+a):b*((2-b)*a+(1-a))}},Ease.getPowIn=function(a){return function(b){return Math.pow(b,a)}},Ease.getPowOut=function(a){return function(b){return 1-Math.pow(1-b,a)}},Ease.getPowInOut=function(a){return function(b){return(b*=2)<1?.5*Math.pow(b,a):1-.5*Math.abs(Math.pow(2-b,a))}},Ease.quadIn=Ease.getPowIn(2),Ease.quadOut=Ease.getPowOut(2),Ease.quadInOut=Ease.getPowInOut(2),Ease.cubicIn=Ease.getPowIn(3),Ease.cubicOut=Ease.getPowOut(3),Ease.cubicInOut=Ease.getPowInOut(3),Ease.quartIn=Ease.getPowIn(4),Ease.quartOut=Ease.getPowOut(4),Ease.quartInOut=Ease.getPowInOut(4),Ease.quintIn=Ease.getPowIn(5),Ease.quintOut=Ease.getPowOut(5),Ease.quintInOut=Ease.getPowInOut(5),Ease.sineIn=function(a){return 1-Math.cos(a*Math.PI/2)},Ease.sineOut=function(a){return Math.sin(a*Math.PI/2)},Ease.sineInOut=function(a){return-.5*(Math.cos(Math.PI*a)-1)},Ease.getBackIn=function(a){return function(b){return b*b*((a+1)*b-a)}},Ease.backIn=Ease.getBackIn(1.7),Ease.getBackOut=function(a){return function(b){return--b*b*((a+1)*b+a)+1}},Ease.backOut=Ease.getBackOut(1.7),Ease.getBackInOut=function(a){return a*=1.525,function(b){return(b*=2)<1?.5*b*b*((a+1)*b-a):.5*((b-=2)*b*((a+1)*b+a)+2)}},Ease.backInOut=Ease.getBackInOut(1.7),Ease.circIn=function(a){return-(Math.sqrt(1-a*a)-1)},Ease.circOut=function(a){return Math.sqrt(1- --a*a)},Ease.circInOut=function(a){return(a*=2)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},Ease.bounceIn=function(a){return 1-Ease.bounceOut(1-a)},Ease.bounceOut=function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},Ease.bounceInOut=function(a){return.5>a?.5*Ease.bounceIn(2*a):.5*Ease.bounceOut(2*a-1)+.5},Ease.getElasticIn=function(a,b){var c=2*Math.PI;return function(d){if(0==d||1==d)return d;var e=b/c*Math.asin(1/a);return-(a*Math.pow(2,10*(d-=1))*Math.sin((d-e)*c/b))}},Ease.elasticIn=Ease.getElasticIn(1,.3),Ease.getElasticOut=function(a,b){var c=2*Math.PI;return function(d){if(0==d||1==d)return d;var e=b/c*Math.asin(1/a);return a*Math.pow(2,-10*d)*Math.sin((d-e)*c/b)+1}},Ease.elasticOut=Ease.getElasticOut(1,.3),Ease.getElasticInOut=function(a,b){var c=2*Math.PI;return function(d){var e=b/c*Math.asin(1/a);return(d*=2)<1?-.5*a*Math.pow(2,10*(d-=1))*Math.sin((d-e)*c/b):a*Math.pow(2,-10*(d-=1))*Math.sin((d-e)*c/b)*.5+1}},Ease.elasticInOut=Ease.getElasticInOut(1,.3*1.5),createjs.Ease=Ease}(),this.createjs=this.createjs||{},function(){"use strict";function MotionGuidePlugin(){throw"MotionGuidePlugin cannot be instantiated."}var a=MotionGuidePlugin;a.priority=0,a.ID="MotionGuide",a.install=function(){return createjs.Tween._installPlugin(MotionGuidePlugin),createjs.Tween.IGNORE},a.init=function(b,c){"guide"==c&&b._addPlugin(a)},a.step=function(b,c,d){for(var e in d)if("guide"===e){var f=c.props.guide,g=a._solveGuideData(d.guide,f);f.valid=!g;var h=f.endData;if(b._injectProp("x",h.x),b._injectProp("y",h.y),g||!f.orient)break;var i=void 0===c.prev.props.rotation?b.target.rotation||0:c.prev.props.rotation;if(f.startOffsetRot=i-f.startData.rotation,"fixed"==f.orient)f.endAbsRot=h.rotation+f.startOffsetRot,f.deltaRotation=0;else{var j=void 0===d.rotation?b.target.rotation||0:d.rotation,k=j-f.endData.rotation-f.startOffsetRot,l=k%360;switch(f.endAbsRot=j,f.orient){case"auto":f.deltaRotation=k;break;case"cw":f.deltaRotation=(l+360)%360+360*Math.abs(k/360|0);break;case"ccw":f.deltaRotation=(l-360)%360+-360*Math.abs(k/360|0)}}b._injectProp("rotation",f.endAbsRot)}},a.change=function(b,c,d,e,f){var g=c.props.guide;if(g&&c.props!==c.prev.props&&g!==c.prev.props.guide)return"guide"===d&&!g.valid||"x"==d||"y"==d||"rotation"===d&&g.orient?createjs.Tween.IGNORE:void a._ratioToPositionData(f,g,b.target)},a.debug=function(b,c,d){b=b.guide||b;var e=a._findPathProblems(b);if(e&&console.error("MotionGuidePlugin Error found: \n"+e),!c)return e;var f,g=b.path,h=g.length,i=3,j=9;for(c.save(),c.lineCap="round",c.lineJoin="miter",c.beginPath(),c.moveTo(g[0],g[1]),f=2;h>f;f+=4)c.quadraticCurveTo(g[f],g[f+1],g[f+2],g[f+3]);c.strokeStyle="black",c.lineWidth=1.5*i,c.stroke(),c.strokeStyle="white",c.lineWidth=i,c.stroke(),c.closePath();var k=d.length;if(d&&k){var l={},m={};a._solveGuideData(b,l);for(var f=0;k>f;f++)l.orient="fixed",a._ratioToPositionData(d[f],l,m),c.beginPath(),c.moveTo(m.x,m.y),c.lineTo(m.x+Math.cos(.0174533*m.rotation)*j,m.y+Math.sin(.0174533*m.rotation)*j),c.strokeStyle="black",c.lineWidth=1.5*i,c.stroke(),c.strokeStyle="red",c.lineWidth=i,c.stroke(),c.closePath()}return c.restore(),e},a._solveGuideData=function(b,c){var d=void 0;if(d=a.debug(b))return d;{var e=c.path=b.path;c.orient=b.orient}c.subLines=[],c.totalLength=0,c.startOffsetRot=0,c.deltaRotation=0,c.startData={ratio:0},c.endData={ratio:1},c.animSpan=1;var f,g,h,i,j,k,l,m,n,o=e.length,p=10,q={};for(f=e[0],g=e[1],l=2;o>l;l+=4){h=e[l],i=e[l+1],j=e[l+2],k=e[l+3];var r={weightings:[],estLength:0,portion:0},s=f,t=g;for(m=1;p>=m;m++){a._getParamsForCurve(f,g,h,i,j,k,m/p,!1,q);var u=q.x-s,v=q.y-t;n=Math.sqrt(u*u+v*v),r.weightings.push(n),r.estLength+=n,s=q.x,t=q.y}for(c.totalLength+=r.estLength,m=0;p>m;m++)n=r.estLength,r.weightings[m]=r.weightings[m]/n;c.subLines.push(r),f=j,g=k}n=c.totalLength;var w=c.subLines.length;for(l=0;w>l;l++)c.subLines[l].portion=c.subLines[l].estLength/n;var x=isNaN(b.start)?0:b.start,y=isNaN(b.end)?1:b.end;a._ratioToPositionData(x,c,c.startData),a._ratioToPositionData(y,c,c.endData),c.startData.ratio=x,c.endData.ratio=y,c.animSpan=c.endData.ratio-c.startData.ratio},a._ratioToPositionData=function(b,c,d){var e,f,g,h,i,j=c.subLines,k=0,l=10,m=b*c.animSpan+c.startData.ratio;for(f=j.length,e=0;f>e;e++){if(h=j[e].portion,k+h>=m){i=e;break}k+=h}void 0===i&&(i=f-1,k-=h);var n=j[i].weightings,o=h;for(f=n.length,e=0;f>e&&(h=n[e]*o,!(k+h>=m));e++)k+=h;i=4*i+2,g=e/l+(m-k)/h*(1/l);var p=c.path;return a._getParamsForCurve(p[i-2],p[i-1],p[i],p[i+1],p[i+2],p[i+3],g,c.orient,d),c.orient&&(b>=.99999&&1.00001>=b&&void 0!==c.endAbsRot?d.rotation=c.endAbsRot:d.rotation+=c.startOffsetRot+b*c.deltaRotation),d},a._getParamsForCurve=function(a,b,c,d,e,f,g,h,i){var j=1-g;i.x=j*j*a+2*j*g*c+g*g*e,i.y=j*j*b+2*j*g*d+g*g*f,h&&(i.rotation=57.2957795*Math.atan2((d-b)*j+(f-d)*g,(c-a)*j+(e-c)*g))},a._findPathProblems=function(a){var b=a.path,c=b&&b.length||0;if(6>c||(c-2)%4){var d=" Cannot parse 'path' array due to invalid number of entries in path. ";return d+="There should be an odd number of points, at least 3 points, and 2 entries per point (x & y). ",d+="See 'CanvasRenderingContext2D.quadraticCurveTo' for details as 'path' models a quadratic bezier.\n\n",d+="Only [ "+c+" ] values found. Expected: "+Math.max(4*Math.ceil((c-2)/4)+2,6)}for(var e=0;c>e;e++)if(isNaN(b[e]))return"All data in path array must be numeric";var f=a.start;if(isNaN(f)&&void 0!==f)return"'start' out of bounds. Expected 0 to 1, got: "+f;var g=a.end;if(isNaN(g)&&void 0!==g)return"'end' out of bounds. Expected 0 to 1, got: "+g;var h=a.orient;return h&&"fixed"!=h&&"auto"!=h&&"cw"!=h&&"ccw"!=h?'Invalid orientation value. Expected ["fixed", "auto", "cw", "ccw", undefined], got: '+h:void 0},createjs.MotionGuidePlugin=MotionGuidePlugin}(),this.createjs=this.createjs||{},function(){"use strict";var a=createjs.TweenJS=createjs.TweenJS||{};a.version="NEXT",a.buildDate="Thu, 14 Sep 2017 22:19:45 GMT"}(); \ No newline at end of file diff --git a/bower.json b/bower.json index a38c18a8..aa5e8161 100644 --- a/bower.json +++ b/bower.json @@ -1,15 +1,14 @@ { "name": "SoundJS", - "version": "0.6.2", + "version": "1.0.0", "homepage": "https://github.com/CreateJS/SoundJS", "authors": [ "lannymcnie", - "OJayRobinson", "gskinner", "wdamien" ], "description": "A Javascript library for working with Audio. Features a simple interface as the front end to multiple audio APIs via a plugin model. Currently supports WebAudio, HTML5 Audio, and a Flash fallback. Part of the CreateJS suite of libraries.", - "main": "lib/soundjs-0.6.2.combined.js", + "main": "lib/soundjs.js", "keywords": [ "sound", "audio", diff --git a/build/Gruntfile.js b/build/Gruntfile.js index 46a38642..aa1d995e 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -8,10 +8,11 @@ module.exports = function (grunt) { // Default values version: 'NEXT', + fileVersion: '-<%= version %>', name: 'soundjs', // Setup doc names / paths. - docsName: '<%= pkg.name %>_docs-<%= version %>', + docsName: '<%= pkg.name %>_docs<%= fileVersion %>', docsZip: "<%= docsName %>.zip", // Setup Uglify for JS minification. @@ -30,9 +31,9 @@ module.exports = function (grunt) { }, build: { files: { - 'output/<%= pkg.name.toLowerCase() %>-<%= version %>.min.js': getConfigValue('source'), - 'output/flashaudioplugin-<%= version %>.min.js': getConfigValue('flashaudioplugin_source'), - 'output/cordovaaudioplugin-<%= version %>.min.js': getConfigValue('cordovaaudioplugin_source'), + 'output/<%= pkg.name.toLowerCase() %><%= fileVersion %>.min.js': getConfigValue('source'), + 'output/flashaudioplugin<%= fileVersion %>.min.js': getConfigValue('flashaudioplugin_source'), + 'output/cordovaaudioplugin<%= fileVersion %>.min.js': getConfigValue('cordovaaudioplugin_source'), } } }, @@ -71,13 +72,13 @@ module.exports = function (grunt) { }, build: { files: { - 'output/<%= pkg.name.toLowerCase() %>-<%= version %>.combined.js': combineSource([ + 'output/<%= pkg.name.toLowerCase() %><%= fileVersion %>.js': combineSource([ {cwd: '', config:'config.json', source:'source'} ]), - 'output/flashaudioplugin-<%= version %>.combined.js': combineSource([ + 'output/flashaudioplugin<%= fileVersion %>.js': combineSource([ {cwd: '', config:'config.json', source:'flashaudioplugin_source'} ]), - 'output/cordovaaudioplugin-<%= version %>.combined.js': combineSource([ + 'output/cordovaaudioplugin<%= fileVersion %>.js': combineSource([ {cwd: '', config:'config.json', source:'cordovaaudioplugin_source'} ]) } @@ -135,7 +136,7 @@ module.exports = function (grunt) { }, src: { files: [ - {expand: true, cwd:'./output/', src: '*<%=version %>*.js', dest: '../lib/'} + {expand: true, cwd:'./output/', src: '*<%=fileVersion %>*.js', dest: '../lib/'} ] } }, @@ -315,6 +316,7 @@ module.exports = function (grunt) { */ grunt.registerTask('setVersion', function () { grunt.config.set('version', grunt.config.get('pkg').version); + grunt.config.set('fileVersion', ''); }); /** diff --git a/build/config.json b/build/config.json index 7242f50d..082c6419 100644 --- a/build/config.json +++ b/build/config.json @@ -4,16 +4,22 @@ "../src/createjs/utils/extend.js", "../src/createjs/utils/promote.js", - "../src/createjs/utils/IndexOf.js", - "../src/createjs/utils/Proxy.js", + "../src/createjs/utils/deprecate.js", + "../src/createjs/utils/indexOf.js", + "../src/createjs/utils/proxy.js", "../src/createjs/utils/BrowserDetect.js", "../src/createjs/events/EventDispatcher.js", "../src/createjs/events/Event.js", - "../src/createjs/events/ErrorEvent.js", + "../src/preloadjs/events/ProgressEvent.js", "../src/preloadjs/data/LoadItem.js", + "../src/preloadjs/data/Methods.js", + "../src/preloadjs/data/Types.js", + "../src/preloadjs/utils/Elements.js", + "../src/preloadjs/utils/DomUtils.js", "../src/preloadjs/utils/RequestUtils.js", + "../src/preloadjs/utils/URLUtils.js", "../src/preloadjs/loaders/AbstractLoader.js", "../src/preloadjs/loaders/AbstractMediaLoader.js", "../src/preloadjs/net/AbstractRequest.js", @@ -27,9 +33,9 @@ "../src/soundjs/Sound.js", "../src/soundjs/AbstractSoundInstance.js", "../src/soundjs/AbstractPlugin.js", - "../src/soundjs/webAudio/WebAudioLoader.js", - "../src/soundjs/webAudio/WebAudioSoundInstance.js", - "../src/soundjs/webAudio/WebAudioPlugin.js", + "../src/soundjs/webaudio/WebAudioLoader.js", + "../src/soundjs/webaudio/WebAudioSoundInstance.js", + "../src/soundjs/webaudio/WebAudioPlugin.js", "../src/soundjs/htmlaudio/HTMLAudioTagPool.js", "../src/soundjs/htmlaudio/HTMLAudioSoundInstance.js", "../src/soundjs/htmlaudio/HTMLAudioPlugin.js" diff --git a/build/createjsTheme/assets/css/yui-cssgrids-min.css b/build/createjsTheme/assets/css/yui-cssgrids-min.css index 658bbf07..ec40c74c 100644 --- a/build/createjsTheme/assets/css/yui-cssgrids-min.css +++ b/build/createjsTheme/assets/css/yui-cssgrids-min.css @@ -1 +1 @@ -.yui3-g{letter-spacing:-0.31em;*letter-spacing:normal;word-spacing:-0.43em}.yui3-u{display:inline-block;zoom:1;*display:inline;letter-spacing:normal;word-spacing:normal;vertical-align:top}.yui3-u-1,.yui3-u-1-2,.yui3-u-1-3,.yui3-u-2-3,.yui3-u-1-4,.yui3-u-3-4,.yui3-u-1-5,.yui3-u-2-5,.yui3-u-3-5,.yui3-u-4-5,.yui3-u-1-6,.yui3-u-5-6,.yui3-u-1-8,.yui3-u-3-8,.yui3-u-5-8,.yui3-u-7-8,.yui3-u-1-12,.yui3-u-5-12,.yui3-u-7-12,.yui3-u-11-12,.yui3-u-1-24,.yui3-u-5-24,.yui3-u-7-24,.yui3-u-11-24,.yui3-u-13-24,.yui3-u-17-24,.yui3-u-19-24,.yui3-u-23-24{display:inline-block;zoom:1;*display:inline;letter-spacing:normal;word-spacing:normal;vertical-align:top}.yui3-u-1{display:block}.yui3-u-1-2{width:50%}.yui3-u-1-3{width:33.33333%}.yui3-u-2-3{width:66.66666%}.yui3-u-1-4{width:25%}.yui3-u-3-4{width:75%}.yui3-u-1-5{width:20%}.yui3-u-2-5{width:40%}.yui3-u-3-5{width:60%}.yui3-u-4-5{width:80%}.yui3-u-1-6{width:16.656%}.yui3-u-5-6{width:83.33%}.yui3-u-1-8{width:12.5%}.yui3-u-3-8{width:37.5%}.yui3-u-5-8{width:62.5%}.yui3-u-7-8{width:87.5%}.yui3-u-1-12{width:8.3333%}.yui3-u-5-12{width:41.6666%}.yui3-u-7-12{width:58.3333%}.yui3-u-11-12{width:91.6666%}.yui3-u-1-24{width:4.1666%}.yui3-u-5-24{width:20.8333%}.yui3-u-7-24{width:29.1666%}.yui3-u-11-24{width:45.8333%}.yui3-u-13-24{width:54.1666%}.yui3-u-17-24{width:70.8333%}.yui3-u-19-24{width:79.1666%}.yui3-u-23-24{width:95.8333%}#yui3-css-stamp.cssgrids{display:none}.yui3-widget-hidden{display:none}.yui3-widget-content{overflow:hidden}.yui3-widget-content-expanded{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;height:100%}.yui3-widget-tmp-forcesize{overflow:hidden !important}#yui3-css-stamp.skin-sam-widget-base{display:none}.yui3-tab-panel{display:none}.yui3-tab-panel-selected{display:block}.yui3-tabview-list,.yui3-tab{margin:0;padding:0;list-style:none}.yui3-tabview{position:relative}.yui3-tabview,.yui3-tabview-list,.yui3-tabview-panel,.yui3-tab,.yui3-tab-panel{zoom:1}.yui3-tab{display:inline-block;*display:inline;vertical-align:bottom;cursor:pointer}.yui3-tab-label{display:block;display:inline-block;padding:6px 10px;position:relative;text-decoration:none;vertical-align:bottom}.yui3-skin-sam .yui3-tabview-list{border:solid #2647a0;border-width:0 0 5px;zoom:1}.yui3-skin-sam .yui3-tab{margin:0 .2em 0 0;padding:1px 0 0;zoom:1}.yui3-skin-sam .yui3-tab-selected{margin-bottom:-1px}.yui3-skin-sam .yui3-tab-label{background:#d8d8d8 url(http://yui.yahooapis.com/3.10.1/build/assets/skins/sam/sprite.png) repeat-x;border:solid #a3a3a3;border-width:1px 1px 0 1px;color:#000;cursor:pointer;font-size:85%;padding:.3em .75em;text-decoration:none}.yui3-skin-sam .yui3-tab-label:hover,.yui3-skin-sam .yui3-tab-label:focus{background:#bfdaff url(http://yui.yahooapis.com/3.10.1/build/assets/skins/sam/sprite.png) repeat-x left -1300px;outline:0}.yui3-skin-sam .yui3-tab-selected .yui3-tab-label,.yui3-skin-sam .yui3-tab-selected .yui3-tab-label:focus,.yui3-skin-sam .yui3-tab-selected .yui3-tab-label:hover{background:#2647a0 url(http://yui.yahooapis.com/3.10.1/build/assets/skins/sam/sprite.png) repeat-x left -1400px;color:#fff}.yui3-skin-sam .yui3-tab-selected .yui3-tab-label{padding:.4em .75em}.yui3-skin-sam .yui3-tab-selected .yui3-tab-label{border-color:#243356}.yui3-skin-sam .yui3-tabview-panel{background:#edf5ff}.yui3-skin-sam .yui3-tabview-panel{border:1px solid gray;border-top-color:#243356;padding:.25em .5em}#yui3-css-stamp.skin-sam-tabview{display:none} \ No newline at end of file +.yui3-g{letter-spacing:-0.31em;*letter-spacing:normal;word-spacing:-0.43em}.yui3-u{display:inline-block;zoom:1;*display:inline;letter-spacing:normal;word-spacing:normal;vertical-align:top}.yui3-u-1,.yui3-u-1-2,.yui3-u-1-3,.yui3-u-2-3,.yui3-u-1-4,.yui3-u-3-4,.yui3-u-1-5,.yui3-u-2-5,.yui3-u-3-5,.yui3-u-4-5,.yui3-u-1-6,.yui3-u-5-6,.yui3-u-1-8,.yui3-u-3-8,.yui3-u-5-8,.yui3-u-7-8,.yui3-u-1-12,.yui3-u-5-12,.yui3-u-7-12,.yui3-u-11-12,.yui3-u-1-24,.yui3-u-5-24,.yui3-u-7-24,.yui3-u-11-24,.yui3-u-13-24,.yui3-u-17-24,.yui3-u-19-24,.yui3-u-23-24{display:inline-block;zoom:1;*display:inline;letter-spacing:normal;word-spacing:normal;vertical-align:top}.yui3-u-1{display:block}.yui3-u-1-2{width:50%}.yui3-u-1-3{width:33.33333%}.yui3-u-2-3{width:66.66666%}.yui3-u-1-4{width:25%}.yui3-u-3-4{width:75%}.yui3-u-1-5{width:20%}.yui3-u-2-5{width:40%}.yui3-u-3-5{width:60%}.yui3-u-4-5{width:80%}.yui3-u-1-6{width:16.656%}.yui3-u-5-6{width:83.33%}.yui3-u-1-8{width:12.5%}.yui3-u-3-8{width:37.5%}.yui3-u-5-8{width:62.5%}.yui3-u-7-8{width:87.5%}.yui3-u-1-12{width:8.3333%}.yui3-u-5-12{width:41.6666%}.yui3-u-7-12{width:58.3333%}.yui3-u-11-12{width:91.6666%}.yui3-u-1-24{width:4.1666%}.yui3-u-5-24{width:20.8333%}.yui3-u-7-24{width:29.1666%}.yui3-u-11-24{width:45.8333%}.yui3-u-13-24{width:54.1666%}.yui3-u-17-24{width:70.8333%}.yui3-u-19-24{width:79.1666%}.yui3-u-23-24{width:95.8333%}#yui3-css-stamp.cssgrids{display:none}.yui3-widget-hidden{display:none}.yui3-widget-content{overflow:hidden}.yui3-widget-content-expanded{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;height:100%}.yui3-widget-tmp-forcesize{overflow:hidden !important}#yui3-css-stamp.skin-sam-widget-base{display:none}.yui3-tab-panel{display:none}.yui3-tab-panel-selected{display:block}.yui3-tabview-list,.yui3-tab{margin:0;padding:0;list-style:none}.yui3-tabview{position:relative}.yui3-tabview,.yui3-tabview-list,.yui3-tabview-panel,.yui3-tab,.yui3-tab-panel{zoom:1}.yui3-tab{display:inline-block;*display:inline;vertical-align:bottom;cursor:pointer}.yui3-tab-label{display:block;display:inline-block;padding:6px 10px;position:relative;text-decoration:none;vertical-align:bottom}.yui3-skin-sam .yui3-tabview-list{border:solid #2647a0;border-width:0 0 5px;zoom:1}.yui3-skin-sam .yui3-tab{margin:0 .2em 0 0;padding:1px 0 0;zoom:1}.yui3-skin-sam .yui3-tab-selected{margin-bottom:-1px}.yui3-skin-sam .yui3-tab-label{background:#d8d8d8 url(https://yui-s.yahooapis.com/3.10.1/build/assets/skins/sam/sprite.png) repeat-x;border:solid #a3a3a3;border-width:1px 1px 0 1px;color:#000;cursor:pointer;font-size:85%;padding:.3em .75em;text-decoration:none}.yui3-skin-sam .yui3-tab-label:hover,.yui3-skin-sam .yui3-tab-label:focus{background:#bfdaff url(http://yui.yahooapis.com/3.10.1/build/assets/skins/sam/sprite.png) repeat-x left -1300px;outline:0}.yui3-skin-sam .yui3-tab-selected .yui3-tab-label,.yui3-skin-sam .yui3-tab-selected .yui3-tab-label:focus,.yui3-skin-sam .yui3-tab-selected .yui3-tab-label:hover{background:#2647a0 url(http://yui.yahooapis.com/3.10.1/build/assets/skins/sam/sprite.png) repeat-x left -1400px;color:#fff}.yui3-skin-sam .yui3-tab-selected .yui3-tab-label{padding:.4em .75em}.yui3-skin-sam .yui3-tab-selected .yui3-tab-label{border-color:#243356}.yui3-skin-sam .yui3-tabview-panel{background:#edf5ff}.yui3-skin-sam .yui3-tabview-panel{border:1px solid gray;border-top-color:#243356;padding:.25em .5em}#yui3-css-stamp.skin-sam-tabview{display:none} \ No newline at end of file diff --git a/build/createjsTheme/assets/js/yui-source.js b/build/createjsTheme/assets/js/yui-source.js index 8a97ee5a..db908a65 100644 --- a/build/createjsTheme/assets/js/yui-source.js +++ b/build/createjsTheme/assets/js/yui-source.js @@ -1,4 +1,4 @@ -"undefined"!=typeof YUI&&(YUI._YUI=YUI);var YUI=function(){var a=0,b=this,c=arguments,d=c.length,e=function(a,b){return a&&a.hasOwnProperty&&a instanceof b},f="undefined"!=typeof YUI_config&&YUI_config;if(e(b,YUI)?(b._init(),YUI.GlobalConfig&&b.applyConfig(YUI.GlobalConfig),f&&b.applyConfig(f),d||b._setup()):b=new YUI,d){for(;d>a;a++)b.applyConfig(c[a]);b._setup()}return b.instanceOf=e,b};!function(){var a,b,c="3.10.1",d=".",e="http://yui.yahooapis.com/",f="yui3-js-enabled",g="yui3-css-stamp",h=function(){},i=Array.prototype.slice,j={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},k="undefined"!=typeof window,l=k?window:null,m=k?l.document:null,n=m&&m.documentElement,o=n&&n.className,p={},q=(new Date).getTime(),r=function(a,b,c,d){a&&a.addEventListener?a.addEventListener(b,c,d):a&&a.attachEvent&&a.attachEvent("on"+b,c)},s=function(a,b,c,d){if(a&&a.removeEventListener)try{a.removeEventListener(b,c,d)}catch(e){}else a&&a.detachEvent&&a.detachEvent("on"+b,c)},t=function(){YUI.Env.windowLoaded=!0,YUI.Env.DOMReady=!0,k&&s(window,"load",t)},u=function(a){var c=a.Env._loader,d=["loader-base"],e=YUI.Env,f=e.mods;return c?(c.ignoreRegistered=!1,c.onEnd=null,c.data=null,c.required=[],c.loadType=null):(c=new a.Loader(a.config),a.Env._loader=c),f&&f.loader&&(d=[].concat(d,YUI.Env.loaderExtras)),YUI.Env.core=a.Array.dedupe([].concat(YUI.Env.core,d)),c},v=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])},w={success:!0};n&&-1==o.indexOf(f)&&(o&&(o+=" "),o+=f,n.className=o),c.indexOf("@")>-1&&(c="3.5.0"),a={applyConfig:function(a){a=a||h;var b,c,d=this.config,e=d.modules,f=d.groups,g=d.aliases,i=this.Env._loader;for(c in a)a.hasOwnProperty(c)&&(b=a[c],e&&"modules"==c?v(e,b):g&&"aliases"==c?v(g,b):f&&"groups"==c?v(f,b):"win"==c?(d[c]=b&&b.contentWindow||b,d.doc=d[c]?d[c].document:null):"_yuid"!=c&&(d[c]=b));i&&i._config(a)},_config:function(a){this.applyConfig(a)},_init:function(){var a,b,i,d=this,f=YUI.Env,h=d.Env;if(d.version=c,!h){if(d.Env={core:["get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:e,cdn:e+c+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(a,b){var d,e,c=a.match(b);return c&&(d=RegExp.leftContext||a.slice(0,a.indexOf(c[0])),e=c[3],c[1]&&(d+="?"+c[1]),d={filter:e,path:d}),d},getBase:f&&f.getBase||function(b){var f,g,i,j,c=m&&m.getElementsByTagName("script")||[],e=h.cdn;for(g=0,i=c.length;i>g;++g)if(j=c[g].src,j&&(f=d.Env.parseBasePath(j,b))){a=f.filter,e=f.path;break}return e}},h=d.Env,h._loaded[c]={},f&&d!==YUI)h._yidx=++f._yidx,h._guidp=("yui_"+c+"_"+h._yidx+"_"+q).replace(/[^a-z0-9_]+/g,"_");else if(YUI._YUI){f=YUI._YUI.Env,h._yidx+=f._yidx,h._uidx+=f._uidx;for(i in f)i in h||(h[i]=f[i]);delete YUI._YUI}d.id=d.stamp(d),p[d.id]=d}d.constructor=YUI,d.config=d.config||{bootstrap:!0,cacheUse:!0,debug:!0,doc:m,fetchCSS:!0,throwFail:!0,useBrowserConsole:!0,useNativeES5:!0,win:l,global:Function("return this")()},m&&!m.getElementById(g)?(b=m.createElement("div"),b.innerHTML='
',YUI.Env.cssStampEl=b.firstChild,m.body?m.body.appendChild(YUI.Env.cssStampEl):n.insertBefore(YUI.Env.cssStampEl,n.firstChild)):m&&m.getElementById(g)&&!YUI.Env.cssStampEl&&(YUI.Env.cssStampEl=m.getElementById(g)),d.config.lang=d.config.lang||"en-US",d.config.base=YUI.config.base||d.Env.getBase(d.Env._BASE_RE),a&&"mindebug".indexOf(a)||(a="min"),a=a?"-"+a:a,d.config.loaderPath=YUI.config.loaderPath||"loader/loader"+a+".js"},_setup:function(){var a,b=this,c=[],d=YUI.Env.mods,e=b.config.core||[].concat(YUI.Env.core);for(a=0;ac;c++)if(d=a[c],e=j[d],t.push(d),o&&o.conditions[d])for(m in o.conditions[d])o.conditions[d].hasOwnProperty(m)&&(r=o.conditions[d][m],s=r&&(r.ua&&l.UA[r.ua]||r.test&&r.test(l)),s&&t.push(r.name));for(a=t,q=a.length,c=0;q>c;c++)if(!p[a[c]]){if(d=a[c],e=j[d],k&&k[d]&&!e){l._attach(k[d]);continue}if(e){for(p[d]=!0,m=0;md;d++)l[a[d]]&&!i[a[d]]?e=[].concat(e,l[a[d]]):e.push(a[d]);a=e}for(g=a.length,d=0;g>d;d++)f=a[d],b||t.push(f),k[f]||(j=i[f],m=null,n=null,j?(k[f]=!0,m=j.details.requires,n=j.details.use):h._loaded[c][f]?k[f]=!0:r.push(f),m&&m.length&&x(m),n&&n.length&&x(n,1))}},y=function(c){var e,f,d=c||{success:!0,msg:"not dynamic"},h=!0,i=d.data;g._loading=!1,i&&(f=r,r=[],t=[],x(i),e=r.length,e&&[].concat(r).sort().join()==f.sort().join()&&(e=!1)),e&&i?(g._loading=!0,g._use(r,function(){g._attach(i)&&g._notify(b,d,i)})):(i&&(h=g._attach(i)),h&&g._notify(b,d,a)),g._useQueue&&g._useQueue.size()&&!g._loading&&g._use.apply(g,g._useQueue.next())};if("*"===n){a=[];for(s in i)i.hasOwnProperty(s)&&a.push(s);return v=g._attach(a),v&&y(),g}return(i.loader||i["loader-base"])&&!g.Loader&&g._attach(["loader"+(i.loader?"":"-base")]),q&&g.Loader&&a.length&&(e=u(g),e.require(a),e.ignoreRegistered=!0,e._boot=!0,e.calculate(null,w?null:"js"),a=e.sorted,e._boot=!1),x(a),d=r.length,d&&(r=o.dedupe(r),d=r.length),q&&d&&g.Loader?(g._loading=!0,e=u(g),e.onEnd=y,e.context=g,e.data=a,e.ignoreRegistered=!1,e.require(r),e.insert(null,w?null:"js")):q&&d&&g.Get&&!j.bootstrapped?(g._loading=!0,f=function(){g._loading=!1,m.running=!1,j.bootstrapped=!0,h._bootstrapping=!1,g._attach(["loader"])&&g._use(a,b)},h._bootstrapping?m.add(f):(h._bootstrapping=!0,g.Get.script(p.base+p.loaderPath,{onEnd:f}))):(v=g._attach(a),v&&y()),g},namespace:function(){for(var b,e,f,g,a=arguments,c=0;c-1)for(f=g.split(d),e="YAHOO"==f[0]?1:0;eb;++b)f.push(a[b]);return f}return[a]}function d(){this._init(),this.add.apply(this,arguments)}var e=a.Lang||(a.Lang={}),f=String.prototype,g=Object.prototype.toString,h={undefined:"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},i=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,j=/^\s+|\s+$/g,k=/\{\s*\[(?:native code|function)\]\s*\}/i;e._isNative=function(b){return!!(a.config.useNativeES5&&b&&k.test(b))},e.isArray=e._isNative(Array.isArray)?Array.isArray:function(a){return"array"===e.type(a)},e.isBoolean=function(a){return"boolean"==typeof a},e.isDate=function(a){return"date"===e.type(a)&&"Invalid Date"!==a.toString()&&!isNaN(a)},e.isFunction=function(a){return"function"===e.type(a)},e.isNull=function(a){return null===a},e.isNumber=function(a){return"number"==typeof a&&isFinite(a)},e.isObject=function(a,b){var c=typeof a;return a&&("object"===c||!b&&("function"===c||e.isFunction(a)))||!1},e.isString=function(a){return"string"==typeof a},e.isUndefined=function(a){return"undefined"==typeof a},e.isValue=function(a){var b=e.type(a);switch(b){case"number":return isFinite(a);case"null":case"undefined":return!1;default:return!!b}},e.now=Date.now||function(){return(new Date).getTime()},e.sub=function(a,b){return a.replace?a.replace(i,function(a,c){return e.isUndefined(b[c])?a:b[c]}):a},e.trim=f.trim?function(a){return a&&a.trim?a.trim():a}:function(a){try{return a.replace(j,"")}catch(b){return a}},e.trimLeft=f.trimLeft?function(a){return a.trimLeft()}:function(a){return a.replace(/^\s+/,"")},e.trimRight=f.trimRight?function(a){return a.trimRight()}:function(a){return a.replace(/\s+$/,"")},e.type=function(a){return h[typeof a]||h[g.call(a)]||(a?"object":"null")};var l=a.Lang,m=Array.prototype,n=Object.prototype.hasOwnProperty;a.Array=c,c.dedupe=function(a){var d,e,f,b={},c=[];for(d=0,f=a.length;f>d;++d)e=a[d],n.call(b,e)||(b[e]=1,c.push(e));return c},c.each=c.forEach=l._isNative(m.forEach)?function(b,c,d){return m.forEach.call(b||[],c,d||a),a}:function(b,c,d){for(var e=0,f=b&&b.length||0;f>e;++e)e in b&&c.call(d||a,b[e],e,b);return a},c.hash=function(a,b){var e,f,c={},d=b&&b.length||0;for(e=0,f=a.length;f>e;++e)e in a&&(c[a[e]]=d>e&&e in b?b[e]:!0);return c},c.indexOf=l._isNative(m.indexOf)?function(a,b,c){return m.indexOf.call(a,b,c)}:function(a,b,c){var d=a.length;for(c=+c||0,c=(c>0||-1)*Math.floor(Math.abs(c)),0>c&&(c+=d,0>c&&(c=0));d>c;++c)if(c in a&&a[c]===b)return c;return-1},c.numericSort=function(a,b){return a-b},c.some=l._isNative(m.some)?function(a,b,c){return m.some.call(a,b,c)}:function(a,b,c){for(var d=0,e=a.length;e>d;++d)if(d in a&&b.call(c,a[d],d,a))return!0;return!1},c.test=function(a){var b=0;if(l.isArray(a))b=1;else if(l.isObject(a))try{"length"in a&&!a.tagName&&(!a.scrollTo||!a.document)&&!a.apply&&(b=2)}catch(c){}return b},d.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},last:function(){return this._q.pop()},add:function(){return this._q.push.apply(this._q,arguments),this},size:function(){return this._q.length}},a.Queue=d,YUI.Env._loaderQueue=YUI.Env._loaderQueue||new d;var o="__",n=Object.prototype.hasOwnProperty,p=a.Lang.isObject;a.cached=function(a,b,c){return b||(b={}),function(d){var e=arguments.length>1?Array.prototype.join.call(arguments,o):String(d);return(!(e in b)||c&&b[e]==c)&&(b[e]=a.apply(a,arguments)),b[e]}},a.getLocation=function(){var b=a.config.win;return b&&b.location},a.merge=function(){for(var d,e,a=0,b=arguments.length,c={};b>a;++a){e=arguments[a];for(d in e)n.call(e,d)&&(c[d]=e[d])}return c},a.mix=function(b,c,d,e,f,g){var h,i,j,k,l,m,o;if(!b||!c)return b||a;if(f){if(2===f&&a.mix(b.prototype,c.prototype,d,e,0,g),j=1===f||3===f?c.prototype:c,o=1===f||4===f?b.prototype:b,!j||!o)return b}else j=c,o=b;if(h=d&&!g,e)for(k=0,m=e.length;m>k;++k)l=e[k],n.call(j,l)&&(i=h?!1:l in o,g&&i&&p(o[l],!0)&&p(j[l],!0)?a.mix(o[l],j[l],d,null,0,g):(d||!i)&&(o[l]=j[l]));else{for(l in j)n.call(j,l)&&(i=h?!1:l in o,g&&i&&p(o[l],!0)&&p(j[l],!0)?a.mix(o[l],j[l],d,null,0,g):(d||!i)&&(o[l]=j[l]));a.Object._hasEnumBug&&a.mix(o,j,d,a.Object._forceEnum,f,g)}return b};var q,l=a.Lang,n=Object.prototype.hasOwnProperty,r=a.Object=l._isNative(Object.create)?function(a){return Object.create(a)}:function(){function a(){}return function(b){return a.prototype=b,new a}}(),s=r._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],t=r._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),u=r._hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),v=r.owns=function(a,b){return!!a&&n.call(a,b)};r.hasKey=v,r.keys=l._isNative(Object.keys)?Object.keys:function(a){if(!l.isObject(a))throw new TypeError("Object.keys called on a non-object");var c,d,e,b=[];if(u&&"function"==typeof a)for(d in a)v(a,d)&&"prototype"!==d&&b.push(d);else for(d in a)v(a,d)&&b.push(d);if(t)for(c=0,e=s.length;e>c;++c)d=s[c],v(a,d)&&b.push(d);return b},r.values=function(a){for(var b=r.keys(a),c=0,d=b.length,e=[];d>c;++c)e.push(a[b[c]]);return e},r.size=function(a){try{return r.keys(a).length}catch(b){return 0}},r.hasValue=function(b,c){return a.Array.indexOf(r.values(b),c)>-1},r.each=function(b,c,d,e){var f;for(f in b)(e||v(b,f))&&c.call(d||a,b[f],f,b);return a},r.some=function(b,c,d,e){var f;for(f in b)if((e||v(b,f))&&c.call(d||a,b[f],f,b))return!0;return!1},r.getValue=function(b,c){if(!l.isObject(b))return q;var d,e=a.Array(c),f=e.length;for(d=0;b!==q&&f>d;d++)b=b[e[d]];return b},r.setValue=function(b,c,d){var e,f=a.Array(c),g=f.length-1,h=b;if(g>=0){for(e=0;h!==q&&g>e;e++)h=h[f[e]];if(h===q)return q;h[f[e]]=d}return b},r.isEmpty=function(a){return!r.keys(Object(a)).length},YUI.Env.parseUA=function(b){var j,c=function(a){var b=0;return parseFloat(a.replace(/\./g,function(){return 1===b++?"":"."}))},d=a.config.win,e=d&&d.navigator,f={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:!1,webos:0,caja:e&&e.cajaVersion,secure:!1,os:null,nodejs:0,winjs:"undefined"!=typeof Windows&&!!Windows.System,touchEnabled:!1},g=b||e&&e.userAgent,h=d&&d.location,i=h&&h.href;return f.userAgent=g,f.secure=i&&0===i.toLowerCase().indexOf("https"),g&&(/windows|win32/i.test(g)?f.os="windows":/macintosh|mac_powerpc/i.test(g)?f.os="macintosh":/android/i.test(g)?f.os="android":/symbos/i.test(g)?f.os="symbos":/linux/i.test(g)?f.os="linux":/rhino/i.test(g)&&(f.os="rhino"),/KHTML/.test(g)&&(f.webkit=1),/IEMobile|XBLWP7/.test(g)&&(f.mobile="windows"),/Fennec/.test(g)&&(f.mobile="gecko"),j=g.match(/AppleWebKit\/([^\s]*)/),j&&j[1]&&(f.webkit=c(j[1]),f.safari=f.webkit,/PhantomJS/.test(g)&&(j=g.match(/PhantomJS\/([^\s]*)/),j&&j[1]&&(f.phantomjs=c(j[1]))),/ Mobile\//.test(g)||/iPad|iPod|iPhone/.test(g)?(f.mobile="Apple",j=g.match(/OS ([^\s]*)/),j&&j[1]&&(j=c(j[1].replace("_","."))),f.ios=j,f.os="ios",f.ipad=f.ipod=f.iphone=0,j=g.match(/iPad|iPod|iPhone/),j&&j[0]&&(f[j[0].toLowerCase()]=f.ios)):(j=g.match(/NokiaN[^\/]*|webOS\/\d\.\d/),j&&(f.mobile=j[0]),/webOS/.test(g)&&(f.mobile="WebOS",j=g.match(/webOS\/([^\s]*);/),j&&j[1]&&(f.webos=c(j[1]))),/ Android/.test(g)&&(/Mobile/.test(g)&&(f.mobile="Android"),j=g.match(/Android ([^\s]*);/),j&&j[1]&&(f.android=c(j[1]))),/Silk/.test(g)&&(j=g.match(/Silk\/([^\s]*)\)/),j&&j[1]&&(f.silk=c(j[1])),f.android||(f.android=2.34,f.os="Android"),/Accelerated=true/.test(g)&&(f.accel=!0))),j=g.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/),j&&j[1]&&j[2]?(f.chrome=c(j[2]),f.safari=0,"CrMo"===j[1]&&(f.mobile="chrome")):(j=g.match(/AdobeAIR\/([^\s]*)/),j&&(f.air=j[0]))),f.webkit||(/Opera/.test(g)?(j=g.match(/Opera[\s\/]([^\s]*)/),j&&j[1]&&(f.opera=c(j[1])),j=g.match(/Version\/([^\s]*)/),j&&j[1]&&(f.opera=c(j[1])),/Opera Mobi/.test(g)&&(f.mobile="opera",j=g.replace("Opera Mobi","").match(/Opera ([^\s]*)/),j&&j[1]&&(f.opera=c(j[1]))),j=g.match(/Opera Mini[^;]*/),j&&(f.mobile=j[0])):(j=g.match(/MSIE\s([^;]*)/),j&&j[1]?f.ie=c(j[1]):(j=g.match(/Gecko\/([^\s]*)/),j&&(f.gecko=1,j=g.match(/rv:([^\s\)]*)/),j&&j[1]&&(f.gecko=c(j[1]),/Mobile|Tablet/.test(g)&&(f.mobile="ffos"))))))),d&&e&&!(f.chrome&&f.chrome<6)&&(f.touchEnabled="ontouchstart"in d||"msMaxTouchPoints"in e&&e.msMaxTouchPoints>0),b||("object"==typeof process&&process.versions&&process.versions.node&&(f.os=process.platform,f.nodejs=c(process.versions.node)),YUI.Env.UA=f),f},a.UA=YUI.Env.UA||YUI.Env.parseUA(),a.UA.compareVersions=function(a,b){var c,d,e,f,g,h;if(a===b)return 0;for(d=(a+"").split("."),f=(b+"").split("."),g=0,h=Math.max(d.length,f.length);h>g;++g){if(c=parseInt(d[g],10),e=parseInt(f[g],10),isNaN(c)&&(c=0),isNaN(e)&&(e=0),e>c)return-1;if(c>e)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],"anim-shape-transform":["anim-shape"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],"attribute-events":["attribute-observable"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],axes:["axis-numeric","axis-category","axis-time","axis-stacked"],"axes-base":["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],charts:["charts-base"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],color:["color-base","color-hsl","color-harmony"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],datatype:["datatype-date","datatype-number","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format","datatype-date-math"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-hash-ie","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],template:["template-base","template-micro"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}},"3.10.1",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}),YUI.add("get",function(a){var d,e,f,c=a.Lang;a.Get=e={cssOptions:{attributes:{rel:"stylesheet"},doc:a.config.linkDoc||a.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:a.config.scriptDoc||a.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(a){var b,c,d,e,f;if(!a.abort)if(c=a,f=this._pending,a=null,f&&f.transaction.id===c)a=f.transaction,this._pending=null;else for(b=0,e=this._queue.length;e>b;++b)if(d=this._queue[b].transaction,d.id===c){a=d,this._queue.splice(b,1);break}a&&a.abort()},css:function(a,b,c){return this._load("css",a,b,c)},js:function(a,b,c){return this._load("js",a,b,c)},load:function(a,b,c){return this._load(null,a,b,c)},_autoPurge:function(a){a&&this._purgeNodes.length>=a&&this._purge(this._purgeNodes)},_getEnv:function(){var b=a.config.doc,c=a.UA;return this._env={async:b&&b.createElement("script").async===!0||c.ie>=10,cssFail:c.gecko>=9||c.compareVersions(c.webkit,535.24)>=0,cssLoad:(!c.gecko&&!c.webkit||c.gecko>=9||c.compareVersions(c.webkit,535.24)>=0)&&!(c.chrome&&c.chrome<=18),preservesScriptOrder:!!(c.gecko||c.opera||c.ie&&c.ie>=10)}},_getTransaction:function(b,d){var g,h,i,j,e=[];for(c.isArray(b)||(b=[b]),d=a.merge(this.options,d),d.attributes=a.merge(this.options.attributes,d.attributes),g=0,h=b.length;h>g;++g){if(j=b[g],i={attributes:{}},"string"==typeof j)i.url=j;else{if(!j.url)continue;a.mix(i,j,!1,null,0,!0),j=j.url}a.mix(i,d,!1,null,0,!0),i.type||(this.REGEX_CSS.test(j)?i.type="css":(!this.REGEX_JS.test(j),i.type="js")),a.mix(i,"js"===i.type?this.jsOptions:this.cssOptions,!1,null,0,!0),i.attributes.id||(i.attributes.id=a.guid()),i.win?i.doc=i.win.document:i.win=i.doc.defaultView||i.doc.parentWindow,i.charset&&(i.attributes.charset=i.charset),e.push(i)}return new f(e,d)},_load:function(a,b,c,d){var f;return"function"==typeof c&&(d=c,c={}),c||(c={}),c.type=a,c._onFinish=e._onTransactionFinish,this._env||this._getEnv(),f=this._getTransaction(b,c),this._queue.push({callback:d,transaction:f}),this._next(),f},_onTransactionFinish:function(){e._pending=null,e._next()},_next:function(){var a;this._pending||(a=this._queue.shift(),a&&(this._pending=a,a.transaction.execute(a.callback)))},_purge:function(b){for(var e,f,c=this._purgeNodes,d=b!==c;f=b.pop();)f._yuiget_finished&&(f.parentNode&&f.parentNode.removeChild(f),d&&(e=a.Array.indexOf(c,f),e>-1&&c.splice(e,1)))}},e.script=e.js,e.Transaction=f=function(b,c){var d=this;d.id=f._lastId+=1,d.data=c.data,d.errors=[],d.nodes=[],d.options=c,d.requests=b,d._callbacks=[],d._queue=[],d._reqsWaiting=0,d.tId=d.id,d.win=c.win||a.config.win},f._lastId=0,f.prototype={_state:"new",abort:function(a){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._reqsWaiting=0,this.errors.push({error:a||"Aborted"}),this._finish()},execute:function(a){var e,f,g,h,b=this,c=b.requests,d=b._state;if("done"===d)return a&&a(b.errors.length?b.errors:null,b),void 0;if(a&&b._callbacks.push(a),"executing"!==d){for(b._state="executing",b._queue=g=[],b.options.timeout&&(b._timeout=setTimeout(function(){b.abort("Timeout")},b.options.timeout)),b._reqsWaiting=c.length,e=0,f=c.length;f>e;++e)h=c[e],h.async||"css"===h.type?b._insert(h):g.push(h);b._next()}},purge:function(){e._purge(this.nodes)},_createNode:function(a,b,c){var f,g,e=c.createElement(a);d||(g=c.createElement("div"),g.setAttribute("class","a"),d="a"===g.className?{}:{"for":"htmlFor","class":"className"});for(f in b)b.hasOwnProperty(f)&&e.setAttribute(d[f]||f,b[f]);return e},_finish:function(){var d,e,f,a=this.errors.length?this.errors:null,b=this.options,c=b.context||this;if("done"!==this._state){for(this._state="done",e=0,f=this._callbacks.length;f>e;++e)this._callbacks[e].call(c,a,this);d=this._getEventData(),a?(b.onTimeout&&"Timeout"===a[a.length-1].error&&b.onTimeout.call(c,d),b.onFailure&&b.onFailure.call(c,d)):b.onSuccess&&b.onSuccess.call(c,d),b.onEnd&&b.onEnd.call(c,d),b._onFinish&&b._onFinish()}},_getEventData:function(b){return b?a.merge(this,{abort:this.abort,purge:this.purge,request:b,url:b.url,win:b.win}):this},_getInsertBefore:function(b){var f,g,c=b.doc,d=b.insertBefore;return d?"string"==typeof d?c.getElementById(d):d:(f=e._insertCache,g=a.stamp(c),(d=f[g])?d:(d=c.getElementsByTagName("base")[0])?f[g]=d:(d=c.head||c.getElementsByTagName("head")[0],d?(d.appendChild(c.createTextNode("")),f[g]=d.lastChild):f[g]=c.getElementsByTagName("script")[0]))},_insert:function(b){function c(){j._progress("Failed to load "+b.url,b)}function d(){l&&clearTimeout(l),j._progress(null,b)}var l,m,f=e._env,g=this._getInsertBefore(b),h="js"===b.type,i=b.node,j=this,k=a.UA;i||(m=h?"script":!f.cssLoad&&k.gecko?"style":"link",i=b.node=this._createNode(m,b.attributes,b.doc)),h?(i.setAttribute("src",b.url),b.async?i.async=!0:(f.async&&(i.async=!1),f.preservesScriptOrder||(this._pending=b))):!f.cssLoad&&k.gecko?i.innerHTML=(b.attributes.charset?'@charset "'+b.attributes.charset+'";':"")+'@import "'+b.url+'";':i.setAttribute("href",b.url),h&&k.ie&&(k.ie<9||document.documentMode&&document.documentMode<9)?i.onreadystatechange=function(){/loaded|complete/.test(i.readyState)&&(i.onreadystatechange=null,d())}:h||f.cssLoad?(k.ie>=10?(i.onerror=function(){setTimeout(c,0)},i.onload=function(){setTimeout(d,0)}):(i.onerror=c,i.onload=d),!f.cssFail&&!h&&(l=setTimeout(c,b.timeout||3e3))):this._poll(b),this.nodes.push(i),g.parentNode.insertBefore(i,g)},_next:function(){this._pending||(this._queue.length?this._insert(this._queue.shift()):this._reqsWaiting||this._finish())},_poll:function(b){var f,g,h,i,j,k,c=this,d=c._pendingCSS,e=a.UA.webkit;if(!b||(d||(d=c._pendingCSS=[]),d.push(b),!c._pollTimer)){for(c._pollTimer=null,f=0;f=0;)if(k[h].href===i){d.splice(f,1),f-=1,c._progress(null,j);break}}else try{g=!!j.node.sheet.cssRules,d.splice(f,1),f-=1,c._progress(null,j)}catch(l){}d.length&&(c._pollTimer=setTimeout(function(){c._poll.call(c)},c.options.pollInterval))}},_progress:function(a,b){var c=this.options;a&&(b.error=a,this.errors.push({error:a,request:b})),b.node._yuiget_finished=b.finished=!0,c.onProgress&&c.onProgress.call(c.context||this,this._getEventData(b)),b.autopurge&&(e._autoPurge(this.options.purgethreshold),e._purgeNodes.push(b.node)),this._pending===b&&(this._pending=null),this._reqsWaiting-=1,this._next()}}},"3.10.1",{requires:["yui-base"]}),YUI.add("features",function(a){var c={};a.mix(a.namespace("Features"),{tests:c,add:function(a,b,d){c[a]=c[a]||{},c[a][b]=d},all:function(b,d){var e=c[b],f=[];return e&&a.Object.each(e,function(c,e){f.push(e+":"+(a.Features.test(b,e,d)?1:0))}),f.length?f.join(";"):""},test:function(b,d,e){e=e||[];var f,g,h,i=c[b],j=i&&i[d];return!j||(f=j.result,a.Lang.isUndefined(f)&&(g=j.ua,g&&(f=a.UA[g]),h=j.test,h&&(!g||f)&&(f=h.apply(a,e)),j.result=f)),f}});var d=a.Features.add;d("load","0",{name:"app-transitions-native",test:function(a){var b=a.config.doc,c=b?b.documentElement:null;return c&&c.style?"MozTransition"in c.style||"WebkitTransition"in c.style||"transition"in c.style:!1},trigger:"app-transitions"}),d("load","1",{name:"autocomplete-list-keys",test:function(a){return!a.UA.ios&&!a.UA.android},trigger:"autocomplete-list"}),d("load","2",{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"}),d("load","3",{name:"dom-style-ie",test:function(a){var b=a.Features.test,c=a.Features.add,d=a.config.win,e=a.config.doc,f="documentElement",g=!1;return c("style","computedStyle",{test:function(){return d&&"getComputedStyle"in d}}),c("style","opacity",{test:function(){return e&&"opacity"in e[f].style}}),g=!b("style","opacity")&&!b("style","computedStyle")},trigger:"dom-style"}),d("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),d("load","5",{name:"event-base-ie",test:function(a){var b=a.config.doc&&a.config.doc.implementation;return b&&!b.hasFeature("Events","2.0")},trigger:"node-base"}),d("load","6",{name:"graphics-canvas",test:function(a){var b=a.config.doc,c=a.config.defaultGraphicEngine&&"canvas"==a.config.defaultGraphicEngine,d=b&&b.createElement("canvas"),e=b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!e||c)&&d&&d.getContext&&d.getContext("2d")},trigger:"graphics"}),d("load","7",{name:"graphics-canvas-default",test:function(a){var b=a.config.doc,c=a.config.defaultGraphicEngine&&"canvas"==a.config.defaultGraphicEngine,d=b&&b.createElement("canvas"),e=b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!e||c)&&d&&d.getContext&&d.getContext("2d")},trigger:"graphics"}),d("load","8",{name:"graphics-svg",test:function(a){var b=a.config.doc,c=!a.config.defaultGraphicEngine||"canvas"!=a.config.defaultGraphicEngine,d=b&&b.createElement("canvas"),e=b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return e&&(c||!d)},trigger:"graphics"}),d("load","9",{name:"graphics-svg-default",test:function(a){var b=a.config.doc,c=!a.config.defaultGraphicEngine||"canvas"!=a.config.defaultGraphicEngine,d=b&&b.createElement("canvas"),e=b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return e&&(c||!d)},trigger:"graphics"}),d("load","10",{name:"graphics-vml",test:function(a){var b=a.config.doc,c=b&&b.createElement("canvas");return!(!b||b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")||c&&c.getContext&&c.getContext("2d"))},trigger:"graphics"}),d("load","11",{name:"graphics-vml-default",test:function(a){var b=a.config.doc,c=b&&b.createElement("canvas");return!(!b||b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")||c&&c.getContext&&c.getContext("2d")) +"undefined"!=typeof YUI&&(YUI._YUI=YUI);var YUI=function(){var a=0,b=this,c=arguments,d=c.length,e=function(a,b){return a&&a.hasOwnProperty&&a instanceof b},f="undefined"!=typeof YUI_config&&YUI_config;if(e(b,YUI)?(b._init(),YUI.GlobalConfig&&b.applyConfig(YUI.GlobalConfig),f&&b.applyConfig(f),d||b._setup()):b=new YUI,d){for(;d>a;a++)b.applyConfig(c[a]);b._setup()}return b.instanceOf=e,b};!function(){var a,b,c="3.10.1",d=".",e="https://yui-s.yahooapis.com/",f="yui3-js-enabled",g="yui3-css-stamp",h=function(){},i=Array.prototype.slice,j={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},k="undefined"!=typeof window,l=k?window:null,m=k?l.document:null,n=m&&m.documentElement,o=n&&n.className,p={},q=(new Date).getTime(),r=function(a,b,c,d){a&&a.addEventListener?a.addEventListener(b,c,d):a&&a.attachEvent&&a.attachEvent("on"+b,c)},s=function(a,b,c,d){if(a&&a.removeEventListener)try{a.removeEventListener(b,c,d)}catch(e){}else a&&a.detachEvent&&a.detachEvent("on"+b,c)},t=function(){YUI.Env.windowLoaded=!0,YUI.Env.DOMReady=!0,k&&s(window,"load",t)},u=function(a){var c=a.Env._loader,d=["loader-base"],e=YUI.Env,f=e.mods;return c?(c.ignoreRegistered=!1,c.onEnd=null,c.data=null,c.required=[],c.loadType=null):(c=new a.Loader(a.config),a.Env._loader=c),f&&f.loader&&(d=[].concat(d,YUI.Env.loaderExtras)),YUI.Env.core=a.Array.dedupe([].concat(YUI.Env.core,d)),c},v=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])},w={success:!0};n&&-1==o.indexOf(f)&&(o&&(o+=" "),o+=f,n.className=o),c.indexOf("@")>-1&&(c="3.5.0"),a={applyConfig:function(a){a=a||h;var b,c,d=this.config,e=d.modules,f=d.groups,g=d.aliases,i=this.Env._loader;for(c in a)a.hasOwnProperty(c)&&(b=a[c],e&&"modules"==c?v(e,b):g&&"aliases"==c?v(g,b):f&&"groups"==c?v(f,b):"win"==c?(d[c]=b&&b.contentWindow||b,d.doc=d[c]?d[c].document:null):"_yuid"!=c&&(d[c]=b));i&&i._config(a)},_config:function(a){this.applyConfig(a)},_init:function(){var a,b,i,d=this,f=YUI.Env,h=d.Env;if(d.version=c,!h){if(d.Env={core:["get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:e,cdn:e+c+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(a,b){var d,e,c=a.match(b);return c&&(d=RegExp.leftContext||a.slice(0,a.indexOf(c[0])),e=c[3],c[1]&&(d+="?"+c[1]),d={filter:e,path:d}),d},getBase:f&&f.getBase||function(b){var f,g,i,j,c=m&&m.getElementsByTagName("script")||[],e=h.cdn;for(g=0,i=c.length;i>g;++g)if(j=c[g].src,j&&(f=d.Env.parseBasePath(j,b))){a=f.filter,e=f.path;break}return e}},h=d.Env,h._loaded[c]={},f&&d!==YUI)h._yidx=++f._yidx,h._guidp=("yui_"+c+"_"+h._yidx+"_"+q).replace(/[^a-z0-9_]+/g,"_");else if(YUI._YUI){f=YUI._YUI.Env,h._yidx+=f._yidx,h._uidx+=f._uidx;for(i in f)i in h||(h[i]=f[i]);delete YUI._YUI}d.id=d.stamp(d),p[d.id]=d}d.constructor=YUI,d.config=d.config||{bootstrap:!0,cacheUse:!0,debug:!0,doc:m,fetchCSS:!0,throwFail:!0,useBrowserConsole:!0,useNativeES5:!0,win:l,global:Function("return this")()},m&&!m.getElementById(g)?(b=m.createElement("div"),b.innerHTML='
',YUI.Env.cssStampEl=b.firstChild,m.body?m.body.appendChild(YUI.Env.cssStampEl):n.insertBefore(YUI.Env.cssStampEl,n.firstChild)):m&&m.getElementById(g)&&!YUI.Env.cssStampEl&&(YUI.Env.cssStampEl=m.getElementById(g)),d.config.lang=d.config.lang||"en-US",d.config.base=YUI.config.base||d.Env.getBase(d.Env._BASE_RE),a&&"mindebug".indexOf(a)||(a="min"),a=a?"-"+a:a,d.config.loaderPath=YUI.config.loaderPath||"loader/loader"+a+".js"},_setup:function(){var a,b=this,c=[],d=YUI.Env.mods,e=b.config.core||[].concat(YUI.Env.core);for(a=0;ac;c++)if(d=a[c],e=j[d],t.push(d),o&&o.conditions[d])for(m in o.conditions[d])o.conditions[d].hasOwnProperty(m)&&(r=o.conditions[d][m],s=r&&(r.ua&&l.UA[r.ua]||r.test&&r.test(l)),s&&t.push(r.name));for(a=t,q=a.length,c=0;q>c;c++)if(!p[a[c]]){if(d=a[c],e=j[d],k&&k[d]&&!e){l._attach(k[d]);continue}if(e){for(p[d]=!0,m=0;md;d++)l[a[d]]&&!i[a[d]]?e=[].concat(e,l[a[d]]):e.push(a[d]);a=e}for(g=a.length,d=0;g>d;d++)f=a[d],b||t.push(f),k[f]||(j=i[f],m=null,n=null,j?(k[f]=!0,m=j.details.requires,n=j.details.use):h._loaded[c][f]?k[f]=!0:r.push(f),m&&m.length&&x(m),n&&n.length&&x(n,1))}},y=function(c){var e,f,d=c||{success:!0,msg:"not dynamic"},h=!0,i=d.data;g._loading=!1,i&&(f=r,r=[],t=[],x(i),e=r.length,e&&[].concat(r).sort().join()==f.sort().join()&&(e=!1)),e&&i?(g._loading=!0,g._use(r,function(){g._attach(i)&&g._notify(b,d,i)})):(i&&(h=g._attach(i)),h&&g._notify(b,d,a)),g._useQueue&&g._useQueue.size()&&!g._loading&&g._use.apply(g,g._useQueue.next())};if("*"===n){a=[];for(s in i)i.hasOwnProperty(s)&&a.push(s);return v=g._attach(a),v&&y(),g}return(i.loader||i["loader-base"])&&!g.Loader&&g._attach(["loader"+(i.loader?"":"-base")]),q&&g.Loader&&a.length&&(e=u(g),e.require(a),e.ignoreRegistered=!0,e._boot=!0,e.calculate(null,w?null:"js"),a=e.sorted,e._boot=!1),x(a),d=r.length,d&&(r=o.dedupe(r),d=r.length),q&&d&&g.Loader?(g._loading=!0,e=u(g),e.onEnd=y,e.context=g,e.data=a,e.ignoreRegistered=!1,e.require(r),e.insert(null,w?null:"js")):q&&d&&g.Get&&!j.bootstrapped?(g._loading=!0,f=function(){g._loading=!1,m.running=!1,j.bootstrapped=!0,h._bootstrapping=!1,g._attach(["loader"])&&g._use(a,b)},h._bootstrapping?m.add(f):(h._bootstrapping=!0,g.Get.script(p.base+p.loaderPath,{onEnd:f}))):(v=g._attach(a),v&&y()),g},namespace:function(){for(var b,e,f,g,a=arguments,c=0;c-1)for(f=g.split(d),e="YAHOO"==f[0]?1:0;eb;++b)f.push(a[b]);return f}return[a]}function d(){this._init(),this.add.apply(this,arguments)}var e=a.Lang||(a.Lang={}),f=String.prototype,g=Object.prototype.toString,h={undefined:"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},i=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,j=/^\s+|\s+$/g,k=/\{\s*\[(?:native code|function)\]\s*\}/i;e._isNative=function(b){return!!(a.config.useNativeES5&&b&&k.test(b))},e.isArray=e._isNative(Array.isArray)?Array.isArray:function(a){return"array"===e.type(a)},e.isBoolean=function(a){return"boolean"==typeof a},e.isDate=function(a){return"date"===e.type(a)&&"Invalid Date"!==a.toString()&&!isNaN(a)},e.isFunction=function(a){return"function"===e.type(a)},e.isNull=function(a){return null===a},e.isNumber=function(a){return"number"==typeof a&&isFinite(a)},e.isObject=function(a,b){var c=typeof a;return a&&("object"===c||!b&&("function"===c||e.isFunction(a)))||!1},e.isString=function(a){return"string"==typeof a},e.isUndefined=function(a){return"undefined"==typeof a},e.isValue=function(a){var b=e.type(a);switch(b){case"number":return isFinite(a);case"null":case"undefined":return!1;default:return!!b}},e.now=Date.now||function(){return(new Date).getTime()},e.sub=function(a,b){return a.replace?a.replace(i,function(a,c){return e.isUndefined(b[c])?a:b[c]}):a},e.trim=f.trim?function(a){return a&&a.trim?a.trim():a}:function(a){try{return a.replace(j,"")}catch(b){return a}},e.trimLeft=f.trimLeft?function(a){return a.trimLeft()}:function(a){return a.replace(/^\s+/,"")},e.trimRight=f.trimRight?function(a){return a.trimRight()}:function(a){return a.replace(/\s+$/,"")},e.type=function(a){return h[typeof a]||h[g.call(a)]||(a?"object":"null")};var l=a.Lang,m=Array.prototype,n=Object.prototype.hasOwnProperty;a.Array=c,c.dedupe=function(a){var d,e,f,b={},c=[];for(d=0,f=a.length;f>d;++d)e=a[d],n.call(b,e)||(b[e]=1,c.push(e));return c},c.each=c.forEach=l._isNative(m.forEach)?function(b,c,d){return m.forEach.call(b||[],c,d||a),a}:function(b,c,d){for(var e=0,f=b&&b.length||0;f>e;++e)e in b&&c.call(d||a,b[e],e,b);return a},c.hash=function(a,b){var e,f,c={},d=b&&b.length||0;for(e=0,f=a.length;f>e;++e)e in a&&(c[a[e]]=d>e&&e in b?b[e]:!0);return c},c.indexOf=l._isNative(m.indexOf)?function(a,b,c){return m.indexOf.call(a,b,c)}:function(a,b,c){var d=a.length;for(c=+c||0,c=(c>0||-1)*Math.floor(Math.abs(c)),0>c&&(c+=d,0>c&&(c=0));d>c;++c)if(c in a&&a[c]===b)return c;return-1},c.numericSort=function(a,b){return a-b},c.some=l._isNative(m.some)?function(a,b,c){return m.some.call(a,b,c)}:function(a,b,c){for(var d=0,e=a.length;e>d;++d)if(d in a&&b.call(c,a[d],d,a))return!0;return!1},c.test=function(a){var b=0;if(l.isArray(a))b=1;else if(l.isObject(a))try{"length"in a&&!a.tagName&&(!a.scrollTo||!a.document)&&!a.apply&&(b=2)}catch(c){}return b},d.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},last:function(){return this._q.pop()},add:function(){return this._q.push.apply(this._q,arguments),this},size:function(){return this._q.length}},a.Queue=d,YUI.Env._loaderQueue=YUI.Env._loaderQueue||new d;var o="__",n=Object.prototype.hasOwnProperty,p=a.Lang.isObject;a.cached=function(a,b,c){return b||(b={}),function(d){var e=arguments.length>1?Array.prototype.join.call(arguments,o):String(d);return(!(e in b)||c&&b[e]==c)&&(b[e]=a.apply(a,arguments)),b[e]}},a.getLocation=function(){var b=a.config.win;return b&&b.location},a.merge=function(){for(var d,e,a=0,b=arguments.length,c={};b>a;++a){e=arguments[a];for(d in e)n.call(e,d)&&(c[d]=e[d])}return c},a.mix=function(b,c,d,e,f,g){var h,i,j,k,l,m,o;if(!b||!c)return b||a;if(f){if(2===f&&a.mix(b.prototype,c.prototype,d,e,0,g),j=1===f||3===f?c.prototype:c,o=1===f||4===f?b.prototype:b,!j||!o)return b}else j=c,o=b;if(h=d&&!g,e)for(k=0,m=e.length;m>k;++k)l=e[k],n.call(j,l)&&(i=h?!1:l in o,g&&i&&p(o[l],!0)&&p(j[l],!0)?a.mix(o[l],j[l],d,null,0,g):(d||!i)&&(o[l]=j[l]));else{for(l in j)n.call(j,l)&&(i=h?!1:l in o,g&&i&&p(o[l],!0)&&p(j[l],!0)?a.mix(o[l],j[l],d,null,0,g):(d||!i)&&(o[l]=j[l]));a.Object._hasEnumBug&&a.mix(o,j,d,a.Object._forceEnum,f,g)}return b};var q,l=a.Lang,n=Object.prototype.hasOwnProperty,r=a.Object=l._isNative(Object.create)?function(a){return Object.create(a)}:function(){function a(){}return function(b){return a.prototype=b,new a}}(),s=r._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],t=r._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),u=r._hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),v=r.owns=function(a,b){return!!a&&n.call(a,b)};r.hasKey=v,r.keys=l._isNative(Object.keys)?Object.keys:function(a){if(!l.isObject(a))throw new TypeError("Object.keys called on a non-object");var c,d,e,b=[];if(u&&"function"==typeof a)for(d in a)v(a,d)&&"prototype"!==d&&b.push(d);else for(d in a)v(a,d)&&b.push(d);if(t)for(c=0,e=s.length;e>c;++c)d=s[c],v(a,d)&&b.push(d);return b},r.values=function(a){for(var b=r.keys(a),c=0,d=b.length,e=[];d>c;++c)e.push(a[b[c]]);return e},r.size=function(a){try{return r.keys(a).length}catch(b){return 0}},r.hasValue=function(b,c){return a.Array.indexOf(r.values(b),c)>-1},r.each=function(b,c,d,e){var f;for(f in b)(e||v(b,f))&&c.call(d||a,b[f],f,b);return a},r.some=function(b,c,d,e){var f;for(f in b)if((e||v(b,f))&&c.call(d||a,b[f],f,b))return!0;return!1},r.getValue=function(b,c){if(!l.isObject(b))return q;var d,e=a.Array(c),f=e.length;for(d=0;b!==q&&f>d;d++)b=b[e[d]];return b},r.setValue=function(b,c,d){var e,f=a.Array(c),g=f.length-1,h=b;if(g>=0){for(e=0;h!==q&&g>e;e++)h=h[f[e]];if(h===q)return q;h[f[e]]=d}return b},r.isEmpty=function(a){return!r.keys(Object(a)).length},YUI.Env.parseUA=function(b){var j,c=function(a){var b=0;return parseFloat(a.replace(/\./g,function(){return 1===b++?"":"."}))},d=a.config.win,e=d&&d.navigator,f={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:!1,webos:0,caja:e&&e.cajaVersion,secure:!1,os:null,nodejs:0,winjs:"undefined"!=typeof Windows&&!!Windows.System,touchEnabled:!1},g=b||e&&e.userAgent,h=d&&d.location,i=h&&h.href;return f.userAgent=g,f.secure=i&&0===i.toLowerCase().indexOf("https"),g&&(/windows|win32/i.test(g)?f.os="windows":/macintosh|mac_powerpc/i.test(g)?f.os="macintosh":/android/i.test(g)?f.os="android":/symbos/i.test(g)?f.os="symbos":/linux/i.test(g)?f.os="linux":/rhino/i.test(g)&&(f.os="rhino"),/KHTML/.test(g)&&(f.webkit=1),/IEMobile|XBLWP7/.test(g)&&(f.mobile="windows"),/Fennec/.test(g)&&(f.mobile="gecko"),j=g.match(/AppleWebKit\/([^\s]*)/),j&&j[1]&&(f.webkit=c(j[1]),f.safari=f.webkit,/PhantomJS/.test(g)&&(j=g.match(/PhantomJS\/([^\s]*)/),j&&j[1]&&(f.phantomjs=c(j[1]))),/ Mobile\//.test(g)||/iPad|iPod|iPhone/.test(g)?(f.mobile="Apple",j=g.match(/OS ([^\s]*)/),j&&j[1]&&(j=c(j[1].replace("_","."))),f.ios=j,f.os="ios",f.ipad=f.ipod=f.iphone=0,j=g.match(/iPad|iPod|iPhone/),j&&j[0]&&(f[j[0].toLowerCase()]=f.ios)):(j=g.match(/NokiaN[^\/]*|webOS\/\d\.\d/),j&&(f.mobile=j[0]),/webOS/.test(g)&&(f.mobile="WebOS",j=g.match(/webOS\/([^\s]*);/),j&&j[1]&&(f.webos=c(j[1]))),/ Android/.test(g)&&(/Mobile/.test(g)&&(f.mobile="Android"),j=g.match(/Android ([^\s]*);/),j&&j[1]&&(f.android=c(j[1]))),/Silk/.test(g)&&(j=g.match(/Silk\/([^\s]*)\)/),j&&j[1]&&(f.silk=c(j[1])),f.android||(f.android=2.34,f.os="Android"),/Accelerated=true/.test(g)&&(f.accel=!0))),j=g.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/),j&&j[1]&&j[2]?(f.chrome=c(j[2]),f.safari=0,"CrMo"===j[1]&&(f.mobile="chrome")):(j=g.match(/AdobeAIR\/([^\s]*)/),j&&(f.air=j[0]))),f.webkit||(/Opera/.test(g)?(j=g.match(/Opera[\s\/]([^\s]*)/),j&&j[1]&&(f.opera=c(j[1])),j=g.match(/Version\/([^\s]*)/),j&&j[1]&&(f.opera=c(j[1])),/Opera Mobi/.test(g)&&(f.mobile="opera",j=g.replace("Opera Mobi","").match(/Opera ([^\s]*)/),j&&j[1]&&(f.opera=c(j[1]))),j=g.match(/Opera Mini[^;]*/),j&&(f.mobile=j[0])):(j=g.match(/MSIE\s([^;]*)/),j&&j[1]?f.ie=c(j[1]):(j=g.match(/Gecko\/([^\s]*)/),j&&(f.gecko=1,j=g.match(/rv:([^\s\)]*)/),j&&j[1]&&(f.gecko=c(j[1]),/Mobile|Tablet/.test(g)&&(f.mobile="ffos"))))))),d&&e&&!(f.chrome&&f.chrome<6)&&(f.touchEnabled="ontouchstart"in d||"msMaxTouchPoints"in e&&e.msMaxTouchPoints>0),b||("object"==typeof process&&process.versions&&process.versions.node&&(f.os=process.platform,f.nodejs=c(process.versions.node)),YUI.Env.UA=f),f},a.UA=YUI.Env.UA||YUI.Env.parseUA(),a.UA.compareVersions=function(a,b){var c,d,e,f,g,h;if(a===b)return 0;for(d=(a+"").split("."),f=(b+"").split("."),g=0,h=Math.max(d.length,f.length);h>g;++g){if(c=parseInt(d[g],10),e=parseInt(f[g],10),isNaN(c)&&(c=0),isNaN(e)&&(e=0),e>c)return-1;if(c>e)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],"anim-shape-transform":["anim-shape"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],"attribute-events":["attribute-observable"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],axes:["axis-numeric","axis-category","axis-time","axis-stacked"],"axes-base":["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],charts:["charts-base"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],color:["color-base","color-hsl","color-harmony"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],datatype:["datatype-date","datatype-number","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format","datatype-date-math"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-hash-ie","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],template:["template-base","template-micro"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}},"3.10.1",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}),YUI.add("get",function(a){var d,e,f,c=a.Lang;a.Get=e={cssOptions:{attributes:{rel:"stylesheet"},doc:a.config.linkDoc||a.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:a.config.scriptDoc||a.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(a){var b,c,d,e,f;if(!a.abort)if(c=a,f=this._pending,a=null,f&&f.transaction.id===c)a=f.transaction,this._pending=null;else for(b=0,e=this._queue.length;e>b;++b)if(d=this._queue[b].transaction,d.id===c){a=d,this._queue.splice(b,1);break}a&&a.abort()},css:function(a,b,c){return this._load("css",a,b,c)},js:function(a,b,c){return this._load("js",a,b,c)},load:function(a,b,c){return this._load(null,a,b,c)},_autoPurge:function(a){a&&this._purgeNodes.length>=a&&this._purge(this._purgeNodes)},_getEnv:function(){var b=a.config.doc,c=a.UA;return this._env={async:b&&b.createElement("script").async===!0||c.ie>=10,cssFail:c.gecko>=9||c.compareVersions(c.webkit,535.24)>=0,cssLoad:(!c.gecko&&!c.webkit||c.gecko>=9||c.compareVersions(c.webkit,535.24)>=0)&&!(c.chrome&&c.chrome<=18),preservesScriptOrder:!!(c.gecko||c.opera||c.ie&&c.ie>=10)}},_getTransaction:function(b,d){var g,h,i,j,e=[];for(c.isArray(b)||(b=[b]),d=a.merge(this.options,d),d.attributes=a.merge(this.options.attributes,d.attributes),g=0,h=b.length;h>g;++g){if(j=b[g],i={attributes:{}},"string"==typeof j)i.url=j;else{if(!j.url)continue;a.mix(i,j,!1,null,0,!0),j=j.url}a.mix(i,d,!1,null,0,!0),i.type||(this.REGEX_CSS.test(j)?i.type="css":(!this.REGEX_JS.test(j),i.type="js")),a.mix(i,"js"===i.type?this.jsOptions:this.cssOptions,!1,null,0,!0),i.attributes.id||(i.attributes.id=a.guid()),i.win?i.doc=i.win.document:i.win=i.doc.defaultView||i.doc.parentWindow,i.charset&&(i.attributes.charset=i.charset),e.push(i)}return new f(e,d)},_load:function(a,b,c,d){var f;return"function"==typeof c&&(d=c,c={}),c||(c={}),c.type=a,c._onFinish=e._onTransactionFinish,this._env||this._getEnv(),f=this._getTransaction(b,c),this._queue.push({callback:d,transaction:f}),this._next(),f},_onTransactionFinish:function(){e._pending=null,e._next()},_next:function(){var a;this._pending||(a=this._queue.shift(),a&&(this._pending=a,a.transaction.execute(a.callback)))},_purge:function(b){for(var e,f,c=this._purgeNodes,d=b!==c;f=b.pop();)f._yuiget_finished&&(f.parentNode&&f.parentNode.removeChild(f),d&&(e=a.Array.indexOf(c,f),e>-1&&c.splice(e,1)))}},e.script=e.js,e.Transaction=f=function(b,c){var d=this;d.id=f._lastId+=1,d.data=c.data,d.errors=[],d.nodes=[],d.options=c,d.requests=b,d._callbacks=[],d._queue=[],d._reqsWaiting=0,d.tId=d.id,d.win=c.win||a.config.win},f._lastId=0,f.prototype={_state:"new",abort:function(a){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._reqsWaiting=0,this.errors.push({error:a||"Aborted"}),this._finish()},execute:function(a){var e,f,g,h,b=this,c=b.requests,d=b._state;if("done"===d)return a&&a(b.errors.length?b.errors:null,b),void 0;if(a&&b._callbacks.push(a),"executing"!==d){for(b._state="executing",b._queue=g=[],b.options.timeout&&(b._timeout=setTimeout(function(){b.abort("Timeout")},b.options.timeout)),b._reqsWaiting=c.length,e=0,f=c.length;f>e;++e)h=c[e],h.async||"css"===h.type?b._insert(h):g.push(h);b._next()}},purge:function(){e._purge(this.nodes)},_createNode:function(a,b,c){var f,g,e=c.createElement(a);d||(g=c.createElement("div"),g.setAttribute("class","a"),d="a"===g.className?{}:{"for":"htmlFor","class":"className"});for(f in b)b.hasOwnProperty(f)&&e.setAttribute(d[f]||f,b[f]);return e},_finish:function(){var d,e,f,a=this.errors.length?this.errors:null,b=this.options,c=b.context||this;if("done"!==this._state){for(this._state="done",e=0,f=this._callbacks.length;f>e;++e)this._callbacks[e].call(c,a,this);d=this._getEventData(),a?(b.onTimeout&&"Timeout"===a[a.length-1].error&&b.onTimeout.call(c,d),b.onFailure&&b.onFailure.call(c,d)):b.onSuccess&&b.onSuccess.call(c,d),b.onEnd&&b.onEnd.call(c,d),b._onFinish&&b._onFinish()}},_getEventData:function(b){return b?a.merge(this,{abort:this.abort,purge:this.purge,request:b,url:b.url,win:b.win}):this},_getInsertBefore:function(b){var f,g,c=b.doc,d=b.insertBefore;return d?"string"==typeof d?c.getElementById(d):d:(f=e._insertCache,g=a.stamp(c),(d=f[g])?d:(d=c.getElementsByTagName("base")[0])?f[g]=d:(d=c.head||c.getElementsByTagName("head")[0],d?(d.appendChild(c.createTextNode("")),f[g]=d.lastChild):f[g]=c.getElementsByTagName("script")[0]))},_insert:function(b){function c(){j._progress("Failed to load "+b.url,b)}function d(){l&&clearTimeout(l),j._progress(null,b)}var l,m,f=e._env,g=this._getInsertBefore(b),h="js"===b.type,i=b.node,j=this,k=a.UA;i||(m=h?"script":!f.cssLoad&&k.gecko?"style":"link",i=b.node=this._createNode(m,b.attributes,b.doc)),h?(i.setAttribute("src",b.url),b.async?i.async=!0:(f.async&&(i.async=!1),f.preservesScriptOrder||(this._pending=b))):!f.cssLoad&&k.gecko?i.innerHTML=(b.attributes.charset?'@charset "'+b.attributes.charset+'";':"")+'@import "'+b.url+'";':i.setAttribute("href",b.url),h&&k.ie&&(k.ie<9||document.documentMode&&document.documentMode<9)?i.onreadystatechange=function(){/loaded|complete/.test(i.readyState)&&(i.onreadystatechange=null,d())}:h||f.cssLoad?(k.ie>=10?(i.onerror=function(){setTimeout(c,0)},i.onload=function(){setTimeout(d,0)}):(i.onerror=c,i.onload=d),!f.cssFail&&!h&&(l=setTimeout(c,b.timeout||3e3))):this._poll(b),this.nodes.push(i),g.parentNode.insertBefore(i,g)},_next:function(){this._pending||(this._queue.length?this._insert(this._queue.shift()):this._reqsWaiting||this._finish())},_poll:function(b){var f,g,h,i,j,k,c=this,d=c._pendingCSS,e=a.UA.webkit;if(!b||(d||(d=c._pendingCSS=[]),d.push(b),!c._pollTimer)){for(c._pollTimer=null,f=0;f=0;)if(k[h].href===i){d.splice(f,1),f-=1,c._progress(null,j);break}}else try{g=!!j.node.sheet.cssRules,d.splice(f,1),f-=1,c._progress(null,j)}catch(l){}d.length&&(c._pollTimer=setTimeout(function(){c._poll.call(c)},c.options.pollInterval))}},_progress:function(a,b){var c=this.options;a&&(b.error=a,this.errors.push({error:a,request:b})),b.node._yuiget_finished=b.finished=!0,c.onProgress&&c.onProgress.call(c.context||this,this._getEventData(b)),b.autopurge&&(e._autoPurge(this.options.purgethreshold),e._purgeNodes.push(b.node)),this._pending===b&&(this._pending=null),this._reqsWaiting-=1,this._next()}}},"3.10.1",{requires:["yui-base"]}),YUI.add("features",function(a){var c={};a.mix(a.namespace("Features"),{tests:c,add:function(a,b,d){c[a]=c[a]||{},c[a][b]=d},all:function(b,d){var e=c[b],f=[];return e&&a.Object.each(e,function(c,e){f.push(e+":"+(a.Features.test(b,e,d)?1:0))}),f.length?f.join(";"):""},test:function(b,d,e){e=e||[];var f,g,h,i=c[b],j=i&&i[d];return!j||(f=j.result,a.Lang.isUndefined(f)&&(g=j.ua,g&&(f=a.UA[g]),h=j.test,h&&(!g||f)&&(f=h.apply(a,e)),j.result=f)),f}});var d=a.Features.add;d("load","0",{name:"app-transitions-native",test:function(a){var b=a.config.doc,c=b?b.documentElement:null;return c&&c.style?"MozTransition"in c.style||"WebkitTransition"in c.style||"transition"in c.style:!1},trigger:"app-transitions"}),d("load","1",{name:"autocomplete-list-keys",test:function(a){return!a.UA.ios&&!a.UA.android},trigger:"autocomplete-list"}),d("load","2",{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"}),d("load","3",{name:"dom-style-ie",test:function(a){var b=a.Features.test,c=a.Features.add,d=a.config.win,e=a.config.doc,f="documentElement",g=!1;return c("style","computedStyle",{test:function(){return d&&"getComputedStyle"in d}}),c("style","opacity",{test:function(){return e&&"opacity"in e[f].style}}),g=!b("style","opacity")&&!b("style","computedStyle")},trigger:"dom-style"}),d("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),d("load","5",{name:"event-base-ie",test:function(a){var b=a.config.doc&&a.config.doc.implementation;return b&&!b.hasFeature("Events","2.0")},trigger:"node-base"}),d("load","6",{name:"graphics-canvas",test:function(a){var b=a.config.doc,c=a.config.defaultGraphicEngine&&"canvas"==a.config.defaultGraphicEngine,d=b&&b.createElement("canvas"),e=b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!e||c)&&d&&d.getContext&&d.getContext("2d")},trigger:"graphics"}),d("load","7",{name:"graphics-canvas-default",test:function(a){var b=a.config.doc,c=a.config.defaultGraphicEngine&&"canvas"==a.config.defaultGraphicEngine,d=b&&b.createElement("canvas"),e=b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!e||c)&&d&&d.getContext&&d.getContext("2d")},trigger:"graphics"}),d("load","8",{name:"graphics-svg",test:function(a){var b=a.config.doc,c=!a.config.defaultGraphicEngine||"canvas"!=a.config.defaultGraphicEngine,d=b&&b.createElement("canvas"),e=b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return e&&(c||!d)},trigger:"graphics"}),d("load","9",{name:"graphics-svg-default",test:function(a){var b=a.config.doc,c=!a.config.defaultGraphicEngine||"canvas"!=a.config.defaultGraphicEngine,d=b&&b.createElement("canvas"),e=b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return e&&(c||!d)},trigger:"graphics"}),d("load","10",{name:"graphics-vml",test:function(a){var b=a.config.doc,c=b&&b.createElement("canvas");return!(!b||b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")||c&&c.getContext&&c.getContext("2d"))},trigger:"graphics"}),d("load","11",{name:"graphics-vml-default",test:function(a){var b=a.config.doc,c=b&&b.createElement("canvas");return!(!b||b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")||c&&c.getContext&&c.getContext("2d")) },trigger:"graphics"}),d("load","12",{name:"history-hash-ie",test:function(a){var b=a.config.doc&&a.config.doc.documentMode;return a.UA.ie&&(!("onhashchange"in a.config.win)||!b||8>b)},trigger:"history-hash"}),d("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),d("load","14",{name:"json-parse-shim",test:function(a){function b(a,b){return"ok"===a?!0:b}var c=a.config.global.JSON,d="[object JSON]"===Object.prototype.toString.call(c)&&c,e=a.config.useNativeJSONParse!==!1&&!!d;if(e)try{e=d.parse('{"ok":false}',b).ok}catch(f){e=!1}return!e},trigger:"json-parse"}),d("load","15",{name:"json-stringify-shim",test:function(a){var b=a.config.global.JSON,c="[object JSON]"===Object.prototype.toString.call(b)&&b,d=a.config.useNativeJSONStringify!==!1&&!!c;if(d)try{d="0"===c.stringify(0)}catch(e){d=!1}return!d},trigger:"json-stringify"}),d("load","16",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),d("load","17",{name:"selector-css2",test:function(a){var b=a.config.doc,c=b&&!("querySelectorAll"in b);return c},trigger:"selector"}),d("load","18",{name:"transition-timer",test:function(a){var b=a.config.doc,c=b?b.documentElement:null,d=!0;return c&&c.style&&(d=!("MozTransition"in c.style||"WebkitTransition"in c.style||"transition"in c.style)),d},trigger:"transition"}),d("load","19",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"}),d("load","20",{name:"yql-jsonp",test:function(a){return!a.UA.nodejs&&!a.UA.winjs},trigger:"yql",when:"after"}),d("load","21",{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}),d("load","22",{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"})},"3.10.1",{requires:["yui-base"]}),YUI.add("intl-base",function(a){var c=/[, ]/;a.mix(a.namespace("Intl"),{lookupBestLang:function(b,d){function e(a){var b;for(b=0;b0;){if(h=e(g))return h;if(i=g.lastIndexOf("-"),!(i>=0))break;g=g.substring(0,i),i>=2&&"-"===g.charAt(i-2)&&(g=g.substring(0,i-2))}return""}})},"3.10.1",{requires:["yui-base"]}),YUI.add("yui-log",function(a){var c=a,d="yui:log",e="undefined",f={debug:1,info:2,warn:4,error:8};c.log=function(a,b,g,h){var i,j,k,l,m,n,o=c,p=o.config,q=o.fire?o:YUI.Env.globalEvents;return p.debug&&(g=g||"","undefined"!=typeof g&&(j=p.logExclude,k=p.logInclude,!k||g in k?k&&g in k?i=!k[g]:j&&g in j&&(i=j[g]):i=1,o.config.logLevel=o.config.logLevel||"debug",n=f[o.config.logLevel.toLowerCase()],b in f&&f[b]-1,c.comboSep="&",c.maxURLLength=e,c.ignoreRegistered=b.ignoreRegistered,c.root=a.Env.meta.root,c.timeout=0,c.forceMap={},c.allowRollup=!1,c.filters={},c.required={},c.patterns={},c.moduleInfo={},c.groups=a.merge(a.Env.meta.groups),c.skin=a.merge(a.Env.meta.skin),c.conditions={},c.config=b,c._internal=!0,c._populateCache(),c.loaded=g[l],c.async=!0,c._inspectPage(),c._internal=!1,c._config(b),c.forceMap=c.force?a.Array.hash(c.force):{},c.testresults=null,a.config.tests&&(c.testresults=a.config.tests),c.sorted=[],c.dirty=!0,c.inserted={},c.skipped={},c.tested={},c.ignoreRegistered&&c._resetModules()},a.Loader.prototype={_populateCache:function(){var e,b=this,c=r.modules,d=f._renderedMods;if(d&&!b.ignoreRegistered){for(e in d)d.hasOwnProperty(e)&&(b.moduleInfo[e]=a.merge(d[e]));d=f._conditions;for(e in d)d.hasOwnProperty(e)&&(b.conditions[e]=a.merge(d[e]))}else for(e in c)c.hasOwnProperty(e)&&b.addModule(c[e],e)},_resetModules:function(){var b,c,d,e,f,a=this;for(b in a.moduleInfo)if(a.moduleInfo.hasOwnProperty(b)){if(d=a.moduleInfo[b],e=d.name,f=YUI.Env.mods[e]?YUI.Env.mods[e].details:null,f&&(a.moduleInfo[e]._reset=!0,a.moduleInfo[e].requires=f.requires||[],a.moduleInfo[e].optional=f.optional||[],a.moduleInfo[e].supersedes=f.supercedes||[]),d.defaults)for(c in d.defaults)d.defaults.hasOwnProperty(c)&&d[c]&&(d[c]=d.defaults[c]);delete d.langCache,delete d.skinCache,d.skinnable&&a._addSkin(a.skin.defaultSkin,d.name)}},REGEX_CSS:/\.css(?:[?;].*)?$/i,FILTER_DEFS:{RAW:{searchExp:"-min\\.js",replaceStr:".js"},DEBUG:{searchExp:"-min\\.js",replaceStr:"-debug.js"},COVERAGE:{searchExp:"-min\\.js",replaceStr:"-coverage.js"}},_inspectPage:function(){var b,c,d,e,f,a=this;for(f in a.moduleInfo)a.moduleInfo.hasOwnProperty(f)&&(b=a.moduleInfo[f],b.type&&b.type===h&&a.isCSSLoaded(b.name)&&(a.loaded[f]=!0));for(f in u)u.hasOwnProperty(f)&&(b=u[f],b.details&&(c=a.moduleInfo[b.name],d=b.details.requires,e=c&&c.requires,c?!c._inspected&&d&&e.length!==d.length&&delete c.expanded:c=a.addModule(b.details,f),c._inspected=!0))},_requires:function(a,b){var c,d,e,f,g=this.moduleInfo,i=g[a],j=g[b];if(!i||!j)return!1;if(d=i.expanded_map,e=i.after_map,e&&b in e)return!0;if(e=j.after_map,e&&a in e)return!1;if(f=g[b]&&g[b].supersedes)for(c=0;cg?g:Math.min(g-1,4))}if(o=b.plugins)for(e in o)o.hasOwnProperty(e)&&(q=o[e],q.pkg=c,q.path=q.path||w(c,e,b.type),q.requires=q.requires||[],q.group=b.group,this.addModule(q,e),b.skinnable&&this._addSkin(this.skin.defaultSkin,e,c));if(b.condition)for(j=b.condition.trigger,YUI.Env.aliases[j]&&(j=YUI.Env.aliases[j]),a.Lang.isArray(j)||(j=[j]),e=0;ee;e++)if(c=a.getModule(b.use[e]),c&&c.use)for(h=c.use.length,f=0;h>f;f++)i[c.use[f]]=!0;else i[b.use[e]]=!0;a.required=i}},filterRequires:function(b){if(b){a.Lang.isArray(b)||(b=[b]),b=a.Array(b);var d,e,f,g,c=[];for(d=0;d-1&&(B=c);if(A&&(A[l]||B&&A[B]))for(C=l,A[B]&&(C=B),c=0;c-1},getModule:function(b){if(!b)return null;var c,d,e,f=this.moduleInfo[b],g=this.patterns;if(!f||f&&f.ext)for(e in g)if(g.hasOwnProperty(e)&&(c=g[e],c.test||(c.test=this._patternTest),c.test(b,e))){d=c;break}return f?d&&f&&d.configFn&&!f.configFn&&(f.configFn=d.configFn,f.configFn(f)):d&&(c.action?c.action.call(this,b,e):(f=this.addModule(a.merge(d),b),d.configFn&&(f.configFn=d.configFn),f.temp=!0)),f},_rollup:function(){},_reduce:function(a){a=a||this.required;var b,c,d,e,f=this.loadType,g=this.ignore?p.hash(this.ignore):!1;for(b in a)if(a.hasOwnProperty(b)&&(e=this.getModule(b),((this.loaded[b]||u[b])&&!this.forceMap[b]&&!this.ignoreRegistered||f&&e&&e.type!==f)&&delete a[b],g&&g[b]&&delete a[b],d=e&&e.supersedes,d))for(c=0;cd;d++)c.push(a.errors[d].error);c=c.join(","),b&&b.call(this.context,{msg:c,data:this.data,success:!1}),this._finish(c,!1)},_onTimeout:function(a){var b=this.onTimeout;b&&b.call(this.context,{msg:"timeout",data:this.data,success:!1,transaction:a})},_sort:function(){for(var d,e,f,g,h,i,j,a=n.keys(this.required),b={},c=0;;){for(d=a.length,i=!1,g=c;d>g;g++){for(e=a[g],h=g+1;d>h;h++)if(j=e+a[h],!b[j]&&this._requires(e,a[h])){f=a.splice(h,1),a.splice(g,0,f[0]),b[j]=!0,i=!0;break}if(i)break;c++}if(!i)break}this.sorted=a},_insert:function(b,c,d,e){b&&this._config(b);var m,n,f=this.resolve(!e),g=this,j=0,k=0,l={};return g._refetch=[],d&&(f[d===i?h:i]=[]),g.fetchCSS||(f.css=[]),f.js.length&&j++,f.css.length&&j++,n=function(b){k++;var h,i,n,c={},d=0,e=0,f="";if(b&&b.errors)for(d=0;d0&&(q.running=!0,q.next()())},insert:function(b,c,d){var e=this,f=a.merge(this);delete f.require,delete f.dirty,q.add(function(){e._insert(f,b,c,d)}),this._continue()},loadNext:function(){},_filter:function(a,b,c){var d=this.filter,e=b&&b in this.filters,f=e&&this.filters[b],g=c||(this.moduleInfo[b]?this.moduleInfo[b].group:null);return g&&this.groups[g]&&this.groups[g].filter&&(f=this.groups[g].filter,e=!0),a&&(e&&(d=t.isString(f)?this.FILTER_DEFS[f.toUpperCase()]||null:f),d&&(a=a.replace(new RegExp(d.searchExp,"g"),d.replaceStr))),a},_url:function(a,b,c){return this._filter((c||this.base||"")+a,b)},resolve:function(a,b){var d,f,g,j,l,m,n,o,p,q,r,s,u,v,x,y,B,C,G,w=[],z={},A=this,D=A.ignoreRegistered?{}:A.inserted,E={js:[],jsMods:[],css:[],cssMods:[]},F=A.loadType||"js";for((A.skin.overrides||A.skin.defaultSkin!==k||A.ignoreRegistered)&&A._resetModules(),a&&A.calculate(),b=b||A.sorted,G=function(a){a&&(l=a.group&&A.groups[a.group]||c,l.async===!1&&(a.async=l.async),j=a.fullpath?A._filter(a.fullpath,b[f]):A._url(a.path,b[f],l.base||a.base),(a.attributes||a.async===!1)&&(j={url:j,async:a.async},a.attributes&&(j.attributes=a.attributes)),E[a.type].push(j),E[a.type+"Mods"].push(a))},d=b.length,s=A.comboBase,j=s,q={},f=0;d>f;f++){if(p=s,g=A.getModule(b[f]),m=g&&g.group,l=A.groups[m],m&&l){if(!l.combine||g.fullpath){G(g);continue}g.combine=!0,l.comboBase&&(p=l.comboBase),"root"in l&&t.isValue(l.root)&&(g.root=l.root),g.comboSep=l.comboSep||A.comboSep,g.maxURLLength=l.maxURLLength||A.maxURLLength}else if(!A.combine){G(g);continue}q[p]=q[p]||[],q[p].push(g)}for(n in q)if(q.hasOwnProperty(n)&&(z[n]=z[n]||{js:[],jsMods:[],css:[],cssMods:[]},j=n,r=q[n],d=r.length,d))for(f=0;d>f;f++)D[r[f]]||(g=r[f],!g||!g.combine&&g.ext?r[f]&&G(r[f]):(z[n].comboSep=g.comboSep,z[n].group=g.group,z[n].maxURLLength=g.maxURLLength,o=(t.isValue(g.root)?g.root:A.root)+(g.path||g.fullpath),o=A._filter(o,g.name),z[n][g.type].push(o),z[n][g.type+"Mods"].push(g)));for(n in z)if(z.hasOwnProperty(n)){u=n,B=z[u].comboSep||A.comboSep,C=z[u].maxURLLength||A.maxURLLength;for(F in z[u])if(F===i||F===h){if(v=z[u][F],r=z[u][F+"Mods"],d=v.length,x=u+v.join(B),y=x.length,C<=u.length&&(C=e),d)if(y>C){for(w=[],b=0;d>b;b++)w.push(v[b]),x=u+w.join(B),x.length>C&&(g=w.pop(),x=u+w.join(B),E[F].push(A._filter(x,null,z[u].group)),w=[],g&&w.push(g));w.length&&(x=u+w.join(B),E[F].push(A._filter(x,null,z[u].group)))}else E[F].push(A._filter(x,null,z[u].group));E[F+"Mods"]=E[F+"Mods"].concat(r)}}return z=null,E},load:function(a){if(a){var b=this,c=b.resolve(!0);b.data=c,b.onEnd=function(){a.apply(b.context||b,arguments)},b.insert()}}}},"3.10.1",{requires:["get","features"]}),YUI.add("loader-rollup",function(a){a.Loader.prototype._rollup=function(){var a,b,c,d,f,h,i,j,e=this.required,g=this.moduleInfo;if(this.dirty||!this.rollups){this.rollups={};for(a in g)g.hasOwnProperty(a)&&(c=this.getModule(a),c&&c.rollup&&(this.rollups[a]=c))}for(;;){h=!1;for(a in this.rollups)if(this.rollups.hasOwnProperty(a)&&!e[a]&&(!this.loaded[a]||this.forceMap[a])){if(c=this.getModule(a),d=c.supersedes||[],f=!1,!c.rollup)continue;for(i=0,b=0;b=c.rollup))break}f&&(e[a]=!0,h=!0,this.getRequires(c))}if(!h)break}}},"3.10.1",{requires:["loader-base"]}),YUI.add("loader-yui3",function(a){YUI.Env[a.version].modules=YUI.Env[a.version].modules||{},a.mix(YUI.Env[a.version].modules,{"align-plugin":{requires:["node-screen","node-pluginhost"]},anim:{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{requires:["base-base","node-style"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{requires:["anim-base"]},"anim-node-plugin":{requires:["node-pluginhost","anim-base"]},"anim-scroll":{requires:["anim-base"]},"anim-shape":{requires:["anim-base","anim-easing","anim-color","matrix"]},"anim-shape-transform":{use:["anim-shape"]},"anim-xy":{requires:["anim-base","node-screen"]},app:{use:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"]},"app-base":{requires:["classnamemanager","pjax-base","router","view"]},"app-content":{requires:["app-base","pjax-content"]},"app-transitions":{requires:["app-base"]},"app-transitions-css":{type:"css"},"app-transitions-native":{condition:{name:"app-transitions-native",test:function(a){var b=a.config.doc,c=b?b.documentElement:null;return c&&c.style?"MozTransition"in c.style||"WebkitTransition"in c.style||"transition"in c.style:!1},trigger:"app-transitions"},requires:["app-transitions","app-transitions-css","parallel","transition"]},"array-extras":{requires:["yui-base"]},"array-invoke":{requires:["yui-base"]},arraylist:{requires:["yui-base"]},"arraylist-add":{requires:["arraylist"]},"arraylist-filter":{requires:["arraylist"]},arraysort:{requires:["yui-base"]},"async-queue":{requires:["event-custom"]},attribute:{use:["attribute-base","attribute-complex"]},"attribute-base":{requires:["attribute-core","attribute-observable","attribute-extras"]},"attribute-complex":{requires:["attribute-base"]},"attribute-core":{requires:["oop"]},"attribute-events":{use:["attribute-observable"]},"attribute-extras":{requires:["oop"]},"attribute-observable":{requires:["event-custom"]},autocomplete:{use:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{requires:["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{requires:["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{requires:["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{requires:["array-extras","highlight-accentfold"]},"autocomplete-list":{after:["autocomplete-sources"],lang:["en","es","it"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0},"autocomplete-list-keys":{condition:{name:"autocomplete-list-keys",test:function(a){return!a.UA.ios&&!a.UA.android},trigger:"autocomplete-list"},requires:["autocomplete-list","base-build"]},"autocomplete-plugin":{requires:["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]},axes:{use:["axis-numeric","axis-category","axis-time","axis-stacked"]},"axes-base":{use:["axis-numeric-base","axis-category-base","axis-time-base","axis-stacked-base"]},axis:{requires:["dom","widget","widget-position","widget-stack","graphics","axis-base"]},"axis-base":{requires:["classnamemanager","datatype-number","datatype-date","base","event-custom"]},"axis-category":{requires:["axis","axis-category-base"]},"axis-category-base":{requires:["axis-base"]},"axis-numeric":{requires:["axis","axis-numeric-base"]},"axis-numeric-base":{requires:["axis-base"]},"axis-stacked":{requires:["axis-numeric","axis-stacked-base"]},"axis-stacked-base":{requires:["axis-numeric-base"]},"axis-time":{requires:["axis","axis-time-base"]},"axis-time-base":{requires:["axis-base"]},base:{use:["base-base","base-pluginhost","base-build"]},"base-base":{requires:["attribute-base","base-core","base-observable"]},"base-build":{requires:["base-base"]},"base-core":{requires:["attribute-core"]},"base-observable":{requires:["attribute-observable"]},"base-pluginhost":{requires:["base-base","pluginhost"]},button:{requires:["button-core","cssbutton","widget"]},"button-core":{requires:["attribute-core","classnamemanager","node-base"]},"button-group":{requires:["button-plugin","cssbutton","widget"]},"button-plugin":{requires:["button-core","cssbutton","node-pluginhost"]},cache:{use:["cache-base","cache-offline","cache-plugin"]},"cache-base":{requires:["base"]},"cache-offline":{requires:["cache-base","json"]},"cache-plugin":{requires:["plugin","cache-base"]},calendar:{lang:["de","en","es","es-AR","fr","it","ja","nb-NO","nl","pt-BR","ru","zh-HANT-TW"],requires:["calendar-base","calendarnavigator"],skinnable:!0},"calendar-base":{lang:["de","en","es","es-AR","fr","it","ja","nb-NO","nl","pt-BR","ru","zh-HANT-TW"],requires:["widget","datatype-date","datatype-date-math","cssgrids"],skinnable:!0},calendarnavigator:{requires:["plugin","classnamemanager","datatype-date","node"],skinnable:!0},charts:{use:["charts-base"]},"charts-base":{requires:["dom","event-mouseenter","event-touch","graphics-group","axes","series-pie","series-line","series-marker","series-area","series-spline","series-column","series-bar","series-areaspline","series-combo","series-combospline","series-line-stacked","series-marker-stacked","series-area-stacked","series-spline-stacked","series-column-stacked","series-bar-stacked","series-areaspline-stacked","series-combo-stacked","series-combospline-stacked"]},"charts-legend":{requires:["charts-base"]},classnamemanager:{requires:["yui-base"]},"clickable-rail":{requires:["slider-base"]},collection:{use:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},color:{use:["color-base","color-hsl","color-harmony"]},"color-base":{requires:["yui-base"]},"color-harmony":{requires:["color-hsl"]},"color-hsl":{requires:["color-base"]},"color-hsv":{requires:["color-base"]},console:{lang:["en","es","it","ja"],requires:["yui-log","widget"],skinnable:!0},"console-filters":{requires:["plugin","console"],skinnable:!0},controller:{use:["router"]},cookie:{requires:["yui-base"]},"createlink-base":{requires:["editor-base"]},cssbase:{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},"cssbase-context":{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},cssbutton:{type:"css"},cssfonts:{type:"css"},"cssfonts-context":{type:"css"},cssgrids:{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-base":{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-responsive":{optional:["cssreset","cssfonts"],requires:["cssgrids","cssgrids-responsive-base"],type:"css"},"cssgrids-units":{optional:["cssreset","cssfonts"],requires:["cssgrids-base"],type:"css"},cssnormalize:{type:"css"},"cssnormalize-context":{type:"css"},cssreset:{type:"css"},"cssreset-context":{type:"css"},dataschema:{use:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{requires:["dataschema-base"]},"dataschema-base":{requires:["base"]},"dataschema-json":{requires:["dataschema-base","json"]},"dataschema-text":{requires:["dataschema-base"]},"dataschema-xml":{requires:["dataschema-base"]},datasource:{use:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{requires:["datasource-local","plugin","dataschema-array"]},"datasource-cache":{requires:["datasource-local","plugin","cache-base"]},"datasource-function":{requires:["datasource-local"]},"datasource-get":{requires:["datasource-local","get"]},"datasource-io":{requires:["datasource-local","io-base"]},"datasource-jsonschema":{requires:["datasource-local","plugin","dataschema-json"]},"datasource-local":{requires:["base"]},"datasource-polling":{requires:["datasource-local"]},"datasource-textschema":{requires:["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{requires:["datasource-local","plugin","datatype-xml","dataschema-xml"]},datatable:{use:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"]},"datatable-base":{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0},"datatable-body":{requires:["datatable-core","view","classnamemanager"]},"datatable-column-widths":{requires:["datatable-base"]},"datatable-core":{requires:["escape","model-list","node-event-delegate"]},"datatable-datasource":{requires:["datatable-base","plugin","datasource-local"]},"datatable-formatters":{requires:["datatable-body","datatype-number-format","datatype-date-format","escape"]},"datatable-head":{requires:["datatable-core","view","classnamemanager"]},"datatable-message":{lang:["en","fr","es","it"],requires:["datatable-base"],skinnable:!0},"datatable-mutable":{requires:["datatable-base"]},"datatable-scroll":{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0},"datatable-sort":{lang:["en","fr","es"],requires:["datatable-base"],skinnable:!0},"datatable-table":{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]},datatype:{use:["datatype-date","datatype-number","datatype-xml"]},"datatype-date":{use:["datatype-date-parse","datatype-date-format","datatype-date-math"]},"datatype-date-format":{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{requires:["yui-base"]},"datatype-date-parse":{},"datatype-number":{use:["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{},"datatype-xml":{use:["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},dd:{use:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{requires:["dd-drag"]},"dd-ddm":{requires:["dd-ddm-base","event-resize"]},"dd-ddm-base":{requires:["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-delegate":{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{requires:["dd-ddm-base"]},"dd-drop":{requires:["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{requires:["dd-drop"]},"dd-gestures":{condition:{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"},requires:["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]},"dd-proxy":{requires:["dd-drag"]},"dd-scroll":{requires:["dd-drag"]},dial:{lang:["en","es"],requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],skinnable:!0},dom:{use:["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{requires:["dom-core"]},"dom-core":{requires:["oop","features"]},"dom-deprecated":{requires:["dom-base"]},"dom-screen":{requires:["dom-base","dom-style"]},"dom-style":{requires:["dom-base"]},"dom-style-ie":{condition:{name:"dom-style-ie",test:function(a){var b=a.Features.test,c=a.Features.add,d=a.config.win,e=a.config.doc,f="documentElement",g=!1; return c("style","computedStyle",{test:function(){return d&&"getComputedStyle"in d}}),c("style","opacity",{test:function(){return e&&"opacity"in e[f].style}}),g=!b("style","opacity")&&!b("style","computedStyle")},trigger:"dom-style"},requires:["dom-style"]},dump:{requires:["yui-base"]},editor:{use:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{requires:["base","frame","node","exec-command","editor-selection"]},"editor-bidi":{requires:["editor-base"]},"editor-br":{requires:["editor-base"]},"editor-lists":{requires:["editor-base"]},"editor-para":{requires:["editor-para-base"]},"editor-para-base":{requires:["editor-base"]},"editor-para-ie":{condition:{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"},requires:["editor-para-base"]},"editor-selection":{requires:["node"]},"editor-tab":{requires:["editor-base"]},escape:{requires:["yui-base"]},event:{after:["node-base"],use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"]},"event-base":{after:["node-base"],requires:["event-custom-base"]},"event-base-ie":{after:["event-base"],condition:{name:"event-base-ie",test:function(a){var b=a.config.doc&&a.config.doc.implementation;return b&&!b.hasFeature("Events","2.0")},trigger:"node-base"},requires:["node-base"]},"event-contextmenu":{requires:["event-synthetic","dom-screen"]},"event-custom":{use:["event-custom-base","event-custom-complex"]},"event-custom-base":{requires:["oop"]},"event-custom-complex":{requires:["event-custom-base"]},"event-delegate":{requires:["node-base"]},"event-flick":{requires:["node-base","event-touch","event-synthetic"]},"event-focus":{requires:["event-synthetic"]},"event-gestures":{use:["event-flick","event-move"]},"event-hover":{requires:["event-mouseenter"]},"event-key":{requires:["event-synthetic"]},"event-mouseenter":{requires:["event-synthetic"]},"event-mousewheel":{requires:["node-base"]},"event-move":{requires:["node-base","event-touch","event-synthetic"]},"event-outside":{requires:["event-synthetic"]},"event-resize":{requires:["node-base","event-synthetic"]},"event-simulate":{requires:["event-base"]},"event-synthetic":{requires:["node-base","event-custom-complex"]},"event-tap":{requires:["node-base","event-base","event-touch","event-synthetic"]},"event-touch":{requires:["node-base"]},"event-valuechange":{requires:["event-focus","event-synthetic"]},"exec-command":{requires:["frame"]},features:{requires:["yui-base"]},file:{requires:["file-flash","file-html5"]},"file-flash":{requires:["base"]},"file-html5":{requires:["base"]},frame:{requires:["base","node","selector-css3","yui-throttle"]},"gesture-simulate":{requires:["async-queue","event-simulate","node-screen"]},get:{requires:["yui-base"]},graphics:{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]},"graphics-canvas":{condition:{name:"graphics-canvas",test:function(a){var b=a.config.doc,c=a.config.defaultGraphicEngine&&"canvas"==a.config.defaultGraphicEngine,d=b&&b.createElement("canvas"),e=b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!e||c)&&d&&d.getContext&&d.getContext("2d")},trigger:"graphics"},requires:["graphics"]},"graphics-canvas-default":{condition:{name:"graphics-canvas-default",test:function(a){var b=a.config.doc,c=a.config.defaultGraphicEngine&&"canvas"==a.config.defaultGraphicEngine,d=b&&b.createElement("canvas"),e=b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!e||c)&&d&&d.getContext&&d.getContext("2d")},trigger:"graphics"}},"graphics-group":{requires:["graphics"]},"graphics-svg":{condition:{name:"graphics-svg",test:function(a){var b=a.config.doc,c=!a.config.defaultGraphicEngine||"canvas"!=a.config.defaultGraphicEngine,d=b&&b.createElement("canvas"),e=b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return e&&(c||!d)},trigger:"graphics"},requires:["graphics"]},"graphics-svg-default":{condition:{name:"graphics-svg-default",test:function(a){var b=a.config.doc,c=!a.config.defaultGraphicEngine||"canvas"!=a.config.defaultGraphicEngine,d=b&&b.createElement("canvas"),e=b&&b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return e&&(c||!d)},trigger:"graphics"}},"graphics-vml":{condition:{name:"graphics-vml",test:function(a){var b=a.config.doc,c=b&&b.createElement("canvas");return!(!b||b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")||c&&c.getContext&&c.getContext("2d"))},trigger:"graphics"},requires:["graphics"]},"graphics-vml-default":{condition:{name:"graphics-vml-default",test:function(a){var b=a.config.doc,c=b&&b.createElement("canvas");return!(!b||b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")||c&&c.getContext&&c.getContext("2d"))},trigger:"graphics"}},handlebars:{use:["handlebars-compiler"]},"handlebars-base":{requires:[]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-hash-ie","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(a){var b=a.config.doc&&a.config.doc.documentMode;return a.UA.ie&&(!("onhashchange"in a.config.win)||!b||8>b)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-parse-shim":{condition:{name:"json-parse-shim",test:function(a){function b(a,b){return"ok"===a?!0:b}var c=a.config.global.JSON,d="[object JSON]"===Object.prototype.toString.call(c)&&c,e=a.config.useNativeJSONParse!==!1&&!!d;if(e)try{e=d.parse('{"ok":false}',b).ok}catch(f){e=!1}return!e},trigger:"json-parse"},requires:["json-parse"]},"json-stringify":{requires:["yui-base"]},"json-stringify-shim":{condition:{name:"json-stringify-shim",test:function(a){var b=a.config.global.JSON,c="[object JSON]"===Object.prototype.toString.call(b)&&b,d=a.config.useNativeJSONStringify!==!1&&!!c;if(d)try{d="0"===c.stringify(0)}catch(e){d=!1}return!d},trigger:"json-stringify"},requires:["json-stringify"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core","dom-base"]},"node-core":{requires:["dom-core","selector"]},"node-deprecated":{requires:["node-base"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["base-build","dom-screen","event-resize","node-pluginhost","plugin"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},profiler:{requires:["yui-base"]},promise:{requires:["timers"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires:["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(a){var b=a.config.doc,c=b&&!("querySelectorAll"in b);return c},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"series-area":{requires:["series-cartesian","series-fill-util"]},"series-area-stacked":{requires:["series-stacked","series-area"]},"series-areaspline":{requires:["series-area","series-curve-util"]},"series-areaspline-stacked":{requires:["series-stacked","series-areaspline"]},"series-bar":{requires:["series-marker","series-histogram-base"]},"series-bar-stacked":{requires:["series-stacked","series-bar"]},"series-base":{requires:["graphics","axis-base"]},"series-candlestick":{requires:["series-range"]},"series-cartesian":{requires:["series-base"]},"series-column":{requires:["series-marker","series-histogram-base"]},"series-column-stacked":{requires:["series-stacked","series-column"]},"series-combo":{requires:["series-cartesian","series-line-util","series-plot-util","series-fill-util"]},"series-combo-stacked":{requires:["series-stacked","series-combo"]},"series-combospline":{requires:["series-combo","series-curve-util"]},"series-combospline-stacked":{requires:["series-combo-stacked","series-curve-util"]},"series-curve-util":{},"series-fill-util":{},"series-histogram-base":{requires:["series-cartesian","series-plot-util"]},"series-line":{requires:["series-cartesian","series-line-util"]},"series-line-stacked":{requires:["series-stacked","series-line"]},"series-line-util":{},"series-marker":{requires:["series-cartesian","series-plot-util"]},"series-marker-stacked":{requires:["series-stacked","series-marker"]},"series-ohlc":{requires:["series-range"]},"series-pie":{requires:["series-base","series-plot-util"]},"series-plot-util":{},"series-range":{requires:["series-cartesian"]},"series-spline":{requires:["series-line","series-curve-util"]},"series-spline-stacked":{requires:["series-stacked","series-spline"]},"series-stacked":{requires:["axis-stacked"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager"]},"tabview-plugin":{requires:["tabview-base"]},template:{use:["template-base","template-micro"]},"template-base":{requires:["yui-base"]},"template-micro":{requires:["escape"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test","array-extras"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},timers:{requires:["yui-base"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(a){var b=a.config.doc,c=b?b.documentElement:null,d=!0;return c&&c.style&&(d=!("MozTransition"in c.style||"WebkitTransition"in c.style||"transition"in c.style)),d},trigger:"transition"},requires:["transition"]},tree:{requires:["base-build","tree-node"]},"tree-labelable":{requires:["tree"]},"tree-lazy":{requires:["base-pluginhost","plugin","tree"]},"tree-node":{},"tree-openable":{requires:["tree"]},"tree-selectable":{requires:["tree"]},"tree-sortable":{requires:["tree"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-flash":{requires:["swf","widget","base","cssbutton","node","event-custom","file-flash","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-locale":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain":{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["oop"]},"yql-jsonp":{condition:{name:"yql-jsonp",test:function(a){return!a.UA.nodejs&&!a.UA.winjs},trigger:"yql",when:"after"},requires:["jsonp","jsonp-url"]},"yql-nodejs":{condition:{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}},"yql-winjs":{condition:{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"}},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}}),YUI.Env[a.version].md5="12bd02dfcbc39e6eebb7a8d96ada727c"},"3.10.1",{requires:["loader-base"]}),YUI.add("yui",function(){},"3.10.1",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}),YUI().use("yuidoc-meta","api-list","history-hash","node-screen","node-style","pjax",function(a){var e,f,g,h,b=a.config.win,c=b.localStorage,d=a.one("#bd");a.getLocation().protocol.match(/^https?\:/)||(a.Router.html5=!1),f=a.Pjax.defaultRoute.concat(function(a,b,c){prettyPrint(),d.removeClass("loading"),c()}),e=new a.Pjax({container:"#docs-main",contentSelector:"#docs-main > .content",linkSelector:"#bd a",titleSelector:"#xhr-title",navigateOnHash:!0,root:"/",routes:[{path:"/(index.html)?",callbacks:f},{path:"/classes/:class.html*",callbacks:[f,"handleClasses"]},{path:"/files/*file",callbacks:[f,"handleFiles"]},{path:"/modules/:module.html*",callbacks:f}]}),e.checkVisibility=function(b){if(b||(b=h),b){var d,c=b.get("panelNode");d=c.all(".item,.index-item").some(function(a){return"none"!==a.getComputedStyle("display")?!0:void 0}),c.all(".no-visible-items").remove(),d||(a.one("#index .index-item")?c.append('

Some items are not shown due to the current visibility settings. Use the checkboxes at the upper right of this page to change the visibility settings.

'):c.append('

This class doesn\'t provide any methods, properties, attributes, or events.

')),a.all(".index-section").each(function(a){var b=0,c=0;a.all(".index-item").each(function(a){b+=1,"none"!==a.getComputedStyle("display")&&(c+=1)}),a.toggleClass("hidden",!c),a.toggleClass("no-columns",4>c)})}},e.initClassTabView=function(){a.all("#classdocs .api-class-tab").size()&&(g&&(g.destroy(),h=null),g=new a.TabView({srcNode:"#classdocs",on:{selectionChange:e.onTabSelectionChange}}),e.updateTabState(),g.render())},e.initLineNumbers=function(){var d,f,a=b.location.hash.substring(1),c=e.get("container");c.all(".linenums>li").each(function(a,b){a.set("id","l"+(b+1)),a.addClass("file-line"),d=!0}),d&&/^l\d+$/.test(a)&&(f=c.getById(a))&&b.scroll(0,f.getY())},e.initRoot=function(){var d,f,g,a=/^(?:classes|files|modules)$/,b=e._getPathRoot().split("/"),c=[];for(d=0,f=b.length;f>d;d+=1){if(g=b[d],g.match(a)){c.push("");break}c.push(g)}e.set("root",c.join("/"))},e.updateTabState=function(d){function l(){i.hasClass("protected")&&(a.one("#api-show-protected").set("checked",!0),e.updateVisibility()),i.hasClass("private")&&(a.one("#api-show-private").set("checked",!0),e.updateVisibility()),setTimeout(function(){var c=a.one("#classdocs").getById(f);b.scrollTo(0,c.getY()-70)},1)}var h,i,j,k,f=b.location.hash.substring(1);g&&(h="hashchange"!==d||f?c?c.getItem("tab_"+e.getPath())||"index":"index":"index",f&&(i=a.one("#classdocs").getById(f))?((k=i.ancestor(".api-class-tabpanel",!0))&&(j=a.one("#classdocs .api-class-tab."+k.get("id")))&&(g.get("rendered")?a.Widget.getByNode(j).set("selected",1):j.addClass("yui3-tab-selected")),i&&(g.get("rendered")?l():g.once("renderedChange",l))):(j=a.one("#classdocs .api-class-tab."+h),g.get("rendered")?a.Widget.getByNode(j).set("selected",1):j.addClass("yui3-tab-selected")))},e.updateVisibility=function(){var b=e.get("container");b.toggleClass("hide-inherited",!a.one("#api-show-inherited").get("checked")),b.toggleClass("show-deprecated",a.one("#api-show-deprecated").get("checked")),b.toggleClass("show-protected",a.one("#api-show-protected").get("checked")),b.toggleClass("show-private",a.one("#api-show-private").get("checked")),e.checkVisibility()},e.handleClasses=function(a,b,c){var d=b.ioResponse.status;(!d||d>=200&&300>d)&&e.initClassTabView(),c()},e.handleFiles=function(a,b,c){var d=b.ioResponse.status;(!d||d>=200&&300>d)&&e.initLineNumbers(),c()},e.onNavigate=function(a){var g,c=a.hash,f=a.originEvent&&a.originEvent.target;return c?(g=f&&f.ancestor(".yui3-tab",!0),c===b.location.hash?e.updateTabState("hashchange"):g||(b.location.hash=c),a.preventDefault(),void 0):(this.set("scrollToTop",!a.url.match(/#.+$/)),d.addClass("loading"),void 0)},e.onOptionClick=function(){e.updateVisibility()},e.onTabSelectionChange=function(a){var b=a.newVal,d=b.get("contentBox").getAttribute("href").substring(1);h=b,a.prevVal&&c&&c.setItem("tab_"+e.getPath(),d),e.checkVisibility(b)},e.on("navigate",e.onNavigate),e.initRoot(),e.upgrade(),e.initClassTabView(),e.initLineNumbers(),e.updateVisibility(),a.APIList.rootPath=e.get("root"),a.one("#api-options").delegate("click",e.onOptionClick,"input"),a.on("hashchange",function(){e.updateTabState("hashchange")},b)}),YUI.add("api-search",function(a){var b=a.Lang,c=a.Node,d=a.Array;a.APISearch=a.Base.create("apiSearch",a.Base,[a.AutoCompleteBase],{RESULT_TEMPLATE:'
  • {name}

    {resultType}
    {description}
    {class}
  • ',initializer:function(){this._bindUIACBase(),this._syncUIACBase()},_apiResultFilter:function(a,b){return d.filter(b,function(a){return"component"===a.raw.resultType?!1:a})},_apiResultFormatter:function(e,f){return d.map(f,function(d){var e=a.merge(d.raw),f=e.description||"";return f=c.create("
    "+f+"
    ").get("text"),f=f.length>65?a.Escape.html(f.substr(0,65))+" …":a.Escape.html(f),e["class"]||(e["class"]=""),e.description=f,e.name=d.highlighted,b.sub(this.RESULT_TEMPLATE,e)},this)},_apiTextLocator:function(a){return a.displayName||a.name}},{ATTRS:{resultFormatter:{valueFn:function(){return this._apiResultFormatter}},resultFilters:{valueFn:function(){return this._apiResultFilter}},resultHighlighter:{value:"phraseMatch"},resultListLocator:{value:"data.results"},resultTextLocator:{valueFn:function(){return this._apiTextLocator}},source:{value:"/api/v1/search?q={query}&count={maxResults}"}}})},"3.4.0",{requires:["autocomplete-base","autocomplete-highlighters","autocomplete-sources","escape"]}),YUI.add("api-list",function(a){function o(){return"classes"===j.get("queryType")?e:g}function p(e){var f=a.one(a.config.doc.createDocumentFragment()),g=o(),h=j.get("queryType"),i="classes"===h?"class":"module";e.results.length?c.each(e.results,function(a){f.append(b.sub(n,{rootPath:d.rootPath,displayName:j.getDisplayName(a.highlighted),name:a.text,typePlural:h,typeSingular:i}))}):f.append('
  • No '+h+" found."+"
  • "),g.empty(!0),g.append(f),m.refresh()}function q(){m.refresh()}function r(a){var b=a.target;b.test("input,select,textarea")||b.get("isContentEditable")||(a.preventDefault(),f.focus(),m.refresh())}function s(b){var d=a.one(a.config.doc.createDocumentFragment());b.results.length?c.each(b.results,function(a){d.append(a.display)}):d.append('
  • No results found. Maybe you\'ll have better luck with a different query?
  • '),m.refresh()}function t(a){var b=a.newVal,c=b.get("label").toLowerCase();switch(i.selected={index:b.get("index"),name:c,tab:b},c){case"classes":case"modules":j.setAttrs({minQueryLength:0,queryType:c}),k.set("minQueryLength",-1),a.prevVal&&j.sendRequest(j.get("value"));break;case"everything":j.set("minQueryLength",-1),k.set("minQueryLength",1),k.get("value")?k.sendRequest(k.get("value")):f.focus();break;default:j.set("minQueryLength",-1),k.set("minQueryLength",-1)}m&&setTimeout(function(){m.refresh()},1)}function u(b){var c=i.selected.index;if(b.ctrlKey||b.metaKey)switch(b.preventDefault(),b.keyCode){case 37:c>0&&(l.selectChild(c-1),f.focus());break;case 39:c-1&&e.push(a)}),e}}}}})},"3.4.0",{requires:["autocomplete-base","autocomplete-highlighters","autocomplete-sources"]}),window.PR_SHOULD_USE_CONTINUATION=!0;var prettyPrintOne,prettyPrint;!function(){function D(a){function i(a){var b=a.charCodeAt(0);if(92!==b)return b;var c=a.charAt(1);return b=h[c],b?b:c>="0"&&"7">=c?parseInt(a.substring(1),8):"u"===c||"x"===c?parseInt(a.substring(2),16):a.charCodeAt(1)}function j(a){if(32>a)return(16>a?"\\x0":"\\x")+a.toString(16);var b=String.fromCharCode(a);return"\\"===b||"-"===b||"]"===b||"^"===b?"\\"+b:b}function k(a){var b=a.substring(1,a.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),c=[],d="^"===b[0],e=["["];d&&e.push("^");for(var f=d?1:0,g=b.length;g>f;++f){var h=b[f];if(/\\[bdsw]/i.test(h))e.push(h);else{var l,k=i(h);g>f+2&&"-"===b[f+1]?(l=i(b[f+2]),f+=2):l=k,c.push([k,l]),65>l||k>122||(65>l||k>90||c.push([32|Math.max(65,k),32|Math.min(l,90)]),97>l||k>122||c.push([-33&Math.max(97,k),-33&Math.min(l,122)]))}}c.sort(function(a,b){return a[0]-b[0]||b[1]-a[1]});for(var m=[],n=[],f=0;fo[0]&&(o[1]+1>o[0]&&e.push("-"),e.push(j(o[1])))}return e.push("]"),e.join("")}function l(a){for(var d=a.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),e=d.length,f=[],g=0,h=0;e>g;++g){var i=d[g];if("("===i)++h;else if("\\"===i.charAt(0)){var l=+i.substring(1);l&&(h>=l?f[l]=-1:d[g]=j(l))}}for(var g=1;gg;++g){var i=d[g];if("("===i)++h,f[h]||(d[g]="(?:");else if("\\"===i.charAt(0)){var l=+i.substring(1);l&&h>=l&&(d[g]="\\"+f[l])}}for(var g=0;e>g;++g)"^"===d[g]&&"^"!==d[g+1]&&(d[g]="");if(a.ignoreCase&&c)for(var g=0;e>g;++g){var i=d[g],m=i.charAt(0);i.length>=2&&"["===m?d[g]=k(i):"\\"!==m&&(d[g]=i.replace(/[a-zA-Z]/g,function(a){var b=a.charCodeAt(0);return"["+String.fromCharCode(-33&b,32|b)+"]"}))}return d.join("")}for(var b=0,c=!1,d=!1,e=0,f=a.length;f>e;++e){var g=a[e];if(g.ignoreCase)d=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){c=!0,d=!1;break}}for(var h={b:8,t:9,n:10,v:11,f:12,r:13},m=[],e=0,f=a.length;f>e;++e){var g=a[e];if(g.global||g.multiline)throw new Error(""+g);m.push("(?:"+l(g)+")")}return new RegExp(m.join("|"),d?"gi":"g")}function E(a,b){function h(a){switch(a.nodeType){case 1:if(c.test(a.className))return;for(var i=a.firstChild;i;i=i.nextSibling)h(i);var j=a.nodeName.toLowerCase();("br"===j||"li"===j)&&(d[g]="\n",f[g<<1]=e++,f[1|g++<<1]=a);break;case 3:case 4:var k=a.nodeValue;k.length&&(k=b?k.replace(/\r\n?/g,"\n"):k.replace(/[ \t\r\n]+/g," "),d[g]=k,f[g<<1]=e,e+=k.length,f[1|g++<<1]=a)}}var c=/(?:^|\s)nocode(?:\s|$)/,d=[],e=0,f=[],g=0;return h(a),{sourceCode:d.join("").replace(/\n$/,""),spans:f}}function F(a,b,c,d){if(b){var e={sourceCode:b,basePos:a};c(e),d.push.apply(d,e.decorations)}}function H(a){for(var b=void 0,c=a.firstChild;c;c=c.nextSibling){var d=c.nodeType;b=1===d?b?a:c:3===d?G.test(c.nodeValue)?a:b:b}return b===a?void 0:b}function I(a,b){var d,c={};!function(){for(var e=a.concat(b),f=[],g={},h=0,i=e.length;i>h;++h){var j=e[h],k=j[3];if(k)for(var l=k.length;--l>=0;)c[k.charAt(l)]=j;var m=j[1],n=""+m;g.hasOwnProperty(n)||(f.push(m),g[n]=null)}f.push(/[\0-\uffff]/),d=D(f)}();var e=b.length,f=function(a){for(var g=a.sourceCode,h=a.basePos,i=[h,v],j=0,k=g.match(d)||[],l={},m=0,n=k.length;n>m;++m){var r,o=k[m],p=l[o],q=void 0;if("string"==typeof p)r=!1;else{var s=c[o.charAt(0)];if(s)q=o.match(s[1]),p=s[0];else{for(var t=0;e>t;++t)if(s=b[t],q=o.match(s[1])){p=s[0];break}q||(p=v)}r=p.length>=5&&"lang-"===p.substring(0,5),!r||q&&"string"==typeof q[1]||(r=!1,p=y),r||(l[o]=p)}var u=j;if(j+=o.length,r){var w=q[1],x=o.indexOf(w),z=x+w.length;q[2]&&(z=o.length-q[2].length,x=z-w.length);var A=p.substring(5);F(h+u,o.substring(0,x),f,i),F(h+u+x,w,P(A,w),i),F(h+u+z,o.substring(z),f,i)}else i.push(h+u,p)}a.decorations=i};return f}function J(a){var b=[],c=[];a.tripleQuotedStrings?b.push([p,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):a.multiLineStrings?b.push([p,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):b.push([p,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),a.verbatimStrings&&c.push([p,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var d=a.hashComments;if(d&&(a.cStyleComments?(d>1?b.push([r,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):b.push([r,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),c.push([p,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):b.push([r,/^#[^\r\n]*/,null,"#"])),a.cStyleComments&&(c.push([r,/^\/\/[^\r\n]*/,null]),c.push([r,/^\/\*[\s\S]*?(?:\*\/|$)/,null])),a.regexLiterals){var e="/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/"; c.push(["lang-regex",new RegExp("^"+C+"("+e+")")])}var f=a.types;f&&c.push([s,f]);var g=(""+a.keywords).replace(/^ | $/g,"");g.length&&c.push([q,new RegExp("^(?:"+g.replace(/[\s,]+/g,"|")+")\\b"),null]),b.push([v,/^\s+/,null," \r\n \xa0"]);var h=/^.[^\s\w\.$@\'\"\`\/\\]*/;return c.push([t,/^@[a-z_$][a-z_$@0-9]*/i,null],[s,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[v,/^[a-z_$][a-z_$@0-9]*/i,null],[t,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[v,/^\\[\s\S]?/,null],[u,h,null]),I(b,c)}function L(a,b,c){function i(a){switch(a.nodeType){case 1:if(d.test(a.className))break;if("br"===a.nodeName)j(a),a.parentNode&&a.parentNode.removeChild(a);else for(var b=a.firstChild;b;b=b.nextSibling)i(b);break;case 3:case 4:if(c){var g=a.nodeValue,h=g.match(e);if(h){var k=g.substring(0,h.index);a.nodeValue=k;var l=g.substring(h.index+h[0].length);if(l){var m=a.parentNode;m.insertBefore(f.createTextNode(l),a.nextSibling)}j(a),k||a.parentNode.removeChild(a)}}}}function j(a){function b(a,c){var d=c?a.cloneNode(!1):a,e=a.parentNode;if(e){var f=b(e,1),g=a.nextSibling;f.appendChild(d);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return d}for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var d,c=b(a.nextSibling,0);(d=c.parentNode)&&1===d.nodeType;)c=d;h.push(c)}for(var d=/(?:^|\s)nocode(?:\s|$)/,e=/\r\n?|\n/,f=a.ownerDocument,g=f.createElement("li");a.firstChild;)g.appendChild(a.firstChild);for(var h=[g],k=0;kk;++k)g=h[k],g.className="L"+(k+m)%10,g.firstChild||g.appendChild(f.createTextNode("\xa0")),l.appendChild(g);a.appendChild(l)}function M(a){var b=/\bMSIE\s(\d+)/.exec(navigator.userAgent);b=b&&+b[1]<=8;var c=/\n/g,d=a.sourceCode,e=d.length,f=0,g=a.spans,h=g.length,i=0,j=a.decorations,k=j.length,l=0;j[k]=e;var m,n;for(n=m=0;k>n;)j[n]!==j[n+2]?(j[m++]=j[n++],j[m++]=j[n++]):n+=2;for(k=m,n=m=0;k>n;){for(var o=j[n],p=j[n+1],q=n+2;k>=q+2&&j[q+1]===p;)q+=2;j[m++]=o,j[m++]=p,n=q}k=j.length=m;var s,r=a.sourceNode;r&&(s=r.style.display,r.style.display="none");try{for(;h>i;){g[i];var y,v=g[i+2]||e,w=j[l+2]||e,q=Math.min(v,w),x=g[i+1];if(1!==x.nodeType&&(y=d.substring(f,q))){b&&(y=y.replace(c,"\r")),x.nodeValue=y;var z=x.ownerDocument,A=z.createElement("span");A.className=j[l+1];var B=x.parentNode;B.replaceChild(A,x),A.appendChild(x),v>f&&(g[i+1]=x=z.createTextNode(d.substring(q,v)),B.insertBefore(x,A.nextSibling))}f=q,f>=v&&(i+=2),f>=w&&(l+=2)}}finally{r&&(r.style.display=s)}}function O(b,c){for(var d=c.length;--d>=0;){var e=c[d];N.hasOwnProperty(e)?a.console&&console.warn("cannot override language handler %s",e):N[e]=b}}function P(a,b){return a&&N.hasOwnProperty(a)||(a=/^\s*g;++g)e.push(d[f][g]);d=null;var i=Date;i.now||(i={now:function(){return+new Date}});var k,j=0,l=/\blang(?:uage)?-([\w.]+)(?!\S)/,m=/\bprettyprint\b/,n=/\bprettyprinted\b/,o=/pre|xmp/i,p=/^code$/i,q=/^(?:pre|code|xmp)$/i;r()}var a=window,b=["break,continue,do,else,for,if,return,while"],c=[b,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],d=[c,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],e=[d,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],f=[d,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],g=[f,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,let,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var,virtual,where"],h="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",i=[d,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],j="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",k=[b,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],l=[b,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],m=[b,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],n=[e,g,i,j+k,l,m],o=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,p="str",q="kwd",r="com",s="typ",t="lit",u="pun",v="pln",w="tag",x="dec",y="src",z="atn",A="atv",B="nocode",C="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*",G=/\S/,K=J({keywords:n,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),N={};O(K,["default-code"]),O(I([],[[v,/^[^]*(?:>|$)/],[r,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[u,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),O(I([[v,/^[\s]+/,null," \r\n"],[A,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[w,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[z,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[u,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),O(I([],[[A,/^[\s\S]+/]]),["uq.val"]),O(J({keywords:e,hashComments:!0,cStyleComments:!0,types:o}),["c","cc","cpp","cxx","cyc","m"]),O(J({keywords:"null,true,false"}),["json"]),O(J({keywords:g,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:o}),["cs"]),O(J({keywords:f,cStyleComments:!0}),["java"]),O(J({keywords:m,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]),O(J({keywords:k,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py"]),O(J({keywords:j,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]),O(J({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]),O(J({keywords:i,cStyleComments:!0,regexLiterals:!0}),["js"]),O(J({keywords:h,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),O(I([],[[p,/^[\s\S]+/]]),["regex"]);var T=a.PR={createSimpleLexer:I,registerLangHandler:O,sourceDecorator:J,PR_ATTRIB_NAME:z,PR_ATTRIB_VALUE:A,PR_COMMENT:r,PR_DECLARATION:x,PR_KEYWORD:q,PR_LITERAL:t,PR_NOCODE:B,PR_PLAIN:v,PR_PUNCTUATION:u,PR_SOURCE:y,PR_STRING:p,PR_TAG:w,PR_TYPE:s,prettyPrintOne:a.prettyPrintOne=R,prettyPrint:a.prettyPrint=S};"function"==typeof define&&define.amd&&define("google-code-prettify",[],function(){return T})}(),PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_DECLARATION,/^]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]),PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]),PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]),PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]),YUI.add("oop",function(a){function c(b,c,d,f,g){if(b&&b[g]&&b!==a)return b[g].call(b,c,d);switch(e.test(b)){case 1:return e[g](b,c,d);case 2:return e[g](a.Array(b,0,!0),c,d);default:return a.Object[g](b,c,d,f)}}var d=a.Lang,e=a.Array,f=Object.prototype,g="_~yuim~_",h=f.hasOwnProperty,i=f.toString;a.augment=function(b,c,d,e,f){var m,n,o,p,q,g=b.prototype,j=g&&c,k=c.prototype,l=g||b;return f=f?a.Array(f):[],j&&(n={},o={},p={},m=function(a,b){!d&&b in g||("[object Function]"===i.call(a)?(p[b]=a,n[b]=o[b]=function(){return q(this,a,arguments)}):n[b]=a)},q=function(a,b,d){for(var e in p)h.call(p,e)&&a[e]===o[e]&&(a[e]=p[e]);return c.apply(a,f),b.apply(a,d)},e?a.Array.each(e,function(a){a in k&&m(k[a],a)}):a.Object.each(k,m,null,!0)),a.mix(l,n||k,d,e),j||c.apply(l,f),b},a.aggregate=function(b,c,d,e){return a.mix(b,c,d,e,0,!0)},a.extend=function(b,c,d,e){(!c||!b)&&a.error("extend failed, verify dependencies");var g=c.prototype,h=a.Object(g);return b.prototype=h,h.constructor=b,b.superclass=g,c!=Object&&g.constructor==f.constructor&&(g.constructor=c),d&&a.mix(h,d,!0),e&&a.mix(b,e,!0),b},a.each=function(a,b,d,e){return c(a,b,d,e,"each")},a.some=function(a,b,d,e){return c(a,b,d,e,"some")},a.clone=function(b,c,e,f,h,i){var j,k,l;if(!d.isObject(b)||a.instanceOf(b,YUI)||b.addEventListener||b.attachEvent)return b;switch(k=i||{},d.type(b)){case"date":return new Date(b);case"regexp":return b;case"function":return b;case"array":j=[];break;default:if(b[g])return k[b[g]];l=a.guid(),j=c?{}:a.Object(b),b[g]=l,k[l]=b}return a.each(b,function(d,i){(i||0===i)&&(!e||e.call(f||this,d,i,this,b)!==!1)&&i!==g&&"prototype"!=i&&(this[i]=a.clone(d,c,e,f,h||b,k))},j),i||(a.Object.each(k,function(a){if(a[g])try{delete a[g]}catch(c){a[g]=null}},this),k=null),j},a.bind=function(b,c){var e=arguments.length>2?a.Array(arguments,2,!0):null;return function(){var f=d.isString(b)?c[b]:b,g=e?e.concat(a.Array(arguments,0,!0)):arguments;return f.apply(c||f,g)}},a.rbind=function(b,c){var e=arguments.length>2?a.Array(arguments,2,!0):null;return function(){var f=d.isString(b)?c[b]:b,g=e?a.Array(arguments,0,!0).concat(e):arguments;return f.apply(c||f,g)}}},"3.10.1",{requires:["yui-base"]}),YUI.add("event-custom-base",function(a){a.Env.evt={handles:{},plugins:{}};var c=0,d=1,e={objs:null,before:function(b,d,e,f){var h,g=b;return f&&(h=[b,f].concat(a.Array(arguments,4,!0)),g=a.rbind.apply(a,h)),this._inject(c,g,d,e)},after:function(b,c,e,f){var h,g=b;return f&&(h=[b,f].concat(a.Array(arguments,4,!0)),g=a.rbind.apply(a,h)),this._inject(d,g,c,e)},_inject:function(b,c,d,e){var g,h,f=a.stamp(d);return d._yuiaop||(d._yuiaop={}),g=d._yuiaop,g[e]||(g[e]=new a.Do.Method(d,e),d[e]=function(){return g[e].exec.apply(g[e],arguments)}),h=f+a.stamp(c)+e,g[e].register(h,c,b),new a.EventHandle(g[e],h)},detach:function(a){a.detach&&a.detach()}};a.Do=e,e.Method=function(a,b){this.obj=a,this.methodName=b,this.method=a[b],this.before={},this.after={}},e.Method.prototype.register=function(a,b,c){c?this.after[a]=b:this.before[a]=b},e.Method.prototype._delete=function(a){delete this.before[a],delete this.after[a]},e.Method.prototype.exec=function(){var c,d,f,b=a.Array(arguments,0,!0),g=this.before,h=this.after,i=!1;for(c in g)if(g.hasOwnProperty(c)&&(d=g[c].apply(this.obj,b)))switch(d.constructor){case e.Halt:return d.retVal;case e.AlterArgs:b=d.newArgs;break;case e.Prevent:i=!0}i||(d=this.method.apply(this.obj,b)),e.originalRetVal=d,e.currentRetVal=d;for(c in h)if(h.hasOwnProperty(c)){if(f=h[c].apply(this.obj,b),f&&f.constructor===e.Halt)return f.retVal;f&&f.constructor===e.AlterReturn&&(d=f.newRetVal,e.currentRetVal=d)}return d},e.AlterArgs=function(a,b){this.msg=a,this.newArgs=b},e.AlterReturn=function(a,b){this.msg=a,this.newRetVal=b},e.Halt=function(a,b){this.msg=a,this.retVal=b},e.Prevent=function(a){this.msg=a},e.Error=e.Halt;var f=a.Array,g="after",h=["broadcast","monitored","bubbles","context","contextFn","currentTarget","defaultFn","defaultTargetOnly","details","emitFacade","fireOnce","async","host","preventable","preventedFn","queuable","silent","stoppedFn","target","type"],i=f.hash(h),j=Array.prototype.slice,k=9,l="yui:log",m=function(a,b,c){var d;for(d in b)i[d]&&(c||!(d in a))&&(a[d]=b[d]);return a};a.CustomEvent=function(b,c){this._kds=a.CustomEvent.keepDeprecatedSubs,this.id=a.guid(),this.type=b,this.silent=this.logSystem=b===l,this._kds&&(this.subscribers={},this.afters={}),c&&m(this,c,!0)},a.CustomEvent.keepDeprecatedSubs=!1,a.CustomEvent.mixConfigs=m,a.CustomEvent.prototype={constructor:a.CustomEvent,signature:k,context:a,preventable:!0,bubbles:!0,hasSubs:function(a){var b=0,c=0,d=this._subscribers,e=this._afters,f=this.sibling;return d&&(b=d.length),e&&(c=e.length),f&&(d=f._subscribers,e=f._afters,d&&(b+=d.length),e&&(c+=e.length)),a?"after"===a?c:b:b+c},monitor:function(a){this.monitored=!0;var b=this.id+"|"+this.type+"_"+a,c=j.call(arguments,0);return c[0]=b,this.host.on.apply(this.host,c)},getSubs:function(){var d,e,a=this.sibling,b=this._subscribers,c=this._afters;return a&&(d=a._subscribers,e=a._afters),b=d?b?b.concat(d):d.concat():b?b.concat():[],c=e?c?c.concat(e):e.concat():c?c.concat():[],[b,c]},applyConfig:function(a,b){m(this,a,b)},_on:function(b,c,d,e){var f=new a.Subscriber(b,c,d,e);return this.fireOnce&&this.fired&&(this.async?setTimeout(a.bind(this._notify,this,f,this.firedWith),0):this._notify(f,this.firedWith)),e===g?(this._afters||(this._afters=[],this._hasAfters=!0),this._afters.push(f)):(this._subscribers||(this._subscribers=[],this._hasSubs=!0),this._subscribers.push(f)),this._kds&&(e===g?this.afters[f.id]=f:this.subscribers[f.id]=f),new a.EventHandle(this,f)},subscribe:function(a,b){var c=arguments.length>2?j.call(arguments,2):null;return this._on(a,b,c,!0)},on:function(a,b){var c=arguments.length>2?j.call(arguments,2):null;return this.monitored&&this.host&&this.host._monitor("attach",this,{args:arguments}),this._on(a,b,c,!0)},after:function(a,b){var c=arguments.length>2?j.call(arguments,2):null;return this._on(a,b,c,g)},detach:function(a){if(a&&a.detach)return a.detach();var c,d,e=0,f=this._subscribers,g=this._afters;if(f)for(c=f.length;c>=0;c--)d=f[c],d&&(!a||a===d.fn)&&(this._delete(d,f,c),e++);if(g)for(c=g.length;c>=0;c--)d=g[c],d&&(!a||a===d.fn)&&(this._delete(d,g,c),e++);return e},unsubscribe:function(){return this.detach.apply(this,arguments)},_notify:function(a,b){var d;return d=a.notify(b,this),!1===d||this.stopped>1?!1:!0},log:function(){},fire:function(){var a=[];return a.push.apply(a,arguments),this._fire(a)},_fire:function(a){return this.fireOnce&&this.fired?!0:(this.fired=!0,this.fireOnce&&(this.firedWith=a),this.emitFacade?this.fireComplex(a):this.fireSimple(a))},fireSimple:function(a){if(this.stopped=0,this.prevented=0,this.hasSubs()){var b=this.getSubs();this._procSubs(b[0],a),this._procSubs(b[1],a)}return this.broadcast&&this._broadcast(a),this.stopped?!1:!0},fireComplex:function(a){return a[0]=a[0]||{},this.fireSimple(a)},_procSubs:function(a,b,c){var d,e,f;for(e=0,f=a.length;f>e;e++)if(d=a[e],d&&d.fn&&(!1===this._notify(d,b,c)&&(this.stopped=2),2===this.stopped))return!1;return!0},_broadcast:function(b){if(!this.stopped&&this.broadcast){var c=b.concat();c.unshift(this.type),this.host!==a&&a.fire.apply(a,c),2===this.broadcast&&a.Global.fire.apply(a.Global,c)}},unsubscribeAll:function(){return this.detachAll.apply(this,arguments)},detachAll:function(){return this.detach()},_delete:function(a,b,c){var d=a._when;b||(b=d===g?this._afters:this._subscribers,c=f.indexOf(b,a,0)),b&&a&&b[c]===a&&(b.splice(c,1),0===b.length&&(d===g?this._hasAfters=!1:this._hasSubs=!1)),this._kds&&(d===g?delete this.afters[a.id]:delete this.subscribers[a.id]),this.monitored&&this.host&&this.host._monitor("detach",this,{ce:this,sub:a}),a&&(a.deleted=!0)}},a.Subscriber=function(b,c,d,e){this.fn=b,this.context=c,this.id=a.guid(),this.args=d,this._when=e},a.Subscriber.prototype={constructor:a.Subscriber,_notify:function(a,b,c){if(this.deleted&&!this.postponed){if(!this.postponed)return delete this.postponed,null;delete this.fn,delete this.context}var e,d=this.args;switch(c.signature){case 0:e=this.fn.call(a,c.type,b,a);break;case 1:e=this.fn.call(a,b[0]||null,a);break;default:d||b?(b=b||[],d=d?b.concat(d):b,e=this.fn.apply(a,d)):e=this.fn.call(a)}return this.once&&c._delete(this),e},notify:function(b,c){var d=this.context,e=!0;if(d||(d=c.contextFn?c.contextFn():c.context),a.config&&a.config.throwFail)e=this._notify(d,b,c);else try{e=this._notify(d,b,c)}catch(f){a.error(this+" failed: "+f.message,f)}return e},contains:function(a,b){return b?this.fn===a&&this.context===b:this.fn===a},valueOf:function(){return this.id}},a.EventHandle=function(a,b){this.evt=a,this.sub=b},a.EventHandle.prototype={batch:function(b,c){b.call(c||this,this),a.Lang.isArray(this.evt)&&a.Array.each(this.evt,function(a){a.batch.call(c||a,b)})},detach:function(){var d,b=this.evt,c=0;if(b)if(a.Lang.isArray(b))for(d=0;d-1?a:b+o+a},u=a.cached(function(a,b){var d,e,f,c=a;return n.isString(c)?(f=c.indexOf(q),f>-1&&(e=!0,c=c.substr(q.length)),f=c.indexOf(p),f>-1&&(d=c.substr(0,f),c=c.substr(f+1),"*"===c&&(c=null)),[d,b?t(c,b):c,e,c]):c}),v=function(b){var d,c=this._yuievt;c||(c=this._yuievt={events:{},targets:null,config:{host:this,context:this},chain:a.config.chain}),d=c.config,b&&(m(d,b,!0),void 0!==b.chain&&(c.chain=b.chain),b.prefix&&(d.prefix=b.prefix))};v.prototype={constructor:v,once:function(){var a=this.on.apply(this,arguments);return a.batch(function(a){a.sub&&(a.sub.once=!0)}),a},onceAfter:function(){var a=this.after.apply(this,arguments);return a.batch(function(a){a.sub&&(a.sub.once=!0)}),a},parseType:function(a,b){return u(a,b||this._yuievt.config.prefix)},on:function(b,c,d){var g,h,i,k,l,m,o,r,s,t,w,x,y,e=this._yuievt,f=u(b,e.config.prefix),p=a.Env.evt.handles,v=a.Node;return this._monitor("attach",f[1],{args:arguments,category:f[0],after:f[2]}),n.isObject(b)?n.isFunction(b)?a.Do.before.apply(a.Do,arguments):(g=c,h=d,i=j.call(arguments,0),k=[],n.isArray(b)&&(y=!0),r=b._after,delete b._after,a.each(b,function(a,b){n.isObject(a)&&(g=a.fn||(n.isFunction(a)?a:g),h=a.context||h);var c=r?q:"";i[0]=c+(y?a:b),i[1]=g,i[2]=h,k.push(this.on.apply(this,i))},this),e.chain?this:new a.EventHandle(k)):(m=f[0],r=f[2],t=f[3],v&&a.instanceOf(this,v)&&t in v.DOM_EVENTS?(i=j.call(arguments,0),i.splice(2,0,v.getDOMNode(this)),a.on.apply(a,i)):(b=f[1],a.instanceOf(this,YUI)&&(s=a.Env.evt.plugins[b],i=j.call(arguments,0),i[0]=t,v&&(w=i[2],a.instanceOf(w,a.NodeList)?w=a.NodeList.getDOMNodes(w):a.instanceOf(w,v)&&(w=v.getDOMNode(w)),x=t in v.DOM_EVENTS,x&&(i[2]=w)),s?o=s.on.apply(a,i):(!b||x)&&(o=a.Event._attach(i))),o||(l=e.events[b]||this.publish(b),o=l._on(c,d,arguments.length>3?j.call(arguments,3):null,r?"after":!0),-1!==b.indexOf("*:")&&(this._hasSiblings=!0)),m&&(p[m]=p[m]||{},p[m][b]=p[m][b]||[],p[m][b].push(o)),e.chain?this:o))},subscribe:function(){return this.on.apply(this,arguments)},detach:function(b,c,d){var f,e=this._yuievt.events,g=a.Node,h=g&&a.instanceOf(this,g);if(!b&&this!==a){for(f in e)e.hasOwnProperty(f)&&e[f].detach(c,d);return h&&a.Event.purgeElement(g.getDOMNode(this)),this}var m,p,q,r,s,i=u(b,this._yuievt.config.prefix),k=n.isArray(i)?i[0]:null,l=i?i[3]:null,o=a.Env.evt.handles,t=function(a,b,c){var e,f,d=a[b];if(d)for(f=d.length-1;f>=0;--f)e=d[f].evt,(e.host===c||e.el===c)&&d[f].detach()};if(k){if(q=o[k],b=i[1],p=h?a.Node.getDOMNode(this):this,q){if(b)t(q,b,p);else for(f in q)q.hasOwnProperty(f)&&t(q,f,p);return this}}else{if(n.isObject(b)&&b.detach)return b.detach(),this;if(h&&(!l||l in g.DOM_EVENTS))return r=j.call(arguments,0),r[2]=g.getDOMNode(this),a.detach.apply(a,r),this}if(m=a.Env.evt.plugins[l],a.instanceOf(this,YUI)){if(r=j.call(arguments,0),m&&m.detach)return m.detach.apply(a,r),this;if(!b||!m&&g&&b in g.DOM_EVENTS)return r[0]=b,a.Event.detach.apply(a.Event,r),this}return s=e[i[1]],s&&s.detach(c,d),this},unsubscribe:function(){return this.detach.apply(this,arguments)},detachAll:function(a){return this.detach(a)},unsubscribeAll:function(){return this.detachAll.apply(this,arguments)},publish:function(b,c){var d,e=this._yuievt,f=e.config,g=f.prefix;return"string"==typeof b?(g&&(b=t(b,g)),d=this._publish(b,f,c)):(d={},a.each(b,function(a,b){g&&(b=t(b,g)),d[b]=this._publish(b,f,a||c)},this)),d},_getFullType:function(a){var b=this._yuievt.config.prefix;return b?b+o+a:a},_publish:function(b,c,d){var e,f=this._yuievt,g=f.config,h=g.host,i=g.context,j=f.events;return e=j[b],(g.monitored&&!e||e&&e.monitored)&&this._monitor("publish",b,{args:arguments}),e||(e=j[b]=new a.CustomEvent(b,c),c||(e.host=h,e.context=i)),d&&m(e,d,!0),e},_monitor:function(a,b,c){var d,e,f;b&&("string"==typeof b?(f=b,e=this.getEvent(b,!0)):(e=b,f=b.type),(this._yuievt.config.monitored&&(!e||e.monitored)||e&&e.monitored)&&(d=f+"_"+a,c.monitored=a,this.fire.call(this,d,c)))},fire:function(a){var h,i,k,l,b="string"==typeof a,c=arguments.length,d=a,e=this._yuievt,f=e.config,g=f.prefix;if(l=b&&2>=c?2===c?[arguments[1]]:[]:j.call(arguments,b?1:0),b||(d=a&&a.type),g&&(d=t(d,g)),i=e.events[d],this._hasSiblings&&(k=this.getSibling(d,i),k&&!i&&(i=this.publish(d))),(f.monitored&&(!i||i.monitored)||i&&i.monitored)&&this._monitor("fire",i||d,{args:l}),i)k&&(i.sibling=k),h=i._fire(l);else{if(e.hasTargets)return this.bubble({type:d},l,this);h=!0}return e.chain?this:h},getSibling:function(a,b){var c;return a.indexOf(o)>-1&&(a=s(a),c=this.getEvent(a,!0),c&&(c.applyConfig(b),c.bubbles=!1,c.broadcast=0)),c},getEvent:function(a,b){var c,d;return b||(c=this._yuievt.config.prefix,a=c?t(a,c):a),d=this._yuievt.events,d[a]||null},after:function(b){var d=j.call(arguments,0);switch(n.type(b)){case"function":return a.Do.after.apply(a.Do,arguments);case"array":case"object":d[0]._after=!0;break;default:d[0]=q+b}return this.on.apply(this,d)},before:function(){return this.on.apply(this,arguments)}},a.EventTarget=v,a.mix(a,v.prototype),v.call(a,{bubbles:!1}),YUI.Env.globalEvents=YUI.Env.globalEvents||new v,a.Global=YUI.Env.globalEvents},"3.10.1",{requires:["oop"]}),YUI.add("dom-core",function(a){var c="nodeType",d="ownerDocument",e="documentElement",f="defaultView",g="parentWindow",h="tagName",i="parentNode",j="previousSibling",k="nextSibling",l="contains",m="compareDocumentPosition",n=[],o=function(){var b=a.config.doc.createElement("div"),c=b.appendChild(a.config.doc.createTextNode("")),d=!1;try{d=b.contains(c)}catch(e){}return d}(),p={byId:function(a,b){return p.allById(a,b)[0]||null},getId:function(a){var b;return!a.id||a.id.tagName||a.id.item?a.attributes&&a.attributes.id&&(b=a.attributes.id.value):b=a.id,b},setId:function(a,b){a.setAttribute?a.setAttribute("id",b):a.id=b},ancestor:function(a,b,c,d){var e=null;return c&&(e=!b||b(a)?a:null),e||p.elementByAxis(a,i,b,null,d)},ancestors:function(a,b,c,d){for(var e=a,f=[];e=p.ancestor(e,b,c,d);)if(c=!1,e&&(f.unshift(e),d&&d(e)))return f;return f},elementByAxis:function(a,b,c,d,e){for(;a&&(a=a[b]);){if((d||a[h])&&(!c||c(a)))return a;if(e&&e(a))return null}return null},contains:function(a,b){var d=!1;return b&&a&&b[c]&&a[c]?a[l]&&(1===b[c]||o)?d=a[l](b):a[m]?(a===b||16&a[m](b))&&(d=!0):d=p._bruteContains(a,b):d=!1,d},inDoc:function(a,b){var f,c=!1;return a&&a.nodeType&&(b||(b=a[d]),f=b[e],c=f&&f.contains&&a.tagName?f.contains(a):p.contains(f,a)),c},allById:function(b,c){c=c||a.config.doc;var f,g,d=[],e=[];if(c.querySelectorAll)e=c.querySelectorAll('[id="'+b+'"]');else if(c.all){if(d=c.all(b),d&&(d.nodeName&&(d.id===b?(e.push(d),d=n):d=[d]),d.length))for(f=0;g=d[f++];)(g.id===b||g.attributes&&g.attributes.id&&g.attributes.id.value===b)&&e.push(g)}else e=[p._getDoc(c).getElementById(b)];return e},isWindow:function(a){return!!(a&&a.scrollTo&&a.document)},_removeChildNodes:function(a){for(;a.firstChild;)a.removeChild(a.firstChild)},siblings:function(a,b){for(var c=[],d=a;d=d[j];)d[h]&&(!b||b(d))&&c.unshift(d);for(d=a;d=d[k];)d[h]&&(!b||b(d))&&c.push(d);return c},_bruteContains:function(a,b){for(;b;){if(a===b)return!0;b=b.parentNode}return!1},_getRegExp:function(a,b){return b=b||"",p._regexCache=p._regexCache||{},p._regexCache[a+b]||(p._regexCache[a+b]=new RegExp(a,b)),p._regexCache[a+b]},_getDoc:function(b){var e=a.config.doc;return b&&(e=9===b[c]?b:b[d]||b.document||a.config.doc),e},_getWin:function(b){var c=p._getDoc(b);return c[f]||c[g]||a.config.win},_batch:function(a,b,c,d,e,f){b="string"==typeof b?p[b]:b;var g,i,j,h=0;if(b&&a)for(;i=a[h++];)g=g=b.call(p,i,c,d,e,f),"undefined"!=typeof g&&(j||(j=[]),j.push(g));return"undefined"!=typeof j?j:a},generateID:function(b){var c=b.id;return c||(c=a.stamp(b),b.id=c),c}};a.DOM=p},"3.10.1",{requires:["oop","features"]}),YUI.add("dom-base",function(a){var c=a.config.doc.documentElement,d=a.DOM,e="tagName",f="ownerDocument",g="",h=a.Features.add,i=a.Features.test;a.mix(d,{getText:void 0!==c.textContent?function(a){var b="";return a&&(b=a.textContent),b||""}:function(a){var b="";return a&&(b=a.innerText||a.nodeValue),b||""},setText:void 0!==c.textContent?function(a,b){a&&(a.textContent=b)}:function(a,b){"innerText"in a?a.innerText=b:"nodeValue"in a&&(a.nodeValue=b)},CUSTOM_ATTRIBUTES:c.hasAttribute?{htmlFor:"for",className:"class"}:{"for":"htmlFor","class":"className"},setAttribute:function(a,b,c,e){a&&b&&a.setAttribute&&(b=d.CUSTOM_ATTRIBUTES[b]||b,a.setAttribute(b,c,e))},getAttribute:function(a,b,c){c=void 0!==c?c:2;var e="";return a&&b&&a.getAttribute&&(b=d.CUSTOM_ATTRIBUTES[b]||b,e=a.getAttribute(b,c),null===e&&(e="")),e},VALUE_SETTERS:{},VALUE_GETTERS:{},getValue:function(a){var c,b="";return a&&a[e]&&(c=d.VALUE_GETTERS[a[e].toLowerCase()],b=c?c(a):a.value),b===g&&(b=g),"string"==typeof b?b:""},setValue:function(a,b){var c;a&&a[e]&&(c=d.VALUE_SETTERS[a[e].toLowerCase()],c?c(a,b):a.value=b)},creators:{}}),h("value-set","select",{test:function(){var b=a.config.doc.createElement("select");return b.innerHTML="",b.value="2",b.value&&"2"===b.value}}),i("value-set","select")||(d.VALUE_SETTERS.select=function(a,b){for(var f,c=0,e=a.getElementsByTagName("option");f=e[c++];)if(d.getValue(f)===b){f.selected=!0;break}}),a.mix(d.VALUE_GETTERS,{button:function(a){return a.attributes&&a.attributes.value?a.attributes.value.value:""}}),a.mix(d.VALUE_SETTERS,{button:function(a,b){var c=a.attributes.value;c||(c=a[f].createAttribute("value"),a.setAttributeNode(c)),c.value=b}}),a.mix(d.VALUE_GETTERS,{option:function(a){var b=a.attributes;return b.value&&b.value.specified?a.value:a.text},select:function(a){var b=a.value,c=a.options;return c&&c.length&&(a.multiple||a.selectedIndex>-1&&(b=d.getValue(c[a.selectedIndex]))),b}});var j,k,l;a.mix(a.DOM,{hasClass:function(b,c){var d=a.DOM._getRegExp("(?:^|\\s+)"+c+"(?:\\s+|$)");return d.test(b.className)},addClass:function(b,c){a.DOM.hasClass(b,c)||(b.className=a.Lang.trim([b.className,c].join(" ")))},removeClass:function(b,c){c&&k(b,c)&&(b.className=a.Lang.trim(b.className.replace(a.DOM._getRegExp("(?:^|\\s+)"+c+"(?:\\s+|$)")," ")),k(b,c)&&l(b,c))},replaceClass:function(a,b,c){l(a,b),j(a,c)},toggleClass:function(a,b,c){var d=void 0!==c?c:!k(a,b);d?j(a,b):l(a,b)}}),k=a.DOM.hasClass,l=a.DOM.removeClass,j=a.DOM.addClass;var m=/<([a-z]+)/i,d=a.DOM,h=a.Features.add,i=a.Features.test,n={},o=function(b,c){var d=a.config.doc.createElement("div"),e=!0;return d.innerHTML=b,d.firstChild&&d.firstChild.tagName===c.toUpperCase()||(e=!1),e},p=/(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*e;e++)d.appendChild(b[e]);return d},addHTML:function(b,c,e){var h,j,f=b.parentNode,g=0,i=c;if(void 0!=c)if(c.nodeType)j=c;else if("string"==typeof c||"number"==typeof c)i=j=d.create(c);else if(c[0]&&c[0].nodeType)for(j=a.config.doc.createDocumentFragment();h=c[g++];)j.appendChild(h);if(e)if(j&&e.parentNode)e.parentNode.insertBefore(j,e);else switch(e){case"replace":for(;b.firstChild;)b.removeChild(b.firstChild);j&&b.appendChild(j); diff --git a/build/createjsTheme/assets/scss/main.scss b/build/createjsTheme/assets/scss/main.scss index b017e7c3..d688ce74 100644 --- a/build/createjsTheme/assets/scss/main.scss +++ b/build/createjsTheme/assets/scss/main.scss @@ -226,6 +226,9 @@ th { padding: 0 20px 0 25px; max-width: 104rem; } +.content.source-content{ + max-width: none; +} .sidebar { padding: 0 2em; } diff --git a/build/createjsTheme/assets/scss/settings/fonts.scss b/build/createjsTheme/assets/scss/settings/fonts.scss index d9797069..7992d9bf 100644 --- a/build/createjsTheme/assets/scss/settings/fonts.scss +++ b/build/createjsTheme/assets/scss/settings/fonts.scss @@ -44,7 +44,7 @@ $fontFamily-secondary: 'Proxima Nova', sans-serif; // Weights: 400, 500 // Monospace Font -@import url("http://fonts.googleapis.com/css?family=Source+Code+Pro&subset=latin,latin-ext"); +@import url("https://fonts.googleapis.com/css?family=Source+Code+Pro&subset=latin,latin-ext"); $fontFamily-monospace: 'Source Code Pro', monospace; // Weights: 400 diff --git a/build/createjsTheme/layouts/main.handlebars b/build/createjsTheme/layouts/main.handlebars index b9af452f..71f49b0c 100755 --- a/build/createjsTheme/layouts/main.handlebars +++ b/build/createjsTheme/layouts/main.handlebars @@ -35,7 +35,7 @@ {{>options}}
    -
    +
    {{>layout_content}}
    diff --git a/build/package.json b/build/package.json index 068507f5..edb15da2 100644 --- a/build/package.json +++ b/build/package.json @@ -1,6 +1,6 @@ { "name": "SoundJS", - "version": "0.6.2", + "version": "1.0.0", "description": "SoundJS Docs", "url": "http://www.createjs.com/soundjs", "logo": "assets/docs-icon-SoundJS.png", diff --git a/docs/SoundJS_docs-0.6.2.zip b/docs/SoundJS_docs-0.6.2.zip deleted file mode 100644 index 1a99854d..00000000 Binary files a/docs/SoundJS_docs-0.6.2.zip and /dev/null differ diff --git a/docs/SoundJS_docs.zip b/docs/SoundJS_docs.zip new file mode 100644 index 00000000..99004a5d Binary files /dev/null and b/docs/SoundJS_docs.zip differ diff --git a/docs/soundjs_docs-NEXT.zip b/docs/soundjs_docs-NEXT.zip index 43e35e1f..b7342d4a 100644 Binary files a/docs/soundjs_docs-NEXT.zip and b/docs/soundjs_docs-NEXT.zip differ diff --git a/examples/00_Basics.html b/examples/00_Basics.html index a51b34c1..7bc526d4 100644 --- a/examples/00_Basics.html +++ b/examples/00_Basics.html @@ -41,7 +41,7 @@

    Sorry!

    Thank you.

    - + diff --git a/examples/01_LoadWithPreloadJS.html b/examples/01_LoadWithPreloadJS.html index 95d6a6c2..d97c918d 100644 --- a/examples/01_LoadWithPreloadJS.html +++ b/examples/01_LoadWithPreloadJS.html @@ -61,9 +61,9 @@

    Sorry!

    - + - + diff --git a/examples/02_PlayOnClick.html b/examples/02_PlayOnClick.html index 4e3cad01..58d40b3a 100644 --- a/examples/02_PlayOnClick.html +++ b/examples/02_PlayOnClick.html @@ -76,7 +76,7 @@

    Sorry!

    with the device and browser you are using. Thank you.

    - + diff --git a/examples/03_PlayWithEaselJS.html b/examples/03_PlayWithEaselJS.html index 5309f552..84673f21 100644 --- a/examples/03_PlayWithEaselJS.html +++ b/examples/03_PlayWithEaselJS.html @@ -35,7 +35,7 @@

    Sorry!

    - + diff --git a/examples/04_SoundTween.html b/examples/04_SoundTween.html old mode 100644 new mode 100755 index fddd2cb8..eb8fdcc8 --- a/examples/04_SoundTween.html +++ b/examples/04_SoundTween.html @@ -14,7 +14,7 @@

    Sound Tween

    -

    This example shows how to tween volume and pan.

    +

    This example shows how to tween volume and pan. Note that HTML audio does not support panning.

    @@ -56,9 +56,9 @@

    Sorry!

    - + - + @@ -129,29 +129,33 @@

    Sorry!

    function initSoundTween() { setMessage("Volume Down: 0.0"); - tween = createjs.Tween.get(soundInstance, {loop: true}) + tween = createjs.Tween.get(soundInstance, {loop: true, onChange:handleSoundChange}) .to({volume: 0.0}, 3 * baseTime) - .wait(baseTime).call(setMessage, ["Volume Up: 0.5"]) + .wait(baseTime) .to({volume: 0.5}, 3 * baseTime) - .wait(baseTime).call(setMessage, ["Volume Up: 1.0"]) + .wait(baseTime) .to({volume: 1.0}, 3 * baseTime) - .wait(baseTime).call(setMessage, ["Volume Down: 0.5"]) + .wait(baseTime) .to({volume: 0.5}, 3 * baseTime) - .wait(baseTime).call(setMessage, ["Pan Right: 1.0"]) + .wait(baseTime) .to({pan: 1}, 3 * baseTime) - .wait(baseTime).call(setMessage, ["Pan Center: 0.0"]) + .wait(baseTime) .to({pan: 0}, 3 * baseTime) - .wait(baseTime).call(setMessage, ["Pan Left: -1.0"]) + .wait(baseTime) .to({pan: -1}, 3 * baseTime) - .wait(baseTime).call(setMessage, ["Pan Center: 0.0"]) + .wait(baseTime) .to({pan: 0}, 3 * baseTime) - .wait(baseTime).call(setMessage, ["Volume Down: 0.0, Pan Left: -1.0"]) + .wait(baseTime) .to({pan: -1, volume: 0.0}, 3 * baseTime) - .wait(baseTime).call(setMessage, ["Volume Up: 1.0, Pan Right: 1.0"]) + .wait(baseTime) .to({pan: 1, volume: 1}, 6 * baseTime) - .wait(baseTime).call(setMessage, ["Volume Down: 0.5, Pan Center: 0.0"]) + .wait(baseTime) .to({pan: 0, volume: 0.5}, 3 * baseTime) - .wait(baseTime).call(setMessage, ["Volume Down: 0.0"]); + .wait(baseTime) + } + + function handleSoundChange() { + setMessage("Volume Up:" + soundInstance.volume.toFixed(2) +" Pan Right:" + soundInstance.pan.toFixed(2)) + ""; } function setMessage(message) { diff --git a/examples/05_AudioSprite.html b/examples/05_AudioSprite.html old mode 100644 new mode 100755 index dcd9bfa3..e647c931 --- a/examples/05_AudioSprite.html +++ b/examples/05_AudioSprite.html @@ -29,10 +29,25 @@

    Sorry!

    with the device and browser you are using. Thank you.

    - + + - - - - -
    -

    Mobile Safe Play

    - -

    This example registers and plays a sound with SoundJS in a way that will - work on mobile devices.

    -
    - -
    -

    Hello World.

    -
    - -
    -

    Sorry!

    - -

    SoundJS is not currently supported in your browser.

    - -

    Please log a bug - with the device and browser you are using. Thank you.

    -
    - - - - - - - - diff --git a/examples/07_WebAudioNodeInsertion.html b/examples/07_WebAudioNodeInsertion.html index d03e116b..1fb98e46 100644 --- a/examples/07_WebAudioNodeInsertion.html +++ b/examples/07_WebAudioNodeInsertion.html @@ -35,7 +35,7 @@

    Sorry!

    - + @@ -54,7 +54,7 @@

    Sorry!

    // global variables var stage; // the stage we draw everything to - var h, w; // variables to store the width and height of the canvas + var w, h; // store the width and height of the canvas var centerX, centerY; // variables to hold the center point, so that tick is quicker var messageField; // Message display field var assetsPath = "../_assets/audio/"; // Create a single item to load. @@ -76,13 +76,11 @@

    Sorry!

    return; } - // create a new stage and point it at our canvas: - var canvas = document.getElementById("testCanvas"); - stage = new createjs.Stage(canvas); + stage = new createjs.Stage("testCanvas"); - // set the width and height, so we only have to access this data once (quicker) - h = canvas.height; - w = canvas.width; + // Store the width and height, so we only have to access this data once (quicker) + h = stage.canvas.height; + w = stage.canvas.width; // calculate the center point, so we only have to do this math once (quicker) centerX = w >> 1; centerY = h >> 1; @@ -96,12 +94,12 @@

    Sorry!

    stage.addChild(messageField); stage.update(); //update the stage to show text - createjs.Sound.addEventListener("fileload", createjs.proxy(handleLoad, this)); // add an event listener for when load is completed - createjs.Sound.registerSound(src); // register sound, which preloads by default + createjs.Sound.on("fileload", handleLoad, this); // add an event listener for when load is completed + createjs.Sound.registerSound(src); // register sound, which will preload automatically } function handleLoad(evt) { - // get the context. NOTE to connect to existing nodes we need to work in the same context. + // get the context. NOTE to connect to existing nodes we need to work in the same context. var context = createjs.Sound.activePlugin.context; // create an analyser node @@ -126,13 +124,12 @@

    Sorry!

    // enable touch interactions if supported on the current device, and display appropriate message if (createjs.Touch.enable(stage)) { messageField.text = "Touch to start"; + // wrap our sound playing in a click event so we can be played on mobile devices + stage.addEventListener("stagemousedown", startPlayback); + stage.update(); //update the stage to show text } else { - messageField.text = "Click to start"; + startPlayback(); } - stage.update(); //update the stage to show text - - // wrap our sound playing in a click event so we can be played on mobile devices - stage.addEventListener("stagemousedown", startPlayback); } // this will start our playback in response to a user click, allowing this demo to work on mobile devices diff --git a/examples/Game/Game.html b/examples/Game/Game.html index a0e3933d..d3f661e4 100644 --- a/examples/Game/Game.html +++ b/examples/Game/Game.html @@ -47,7 +47,7 @@

    Sorry!

    - + diff --git a/examples/Game/Ship.js b/examples/Game/Ship.js index 090bc4bd..fc6a2bae 100644 --- a/examples/Game/Ship.js +++ b/examples/Game/Ship.js @@ -101,7 +101,7 @@ } p.accelerate = function () { - //increase push ammount for acceleration + //increase push amount for acceleration this.thrust += this.thrust + 0.6; if (this.thrust >= Ship.MAX_THRUST) { this.thrust = Ship.MAX_THRUST; @@ -118,4 +118,4 @@ window.Ship = createjs.promote(Ship, "Container"); -}(window)); \ No newline at end of file +}(window)); diff --git a/examples/Game/SpaceRock.js b/examples/Game/SpaceRock.js index e3dd5375..334bf18f 100644 --- a/examples/Game/SpaceRock.js +++ b/examples/Game/SpaceRock.js @@ -18,7 +18,7 @@ p.bounds; //visual radial size p.hit; //average radial disparity p.size; //size value itself - p.spin; //spin ammount + p.spin; //spin amount p.score; //score value p.vX; //velocity X diff --git a/examples/MediaPlayer/MediaPlayer.html b/examples/MediaPlayer/MediaPlayer.html index f861de4e..b69a9211 100644 --- a/examples/MediaPlayer/MediaPlayer.html +++ b/examples/MediaPlayer/MediaPlayer.html @@ -141,12 +141,12 @@

    Sorry!

    with the device and browser you are using. Thank you.

    - + - + diff --git a/examples/TestSuite.html b/examples/TestSuite.html index eaf278dd..3bd24552 100644 --- a/examples/TestSuite.html +++ b/examples/TestSuite.html @@ -252,12 +252,12 @@

    Sorry!

    with the device and browser you are using. Thank you.

    - - + + - + - + @@ -351,7 +351,7 @@

    Sorry!

    createjs.Sound.stop(); }); $("#muteAllSoundsBtn").click(function (event) { - var muted = !createjs.Sound.getMute(); + var muted = !createjs.Sound.muted; createjs.Sound.muted = muted; $("#muteAllSoundsBtn").attr("value", muted ? "Unmute All Sounds" : "Mute All Sounds"); }); diff --git a/lib/README.md b/lib/README.md new file mode 100644 index 00000000..a3027626 --- /dev/null +++ b/lib/README.md @@ -0,0 +1,27 @@ +# lib directory +This directory contains compressed versions of the SoundJS library, including the most recent tagged release and the +in-progress NEXT release. + +Both combined and minified versions of the library are included. The former being useful for debugging, and the latter +for deployment. + +You can also link to the libraries on the [CreateJS CDN](http://code.createjs.com/), to benefit from faster load times +and shared caching across sites. + +# libraries +* **soundjs.js** the most recent _tagged_ version of all the SoundJS classes. +* **soundjs.min.js** the most recent tagged version, minified and stripped of comments and whitespace. +* **soundjs-NEXT.js** contains the _latest_ SoundJS classes. +* **soundjs-NEXT.min.js** is a minified version of the _latest updates_ to the library. + +## plugins +SoundJS plugins are also minified for easy inclusion. +* **flashplugin.js** a plugin to utilize Adobe Flash to playback audio. +* **flashplugin.js** a minified version of the flash plugin, stripped of comments and whitespace. +* **cordovaplugin.js** a plugin to utilize Cordova/PhoneGap APIs to playback audio. +* **cordovaplugin.js** a minified version of the cordova plugin, stripped of comments and whitespace. + + +# license +The libraries are ©20107 gskinner.com, inc., and made available under the highly permissive MIT open source software +license. See the source file header for the full license text. diff --git a/lib/README.txt b/lib/README.txt deleted file mode 100644 index b04d9624..00000000 --- a/lib/README.txt +++ /dev/null @@ -1,24 +0,0 @@ -# lib directory -This directory contains a compressed version of the SoundJS library, including the most recent tagged release and the -in-progress NEXT release. - -Both combined and minified versions of the library are included. The former being useful for debugging, and the latter -for deployment. - -You can also link to the libraries on the [CreateJS CDN](http://code.createjs.com/), to benefit from faster load times -and shared caching across sites. - -# libraries -**soundjs-VERSION.min.js** contains minified versions of all of the SoundJS classes (comments and white space stripped) -except for the Flash and Cordova audio plugins. -**flashaudioplugin-VERSION.min.js** contains minified versions of the Flash audio plugin. -**cordovaaudioplugin-VERSION.min.js** contains minified versions of the Cordova audio plugin. -**soundjs-VERSION.combined.js** contains all the SoundJS classes (except Flash and Cordova plugin classes) including -whitespace and comments. -**flashaudioplugin-VERSION.combined.js** contains all the Flash audio plugin classes. -**cordovaaudioplugin-VERSION.combined.js** contains all the Cordova audio plugin classes. - - -# license -The libraries are ©2010 gskinner.com, inc., and made available under the highly permissive MIT open source software -license. See the source file header for the full license text. diff --git a/lib/cordovaaudioplugin-0.6.2.min.js b/lib/cordovaaudioplugin-0.6.2.min.js deleted file mode 100644 index 26f80cc9..00000000 --- a/lib/cordovaaudioplugin-0.6.2.min.js +++ /dev/null @@ -1,17 +0,0 @@ -/*! -* @license SoundJS -* Visit http://createjs.com/ for documentation, updates and examples. -* -* Copyright (c) 2011-2015 gskinner.com, inc. -* -* 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. -*/ - -/**! - * SoundJS FlashAudioPlugin also includes swfobject (http://code.google.com/p/swfobject/) - */ - -this.createjs=this.createjs||{},function(){"use strict";function a(a){this.AbstractLoader_constructor(a,!0,createjs.AbstractLoader.SOUND),this._media=null,this._loadTime=0,this._TIMER_FREQUENCY=100}var b=createjs.extend(a,createjs.AbstractLoader);b.load=function(){this._media=new Media(this._item.src,null,createjs.proxy(this._mediaErrorHandler,this)),this._media.seekTo(0),this._getMediaDuration()},b.toString=function(){return"[CordovaAudioLoader]"},b._mediaErrorHandler=function(){this._media.release(),this._sendError()},b._getMediaDuration=function(){this._result=1e3*this._media.getDuration(),this._result<0?(this._loadTime+=this._TIMER_FREQUENCY,this._loadTime>this._item.loadTimeout?this.handleEvent({type:"timeout"}):setTimeout(createjs.proxy(this._getMediaDuration,this),this._TIMER_FREQUENCY)):(this._media.release(),this._sendComplete())},createjs.CordovaAudioLoader=createjs.promote(a,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function CordovaAudioSoundInstance(a,b,c,d){this.AbstractSoundInstance_constructor(a,b,c,d),this.playWhenScreenLocked=null,this._playStartTime=null,this._audioSpriteTimeout=null,this._audioSprite=!1,this._audioSpriteEndHandler=createjs.proxy(this._handleAudioSpriteComplete,this),this._mediaPlayFinishedHandler=createjs.proxy(this._handleSoundComplete,this),this._mediaErrorHandler=createjs.proxy(this._handleMediaError,this),this._mediaProgressHandler=createjs.proxy(this._handleMediaProgress,this),this._playbackResource=new Media(a,this._mediaPlayFinishedHandler,this._mediaErrorHandler,this._mediaProgressHandler),c?this._audioSprite=!0:this._setDurationFromSource()}var a=createjs.extend(CordovaAudioSoundInstance,createjs.AbstractSoundInstance);a.setMasterVolume=function(){this._updateVolume()},a.setMasterMute=function(){this._updateVolume()},a.destroy=function(){this.AbstractSoundInstance_destroy(),this._playbackResource.release()},a.getCurrentPosition=function(a,b){this._playbackResource.getCurrentPosition(a,b)},a.toString=function(){return"[CordovaAudioSoundInstance]"},a._handleMediaError=function(){clearTimeout(this.delayTimeoutId),this.playState=createjs.Sound.PLAY_FAILED,this._sendEvent("failed")},a._handleMediaProgress=function(){},a._handleAudioSpriteComplete=function(){this._playbackResource.pause(),this._handleSoundComplete()},a._handleCleanUp=function(){clearTimeout(this._audioSpriteTimeout),this._playbackResource.pause()},a._handleSoundReady=function(){this._playbackResource.seekTo(this._startTime+this._position),this._audioSprite&&(this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this._position)),this._playbackResource.play({playAudioWhenScreenIsLocked:this.playWhenScreenLocked}),this._playStartTime=Date.now()},a._pause=function(){clearTimeout(this._audioSpriteTimeout),this._playbackResource.pause(),this._playStartTime&&(this._position=Date.now()-this._playStartTime,this._playStartTime=null),this._playbackResource.getCurrentPosition(createjs.proxy(this._updatePausePos,this))},a._updatePausePos=function(a){this._position=1e3*a-this._startTime,this._playStartTime&&(this._playStartTime=Date.now())},a._resume=function(){this._audioSprite&&(this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this._position)),this._playbackResource.play({playAudioWhenScreenIsLocked:this.playWhenScreenLocked}),this._playStartTime=Date.now()},a._handleStop=function(){clearTimeout(this._audioSpriteTimeout),this._playbackResource.pause(),this._playbackResource.seekTo(this._startTime),this._playStartTime&&(this._position=0,this._playStartTime=null)},a._updateVolume=function(){var a=this._muted||createjs.Sound._masterMute?0:this._volume*createjs.Sound._masterVolume;this._playbackResource.setVolume(a)},a._calculateCurrentPosition=function(){return this._playStartTime&&(this._position=Date.now()-this._playStartTime+this._position,this._playStartTime=Date.now()),this._position},a._updatePosition=function(){this._playbackResource.seekTo(this._startTime+this._position),this._playStartTime=Date.now(),this._audioSprite&&(clearTimeout(this._audioSpriteTimeout),this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this._position))},a._handleLoop=function(){this._handleSoundReady()},a._updateStartTime=function(){this._audioSprite=!0,this.playState==createjs.Sound.PLAY_SUCCEEDED},a._updateDuration=function(){this._audioSprite,this.playState==createjs.Sound.PLAY_SUCCEEDED&&(clearTimeout(this._audioSpriteTimeout),this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this.position))},a._setDurationFromSource=function(){this._duration=createjs.Sound.activePlugin.getSrcDuration(this.src)},createjs.CordovaAudioSoundInstance=createjs.promote(CordovaAudioSoundInstance,"AbstractSoundInstance")}(),this.createjs=this.createjs||{},function(){"use strict";function CordovaAudioPlugin(){this.AbstractPlugin_constructor(),this._capabilities=b._capabilities,this._loaderClass=createjs.CordovaAudioLoader,this._soundInstanceClass=createjs.CordovaAudioSoundInstance,this._srcDurationHash={}}var a=createjs.extend(CordovaAudioPlugin,createjs.AbstractPlugin),b=CordovaAudioPlugin;b.playWhenScreenLocked=!1,b._capabilities=null,b.isSupported=function(){return b._generateCapabilities(),null!=b._capabilities},b._generateCapabilities=function(){if(null==b._capabilities&&(window.cordova||window.PhoneGap||window.phonegap)&&window.Media){var a=document.createElement("audio");if(null==a.canPlayType)return null;b._capabilities={panning:!1,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}}},a.create=function(a,b,c){var d=this.AbstractPlugin_create(a,b,c);return d.playWhenScreenLocked=this.playWhenScreenLocked,d},a.toString=function(){return"[CordovaAudioPlugin]"},a.setVolume=a.getVolume=a.setMute=null,a.getSrcDuration=function(a){return this._srcDurationHash[a]},a._handlePreloadComplete=function(a){var b=a.target.getItem().src;this._srcDurationHash[b]=a.result,this._audioSources[b]=a.result},a.removeSound=function(a){delete this._srcDurationHash[a],this.AbstractPlugin_removeSound(a)},createjs.CordovaAudioPlugin=createjs.promote(CordovaAudioPlugin,"AbstractPlugin")}(),this.createjs=this.createjs||{},function(){var a=createjs.CordovaAudioPlugin=createjs.CordovaAudioPlugin||{};a.version="0.6.2",a.buildDate="Thu, 26 Nov 2015 20:44:31 GMT"}(); \ No newline at end of file diff --git a/lib/cordovaaudioplugin-NEXT.combined.js b/lib/cordovaaudioplugin-NEXT.js similarity index 97% rename from lib/cordovaaudioplugin-NEXT.combined.js rename to lib/cordovaaudioplugin-NEXT.js index 07567f09..8773e703 100644 --- a/lib/cordovaaudioplugin-NEXT.combined.js +++ b/lib/cordovaaudioplugin-NEXT.js @@ -48,7 +48,7 @@ this.createjs = this.createjs || {}; * @protected */ function Loader(loadItem) { - this.AbstractLoader_constructor(loadItem, true, createjs.AbstractLoader.SOUND); + this.AbstractLoader_constructor(loadItem, true, createjs.Types.SOUND); /** * A Media object used to determine if src exists and to get duration @@ -223,9 +223,10 @@ this.createjs = this.createjs || {}; }; p.destroy = function() { - // call parent function, then release - this.AbstractSoundInstance_destroy(); + // pause and release the playback resource, then call parent function + this._playbackResource.pause(); this._playbackResource.release(); + this.AbstractSoundInstance_destroy(); }; /** @@ -275,7 +276,7 @@ this.createjs = this.createjs || {}; p._handleCleanUp = function () { clearTimeout(this._audioSpriteTimeout); - this._playbackResource.pause(); // OJR cannot use .stop as it prevents .seekTo from working + // OJR cannot use .stop as it prevents .seekTo from working // todo consider media.release }; @@ -445,11 +446,11 @@ this.createjs = this.createjs || {}; /** * The capabilities of the plugin. This is generated via the {{#crossLink "CordovaAudioPlugin/_generateCapabilities"}}{{/crossLink}} - * method. Please see the Sound {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} method for an overview of all + * method. Please see the Sound {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} method for an overview of all * of the available properties. * @property _capabilities * @type {Object} - * @protected + * @private * @static */ s._capabilities = null; @@ -469,11 +470,11 @@ this.createjs = this.createjs || {}; }; /** - * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} + * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} * method for an overview of plugin capabilities. * @method _generateCapabilities * @static - * @protected + * @private */ s._generateCapabilities = function () { if (s._capabilities != null || !(window.cordova || window.PhoneGap || window.phonegap) || !window.Media) {return;} @@ -565,6 +566,6 @@ this.createjs = this.createjs || {}; * @type String * @static **/ - s.buildDate = /*=date*/"Mon, 14 Sep 2015 19:11:47 GMT"; // injected by build process + s.buildDate = /*=date*/"Wed, 21 Jun 2017 16:53:32 GMT"; // injected by build process })(); \ No newline at end of file diff --git a/lib/cordovaaudioplugin-NEXT.min.js b/lib/cordovaaudioplugin-NEXT.min.js index ef27c7f2..d0a91ffc 100644 --- a/lib/cordovaaudioplugin-NEXT.min.js +++ b/lib/cordovaaudioplugin-NEXT.min.js @@ -14,4 +14,4 @@ * SoundJS FlashAudioPlugin also includes swfobject (http://code.google.com/p/swfobject/) */ -this.createjs=this.createjs||{},function(){"use strict";function a(a){this.AbstractLoader_constructor(a,!0,createjs.AbstractLoader.SOUND),this._media=null,this._loadTime=0,this._TIMER_FREQUENCY=100}var b=createjs.extend(a,createjs.AbstractLoader);b.load=function(){this._media=new Media(this._item.src,null,createjs.proxy(this._mediaErrorHandler,this)),this._media.seekTo(0),this._getMediaDuration()},b.toString=function(){return"[CordovaAudioLoader]"},b._mediaErrorHandler=function(a){this._media.release(),this._sendError()},b._getMediaDuration=function(){this._result=1e3*this._media.getDuration(),this._result<0?(this._loadTime+=this._TIMER_FREQUENCY,this._loadTime>this._item.loadTimeout?this.handleEvent({type:"timeout"}):setTimeout(createjs.proxy(this._getMediaDuration,this),this._TIMER_FREQUENCY)):(this._media.release(),this._sendComplete())},createjs.CordovaAudioLoader=createjs.promote(a,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function CordovaAudioSoundInstance(a,b,c,d){this.AbstractSoundInstance_constructor(a,b,c,d),this.playWhenScreenLocked=null,this._playStartTime=null,this._audioSpriteTimeout=null,this._audioSprite=!1,this._audioSpriteEndHandler=createjs.proxy(this._handleAudioSpriteComplete,this),this._mediaPlayFinishedHandler=createjs.proxy(this._handleSoundComplete,this),this._mediaErrorHandler=createjs.proxy(this._handleMediaError,this),this._mediaProgressHandler=createjs.proxy(this._handleMediaProgress,this),this._playbackResource=new Media(a,this._mediaPlayFinishedHandler,this._mediaErrorHandler,this._mediaProgressHandler),c?this._audioSprite=!0:this._setDurationFromSource()}var a=createjs.extend(CordovaAudioSoundInstance,createjs.AbstractSoundInstance);a.setMasterVolume=function(a){this._updateVolume()},a.setMasterMute=function(a){this._updateVolume()},a.destroy=function(){this.AbstractSoundInstance_destroy(),this._playbackResource.release()},a.getCurrentPosition=function(a,b){this._playbackResource.getCurrentPosition(a,b)},a.toString=function(){return"[CordovaAudioSoundInstance]"},a._handleMediaError=function(a){clearTimeout(this.delayTimeoutId),this.playState=createjs.Sound.PLAY_FAILED,this._sendEvent("failed")},a._handleMediaProgress=function(a){},a._handleAudioSpriteComplete=function(){this._playbackResource.pause(),this._handleSoundComplete()},a._handleCleanUp=function(){clearTimeout(this._audioSpriteTimeout),this._playbackResource.pause()},a._handleSoundReady=function(a){this._playbackResource.seekTo(this._startTime+this._position),this._audioSprite&&(this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this._position)),this._playbackResource.play({playAudioWhenScreenIsLocked:this.playWhenScreenLocked}),this._playStartTime=Date.now()},a._pause=function(){clearTimeout(this._audioSpriteTimeout),this._playbackResource.pause(),this._playStartTime&&(this._position=Date.now()-this._playStartTime,this._playStartTime=null),this._playbackResource.getCurrentPosition(createjs.proxy(this._updatePausePos,this))},a._updatePausePos=function(a){this._position=1e3*a-this._startTime,this._playStartTime&&(this._playStartTime=Date.now())},a._resume=function(){this._audioSprite&&(this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this._position)),this._playbackResource.play({playAudioWhenScreenIsLocked:this.playWhenScreenLocked}),this._playStartTime=Date.now()},a._handleStop=function(){clearTimeout(this._audioSpriteTimeout),this._playbackResource.pause(),this._playbackResource.seekTo(this._startTime),this._playStartTime&&(this._position=0,this._playStartTime=null)},a._updateVolume=function(){var a=this._muted||createjs.Sound._masterMute?0:this._volume*createjs.Sound._masterVolume;this._playbackResource.setVolume(a)},a._calculateCurrentPosition=function(){return this._playStartTime&&(this._position=Date.now()-this._playStartTime+this._position,this._playStartTime=Date.now()),this._position},a._updatePosition=function(){this._playbackResource.seekTo(this._startTime+this._position),this._playStartTime=Date.now(),this._audioSprite&&(clearTimeout(this._audioSpriteTimeout),this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this._position))},a._handleLoop=function(a){this._handleSoundReady()},a._updateStartTime=function(){this._audioSprite=!0,this.playState==createjs.Sound.PLAY_SUCCEEDED},a._updateDuration=function(){this._audioSprite,this.playState==createjs.Sound.PLAY_SUCCEEDED&&(clearTimeout(this._audioSpriteTimeout),this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this.position))},a._setDurationFromSource=function(){this._duration=createjs.Sound.activePlugin.getSrcDuration(this.src)},createjs.CordovaAudioSoundInstance=createjs.promote(CordovaAudioSoundInstance,"AbstractSoundInstance")}(),this.createjs=this.createjs||{},function(){"use strict";function CordovaAudioPlugin(){this.AbstractPlugin_constructor(),this._capabilities=b._capabilities,this._loaderClass=createjs.CordovaAudioLoader,this._soundInstanceClass=createjs.CordovaAudioSoundInstance,this._srcDurationHash={}}var a=createjs.extend(CordovaAudioPlugin,createjs.AbstractPlugin),b=CordovaAudioPlugin;b.playWhenScreenLocked=!1,b._capabilities=null,b.isSupported=function(){return b._generateCapabilities(),null!=b._capabilities},b._generateCapabilities=function(){if(null==b._capabilities&&(window.cordova||window.PhoneGap||window.phonegap)&&window.Media){var a=document.createElement("audio");if(null==a.canPlayType)return null;b._capabilities={panning:!1,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}}},a.create=function(a,b,c){var d=this.AbstractPlugin_create(a,b,c);return d.playWhenScreenLocked=this.playWhenScreenLocked,d},a.toString=function(){return"[CordovaAudioPlugin]"},a.setVolume=a.getVolume=a.setMute=null,a.getSrcDuration=function(a){return this._srcDurationHash[a]},a._handlePreloadComplete=function(a){var b=a.target.getItem().src;this._srcDurationHash[b]=a.result,this._audioSources[b]=a.result},a.removeSound=function(a){delete this._srcDurationHash[a],this.AbstractPlugin_removeSound(a)},createjs.CordovaAudioPlugin=createjs.promote(CordovaAudioPlugin,"AbstractPlugin")}(),this.createjs=this.createjs||{},function(){var a=createjs.CordovaAudioPlugin=createjs.CordovaAudioPlugin||{};a.version="NEXT",a.buildDate="Mon, 14 Sep 2015 19:11:47 GMT"}(); \ No newline at end of file +this.createjs=this.createjs||{},function(){"use strict";function a(a){this.AbstractLoader_constructor(a,!0,createjs.Types.SOUND),this._media=null,this._loadTime=0,this._TIMER_FREQUENCY=100}var b=createjs.extend(a,createjs.AbstractLoader);b.load=function(){this._media=new Media(this._item.src,null,createjs.proxy(this._mediaErrorHandler,this)),this._media.seekTo(0),this._getMediaDuration()},b.toString=function(){return"[CordovaAudioLoader]"},b._mediaErrorHandler=function(){this._media.release(),this._sendError()},b._getMediaDuration=function(){this._result=1e3*this._media.getDuration(),this._result<0?(this._loadTime+=this._TIMER_FREQUENCY,this._loadTime>this._item.loadTimeout?this.handleEvent({type:"timeout"}):setTimeout(createjs.proxy(this._getMediaDuration,this),this._TIMER_FREQUENCY)):(this._media.release(),this._sendComplete())},createjs.CordovaAudioLoader=createjs.promote(a,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function CordovaAudioSoundInstance(a,b,c,d){this.AbstractSoundInstance_constructor(a,b,c,d),this.playWhenScreenLocked=null,this._playStartTime=null,this._audioSpriteTimeout=null,this._audioSprite=!1,this._audioSpriteEndHandler=createjs.proxy(this._handleAudioSpriteComplete,this),this._mediaPlayFinishedHandler=createjs.proxy(this._handleSoundComplete,this),this._mediaErrorHandler=createjs.proxy(this._handleMediaError,this),this._mediaProgressHandler=createjs.proxy(this._handleMediaProgress,this),this._playbackResource=new Media(a,this._mediaPlayFinishedHandler,this._mediaErrorHandler,this._mediaProgressHandler),c?this._audioSprite=!0:this._setDurationFromSource()}var a=createjs.extend(CordovaAudioSoundInstance,createjs.AbstractSoundInstance);a.setMasterVolume=function(){this._updateVolume()},a.setMasterMute=function(){this._updateVolume()},a.destroy=function(){this._playbackResource.pause(),this._playbackResource.release(),this.AbstractSoundInstance_destroy()},a.getCurrentPosition=function(a,b){this._playbackResource.getCurrentPosition(a,b)},a.toString=function(){return"[CordovaAudioSoundInstance]"},a._handleMediaError=function(){clearTimeout(this.delayTimeoutId),this.playState=createjs.Sound.PLAY_FAILED,this._sendEvent("failed")},a._handleMediaProgress=function(){},a._handleAudioSpriteComplete=function(){this._playbackResource.pause(),this._handleSoundComplete()},a._handleCleanUp=function(){clearTimeout(this._audioSpriteTimeout)},a._handleSoundReady=function(){this._playbackResource.seekTo(this._startTime+this._position),this._audioSprite&&(this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this._position)),this._playbackResource.play({playAudioWhenScreenIsLocked:this.playWhenScreenLocked}),this._playStartTime=Date.now()},a._pause=function(){clearTimeout(this._audioSpriteTimeout),this._playbackResource.pause(),this._playStartTime&&(this._position=Date.now()-this._playStartTime,this._playStartTime=null),this._playbackResource.getCurrentPosition(createjs.proxy(this._updatePausePos,this))},a._updatePausePos=function(a){this._position=1e3*a-this._startTime,this._playStartTime&&(this._playStartTime=Date.now())},a._resume=function(){this._audioSprite&&(this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this._position)),this._playbackResource.play({playAudioWhenScreenIsLocked:this.playWhenScreenLocked}),this._playStartTime=Date.now()},a._handleStop=function(){clearTimeout(this._audioSpriteTimeout),this._playbackResource.pause(),this._playbackResource.seekTo(this._startTime),this._playStartTime&&(this._position=0,this._playStartTime=null)},a._updateVolume=function(){var a=this._muted||createjs.Sound._masterMute?0:this._volume*createjs.Sound._masterVolume;this._playbackResource.setVolume(a)},a._calculateCurrentPosition=function(){return this._playStartTime&&(this._position=Date.now()-this._playStartTime+this._position,this._playStartTime=Date.now()),this._position},a._updatePosition=function(){this._playbackResource.seekTo(this._startTime+this._position),this._playStartTime=Date.now(),this._audioSprite&&(clearTimeout(this._audioSpriteTimeout),this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this._position))},a._handleLoop=function(){this._handleSoundReady()},a._updateStartTime=function(){this._audioSprite=!0,this.playState==createjs.Sound.PLAY_SUCCEEDED},a._updateDuration=function(){this._audioSprite,this.playState==createjs.Sound.PLAY_SUCCEEDED&&(clearTimeout(this._audioSpriteTimeout),this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this.position))},a._setDurationFromSource=function(){this._duration=createjs.Sound.activePlugin.getSrcDuration(this.src)},createjs.CordovaAudioSoundInstance=createjs.promote(CordovaAudioSoundInstance,"AbstractSoundInstance")}(),this.createjs=this.createjs||{},function(){"use strict";function CordovaAudioPlugin(){this.AbstractPlugin_constructor(),this._capabilities=b._capabilities,this._loaderClass=createjs.CordovaAudioLoader,this._soundInstanceClass=createjs.CordovaAudioSoundInstance,this._srcDurationHash={}}var a=createjs.extend(CordovaAudioPlugin,createjs.AbstractPlugin),b=CordovaAudioPlugin;b.playWhenScreenLocked=!1,b._capabilities=null,b.isSupported=function(){return b._generateCapabilities(),null!=b._capabilities},b._generateCapabilities=function(){if(null==b._capabilities&&(window.cordova||window.PhoneGap||window.phonegap)&&window.Media){var a=document.createElement("audio");if(null==a.canPlayType)return null;b._capabilities={panning:!1,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}}},a.create=function(a,b,c){var d=this.AbstractPlugin_create(a,b,c);return d.playWhenScreenLocked=this.playWhenScreenLocked,d},a.toString=function(){return"[CordovaAudioPlugin]"},a.setVolume=a.getVolume=a.setMute=null,a.getSrcDuration=function(a){return this._srcDurationHash[a]},a._handlePreloadComplete=function(a){var b=a.target.getItem().src;this._srcDurationHash[b]=a.result,this._audioSources[b]=a.result},a.removeSound=function(a){delete this._srcDurationHash[a],this.AbstractPlugin_removeSound(a)},createjs.CordovaAudioPlugin=createjs.promote(CordovaAudioPlugin,"AbstractPlugin")}(),this.createjs=this.createjs||{},function(){var a=createjs.CordovaAudioPlugin=createjs.CordovaAudioPlugin||{};a.version="NEXT",a.buildDate="Wed, 21 Jun 2017 16:53:32 GMT"}(); \ No newline at end of file diff --git a/lib/cordovaaudioplugin-0.6.2.combined.js b/lib/cordovaaudioplugin.js similarity index 96% rename from lib/cordovaaudioplugin-0.6.2.combined.js rename to lib/cordovaaudioplugin.js index 594f8456..2688126c 100644 --- a/lib/cordovaaudioplugin-0.6.2.combined.js +++ b/lib/cordovaaudioplugin.js @@ -48,7 +48,7 @@ this.createjs = this.createjs || {}; * @protected */ function Loader(loadItem) { - this.AbstractLoader_constructor(loadItem, true, createjs.AbstractLoader.SOUND); + this.AbstractLoader_constructor(loadItem, true, createjs.Types.SOUND); /** * A Media object used to determine if src exists and to get duration @@ -223,9 +223,10 @@ this.createjs = this.createjs || {}; }; p.destroy = function() { - // call parent function, then release - this.AbstractSoundInstance_destroy(); + // pause and release the playback resource, then call parent function + this._playbackResource.pause(); this._playbackResource.release(); + this.AbstractSoundInstance_destroy(); }; /** @@ -275,7 +276,7 @@ this.createjs = this.createjs || {}; p._handleCleanUp = function () { clearTimeout(this._audioSpriteTimeout); - this._playbackResource.pause(); // OJR cannot use .stop as it prevents .seekTo from working + // OJR cannot use .stop as it prevents .seekTo from working // todo consider media.release }; @@ -445,11 +446,11 @@ this.createjs = this.createjs || {}; /** * The capabilities of the plugin. This is generated via the {{#crossLink "CordovaAudioPlugin/_generateCapabilities"}}{{/crossLink}} - * method. Please see the Sound {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} method for an overview of all + * method. Please see the Sound {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} method for an overview of all * of the available properties. * @property _capabilities * @type {Object} - * @protected + * @private * @static */ s._capabilities = null; @@ -469,11 +470,11 @@ this.createjs = this.createjs || {}; }; /** - * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} + * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} * method for an overview of plugin capabilities. * @method _generateCapabilities * @static - * @protected + * @private */ s._generateCapabilities = function () { if (s._capabilities != null || !(window.cordova || window.PhoneGap || window.phonegap) || !window.Media) {return;} @@ -556,7 +557,7 @@ this.createjs = this.createjs || {}; * @type String * @static **/ - s.version = /*=version*/"0.6.2"; // injected by build process + s.version = /*=version*/"1.0.0"; // injected by build process /** * The build date for this release in UTC format. @@ -565,6 +566,6 @@ this.createjs = this.createjs || {}; * @type String * @static **/ - s.buildDate = /*=date*/"Thu, 26 Nov 2015 20:44:31 GMT"; // injected by build process + s.buildDate = /*=date*/"Thu, 14 Sep 2017 19:47:47 GMT"; // injected by build process })(); \ No newline at end of file diff --git a/lib/cordovaaudioplugin.min.js b/lib/cordovaaudioplugin.min.js new file mode 100644 index 00000000..e400d506 --- /dev/null +++ b/lib/cordovaaudioplugin.min.js @@ -0,0 +1,17 @@ +/*! +* @license SoundJS +* Visit http://createjs.com/ for documentation, updates and examples. +* +* Copyright (c) 2011-2015 gskinner.com, inc. +* +* 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. +*/ + +/**! + * SoundJS FlashAudioPlugin also includes swfobject (http://code.google.com/p/swfobject/) + */ + +this.createjs=this.createjs||{},function(){"use strict";function a(a){this.AbstractLoader_constructor(a,!0,createjs.Types.SOUND),this._media=null,this._loadTime=0,this._TIMER_FREQUENCY=100}var b=createjs.extend(a,createjs.AbstractLoader);b.load=function(){this._media=new Media(this._item.src,null,createjs.proxy(this._mediaErrorHandler,this)),this._media.seekTo(0),this._getMediaDuration()},b.toString=function(){return"[CordovaAudioLoader]"},b._mediaErrorHandler=function(){this._media.release(),this._sendError()},b._getMediaDuration=function(){this._result=1e3*this._media.getDuration(),this._result<0?(this._loadTime+=this._TIMER_FREQUENCY,this._loadTime>this._item.loadTimeout?this.handleEvent({type:"timeout"}):setTimeout(createjs.proxy(this._getMediaDuration,this),this._TIMER_FREQUENCY)):(this._media.release(),this._sendComplete())},createjs.CordovaAudioLoader=createjs.promote(a,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function CordovaAudioSoundInstance(a,b,c,d){this.AbstractSoundInstance_constructor(a,b,c,d),this.playWhenScreenLocked=null,this._playStartTime=null,this._audioSpriteTimeout=null,this._audioSprite=!1,this._audioSpriteEndHandler=createjs.proxy(this._handleAudioSpriteComplete,this),this._mediaPlayFinishedHandler=createjs.proxy(this._handleSoundComplete,this),this._mediaErrorHandler=createjs.proxy(this._handleMediaError,this),this._mediaProgressHandler=createjs.proxy(this._handleMediaProgress,this),this._playbackResource=new Media(a,this._mediaPlayFinishedHandler,this._mediaErrorHandler,this._mediaProgressHandler),c?this._audioSprite=!0:this._setDurationFromSource()}var a=createjs.extend(CordovaAudioSoundInstance,createjs.AbstractSoundInstance);a.setMasterVolume=function(){this._updateVolume()},a.setMasterMute=function(){this._updateVolume()},a.destroy=function(){this._playbackResource.pause(),this._playbackResource.release(),this.AbstractSoundInstance_destroy()},a.getCurrentPosition=function(a,b){this._playbackResource.getCurrentPosition(a,b)},a.toString=function(){return"[CordovaAudioSoundInstance]"},a._handleMediaError=function(){clearTimeout(this.delayTimeoutId),this.playState=createjs.Sound.PLAY_FAILED,this._sendEvent("failed")},a._handleMediaProgress=function(){},a._handleAudioSpriteComplete=function(){this._playbackResource.pause(),this._handleSoundComplete()},a._handleCleanUp=function(){clearTimeout(this._audioSpriteTimeout)},a._handleSoundReady=function(){this._playbackResource.seekTo(this._startTime+this._position),this._audioSprite&&(this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this._position)),this._playbackResource.play({playAudioWhenScreenIsLocked:this.playWhenScreenLocked}),this._playStartTime=Date.now()},a._pause=function(){clearTimeout(this._audioSpriteTimeout),this._playbackResource.pause(),this._playStartTime&&(this._position=Date.now()-this._playStartTime,this._playStartTime=null),this._playbackResource.getCurrentPosition(createjs.proxy(this._updatePausePos,this))},a._updatePausePos=function(a){this._position=1e3*a-this._startTime,this._playStartTime&&(this._playStartTime=Date.now())},a._resume=function(){this._audioSprite&&(this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this._position)),this._playbackResource.play({playAudioWhenScreenIsLocked:this.playWhenScreenLocked}),this._playStartTime=Date.now()},a._handleStop=function(){clearTimeout(this._audioSpriteTimeout),this._playbackResource.pause(),this._playbackResource.seekTo(this._startTime),this._playStartTime&&(this._position=0,this._playStartTime=null)},a._updateVolume=function(){var a=this._muted||createjs.Sound._masterMute?0:this._volume*createjs.Sound._masterVolume;this._playbackResource.setVolume(a)},a._calculateCurrentPosition=function(){return this._playStartTime&&(this._position=Date.now()-this._playStartTime+this._position,this._playStartTime=Date.now()),this._position},a._updatePosition=function(){this._playbackResource.seekTo(this._startTime+this._position),this._playStartTime=Date.now(),this._audioSprite&&(clearTimeout(this._audioSpriteTimeout),this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this._position))},a._handleLoop=function(){this._handleSoundReady()},a._updateStartTime=function(){this._audioSprite=!0,this.playState==createjs.Sound.PLAY_SUCCEEDED},a._updateDuration=function(){this._audioSprite,this.playState==createjs.Sound.PLAY_SUCCEEDED&&(clearTimeout(this._audioSpriteTimeout),this._audioSpriteTimeout=setTimeout(this._audioSpriteEndHandler,this._duration-this.position))},a._setDurationFromSource=function(){this._duration=createjs.Sound.activePlugin.getSrcDuration(this.src)},createjs.CordovaAudioSoundInstance=createjs.promote(CordovaAudioSoundInstance,"AbstractSoundInstance")}(),this.createjs=this.createjs||{},function(){"use strict";function CordovaAudioPlugin(){this.AbstractPlugin_constructor(),this._capabilities=b._capabilities,this._loaderClass=createjs.CordovaAudioLoader,this._soundInstanceClass=createjs.CordovaAudioSoundInstance,this._srcDurationHash={}}var a=createjs.extend(CordovaAudioPlugin,createjs.AbstractPlugin),b=CordovaAudioPlugin;b.playWhenScreenLocked=!1,b._capabilities=null,b.isSupported=function(){return b._generateCapabilities(),null!=b._capabilities},b._generateCapabilities=function(){if(null==b._capabilities&&(window.cordova||window.PhoneGap||window.phonegap)&&window.Media){var a=document.createElement("audio");if(null==a.canPlayType)return null;b._capabilities={panning:!1,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}}},a.create=function(a,b,c){var d=this.AbstractPlugin_create(a,b,c);return d.playWhenScreenLocked=this.playWhenScreenLocked,d},a.toString=function(){return"[CordovaAudioPlugin]"},a.setVolume=a.getVolume=a.setMute=null,a.getSrcDuration=function(a){return this._srcDurationHash[a]},a._handlePreloadComplete=function(a){var b=a.target.getItem().src;this._srcDurationHash[b]=a.result,this._audioSources[b]=a.result},a.removeSound=function(a){delete this._srcDurationHash[a],this.AbstractPlugin_removeSound(a)},createjs.CordovaAudioPlugin=createjs.promote(CordovaAudioPlugin,"AbstractPlugin")}(),this.createjs=this.createjs||{},function(){var a=createjs.CordovaAudioPlugin=createjs.CordovaAudioPlugin||{};a.version="1.0.0",a.buildDate="Thu, 14 Sep 2017 19:47:47 GMT"}(); \ No newline at end of file diff --git a/lib/flashaudioplugin-NEXT.combined.js b/lib/flashaudioplugin-NEXT.js similarity index 97% rename from lib/flashaudioplugin-NEXT.combined.js rename to lib/flashaudioplugin-NEXT.js index 8d20e128..827ae762 100644 --- a/lib/flashaudioplugin-NEXT.combined.js +++ b/lib/flashaudioplugin-NEXT.js @@ -829,7 +829,7 @@ this.createjs = this.createjs || {}; * @protected */ function Loader(loadItem) { - this.AbstractLoader_constructor(loadItem, false, createjs.AbstractLoader.SOUND); + this.AbstractLoader_constructor(loadItem, false, createjs.Types.SOUND); // Public properties @@ -844,17 +844,13 @@ this.createjs = this.createjs || {}; } var p = createjs.extend(Loader, createjs.AbstractLoader); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static Properties var s = Loader; /** * A reference to the Flash instance that gets created. * @property flash * @type {Object | Embed} - * @protected + * @private */ s._flash = null; @@ -862,7 +858,7 @@ this.createjs = this.createjs || {}; * A list of loader instances that tried to load before _flash was set * @property _preloadInstances * @type {Array} - * @protected + * @private */ s._preloadInstances = []; @@ -979,10 +975,6 @@ this.createjs = this.createjs || {}; }; var p = createjs.extend(FlashAudioSoundInstance, createjs.AbstractSoundInstance); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static Propeties var s = FlashAudioSoundInstance; /** @@ -1060,13 +1052,13 @@ this.createjs = this.createjs || {}; p._beginPlaying = function (playProps) { if (s._flash == null) { return false; } - this.setPosition(playProps.offset); - this.setLoop(playProps.loop); - this.setVolume(playProps.volume); - this.setPan(playProps.pan); + this.position = playProps.offset; + this.loop = playProps.loop; + this.volume = playProps.volume; + this.pan = playProps.pan; if (playProps.startTime != null) { - this.setStartTime(playProps.startTime); - this.setDuration(playProps.duration); + this.startTime = playProps.startTime; + this.duration = playProps.duration; } this._paused = false; @@ -1287,10 +1279,6 @@ this.createjs = this.createjs || {}; var p = createjs.extend(FlashAudioPlugin, createjs.AbstractPlugin); var s = FlashAudioPlugin; - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static properties /** * Event constant for the "registerFlashID" event for cleaner code. @@ -1298,7 +1286,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default registerflashid * @static - * @protected + * @private */ s._REG_FLASHID = "registerflashid"; @@ -1308,17 +1296,17 @@ this.createjs = this.createjs || {}; * @type {String} * @default unregisterflashid * @static - * @protected + * @private */ s._UNREG_FLASHID = "unregisterflashid"; /** * The capabilities of the plugin. This is generated via the {{#crossLink "WebAudioPlugin/_generateCapabilities"}}{{/crossLink}} - * method. Please see the Sound {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} method for a list of available + * method. Please see the Sound {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} method for a list of available * capabilities. * @property _capabilities * @type {Object} - * @protected + * @private * @static */ s._capabilities = null; @@ -1351,11 +1339,11 @@ this.createjs = this.createjs || {}; }; /** - * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} + * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} * method for an overview of plugin capabilities. * @method _generateCapabilities * @static - * @protected + * @private */ s._generateCapabilities = function () { if (s._capabilities != null) {return;} @@ -1599,6 +1587,6 @@ this.createjs = this.createjs || {}; * @type String * @static **/ - s.buildDate = /*=date*/"Mon, 14 Sep 2015 19:11:47 GMT"; // injected by build process + s.buildDate = /*=date*/"Wed, 21 Jun 2017 16:53:32 GMT"; // injected by build process })(); \ No newline at end of file diff --git a/lib/flashaudioplugin-NEXT.min.js b/lib/flashaudioplugin-NEXT.min.js index 368e7f39..ab445972 100644 --- a/lib/flashaudioplugin-NEXT.min.js +++ b/lib/flashaudioplugin-NEXT.min.js @@ -17,4 +17,4 @@ /*! SWFObject v2.2 is released under the MIT License */ -var swfobject=function(){function a(){if(!R){try{var a=K.getElementsByTagName("body")[0].appendChild(q("span"));a.parentNode.removeChild(a)}catch(b){return}R=!0;for(var c=N.length,d=0;c>d;d++)N[d]()}}function b(a){R?a():N[N.length]=a}function c(a){if(typeof J.addEventListener!=C)J.addEventListener("load",a,!1);else if(typeof K.addEventListener!=C)K.addEventListener("load",a,!1);else if(typeof J.attachEvent!=C)r(J,"onload",a);else if("function"==typeof J.onload){var b=J.onload;J.onload=function(){b(),a()}}else J.onload=a}function d(){M?e():f()}function e(){var a=K.getElementsByTagName("body")[0],b=q(D);b.setAttribute("type",G);var c=a.appendChild(b);if(c){var d=0;!function(){if(typeof c.GetVariable!=C){var e=c.GetVariable("$version");e&&(e=e.split(" ")[1].split(","),U.pv=[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)])}else if(10>d)return d++,void setTimeout(arguments.callee,10);a.removeChild(b),c=null,f()}()}else f()}function f(){var a=O.length;if(a>0)for(var b=0;a>b;b++){var c=O[b].id,d=O[b].callbackFn,e={success:!1,id:c};if(U.pv[0]>0){var f=p(c);if(f)if(!s(O[b].swfVersion)||U.wk&&U.wk<312)if(O[b].expressInstall&&h()){var k={};k.data=O[b].expressInstall,k.width=f.getAttribute("width")||"0",k.height=f.getAttribute("height")||"0",f.getAttribute("class")&&(k.styleclass=f.getAttribute("class")),f.getAttribute("align")&&(k.align=f.getAttribute("align"));for(var l={},m=f.getElementsByTagName("param"),n=m.length,o=0;n>o;o++)"movie"!=m[o].getAttribute("name").toLowerCase()&&(l[m[o].getAttribute("name")]=m[o].getAttribute("value"));i(k,l,c,d)}else j(f),d&&d(e);else u(c,!0),d&&(e.success=!0,e.ref=g(c),d(e))}else if(u(c,!0),d){var q=g(c);q&&typeof q.SetVariable!=C&&(e.success=!0,e.ref=q),d(e)}}}function g(a){var b=null,c=p(a);if(c&&"OBJECT"==c.nodeName)if(typeof c.SetVariable!=C)b=c;else{var d=c.getElementsByTagName(D)[0];d&&(b=d)}return b}function h(){return!S&&s("6.0.65")&&(U.win||U.mac)&&!(U.wk&&U.wk<312)}function i(a,b,c,d){S=!0,y=d||null,z={success:!1,id:c};var e=p(c);if(e){"OBJECT"==e.nodeName?(w=k(e),x=null):(w=e,x=c),a.id=H,(typeof a.width==C||!/%$/.test(a.width)&&parseInt(a.width,10)<310)&&(a.width="310"),(typeof a.height==C||!/%$/.test(a.height)&&parseInt(a.height,10)<137)&&(a.height="137"),K.title=K.title.slice(0,47)+" - Flash Player Installation";var f=U.ie&&U.win?"ActiveX":"PlugIn",g="MMredirectURL="+encodeURI(window.location).toString().replace(/&/g,"%26")+"&MMplayerType="+f+"&MMdoctitle="+K.title;if(typeof b.flashvars!=C?b.flashvars+="&"+g:b.flashvars=g,U.ie&&U.win&&4!=e.readyState){var h=q("div");c+="SWFObjectNew",h.setAttribute("id",c),e.parentNode.insertBefore(h,e),e.style.display="none",function(){4==e.readyState?e.parentNode.removeChild(e):setTimeout(arguments.callee,10)}()}l(a,b,c)}}function j(a){if(U.ie&&U.win&&4!=a.readyState){var b=q("div");a.parentNode.insertBefore(b,a),b.parentNode.replaceChild(k(a),b),a.style.display="none",function(){4==a.readyState?a.parentNode.removeChild(a):setTimeout(arguments.callee,10)}()}else a.parentNode.replaceChild(k(a),a)}function k(a){var b=q("div");if(U.win&&U.ie)b.innerHTML=a.innerHTML;else{var c=a.getElementsByTagName(D)[0];if(c){var d=c.childNodes;if(d)for(var e=d.length,f=0;e>f;f++)1==d[f].nodeType&&"PARAM"==d[f].nodeName||8==d[f].nodeType||b.appendChild(d[f].cloneNode(!0))}}return b}function l(a,b,c){var d,e=p(c);if(U.wk&&U.wk<312)return d;if(e)if(typeof a.id==C&&(a.id=c),U.ie&&U.win){var f="";for(var g in a)a[g]!=Object.prototype[g]&&("data"==g.toLowerCase()?b.movie=a[g]:"styleclass"==g.toLowerCase()?f+=' class="'+a[g]+'"':"classid"!=g.toLowerCase()&&(f+=" "+g+'="'+a[g]+'"'));var h="";for(var i in b)b[i]!=Object.prototype[i]&&(h+='');e.outerHTML='"+h+"",P[P.length]=a.id,d=p(a.id)}else{var j=q(D);j.setAttribute("type",G);for(var k in a)a[k]!=Object.prototype[k]&&("styleclass"==k.toLowerCase()?j.setAttribute("class",a[k]):"classid"!=k.toLowerCase()&&j.setAttribute(k,a[k]));for(var l in b)b[l]!=Object.prototype[l]&&"movie"!=l.toLowerCase()&&m(j,l,b[l]);e.parentNode.replaceChild(j,e),d=j}return d}function m(a,b,c){var d=q("param");d.setAttribute("name",b),d.setAttribute("value",c),a.appendChild(d)}function n(a){var b=p(a);b&&"OBJECT"==b.nodeName&&(U.ie&&U.win?(b.style.display="none",function(){4==b.readyState?o(a):setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b))}function o(a){var b=p(a);if(b){for(var c in b)"function"==typeof b[c]&&(b[c]=null);b.parentNode.removeChild(b)}}function p(a){var b=null;try{b=K.getElementById(a)}catch(c){}return b}function q(a){return K.createElement(a)}function r(a,b,c){a.attachEvent(b,c),Q[Q.length]=[a,b,c]}function s(a){var b=U.pv,c=a.split(".");return c[0]=parseInt(c[0],10),c[1]=parseInt(c[1],10)||0,c[2]=parseInt(c[2],10)||0,b[0]>c[0]||b[0]==c[0]&&b[1]>c[1]||b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]?!0:!1}function t(a,b,c,d){if(!U.ie||!U.mac){var e=K.getElementsByTagName("head")[0];if(e){var f=c&&"string"==typeof c?c:"screen";if(d&&(A=null,B=null),!A||B!=f){var g=q("style");g.setAttribute("type","text/css"),g.setAttribute("media",f),A=e.appendChild(g),U.ie&&U.win&&typeof K.styleSheets!=C&&K.styleSheets.length>0&&(A=K.styleSheets[K.styleSheets.length-1]),B=f}U.ie&&U.win?A&&typeof A.addRule==D&&A.addRule(a,b):A&&typeof K.createTextNode!=C&&A.appendChild(K.createTextNode(a+" {"+b+"}"))}}}function u(a,b){if(T){var c=b?"visible":"hidden";R&&p(a)?p(a).style.visibility=c:t("#"+a,"visibility:"+c)}}function v(a){var b=/[\\\"<>\.;]/,c=null!=b.exec(a);return c&&typeof encodeURIComponent!=C?encodeURIComponent(a):a}{var w,x,y,z,A,B,C="undefined",D="object",E="Shockwave Flash",F="ShockwaveFlash.ShockwaveFlash",G="application/x-shockwave-flash",H="SWFObjectExprInst",I="onreadystatechange",J=window,K=document,L=navigator,M=!1,N=[d],O=[],P=[],Q=[],R=!1,S=!1,T=!0,U=function(){var a=typeof K.getElementById!=C&&typeof K.getElementsByTagName!=C&&typeof K.createElement!=C,b=L.userAgent.toLowerCase(),c=L.platform.toLowerCase(),d=/win/.test(c?c:b),e=/mac/.test(c?c:b),f=/webkit/.test(b)?parseFloat(b.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,g=!1,h=[0,0,0],i=null;if(typeof L.plugins!=C&&typeof L.plugins[E]==D)i=L.plugins[E].description,!i||typeof L.mimeTypes!=C&&L.mimeTypes[G]&&!L.mimeTypes[G].enabledPlugin||(M=!0,g=!1,i=i.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),h[0]=parseInt(i.replace(/^(.*)\..*$/,"$1"),10),h[1]=parseInt(i.replace(/^.*\.(.*)\s.*$/,"$1"),10),h[2]=/[a-zA-Z]/.test(i)?parseInt(i.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof J.ActiveXObject!=C)try{var j=new ActiveXObject(F);j&&(i=j.GetVariable("$version"),i&&(g=!0,i=i.split(" ")[1].split(","),h=[parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)]))}catch(k){}return{w3:a,pv:h,wk:f,ie:g,win:d,mac:e}}();!function(){U.w3&&((typeof K.readyState!=C&&"complete"==K.readyState||typeof K.readyState==C&&(K.getElementsByTagName("body")[0]||K.body))&&a(),R||(typeof K.addEventListener!=C&&K.addEventListener("DOMContentLoaded",a,!1),U.ie&&U.win&&(K.attachEvent(I,function(){"complete"==K.readyState&&(K.detachEvent(I,arguments.callee),a())}),J==top&&!function(){if(!R){try{K.documentElement.doScroll("left")}catch(b){return void setTimeout(arguments.callee,0)}a()}}()),U.wk&&!function(){return R?void 0:/loaded|complete/.test(K.readyState)?void a():void setTimeout(arguments.callee,0)}(),c(a)))}(),function(){U.ie&&U.win&&window.attachEvent("onunload",function(){for(var a=Q.length,b=0;a>b;b++)Q[b][0].detachEvent(Q[b][1],Q[b][2]);for(var c=P.length,d=0;c>d;d++)n(P[d]);for(var e in U)U[e]=null;U=null;for(var f in swfobject)swfobject[f]=null;swfobject=null})}()}return{registerObject:function(a,b,c,d){if(U.w3&&a&&b){var e={};e.id=a,e.swfVersion=b,e.expressInstall=c,e.callbackFn=d,O[O.length]=e,u(a,!1)}else d&&d({success:!1,id:a})},getObjectById:function(a){return U.w3?g(a):void 0},embedSWF:function(a,c,d,e,f,g,j,k,m,n){var o={success:!1,id:c};U.w3&&!(U.wk&&U.wk<312)&&a&&c&&d&&e&&f?(u(c,!1),b(function(){d+="",e+="";var b={};if(m&&typeof m===D)for(var p in m)b[p]=m[p];b.data=a,b.width=d,b.height=e;var q={};if(k&&typeof k===D)for(var r in k)q[r]=k[r];if(j&&typeof j===D)for(var t in j)typeof q.flashvars!=C?q.flashvars+="&"+t+"="+j[t]:q.flashvars=t+"="+j[t];if(s(f)){var v=l(b,q,c);b.id==c&&u(c,!0),o.success=!0,o.ref=v}else{if(g&&h())return b.data=g,void i(b,q,c,n);u(c,!0)}n&&n(o)})):n&&n(o)},switchOffAutoHideShow:function(){T=!1},ua:U,getFlashPlayerVersion:function(){return{major:U.pv[0],minor:U.pv[1],release:U.pv[2]}},hasFlashPlayerVersion:s,createSWF:function(a,b,c){return U.w3?l(a,b,c):void 0},showExpressInstall:function(a,b,c,d){U.w3&&h()&&i(a,b,c,d)},removeSWF:function(a){U.w3&&n(a)},createCSS:function(a,b,c,d){U.w3&&t(a,b,c,d)},addDomLoadEvent:b,addLoadEvent:c,getQueryParamValue:function(a){var b=K.location.search||K.location.hash;if(b){if(/\?/.test(b)&&(b=b.split("?")[1]),null==a)return v(b);for(var c=b.split("&"),d=0;de;e++)d.push(arguments[e]);try{0==d.length?c[b]():c[b].apply(c,d)}catch(g){}}},a.handlePreloadEvent=function(a,b){var c=this._flashPreloadInstances[a];if(null!=c){for(var d=[],e=2,f=arguments.length;f>e;e++)d.push(arguments[e]);try{0==d.length?c[b]():c[b].apply(c,d)}catch(g){}}},a.handleEvent=function(a){switch(a){case"ready":this._handleFlashReady()}},a.handleErrorEvent=function(a){},createjs.FlashAudioPlugin=createjs.promote(FlashAudioPlugin,"AbstractPlugin")}(),this.createjs=this.createjs||{},function(){var a=createjs.FlashAudioPlugin=createjs.FlashAudioPlugin||{};a.version="NEXT",a.buildDate="Mon, 14 Sep 2015 19:11:47 GMT"}(); \ No newline at end of file +var swfobject=function(){function a(){if(!R){try{var a=K.getElementsByTagName("body")[0].appendChild(q("span"));a.parentNode.removeChild(a)}catch(b){return}R=!0;for(var c=N.length,d=0;c>d;d++)N[d]()}}function b(a){R?a():N[N.length]=a}function c(a){if(typeof J.addEventListener!=C)J.addEventListener("load",a,!1);else if(typeof K.addEventListener!=C)K.addEventListener("load",a,!1);else if(typeof J.attachEvent!=C)r(J,"onload",a);else if("function"==typeof J.onload){var b=J.onload;J.onload=function(){b(),a()}}else J.onload=a}function d(){M?e():f()}function e(){var a=K.getElementsByTagName("body")[0],b=q(D);b.setAttribute("type",G);var c=a.appendChild(b);if(c){var d=0;!function(){if(typeof c.GetVariable!=C){var e=c.GetVariable("$version");e&&(e=e.split(" ")[1].split(","),U.pv=[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)])}else if(10>d)return d++,void setTimeout(arguments.callee,10);a.removeChild(b),c=null,f()}()}else f()}function f(){var a=O.length;if(a>0)for(var b=0;a>b;b++){var c=O[b].id,d=O[b].callbackFn,e={success:!1,id:c};if(U.pv[0]>0){var f=p(c);if(f)if(!s(O[b].swfVersion)||U.wk&&U.wk<312)if(O[b].expressInstall&&h()){var k={};k.data=O[b].expressInstall,k.width=f.getAttribute("width")||"0",k.height=f.getAttribute("height")||"0",f.getAttribute("class")&&(k.styleclass=f.getAttribute("class")),f.getAttribute("align")&&(k.align=f.getAttribute("align"));for(var l={},m=f.getElementsByTagName("param"),n=m.length,o=0;n>o;o++)"movie"!=m[o].getAttribute("name").toLowerCase()&&(l[m[o].getAttribute("name")]=m[o].getAttribute("value"));i(k,l,c,d)}else j(f),d&&d(e);else u(c,!0),d&&(e.success=!0,e.ref=g(c),d(e))}else if(u(c,!0),d){var q=g(c);q&&typeof q.SetVariable!=C&&(e.success=!0,e.ref=q),d(e)}}}function g(a){var b=null,c=p(a);if(c&&"OBJECT"==c.nodeName)if(typeof c.SetVariable!=C)b=c;else{var d=c.getElementsByTagName(D)[0];d&&(b=d)}return b}function h(){return!S&&s("6.0.65")&&(U.win||U.mac)&&!(U.wk&&U.wk<312)}function i(a,b,c,d){S=!0,y=d||null,z={success:!1,id:c};var e=p(c);if(e){"OBJECT"==e.nodeName?(w=k(e),x=null):(w=e,x=c),a.id=H,(typeof a.width==C||!/%$/.test(a.width)&&parseInt(a.width,10)<310)&&(a.width="310"),(typeof a.height==C||!/%$/.test(a.height)&&parseInt(a.height,10)<137)&&(a.height="137"),K.title=K.title.slice(0,47)+" - Flash Player Installation";var f=U.ie&&U.win?"ActiveX":"PlugIn",g="MMredirectURL="+encodeURI(window.location).toString().replace(/&/g,"%26")+"&MMplayerType="+f+"&MMdoctitle="+K.title;if(typeof b.flashvars!=C?b.flashvars+="&"+g:b.flashvars=g,U.ie&&U.win&&4!=e.readyState){var h=q("div");c+="SWFObjectNew",h.setAttribute("id",c),e.parentNode.insertBefore(h,e),e.style.display="none",function(){4==e.readyState?e.parentNode.removeChild(e):setTimeout(arguments.callee,10)}()}l(a,b,c)}}function j(a){if(U.ie&&U.win&&4!=a.readyState){var b=q("div");a.parentNode.insertBefore(b,a),b.parentNode.replaceChild(k(a),b),a.style.display="none",function(){4==a.readyState?a.parentNode.removeChild(a):setTimeout(arguments.callee,10)}()}else a.parentNode.replaceChild(k(a),a)}function k(a){var b=q("div");if(U.win&&U.ie)b.innerHTML=a.innerHTML;else{var c=a.getElementsByTagName(D)[0];if(c){var d=c.childNodes;if(d)for(var e=d.length,f=0;e>f;f++)1==d[f].nodeType&&"PARAM"==d[f].nodeName||8==d[f].nodeType||b.appendChild(d[f].cloneNode(!0))}}return b}function l(a,b,c){var d,e=p(c);if(U.wk&&U.wk<312)return d;if(e)if(typeof a.id==C&&(a.id=c),U.ie&&U.win){var f="";for(var g in a)a[g]!=Object.prototype[g]&&("data"==g.toLowerCase()?b.movie=a[g]:"styleclass"==g.toLowerCase()?f+=' class="'+a[g]+'"':"classid"!=g.toLowerCase()&&(f+=" "+g+'="'+a[g]+'"'));var h="";for(var i in b)b[i]!=Object.prototype[i]&&(h+='');e.outerHTML='"+h+"",P[P.length]=a.id,d=p(a.id)}else{var j=q(D);j.setAttribute("type",G);for(var k in a)a[k]!=Object.prototype[k]&&("styleclass"==k.toLowerCase()?j.setAttribute("class",a[k]):"classid"!=k.toLowerCase()&&j.setAttribute(k,a[k]));for(var l in b)b[l]!=Object.prototype[l]&&"movie"!=l.toLowerCase()&&m(j,l,b[l]);e.parentNode.replaceChild(j,e),d=j}return d}function m(a,b,c){var d=q("param");d.setAttribute("name",b),d.setAttribute("value",c),a.appendChild(d)}function n(a){var b=p(a);b&&"OBJECT"==b.nodeName&&(U.ie&&U.win?(b.style.display="none",function(){4==b.readyState?o(a):setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b))}function o(a){var b=p(a);if(b){for(var c in b)"function"==typeof b[c]&&(b[c]=null);b.parentNode.removeChild(b)}}function p(a){var b=null;try{b=K.getElementById(a)}catch(c){}return b}function q(a){return K.createElement(a)}function r(a,b,c){a.attachEvent(b,c),Q[Q.length]=[a,b,c]}function s(a){var b=U.pv,c=a.split(".");return c[0]=parseInt(c[0],10),c[1]=parseInt(c[1],10)||0,c[2]=parseInt(c[2],10)||0,b[0]>c[0]||b[0]==c[0]&&b[1]>c[1]||b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]?!0:!1}function t(a,b,c,d){if(!U.ie||!U.mac){var e=K.getElementsByTagName("head")[0];if(e){var f=c&&"string"==typeof c?c:"screen";if(d&&(A=null,B=null),!A||B!=f){var g=q("style");g.setAttribute("type","text/css"),g.setAttribute("media",f),A=e.appendChild(g),U.ie&&U.win&&typeof K.styleSheets!=C&&K.styleSheets.length>0&&(A=K.styleSheets[K.styleSheets.length-1]),B=f}U.ie&&U.win?A&&typeof A.addRule==D&&A.addRule(a,b):A&&typeof K.createTextNode!=C&&A.appendChild(K.createTextNode(a+" {"+b+"}"))}}}function u(a,b){if(T){var c=b?"visible":"hidden";R&&p(a)?p(a).style.visibility=c:t("#"+a,"visibility:"+c)}}function v(a){var b=/[\\\"<>\.;]/,c=null!=b.exec(a);return c&&typeof encodeURIComponent!=C?encodeURIComponent(a):a}{var w,x,y,z,A,B,C="undefined",D="object",E="Shockwave Flash",F="ShockwaveFlash.ShockwaveFlash",G="application/x-shockwave-flash",H="SWFObjectExprInst",I="onreadystatechange",J=window,K=document,L=navigator,M=!1,N=[d],O=[],P=[],Q=[],R=!1,S=!1,T=!0,U=function(){var a=typeof K.getElementById!=C&&typeof K.getElementsByTagName!=C&&typeof K.createElement!=C,b=L.userAgent.toLowerCase(),c=L.platform.toLowerCase(),d=/win/.test(c?c:b),e=/mac/.test(c?c:b),f=/webkit/.test(b)?parseFloat(b.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,g=!1,h=[0,0,0],i=null;if(typeof L.plugins!=C&&typeof L.plugins[E]==D)i=L.plugins[E].description,!i||typeof L.mimeTypes!=C&&L.mimeTypes[G]&&!L.mimeTypes[G].enabledPlugin||(M=!0,g=!1,i=i.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),h[0]=parseInt(i.replace(/^(.*)\..*$/,"$1"),10),h[1]=parseInt(i.replace(/^.*\.(.*)\s.*$/,"$1"),10),h[2]=/[a-zA-Z]/.test(i)?parseInt(i.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof J.ActiveXObject!=C)try{var j=new ActiveXObject(F);j&&(i=j.GetVariable("$version"),i&&(g=!0,i=i.split(" ")[1].split(","),h=[parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)]))}catch(k){}return{w3:a,pv:h,wk:f,ie:g,win:d,mac:e}}();!function(){U.w3&&((typeof K.readyState!=C&&"complete"==K.readyState||typeof K.readyState==C&&(K.getElementsByTagName("body")[0]||K.body))&&a(),R||(typeof K.addEventListener!=C&&K.addEventListener("DOMContentLoaded",a,!1),U.ie&&U.win&&(K.attachEvent(I,function(){"complete"==K.readyState&&(K.detachEvent(I,arguments.callee),a())}),J==top&&!function(){if(!R){try{K.documentElement.doScroll("left")}catch(b){return void setTimeout(arguments.callee,0)}a()}}()),U.wk&&!function(){return R?void 0:/loaded|complete/.test(K.readyState)?void a():void setTimeout(arguments.callee,0)}(),c(a)))}(),function(){U.ie&&U.win&&window.attachEvent("onunload",function(){for(var a=Q.length,b=0;a>b;b++)Q[b][0].detachEvent(Q[b][1],Q[b][2]);for(var c=P.length,d=0;c>d;d++)n(P[d]);for(var e in U)U[e]=null;U=null;for(var f in swfobject)swfobject[f]=null;swfobject=null})}()}return{registerObject:function(a,b,c,d){if(U.w3&&a&&b){var e={};e.id=a,e.swfVersion=b,e.expressInstall=c,e.callbackFn=d,O[O.length]=e,u(a,!1)}else d&&d({success:!1,id:a})},getObjectById:function(a){return U.w3?g(a):void 0},embedSWF:function(a,c,d,e,f,g,j,k,m,n){var o={success:!1,id:c};U.w3&&!(U.wk&&U.wk<312)&&a&&c&&d&&e&&f?(u(c,!1),b(function(){d+="",e+="";var b={};if(m&&typeof m===D)for(var p in m)b[p]=m[p];b.data=a,b.width=d,b.height=e;var q={};if(k&&typeof k===D)for(var r in k)q[r]=k[r];if(j&&typeof j===D)for(var t in j)typeof q.flashvars!=C?q.flashvars+="&"+t+"="+j[t]:q.flashvars=t+"="+j[t];if(s(f)){var v=l(b,q,c);b.id==c&&u(c,!0),o.success=!0,o.ref=v}else{if(g&&h())return b.data=g,void i(b,q,c,n);u(c,!0)}n&&n(o)})):n&&n(o)},switchOffAutoHideShow:function(){T=!1},ua:U,getFlashPlayerVersion:function(){return{major:U.pv[0],minor:U.pv[1],release:U.pv[2]}},hasFlashPlayerVersion:s,createSWF:function(a,b,c){return U.w3?l(a,b,c):void 0},showExpressInstall:function(a,b,c,d){U.w3&&h()&&i(a,b,c,d)},removeSWF:function(a){U.w3&&n(a)},createCSS:function(a,b,c,d){U.w3&&t(a,b,c,d)},addDomLoadEvent:b,addLoadEvent:c,getQueryParamValue:function(a){var b=K.location.search||K.location.hash;if(b){if(/\?/.test(b)&&(b=b.split("?")[1]),null==a)return v(b);for(var c=b.split("&"),d=0;de;e++)d.push(arguments[e]);try{0==d.length?c[b]():c[b].apply(c,d)}catch(g){}}},a.handlePreloadEvent=function(a,b){var c=this._flashPreloadInstances[a];if(null!=c){for(var d=[],e=2,f=arguments.length;f>e;e++)d.push(arguments[e]);try{0==d.length?c[b]():c[b].apply(c,d)}catch(g){}}},a.handleEvent=function(a){switch(a){case"ready":this._handleFlashReady()}},a.handleErrorEvent=function(){},createjs.FlashAudioPlugin=createjs.promote(FlashAudioPlugin,"AbstractPlugin")}(),this.createjs=this.createjs||{},function(){var a=createjs.FlashAudioPlugin=createjs.FlashAudioPlugin||{};a.version="NEXT",a.buildDate="Wed, 21 Jun 2017 16:53:32 GMT"}(); \ No newline at end of file diff --git a/lib/flashaudioplugin-0.6.2.combined.js b/lib/flashaudioplugin.js similarity index 97% rename from lib/flashaudioplugin-0.6.2.combined.js rename to lib/flashaudioplugin.js index d7f8c883..e1f542fa 100644 --- a/lib/flashaudioplugin-0.6.2.combined.js +++ b/lib/flashaudioplugin.js @@ -829,7 +829,7 @@ this.createjs = this.createjs || {}; * @protected */ function Loader(loadItem) { - this.AbstractLoader_constructor(loadItem, false, createjs.AbstractLoader.SOUND); + this.AbstractLoader_constructor(loadItem, false, createjs.Types.SOUND); // Public properties @@ -844,17 +844,13 @@ this.createjs = this.createjs || {}; } var p = createjs.extend(Loader, createjs.AbstractLoader); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static Properties var s = Loader; /** * A reference to the Flash instance that gets created. * @property flash * @type {Object | Embed} - * @protected + * @private */ s._flash = null; @@ -862,7 +858,7 @@ this.createjs = this.createjs || {}; * A list of loader instances that tried to load before _flash was set * @property _preloadInstances * @type {Array} - * @protected + * @private */ s._preloadInstances = []; @@ -979,10 +975,6 @@ this.createjs = this.createjs || {}; }; var p = createjs.extend(FlashAudioSoundInstance, createjs.AbstractSoundInstance); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static Propeties var s = FlashAudioSoundInstance; /** @@ -1060,13 +1052,13 @@ this.createjs = this.createjs || {}; p._beginPlaying = function (playProps) { if (s._flash == null) { return false; } - this.setPosition(playProps.offset); - this.setLoop(playProps.loop); - this.setVolume(playProps.volume); - this.setPan(playProps.pan); + this.position = playProps.offset; + this.loop = playProps.loop; + this.volume = playProps.volume; + this.pan = playProps.pan; if (playProps.startTime != null) { - this.setStartTime(playProps.startTime); - this.setDuration(playProps.duration); + this.startTime = playProps.startTime; + this.duration = playProps.duration; } this._paused = false; @@ -1287,10 +1279,6 @@ this.createjs = this.createjs || {}; var p = createjs.extend(FlashAudioPlugin, createjs.AbstractPlugin); var s = FlashAudioPlugin; - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static properties /** * Event constant for the "registerFlashID" event for cleaner code. @@ -1298,7 +1286,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default registerflashid * @static - * @protected + * @private */ s._REG_FLASHID = "registerflashid"; @@ -1308,17 +1296,17 @@ this.createjs = this.createjs || {}; * @type {String} * @default unregisterflashid * @static - * @protected + * @private */ s._UNREG_FLASHID = "unregisterflashid"; /** * The capabilities of the plugin. This is generated via the {{#crossLink "WebAudioPlugin/_generateCapabilities"}}{{/crossLink}} - * method. Please see the Sound {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} method for a list of available + * method. Please see the Sound {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} method for a list of available * capabilities. * @property _capabilities * @type {Object} - * @protected + * @private * @static */ s._capabilities = null; @@ -1351,11 +1339,11 @@ this.createjs = this.createjs || {}; }; /** - * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} + * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} * method for an overview of plugin capabilities. * @method _generateCapabilities * @static - * @protected + * @private */ s._generateCapabilities = function () { if (s._capabilities != null) {return;} @@ -1590,7 +1578,7 @@ this.createjs = this.createjs || {}; * @type String * @static **/ - s.version = /*=version*/"0.6.2"; // injected by build process + s.version = /*=version*/"1.0.0"; // injected by build process /** * The build date for this release in UTC format. @@ -1599,6 +1587,6 @@ this.createjs = this.createjs || {}; * @type String * @static **/ - s.buildDate = /*=date*/"Thu, 26 Nov 2015 20:44:31 GMT"; // injected by build process + s.buildDate = /*=date*/"Thu, 14 Sep 2017 19:47:47 GMT"; // injected by build process })(); \ No newline at end of file diff --git a/lib/flashaudioplugin-0.6.2.min.js b/lib/flashaudioplugin.min.js similarity index 57% rename from lib/flashaudioplugin-0.6.2.min.js rename to lib/flashaudioplugin.min.js index d6160ec7..79a55a7e 100644 --- a/lib/flashaudioplugin-0.6.2.min.js +++ b/lib/flashaudioplugin.min.js @@ -17,4 +17,4 @@ /*! SWFObject v2.2 is released under the MIT License */ -var swfobject=function(){function a(){if(!R){try{var a=K.getElementsByTagName("body")[0].appendChild(q("span"));a.parentNode.removeChild(a)}catch(b){return}R=!0;for(var c=N.length,d=0;c>d;d++)N[d]()}}function b(a){R?a():N[N.length]=a}function c(a){if(typeof J.addEventListener!=C)J.addEventListener("load",a,!1);else if(typeof K.addEventListener!=C)K.addEventListener("load",a,!1);else if(typeof J.attachEvent!=C)r(J,"onload",a);else if("function"==typeof J.onload){var b=J.onload;J.onload=function(){b(),a()}}else J.onload=a}function d(){M?e():f()}function e(){var a=K.getElementsByTagName("body")[0],b=q(D);b.setAttribute("type",G);var c=a.appendChild(b);if(c){var d=0;!function(){if(typeof c.GetVariable!=C){var e=c.GetVariable("$version");e&&(e=e.split(" ")[1].split(","),U.pv=[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)])}else if(10>d)return d++,void setTimeout(arguments.callee,10);a.removeChild(b),c=null,f()}()}else f()}function f(){var a=O.length;if(a>0)for(var b=0;a>b;b++){var c=O[b].id,d=O[b].callbackFn,e={success:!1,id:c};if(U.pv[0]>0){var f=p(c);if(f)if(!s(O[b].swfVersion)||U.wk&&U.wk<312)if(O[b].expressInstall&&h()){var k={};k.data=O[b].expressInstall,k.width=f.getAttribute("width")||"0",k.height=f.getAttribute("height")||"0",f.getAttribute("class")&&(k.styleclass=f.getAttribute("class")),f.getAttribute("align")&&(k.align=f.getAttribute("align"));for(var l={},m=f.getElementsByTagName("param"),n=m.length,o=0;n>o;o++)"movie"!=m[o].getAttribute("name").toLowerCase()&&(l[m[o].getAttribute("name")]=m[o].getAttribute("value"));i(k,l,c,d)}else j(f),d&&d(e);else u(c,!0),d&&(e.success=!0,e.ref=g(c),d(e))}else if(u(c,!0),d){var q=g(c);q&&typeof q.SetVariable!=C&&(e.success=!0,e.ref=q),d(e)}}}function g(a){var b=null,c=p(a);if(c&&"OBJECT"==c.nodeName)if(typeof c.SetVariable!=C)b=c;else{var d=c.getElementsByTagName(D)[0];d&&(b=d)}return b}function h(){return!S&&s("6.0.65")&&(U.win||U.mac)&&!(U.wk&&U.wk<312)}function i(a,b,c,d){S=!0,y=d||null,z={success:!1,id:c};var e=p(c);if(e){"OBJECT"==e.nodeName?(w=k(e),x=null):(w=e,x=c),a.id=H,(typeof a.width==C||!/%$/.test(a.width)&&parseInt(a.width,10)<310)&&(a.width="310"),(typeof a.height==C||!/%$/.test(a.height)&&parseInt(a.height,10)<137)&&(a.height="137"),K.title=K.title.slice(0,47)+" - Flash Player Installation";var f=U.ie&&U.win?"ActiveX":"PlugIn",g="MMredirectURL="+encodeURI(window.location).toString().replace(/&/g,"%26")+"&MMplayerType="+f+"&MMdoctitle="+K.title;if(typeof b.flashvars!=C?b.flashvars+="&"+g:b.flashvars=g,U.ie&&U.win&&4!=e.readyState){var h=q("div");c+="SWFObjectNew",h.setAttribute("id",c),e.parentNode.insertBefore(h,e),e.style.display="none",function(){4==e.readyState?e.parentNode.removeChild(e):setTimeout(arguments.callee,10)}()}l(a,b,c)}}function j(a){if(U.ie&&U.win&&4!=a.readyState){var b=q("div");a.parentNode.insertBefore(b,a),b.parentNode.replaceChild(k(a),b),a.style.display="none",function(){4==a.readyState?a.parentNode.removeChild(a):setTimeout(arguments.callee,10)}()}else a.parentNode.replaceChild(k(a),a)}function k(a){var b=q("div");if(U.win&&U.ie)b.innerHTML=a.innerHTML;else{var c=a.getElementsByTagName(D)[0];if(c){var d=c.childNodes;if(d)for(var e=d.length,f=0;e>f;f++)1==d[f].nodeType&&"PARAM"==d[f].nodeName||8==d[f].nodeType||b.appendChild(d[f].cloneNode(!0))}}return b}function l(a,b,c){var d,e=p(c);if(U.wk&&U.wk<312)return d;if(e)if(typeof a.id==C&&(a.id=c),U.ie&&U.win){var f="";for(var g in a)a[g]!=Object.prototype[g]&&("data"==g.toLowerCase()?b.movie=a[g]:"styleclass"==g.toLowerCase()?f+=' class="'+a[g]+'"':"classid"!=g.toLowerCase()&&(f+=" "+g+'="'+a[g]+'"'));var h="";for(var i in b)b[i]!=Object.prototype[i]&&(h+='');e.outerHTML='"+h+"",P[P.length]=a.id,d=p(a.id)}else{var j=q(D);j.setAttribute("type",G);for(var k in a)a[k]!=Object.prototype[k]&&("styleclass"==k.toLowerCase()?j.setAttribute("class",a[k]):"classid"!=k.toLowerCase()&&j.setAttribute(k,a[k]));for(var l in b)b[l]!=Object.prototype[l]&&"movie"!=l.toLowerCase()&&m(j,l,b[l]);e.parentNode.replaceChild(j,e),d=j}return d}function m(a,b,c){var d=q("param");d.setAttribute("name",b),d.setAttribute("value",c),a.appendChild(d)}function n(a){var b=p(a);b&&"OBJECT"==b.nodeName&&(U.ie&&U.win?(b.style.display="none",function(){4==b.readyState?o(a):setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b))}function o(a){var b=p(a);if(b){for(var c in b)"function"==typeof b[c]&&(b[c]=null);b.parentNode.removeChild(b)}}function p(a){var b=null;try{b=K.getElementById(a)}catch(c){}return b}function q(a){return K.createElement(a)}function r(a,b,c){a.attachEvent(b,c),Q[Q.length]=[a,b,c]}function s(a){var b=U.pv,c=a.split(".");return c[0]=parseInt(c[0],10),c[1]=parseInt(c[1],10)||0,c[2]=parseInt(c[2],10)||0,b[0]>c[0]||b[0]==c[0]&&b[1]>c[1]||b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]?!0:!1}function t(a,b,c,d){if(!U.ie||!U.mac){var e=K.getElementsByTagName("head")[0];if(e){var f=c&&"string"==typeof c?c:"screen";if(d&&(A=null,B=null),!A||B!=f){var g=q("style");g.setAttribute("type","text/css"),g.setAttribute("media",f),A=e.appendChild(g),U.ie&&U.win&&typeof K.styleSheets!=C&&K.styleSheets.length>0&&(A=K.styleSheets[K.styleSheets.length-1]),B=f}U.ie&&U.win?A&&typeof A.addRule==D&&A.addRule(a,b):A&&typeof K.createTextNode!=C&&A.appendChild(K.createTextNode(a+" {"+b+"}"))}}}function u(a,b){if(T){var c=b?"visible":"hidden";R&&p(a)?p(a).style.visibility=c:t("#"+a,"visibility:"+c)}}function v(a){var b=/[\\\"<>\.;]/,c=null!=b.exec(a);return c&&typeof encodeURIComponent!=C?encodeURIComponent(a):a}{var w,x,y,z,A,B,C="undefined",D="object",E="Shockwave Flash",F="ShockwaveFlash.ShockwaveFlash",G="application/x-shockwave-flash",H="SWFObjectExprInst",I="onreadystatechange",J=window,K=document,L=navigator,M=!1,N=[d],O=[],P=[],Q=[],R=!1,S=!1,T=!0,U=function(){var a=typeof K.getElementById!=C&&typeof K.getElementsByTagName!=C&&typeof K.createElement!=C,b=L.userAgent.toLowerCase(),c=L.platform.toLowerCase(),d=/win/.test(c?c:b),e=/mac/.test(c?c:b),f=/webkit/.test(b)?parseFloat(b.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,g=!1,h=[0,0,0],i=null;if(typeof L.plugins!=C&&typeof L.plugins[E]==D)i=L.plugins[E].description,!i||typeof L.mimeTypes!=C&&L.mimeTypes[G]&&!L.mimeTypes[G].enabledPlugin||(M=!0,g=!1,i=i.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),h[0]=parseInt(i.replace(/^(.*)\..*$/,"$1"),10),h[1]=parseInt(i.replace(/^.*\.(.*)\s.*$/,"$1"),10),h[2]=/[a-zA-Z]/.test(i)?parseInt(i.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof J.ActiveXObject!=C)try{var j=new ActiveXObject(F);j&&(i=j.GetVariable("$version"),i&&(g=!0,i=i.split(" ")[1].split(","),h=[parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)]))}catch(k){}return{w3:a,pv:h,wk:f,ie:g,win:d,mac:e}}();!function(){U.w3&&((typeof K.readyState!=C&&"complete"==K.readyState||typeof K.readyState==C&&(K.getElementsByTagName("body")[0]||K.body))&&a(),R||(typeof K.addEventListener!=C&&K.addEventListener("DOMContentLoaded",a,!1),U.ie&&U.win&&(K.attachEvent(I,function(){"complete"==K.readyState&&(K.detachEvent(I,arguments.callee),a())}),J==top&&!function(){if(!R){try{K.documentElement.doScroll("left")}catch(b){return void setTimeout(arguments.callee,0)}a()}}()),U.wk&&!function(){return R?void 0:/loaded|complete/.test(K.readyState)?void a():void setTimeout(arguments.callee,0)}(),c(a)))}(),function(){U.ie&&U.win&&window.attachEvent("onunload",function(){for(var a=Q.length,b=0;a>b;b++)Q[b][0].detachEvent(Q[b][1],Q[b][2]);for(var c=P.length,d=0;c>d;d++)n(P[d]);for(var e in U)U[e]=null;U=null;for(var f in swfobject)swfobject[f]=null;swfobject=null})}()}return{registerObject:function(a,b,c,d){if(U.w3&&a&&b){var e={};e.id=a,e.swfVersion=b,e.expressInstall=c,e.callbackFn=d,O[O.length]=e,u(a,!1)}else d&&d({success:!1,id:a})},getObjectById:function(a){return U.w3?g(a):void 0},embedSWF:function(a,c,d,e,f,g,j,k,m,n){var o={success:!1,id:c};U.w3&&!(U.wk&&U.wk<312)&&a&&c&&d&&e&&f?(u(c,!1),b(function(){d+="",e+="";var b={};if(m&&typeof m===D)for(var p in m)b[p]=m[p];b.data=a,b.width=d,b.height=e;var q={};if(k&&typeof k===D)for(var r in k)q[r]=k[r];if(j&&typeof j===D)for(var t in j)typeof q.flashvars!=C?q.flashvars+="&"+t+"="+j[t]:q.flashvars=t+"="+j[t];if(s(f)){var v=l(b,q,c);b.id==c&&u(c,!0),o.success=!0,o.ref=v}else{if(g&&h())return b.data=g,void i(b,q,c,n);u(c,!0)}n&&n(o)})):n&&n(o)},switchOffAutoHideShow:function(){T=!1},ua:U,getFlashPlayerVersion:function(){return{major:U.pv[0],minor:U.pv[1],release:U.pv[2]}},hasFlashPlayerVersion:s,createSWF:function(a,b,c){return U.w3?l(a,b,c):void 0},showExpressInstall:function(a,b,c,d){U.w3&&h()&&i(a,b,c,d)},removeSWF:function(a){U.w3&&n(a)},createCSS:function(a,b,c,d){U.w3&&t(a,b,c,d)},addDomLoadEvent:b,addLoadEvent:c,getQueryParamValue:function(a){var b=K.location.search||K.location.hash;if(b){if(/\?/.test(b)&&(b=b.split("?")[1]),null==a)return v(b);for(var c=b.split("&"),d=0;de;e++)d.push(arguments[e]);try{0==d.length?c[b]():c[b].apply(c,d)}catch(g){}}},a.handlePreloadEvent=function(a,b){var c=this._flashPreloadInstances[a];if(null!=c){for(var d=[],e=2,f=arguments.length;f>e;e++)d.push(arguments[e]);try{0==d.length?c[b]():c[b].apply(c,d)}catch(g){}}},a.handleEvent=function(a){switch(a){case"ready":this._handleFlashReady()}},a.handleErrorEvent=function(){},createjs.FlashAudioPlugin=createjs.promote(FlashAudioPlugin,"AbstractPlugin")}(),this.createjs=this.createjs||{},function(){var a=createjs.FlashAudioPlugin=createjs.FlashAudioPlugin||{};a.version="0.6.2",a.buildDate="Thu, 26 Nov 2015 20:44:31 GMT"}(); \ No newline at end of file +var swfobject=function(){function a(){if(!R){try{var a=K.getElementsByTagName("body")[0].appendChild(q("span"));a.parentNode.removeChild(a)}catch(b){return}R=!0;for(var c=N.length,d=0;c>d;d++)N[d]()}}function b(a){R?a():N[N.length]=a}function c(a){if(typeof J.addEventListener!=C)J.addEventListener("load",a,!1);else if(typeof K.addEventListener!=C)K.addEventListener("load",a,!1);else if(typeof J.attachEvent!=C)r(J,"onload",a);else if("function"==typeof J.onload){var b=J.onload;J.onload=function(){b(),a()}}else J.onload=a}function d(){M?e():f()}function e(){var a=K.getElementsByTagName("body")[0],b=q(D);b.setAttribute("type",G);var c=a.appendChild(b);if(c){var d=0;!function(){if(typeof c.GetVariable!=C){var e=c.GetVariable("$version");e&&(e=e.split(" ")[1].split(","),U.pv=[parseInt(e[0],10),parseInt(e[1],10),parseInt(e[2],10)])}else if(10>d)return d++,void setTimeout(arguments.callee,10);a.removeChild(b),c=null,f()}()}else f()}function f(){var a=O.length;if(a>0)for(var b=0;a>b;b++){var c=O[b].id,d=O[b].callbackFn,e={success:!1,id:c};if(U.pv[0]>0){var f=p(c);if(f)if(!s(O[b].swfVersion)||U.wk&&U.wk<312)if(O[b].expressInstall&&h()){var k={};k.data=O[b].expressInstall,k.width=f.getAttribute("width")||"0",k.height=f.getAttribute("height")||"0",f.getAttribute("class")&&(k.styleclass=f.getAttribute("class")),f.getAttribute("align")&&(k.align=f.getAttribute("align"));for(var l={},m=f.getElementsByTagName("param"),n=m.length,o=0;n>o;o++)"movie"!=m[o].getAttribute("name").toLowerCase()&&(l[m[o].getAttribute("name")]=m[o].getAttribute("value"));i(k,l,c,d)}else j(f),d&&d(e);else u(c,!0),d&&(e.success=!0,e.ref=g(c),d(e))}else if(u(c,!0),d){var q=g(c);q&&typeof q.SetVariable!=C&&(e.success=!0,e.ref=q),d(e)}}}function g(a){var b=null,c=p(a);if(c&&"OBJECT"==c.nodeName)if(typeof c.SetVariable!=C)b=c;else{var d=c.getElementsByTagName(D)[0];d&&(b=d)}return b}function h(){return!S&&s("6.0.65")&&(U.win||U.mac)&&!(U.wk&&U.wk<312)}function i(a,b,c,d){S=!0,y=d||null,z={success:!1,id:c};var e=p(c);if(e){"OBJECT"==e.nodeName?(w=k(e),x=null):(w=e,x=c),a.id=H,(typeof a.width==C||!/%$/.test(a.width)&&parseInt(a.width,10)<310)&&(a.width="310"),(typeof a.height==C||!/%$/.test(a.height)&&parseInt(a.height,10)<137)&&(a.height="137"),K.title=K.title.slice(0,47)+" - Flash Player Installation";var f=U.ie&&U.win?"ActiveX":"PlugIn",g="MMredirectURL="+encodeURI(window.location).toString().replace(/&/g,"%26")+"&MMplayerType="+f+"&MMdoctitle="+K.title;if(typeof b.flashvars!=C?b.flashvars+="&"+g:b.flashvars=g,U.ie&&U.win&&4!=e.readyState){var h=q("div");c+="SWFObjectNew",h.setAttribute("id",c),e.parentNode.insertBefore(h,e),e.style.display="none",function(){4==e.readyState?e.parentNode.removeChild(e):setTimeout(arguments.callee,10)}()}l(a,b,c)}}function j(a){if(U.ie&&U.win&&4!=a.readyState){var b=q("div");a.parentNode.insertBefore(b,a),b.parentNode.replaceChild(k(a),b),a.style.display="none",function(){4==a.readyState?a.parentNode.removeChild(a):setTimeout(arguments.callee,10)}()}else a.parentNode.replaceChild(k(a),a)}function k(a){var b=q("div");if(U.win&&U.ie)b.innerHTML=a.innerHTML;else{var c=a.getElementsByTagName(D)[0];if(c){var d=c.childNodes;if(d)for(var e=d.length,f=0;e>f;f++)1==d[f].nodeType&&"PARAM"==d[f].nodeName||8==d[f].nodeType||b.appendChild(d[f].cloneNode(!0))}}return b}function l(a,b,c){var d,e=p(c);if(U.wk&&U.wk<312)return d;if(e)if(typeof a.id==C&&(a.id=c),U.ie&&U.win){var f="";for(var g in a)a[g]!=Object.prototype[g]&&("data"==g.toLowerCase()?b.movie=a[g]:"styleclass"==g.toLowerCase()?f+=' class="'+a[g]+'"':"classid"!=g.toLowerCase()&&(f+=" "+g+'="'+a[g]+'"'));var h="";for(var i in b)b[i]!=Object.prototype[i]&&(h+='');e.outerHTML='"+h+"",P[P.length]=a.id,d=p(a.id)}else{var j=q(D);j.setAttribute("type",G);for(var k in a)a[k]!=Object.prototype[k]&&("styleclass"==k.toLowerCase()?j.setAttribute("class",a[k]):"classid"!=k.toLowerCase()&&j.setAttribute(k,a[k]));for(var l in b)b[l]!=Object.prototype[l]&&"movie"!=l.toLowerCase()&&m(j,l,b[l]);e.parentNode.replaceChild(j,e),d=j}return d}function m(a,b,c){var d=q("param");d.setAttribute("name",b),d.setAttribute("value",c),a.appendChild(d)}function n(a){var b=p(a);b&&"OBJECT"==b.nodeName&&(U.ie&&U.win?(b.style.display="none",function(){4==b.readyState?o(a):setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b))}function o(a){var b=p(a);if(b){for(var c in b)"function"==typeof b[c]&&(b[c]=null);b.parentNode.removeChild(b)}}function p(a){var b=null;try{b=K.getElementById(a)}catch(c){}return b}function q(a){return K.createElement(a)}function r(a,b,c){a.attachEvent(b,c),Q[Q.length]=[a,b,c]}function s(a){var b=U.pv,c=a.split(".");return c[0]=parseInt(c[0],10),c[1]=parseInt(c[1],10)||0,c[2]=parseInt(c[2],10)||0,b[0]>c[0]||b[0]==c[0]&&b[1]>c[1]||b[0]==c[0]&&b[1]==c[1]&&b[2]>=c[2]?!0:!1}function t(a,b,c,d){if(!U.ie||!U.mac){var e=K.getElementsByTagName("head")[0];if(e){var f=c&&"string"==typeof c?c:"screen";if(d&&(A=null,B=null),!A||B!=f){var g=q("style");g.setAttribute("type","text/css"),g.setAttribute("media",f),A=e.appendChild(g),U.ie&&U.win&&typeof K.styleSheets!=C&&K.styleSheets.length>0&&(A=K.styleSheets[K.styleSheets.length-1]),B=f}U.ie&&U.win?A&&typeof A.addRule==D&&A.addRule(a,b):A&&typeof K.createTextNode!=C&&A.appendChild(K.createTextNode(a+" {"+b+"}"))}}}function u(a,b){if(T){var c=b?"visible":"hidden";R&&p(a)?p(a).style.visibility=c:t("#"+a,"visibility:"+c)}}function v(a){var b=/[\\\"<>\.;]/,c=null!=b.exec(a);return c&&typeof encodeURIComponent!=C?encodeURIComponent(a):a}{var w,x,y,z,A,B,C="undefined",D="object",E="Shockwave Flash",F="ShockwaveFlash.ShockwaveFlash",G="application/x-shockwave-flash",H="SWFObjectExprInst",I="onreadystatechange",J=window,K=document,L=navigator,M=!1,N=[d],O=[],P=[],Q=[],R=!1,S=!1,T=!0,U=function(){var a=typeof K.getElementById!=C&&typeof K.getElementsByTagName!=C&&typeof K.createElement!=C,b=L.userAgent.toLowerCase(),c=L.platform.toLowerCase(),d=/win/.test(c?c:b),e=/mac/.test(c?c:b),f=/webkit/.test(b)?parseFloat(b.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):!1,g=!1,h=[0,0,0],i=null;if(typeof L.plugins!=C&&typeof L.plugins[E]==D)i=L.plugins[E].description,!i||typeof L.mimeTypes!=C&&L.mimeTypes[G]&&!L.mimeTypes[G].enabledPlugin||(M=!0,g=!1,i=i.replace(/^.*\s+(\S+\s+\S+$)/,"$1"),h[0]=parseInt(i.replace(/^(.*)\..*$/,"$1"),10),h[1]=parseInt(i.replace(/^.*\.(.*)\s.*$/,"$1"),10),h[2]=/[a-zA-Z]/.test(i)?parseInt(i.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0);else if(typeof J.ActiveXObject!=C)try{var j=new ActiveXObject(F);j&&(i=j.GetVariable("$version"),i&&(g=!0,i=i.split(" ")[1].split(","),h=[parseInt(i[0],10),parseInt(i[1],10),parseInt(i[2],10)]))}catch(k){}return{w3:a,pv:h,wk:f,ie:g,win:d,mac:e}}();!function(){U.w3&&((typeof K.readyState!=C&&"complete"==K.readyState||typeof K.readyState==C&&(K.getElementsByTagName("body")[0]||K.body))&&a(),R||(typeof K.addEventListener!=C&&K.addEventListener("DOMContentLoaded",a,!1),U.ie&&U.win&&(K.attachEvent(I,function(){"complete"==K.readyState&&(K.detachEvent(I,arguments.callee),a())}),J==top&&!function(){if(!R){try{K.documentElement.doScroll("left")}catch(b){return void setTimeout(arguments.callee,0)}a()}}()),U.wk&&!function(){return R?void 0:/loaded|complete/.test(K.readyState)?void a():void setTimeout(arguments.callee,0)}(),c(a)))}(),function(){U.ie&&U.win&&window.attachEvent("onunload",function(){for(var a=Q.length,b=0;a>b;b++)Q[b][0].detachEvent(Q[b][1],Q[b][2]);for(var c=P.length,d=0;c>d;d++)n(P[d]);for(var e in U)U[e]=null;U=null;for(var f in swfobject)swfobject[f]=null;swfobject=null})}()}return{registerObject:function(a,b,c,d){if(U.w3&&a&&b){var e={};e.id=a,e.swfVersion=b,e.expressInstall=c,e.callbackFn=d,O[O.length]=e,u(a,!1)}else d&&d({success:!1,id:a})},getObjectById:function(a){return U.w3?g(a):void 0},embedSWF:function(a,c,d,e,f,g,j,k,m,n){var o={success:!1,id:c};U.w3&&!(U.wk&&U.wk<312)&&a&&c&&d&&e&&f?(u(c,!1),b(function(){d+="",e+="";var b={};if(m&&typeof m===D)for(var p in m)b[p]=m[p];b.data=a,b.width=d,b.height=e;var q={};if(k&&typeof k===D)for(var r in k)q[r]=k[r];if(j&&typeof j===D)for(var t in j)typeof q.flashvars!=C?q.flashvars+="&"+t+"="+j[t]:q.flashvars=t+"="+j[t];if(s(f)){var v=l(b,q,c);b.id==c&&u(c,!0),o.success=!0,o.ref=v}else{if(g&&h())return b.data=g,void i(b,q,c,n);u(c,!0)}n&&n(o)})):n&&n(o)},switchOffAutoHideShow:function(){T=!1},ua:U,getFlashPlayerVersion:function(){return{major:U.pv[0],minor:U.pv[1],release:U.pv[2]}},hasFlashPlayerVersion:s,createSWF:function(a,b,c){return U.w3?l(a,b,c):void 0},showExpressInstall:function(a,b,c,d){U.w3&&h()&&i(a,b,c,d)},removeSWF:function(a){U.w3&&n(a)},createCSS:function(a,b,c,d){U.w3&&t(a,b,c,d)},addDomLoadEvent:b,addLoadEvent:c,getQueryParamValue:function(a){var b=K.location.search||K.location.hash;if(b){if(/\?/.test(b)&&(b=b.split("?")[1]),null==a)return v(b);for(var c=b.split("&"),d=0;de;e++)d.push(arguments[e]);try{0==d.length?c[b]():c[b].apply(c,d)}catch(g){}}},a.handlePreloadEvent=function(a,b){var c=this._flashPreloadInstances[a];if(null!=c){for(var d=[],e=2,f=arguments.length;f>e;e++)d.push(arguments[e]);try{0==d.length?c[b]():c[b].apply(c,d)}catch(g){}}},a.handleEvent=function(a){switch(a){case"ready":this._handleFlashReady()}},a.handleErrorEvent=function(){},createjs.FlashAudioPlugin=createjs.promote(FlashAudioPlugin,"AbstractPlugin")}(),this.createjs=this.createjs||{},function(){var a=createjs.FlashAudioPlugin=createjs.FlashAudioPlugin||{};a.version="1.0.0",a.buildDate="Thu, 14 Sep 2017 19:47:47 GMT"}(); \ No newline at end of file diff --git a/lib/soundjs-0.6.2.min.js b/lib/soundjs-0.6.2.min.js deleted file mode 100644 index c186e642..00000000 --- a/lib/soundjs-0.6.2.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! -* @license SoundJS -* Visit http://createjs.com/ for documentation, updates and examples. -* -* Copyright (c) 2011-2015 gskinner.com, inc. -* -* 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. -*/ - -/**! - * SoundJS FlashAudioPlugin also includes swfobject (http://code.google.com/p/swfobject/) - */ - -this.createjs=this.createjs||{},function(){var a=createjs.SoundJS=createjs.SoundJS||{};a.version="0.6.2",a.buildDate="Thu, 26 Nov 2015 20:44:31 GMT"}(),this.createjs=this.createjs||{},createjs.extend=function(a,b){"use strict";function c(){this.constructor=a}return c.prototype=b.prototype,a.prototype=new c},this.createjs=this.createjs||{},createjs.promote=function(a,b){"use strict";var c=a.prototype,d=Object.getPrototypeOf&&Object.getPrototypeOf(c)||c.__proto__;if(d){c[(b+="_")+"constructor"]=d.constructor;for(var e in d)c.hasOwnProperty(e)&&"function"==typeof d[e]&&(c[b+e]=d[e])}return a},this.createjs=this.createjs||{},createjs.indexOf=function(a,b){"use strict";for(var c=0,d=a.length;d>c;c++)if(b===a[c])return c;return-1},this.createjs=this.createjs||{},function(){"use strict";createjs.proxy=function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,Array.prototype.slice.call(arguments,0).concat(c))}}}(),this.createjs=this.createjs||{},function(){"use strict";function BrowserDetect(){throw"BrowserDetect cannot be instantiated"}var a=BrowserDetect.agent=window.navigator.userAgent;BrowserDetect.isWindowPhone=a.indexOf("IEMobile")>-1||a.indexOf("Windows Phone")>-1,BrowserDetect.isFirefox=a.indexOf("Firefox")>-1,BrowserDetect.isOpera=null!=window.opera,BrowserDetect.isChrome=a.indexOf("Chrome")>-1,BrowserDetect.isIOS=(a.indexOf("iPod")>-1||a.indexOf("iPhone")>-1||a.indexOf("iPad")>-1)&&!BrowserDetect.isWindowPhone,BrowserDetect.isAndroid=a.indexOf("Android")>-1&&!BrowserDetect.isWindowPhone,BrowserDetect.isBlackberry=a.indexOf("Blackberry")>-1,createjs.BrowserDetect=BrowserDetect}(),this.createjs=this.createjs||{},function(){"use strict";function EventDispatcher(){this._listeners=null,this._captureListeners=null}var a=EventDispatcher.prototype;EventDispatcher.initialize=function(b){b.addEventListener=a.addEventListener,b.on=a.on,b.removeEventListener=b.off=a.removeEventListener,b.removeAllEventListeners=a.removeAllEventListeners,b.hasEventListener=a.hasEventListener,b.dispatchEvent=a.dispatchEvent,b._dispatchEvent=a._dispatchEvent,b.willTrigger=a.willTrigger},a.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},a.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},a.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},a.off=a.removeEventListener,a.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},a.dispatchEvent=function(a,b,c){if("string"==typeof a){var d=this._listeners;if(!(b||d&&d[a]))return!0;a=new createjs.Event(a,b,c)}else a.target&&a.clone&&(a=a.clone());try{a.target=this}catch(e){}if(a.bubbles&&this.parent){for(var f=this,g=[f];f.parent;)g.push(f=f.parent);var h,i=g.length;for(h=i-1;h>=0&&!a.propagationStopped;h--)g[h]._dispatchEvent(a,1+(0==h));for(h=1;i>h&&!a.propagationStopped;h++)g[h]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return!a.defaultPrevented},a.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},a.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1},a.toString=function(){return"[EventDispatcher]"},a._dispatchEvent=function(a,b){var c,d=1==b?this._captureListeners:this._listeners;if(a&&d){var e=d[a.type];if(!e||!(c=e.length))return;try{a.currentTarget=this}catch(f){}try{a.eventPhase=b}catch(f){}a.removed=!1,e=e.slice();for(var g=0;c>g&&!a.immediatePropagationStopped;g++){var h=e[g];h.handleEvent?h.handleEvent(a):h(a),a.removed&&(this.off(a.type,h,1==b),a.removed=!1)}}},createjs.EventDispatcher=EventDispatcher}(),this.createjs=this.createjs||{},function(){"use strict";function Event(a,b,c){this.type=a,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!b,this.cancelable=!!c,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var a=Event.prototype;a.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},a.stopPropagation=function(){this.propagationStopped=!0},a.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},a.remove=function(){this.removed=!0},a.clone=function(){return new Event(this.type,this.bubbles,this.cancelable)},a.set=function(a){for(var b in a)this[b]=a[b];return this},a.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=Event}(),this.createjs=this.createjs||{},function(){"use strict";function ErrorEvent(a,b,c){this.Event_constructor("error"),this.title=a,this.message=b,this.data=c}var a=createjs.extend(ErrorEvent,createjs.Event);a.clone=function(){return new createjs.ErrorEvent(this.title,this.message,this.data)},createjs.ErrorEvent=createjs.promote(ErrorEvent,"Event")}(),this.createjs=this.createjs||{},function(){"use strict";function ProgressEvent(a,b){this.Event_constructor("progress"),this.loaded=a,this.total=null==b?1:b,this.progress=0==b?0:this.loaded/this.total}var a=createjs.extend(ProgressEvent,createjs.Event);a.clone=function(){return new createjs.ProgressEvent(this.loaded,this.total)},createjs.ProgressEvent=createjs.promote(ProgressEvent,"Event")}(window),this.createjs=this.createjs||{},function(){"use strict";function LoadItem(){this.src=null,this.type=null,this.id=null,this.maintainOrder=!1,this.callback=null,this.data=null,this.method=createjs.LoadItem.GET,this.values=null,this.headers=null,this.withCredentials=!1,this.mimeType=null,this.crossOrigin=null,this.loadTimeout=b.LOAD_TIMEOUT_DEFAULT}var a=LoadItem.prototype={},b=LoadItem;b.LOAD_TIMEOUT_DEFAULT=8e3,b.create=function(a){if("string"==typeof a){var c=new LoadItem;return c.src=a,c}if(a instanceof b)return a;if(a instanceof Object&&a.src)return null==a.loadTimeout&&(a.loadTimeout=b.LOAD_TIMEOUT_DEFAULT),a;throw new Error("Type not recognized.")},a.set=function(a){for(var b in a)this[b]=a[b];return this},createjs.LoadItem=b}(),function(){var a={};a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[.\/]*?\//i,a.EXTENSION_PATT=/\/?[^\/]+\.(\w{1,5})$/i,a.parseURI=function(b){var c={absolute:!1,relative:!1};if(null==b)return c;var d=b.indexOf("?");d>-1&&(b=b.substr(0,d));var e;return a.ABSOLUTE_PATT.test(b)?c.absolute=!0:a.RELATIVE_PATT.test(b)&&(c.relative=!0),(e=b.match(a.EXTENSION_PATT))&&(c.extension=e[1].toLowerCase()),c},a.formatQueryString=function(a,b){if(null==a)throw new Error("You must specify data.");var c=[];for(var d in a)c.push(d+"="+escape(a[d]));return b&&(c=c.concat(b)),c.join("&")},a.buildPath=function(a,b){if(null==b)return a;var c=[],d=a.indexOf("?");if(-1!=d){var e=a.slice(d+1);c=c.concat(e.split("&"))}return-1!=d?a.slice(0,d)+"?"+this.formatQueryString(b,c):a+"?"+this.formatQueryString(b,c)},a.isCrossDomain=function(a){var b=document.createElement("a");b.href=a.src;var c=document.createElement("a");c.href=location.href;var d=""!=b.hostname&&(b.port!=c.port||b.protocol!=c.protocol||b.hostname!=c.hostname);return d},a.isLocal=function(a){var b=document.createElement("a");return b.href=a.src,""==b.hostname&&"file:"==b.protocol},a.isBinary=function(a){switch(a){case createjs.AbstractLoader.IMAGE:case createjs.AbstractLoader.BINARY:return!0;default:return!1}},a.isImageTag=function(a){return a instanceof HTMLImageElement},a.isAudioTag=function(a){return window.HTMLAudioElement?a instanceof HTMLAudioElement:!1},a.isVideoTag=function(a){return window.HTMLVideoElement?a instanceof HTMLVideoElement:!1},a.isText=function(a){switch(a){case createjs.AbstractLoader.TEXT:case createjs.AbstractLoader.JSON:case createjs.AbstractLoader.MANIFEST:case createjs.AbstractLoader.XML:case createjs.AbstractLoader.CSS:case createjs.AbstractLoader.SVG:case createjs.AbstractLoader.JAVASCRIPT:case createjs.AbstractLoader.SPRITESHEET:return!0;default:return!1}},a.getTypeByExtension=function(a){if(null==a)return createjs.AbstractLoader.TEXT;switch(a.toLowerCase()){case"jpeg":case"jpg":case"gif":case"png":case"webp":case"bmp":return createjs.AbstractLoader.IMAGE;case"ogg":case"mp3":case"webm":return createjs.AbstractLoader.SOUND;case"mp4":case"webm":case"ts":return createjs.AbstractLoader.VIDEO;case"json":return createjs.AbstractLoader.JSON;case"xml":return createjs.AbstractLoader.XML;case"css":return createjs.AbstractLoader.CSS;case"js":return createjs.AbstractLoader.JAVASCRIPT;case"svg":return createjs.AbstractLoader.SVG;default:return createjs.AbstractLoader.TEXT}},createjs.RequestUtils=a}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractLoader(a,b,c){this.EventDispatcher_constructor(),this.loaded=!1,this.canceled=!1,this.progress=0,this.type=c,this.resultFormatter=null,this._item=a?createjs.LoadItem.create(a):null,this._preferXHR=b,this._result=null,this._rawResult=null,this._loadedItems=null,this._tagSrcAttribute=null,this._tag=null}var a=createjs.extend(AbstractLoader,createjs.EventDispatcher),b=AbstractLoader;b.POST="POST",b.GET="GET",b.BINARY="binary",b.CSS="css",b.IMAGE="image",b.JAVASCRIPT="javascript",b.JSON="json",b.JSONP="jsonp",b.MANIFEST="manifest",b.SOUND="sound",b.VIDEO="video",b.SPRITESHEET="spritesheet",b.SVG="svg",b.TEXT="text",b.XML="xml",a.getItem=function(){return this._item},a.getResult=function(a){return a?this._rawResult:this._result},a.getTag=function(){return this._tag},a.setTag=function(a){this._tag=a},a.load=function(){this._createRequest(),this._request.on("complete",this,this),this._request.on("progress",this,this),this._request.on("loadStart",this,this),this._request.on("abort",this,this),this._request.on("timeout",this,this),this._request.on("error",this,this);var a=new createjs.Event("initialize");a.loader=this._request,this.dispatchEvent(a),this._request.load()},a.cancel=function(){this.canceled=!0,this.destroy()},a.destroy=function(){this._request&&(this._request.removeAllEventListeners(),this._request.destroy()),this._request=null,this._item=null,this._rawResult=null,this._result=null,this._loadItems=null,this.removeAllEventListeners()},a.getLoadedItems=function(){return this._loadedItems},a._createRequest=function(){this._request=this._preferXHR?new createjs.XHRRequest(this._item):new createjs.TagRequest(this._item,this._tag||this._createTag(),this._tagSrcAttribute)},a._createTag=function(){return null},a._sendLoadStart=function(){this._isCanceled()||this.dispatchEvent("loadstart")},a._sendProgress=function(a){if(!this._isCanceled()){var b=null;"number"==typeof a?(this.progress=a,b=new createjs.ProgressEvent(this.progress)):(b=a,this.progress=a.loaded/a.total,b.progress=this.progress,(isNaN(this.progress)||1/0==this.progress)&&(this.progress=0)),this.hasEventListener("progress")&&this.dispatchEvent(b)}},a._sendComplete=function(){if(!this._isCanceled()){this.loaded=!0;var a=new createjs.Event("complete");a.rawResult=this._rawResult,null!=this._result&&(a.result=this._result),this.dispatchEvent(a)}},a._sendError=function(a){!this._isCanceled()&&this.hasEventListener("error")&&(null==a&&(a=new createjs.ErrorEvent("PRELOAD_ERROR_EMPTY")),this.dispatchEvent(a))},a._isCanceled=function(){return null==window.createjs||this.canceled?!0:!1},a.resultFormatter=null,a.handleEvent=function(a){switch(a.type){case"complete":this._rawResult=a.target._response;var b=this.resultFormatter&&this.resultFormatter(this);b instanceof Function?b.call(this,createjs.proxy(this._resultFormatSuccess,this),createjs.proxy(this._resultFormatFailed,this)):(this._result=b||this._rawResult,this._sendComplete());break;case"progress":this._sendProgress(a);break;case"error":this._sendError(a);break;case"loadstart":this._sendLoadStart();break;case"abort":case"timeout":this._isCanceled()||this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_"+a.type.toUpperCase()+"_ERROR"))}},a._resultFormatSuccess=function(a){this._result=a,this._sendComplete()},a._resultFormatFailed=function(a){this._sendError(a)},a.buildPath=function(a,b){return createjs.RequestUtils.buildPath(a,b)},a.toString=function(){return"[PreloadJS AbstractLoader]"},createjs.AbstractLoader=createjs.promote(AbstractLoader,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractMediaLoader(a,b,c){this.AbstractLoader_constructor(a,b,c),this.resultFormatter=this._formatResult,this._tagSrcAttribute="src",this.on("initialize",this._updateXHR,this)}var a=createjs.extend(AbstractMediaLoader,createjs.AbstractLoader);a.load=function(){this._tag||(this._tag=this._createTag(this._item.src)),this._tag.preload="auto",this._tag.load(),this.AbstractLoader_load()},a._createTag=function(){},a._createRequest=function(){this._request=this._preferXHR?new createjs.XHRRequest(this._item):new createjs.MediaTagRequest(this._item,this._tag||this._createTag(),this._tagSrcAttribute)},a._updateXHR=function(a){a.loader.setResponseType&&a.loader.setResponseType("blob")},a._formatResult=function(a){if(this._tag.removeEventListener&&this._tag.removeEventListener("canplaythrough",this._loadedHandler),this._tag.onstalled=null,this._preferXHR){var b=window.URL||window.webkitURL,c=a.getResult(!0);a.getTag().src=b.createObjectURL(c)}return a.getTag()},createjs.AbstractMediaLoader=createjs.promote(AbstractMediaLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";var AbstractRequest=function(a){this._item=a},a=createjs.extend(AbstractRequest,createjs.EventDispatcher);a.load=function(){},a.destroy=function(){},a.cancel=function(){},createjs.AbstractRequest=createjs.promote(AbstractRequest,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function TagRequest(a,b,c){this.AbstractRequest_constructor(a),this._tag=b,this._tagSrcAttribute=c,this._loadedHandler=createjs.proxy(this._handleTagComplete,this),this._addedToDOM=!1,this._startTagVisibility=null}var a=createjs.extend(TagRequest,createjs.AbstractRequest);a.load=function(){this._tag.onload=createjs.proxy(this._handleTagComplete,this),this._tag.onreadystatechange=createjs.proxy(this._handleReadyStateChange,this),this._tag.onerror=createjs.proxy(this._handleError,this);var a=new createjs.Event("initialize");a.loader=this._tag,this.dispatchEvent(a),this._hideTag(),this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout),this._tag[this._tagSrcAttribute]=this._item.src,null==this._tag.parentNode&&(window.document.body.appendChild(this._tag),this._addedToDOM=!0)},a.destroy=function(){this._clean(),this._tag=null,this.AbstractRequest_destroy()},a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this._tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleTagComplete()},a._handleError=function(){this._clean(),this.dispatchEvent("error")},a._handleTagComplete=function(){this._rawResult=this._tag,this._result=this.resultFormatter&&this.resultFormatter(this)||this._rawResult,this._clean(),this._showTag(),this.dispatchEvent("complete")},a._handleTimeout=function(){this._clean(),this.dispatchEvent(new createjs.Event("timeout"))},a._clean=function(){this._tag.onload=null,this._tag.onreadystatechange=null,this._tag.onerror=null,this._addedToDOM&&null!=this._tag.parentNode&&this._tag.parentNode.removeChild(this._tag),clearTimeout(this._loadTimeout)},a._hideTag=function(){this._startTagVisibility=this._tag.style.visibility,this._tag.style.visibility="hidden"},a._showTag=function(){this._tag.style.visibility=this._startTagVisibility},a._handleStalled=function(){},createjs.TagRequest=createjs.promote(TagRequest,"AbstractRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function MediaTagRequest(a,b,c){this.AbstractRequest_constructor(a),this._tag=b,this._tagSrcAttribute=c,this._loadedHandler=createjs.proxy(this._handleTagComplete,this)}var a=createjs.extend(MediaTagRequest,createjs.TagRequest);a.load=function(){var a=createjs.proxy(this._handleStalled,this);this._stalledCallback=a;var b=createjs.proxy(this._handleProgress,this);this._handleProgress=b,this._tag.addEventListener("stalled",a),this._tag.addEventListener("progress",b),this._tag.addEventListener&&this._tag.addEventListener("canplaythrough",this._loadedHandler,!1),this.TagRequest_load()},a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this._tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleTagComplete()},a._handleStalled=function(){},a._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.ProgressEvent(a.loaded,a.total);this.dispatchEvent(b)}},a._clean=function(){this._tag.removeEventListener&&this._tag.removeEventListener("canplaythrough",this._loadedHandler),this._tag.removeEventListener("stalled",this._stalledCallback),this._tag.removeEventListener("progress",this._progressCallback),this.TagRequest__clean()},createjs.MediaTagRequest=createjs.promote(MediaTagRequest,"TagRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function XHRRequest(a){this.AbstractRequest_constructor(a),this._request=null,this._loadTimeout=null,this._xhrLevel=1,this._response=null,this._rawResponse=null,this._canceled=!1,this._handleLoadStartProxy=createjs.proxy(this._handleLoadStart,this),this._handleProgressProxy=createjs.proxy(this._handleProgress,this),this._handleAbortProxy=createjs.proxy(this._handleAbort,this),this._handleErrorProxy=createjs.proxy(this._handleError,this),this._handleTimeoutProxy=createjs.proxy(this._handleTimeout,this),this._handleLoadProxy=createjs.proxy(this._handleLoad,this),this._handleReadyStateChangeProxy=createjs.proxy(this._handleReadyStateChange,this),!this._createXHR(a)}var a=createjs.extend(XHRRequest,createjs.AbstractRequest);XHRRequest.ACTIVEX_VERSIONS=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],a.getResult=function(a){return a&&this._rawResponse?this._rawResponse:this._response},a.cancel=function(){this.canceled=!0,this._clean(),this._request.abort()},a.load=function(){if(null==this._request)return void this._handleError();null!=this._request.addEventListener?(this._request.addEventListener("loadstart",this._handleLoadStartProxy,!1),this._request.addEventListener("progress",this._handleProgressProxy,!1),this._request.addEventListener("abort",this._handleAbortProxy,!1),this._request.addEventListener("error",this._handleErrorProxy,!1),this._request.addEventListener("timeout",this._handleTimeoutProxy,!1),this._request.addEventListener("load",this._handleLoadProxy,!1),this._request.addEventListener("readystatechange",this._handleReadyStateChangeProxy,!1)):(this._request.onloadstart=this._handleLoadStartProxy,this._request.onprogress=this._handleProgressProxy,this._request.onabort=this._handleAbortProxy,this._request.onerror=this._handleErrorProxy,this._request.ontimeout=this._handleTimeoutProxy,this._request.onload=this._handleLoadProxy,this._request.onreadystatechange=this._handleReadyStateChangeProxy),1==this._xhrLevel&&(this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout));try{this._item.values&&this._item.method!=createjs.AbstractLoader.GET?this._item.method==createjs.AbstractLoader.POST&&this._request.send(createjs.RequestUtils.formatQueryString(this._item.values)):this._request.send()}catch(a){this.dispatchEvent(new createjs.ErrorEvent("XHR_SEND",null,a))}},a.setResponseType=function(a){"blob"===a&&(a=window.URL?"blob":"arraybuffer",this._responseType=a),this._request.responseType=a},a.getAllResponseHeaders=function(){return this._request.getAllResponseHeaders instanceof Function?this._request.getAllResponseHeaders():null},a.getResponseHeader=function(a){return this._request.getResponseHeader instanceof Function?this._request.getResponseHeader(a):null},a._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.ProgressEvent(a.loaded,a.total);this.dispatchEvent(b)}},a._handleLoadStart=function(){clearTimeout(this._loadTimeout),this.dispatchEvent("loadstart")},a._handleAbort=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent("XHR_ABORTED",null,a))},a._handleError=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent(a.message))},a._handleReadyStateChange=function(){4==this._request.readyState&&this._handleLoad()},a._handleLoad=function(){if(!this.loaded){this.loaded=!0;var a=this._checkError();if(a)return void this._handleError(a);if(this._response=this._getResponse(),"arraybuffer"===this._responseType)try{this._response=new Blob([this._response])}catch(b){if(window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,"TypeError"===b.name&&window.BlobBuilder){var c=new BlobBuilder;c.append(this._response),this._response=c.getBlob()}}this._clean(),this.dispatchEvent(new createjs.Event("complete"))}},a._handleTimeout=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_TIMEOUT",null,a))},a._checkError=function(){var a=parseInt(this._request.status);switch(a){case 404:case 0:return new Error(a)}return null},a._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(a){}return null},a._createXHR=function(a){var b=createjs.RequestUtils.isCrossDomain(a),c={},d=null;if(window.XMLHttpRequest)d=new XMLHttpRequest,b&&void 0===d.withCredentials&&window.XDomainRequest&&(d=new XDomainRequest);else{for(var e=0,f=s.ACTIVEX_VERSIONS.length;f>e;e++){var g=s.ACTIVEX_VERSIONS[e];try{d=new ActiveXObject(g);break}catch(h){}}if(null==d)return!1}null==a.mimeType&&createjs.RequestUtils.isText(a.type)&&(a.mimeType="text/plain; charset=utf-8"),a.mimeType&&d.overrideMimeType&&d.overrideMimeType(a.mimeType),this._xhrLevel="string"==typeof d.responseType?2:1;var i=null;if(i=a.method==createjs.AbstractLoader.GET?createjs.RequestUtils.buildPath(a.src,a.values):a.src,d.open(a.method||createjs.AbstractLoader.GET,i,!0),b&&d instanceof XMLHttpRequest&&1==this._xhrLevel&&(c.Origin=location.origin),a.values&&a.method==createjs.AbstractLoader.POST&&(c["Content-Type"]="application/x-www-form-urlencoded"),b||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest"),a.headers)for(var j in a.headers)c[j]=a.headers[j];for(j in c)d.setRequestHeader(j,c[j]);return d instanceof XMLHttpRequest&&void 0!==a.withCredentials&&(d.withCredentials=a.withCredentials),this._request=d,!0},a._clean=function(){clearTimeout(this._loadTimeout),null!=this._request.removeEventListener?(this._request.removeEventListener("loadstart",this._handleLoadStartProxy),this._request.removeEventListener("progress",this._handleProgressProxy),this._request.removeEventListener("abort",this._handleAbortProxy),this._request.removeEventListener("error",this._handleErrorProxy),this._request.removeEventListener("timeout",this._handleTimeoutProxy),this._request.removeEventListener("load",this._handleLoadProxy),this._request.removeEventListener("readystatechange",this._handleReadyStateChangeProxy)):(this._request.onloadstart=null,this._request.onprogress=null,this._request.onabort=null,this._request.onerror=null,this._request.ontimeout=null,this._request.onload=null,this._request.onreadystatechange=null)},a.toString=function(){return"[PreloadJS XHRRequest]"},createjs.XHRRequest=createjs.promote(XHRRequest,"AbstractRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function SoundLoader(a,b){this.AbstractMediaLoader_constructor(a,b,createjs.AbstractLoader.SOUND),createjs.RequestUtils.isAudioTag(a)?this._tag=a:createjs.RequestUtils.isAudioTag(a.src)?this._tag=a:createjs.RequestUtils.isAudioTag(a.tag)&&(this._tag=createjs.RequestUtils.isAudioTag(a)?a:a.src),null!=this._tag&&(this._preferXHR=!1)}var a=createjs.extend(SoundLoader,createjs.AbstractMediaLoader),b=SoundLoader;b.canLoadItem=function(a){return a.type==createjs.AbstractLoader.SOUND},a._createTag=function(a){var b=document.createElement("audio");return b.autoplay=!1,b.preload="none",b.src=a,b},createjs.SoundLoader=createjs.promote(SoundLoader,"AbstractMediaLoader")}(),this.createjs=this.createjs||{},function(){"use strict";var PlayPropsConfig=function(){this.interrupt=null,this.delay=null,this.offset=null,this.loop=null,this.volume=null,this.pan=null,this.startTime=null,this.duration=null},a=PlayPropsConfig.prototype={},b=PlayPropsConfig;b.create=function(a){if(a instanceof b||a instanceof Object){var c=new createjs.PlayPropsConfig;return c.set(a),c}throw new Error("Type not recognized.")},a.set=function(a){for(var b in a)this[b]=a[b];return this},a.toString=function(){return"[PlayPropsConfig]"},createjs.PlayPropsConfig=b}(),this.createjs=this.createjs||{},function(){"use strict";function Sound(){throw"Sound cannot be instantiated"}function a(a,b){this.init(a,b)}var b=Sound;b.INTERRUPT_ANY="any",b.INTERRUPT_EARLY="early",b.INTERRUPT_LATE="late",b.INTERRUPT_NONE="none",b.PLAY_INITED="playInited",b.PLAY_SUCCEEDED="playSucceeded",b.PLAY_INTERRUPTED="playInterrupted",b.PLAY_FINISHED="playFinished",b.PLAY_FAILED="playFailed",b.SUPPORTED_EXTENSIONS=["mp3","ogg","opus","mpeg","wav","m4a","mp4","aiff","wma","mid"],b.EXTENSION_MAP={m4a:"mp4"},b.FILE_PATTERN=/^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([\/.]*?(?:[^?]+)?\/)?((?:[^\/?]+)\.(\w+))(?:\?(\S+)?)?$/,b.defaultInterruptBehavior=b.INTERRUPT_NONE,b.alternateExtensions=[],b.activePlugin=null,b._masterVolume=1,Object.defineProperty(b,"volume",{get:function(){return this._masterVolume},set:function(a){if(null==Number(a))return!1;if(a=Math.max(0,Math.min(1,a)),b._masterVolume=a,!this.activePlugin||!this.activePlugin.setVolume||!this.activePlugin.setVolume(a))for(var c=this._instances,d=0,e=c.length;e>d;d++)c[d].setMasterVolume(a)}}),b._masterMute=!1,Object.defineProperty(b,"muted",{get:function(){return this._masterMute},set:function(a){if(null==a)return!1;if(this._masterMute=a,!this.activePlugin||!this.activePlugin.setMute||!this.activePlugin.setMute(a))for(var b=this._instances,c=0,d=b.length;d>c;c++)b[c].setMasterMute(a);return!0}}),Object.defineProperty(b,"capabilities",{get:function(){return null==b.activePlugin?null:b.activePlugin._capabilities},set:function(){return!1}}),b._pluginsRegistered=!1,b._lastID=0,b._instances=[],b._idHash={},b._preloadHash={},b._defaultPlayPropsHash={},b.addEventListener=null,b.removeEventListener=null,b.removeAllEventListeners=null,b.dispatchEvent=null,b.hasEventListener=null,b._listeners=null,createjs.EventDispatcher.initialize(b),b.getPreloadHandlers=function(){return{callback:createjs.proxy(b.initLoad,b),types:["sound"],extensions:b.SUPPORTED_EXTENSIONS}},b._handleLoadComplete=function(a){var c=a.target.getItem().src;if(b._preloadHash[c])for(var d=0,e=b._preloadHash[c].length;e>d;d++){var f=b._preloadHash[c][d];if(b._preloadHash[c][d]=!0,b.hasEventListener("fileload")){var a=new createjs.Event("fileload");a.src=f.src,a.id=f.id,a.data=f.data,a.sprite=f.sprite,b.dispatchEvent(a)}}},b._handleLoadError=function(a){var c=a.target.getItem().src;if(b._preloadHash[c])for(var d=0,e=b._preloadHash[c].length;e>d;d++){var f=b._preloadHash[c][d];if(b._preloadHash[c][d]=!1,b.hasEventListener("fileerror")){var a=new createjs.Event("fileerror");a.src=f.src,a.id=f.id,a.data=f.data,a.sprite=f.sprite,b.dispatchEvent(a)}}},b._registerPlugin=function(a){return a.isSupported()?(b.activePlugin=new a,!0):!1},b.registerPlugins=function(a){b._pluginsRegistered=!0;for(var c=0,d=a.length;d>c;c++)if(b._registerPlugin(a[c]))return!0;return!1},b.initializeDefaultPlugins=function(){return null!=b.activePlugin?!0:b._pluginsRegistered?!1:b.registerPlugins([createjs.WebAudioPlugin,createjs.HTMLAudioPlugin])?!0:!1},b.isReady=function(){return null!=b.activePlugin},b.getCapabilities=function(){return null==b.activePlugin?null:b.activePlugin._capabilities},b.getCapability=function(a){return null==b.activePlugin?null:b.activePlugin._capabilities[a]},b.initLoad=function(a){return b._registerSound(a)},b._registerSound=function(c){if(!b.initializeDefaultPlugins())return!1;var d;if(c.src instanceof Object?(d=b._parseSrc(c.src),d.src=c.path+d.src):d=b._parsePath(c.src),null==d)return!1;c.src=d.src,c.type="sound";var e=c.data,f=null;if(null!=e&&(isNaN(e.channels)?isNaN(e)||(f=parseInt(e)):f=parseInt(e.channels),e.audioSprite))for(var g,h=e.audioSprite.length;h--;)g=e.audioSprite[h],b._idHash[g.id]={src:c.src,startTime:parseInt(g.startTime),duration:parseInt(g.duration)},g.defaultPlayProps&&(b._defaultPlayPropsHash[g.id]=createjs.PlayPropsConfig.create(g.defaultPlayProps));null!=c.id&&(b._idHash[c.id]={src:c.src});var i=b.activePlugin.register(c);return a.create(c.src,f),null!=e&&isNaN(e)?c.data.channels=f||a.maxPerChannel():c.data=f||a.maxPerChannel(),i.type&&(c.type=i.type),c.defaultPlayProps&&(b._defaultPlayPropsHash[c.src]=createjs.PlayPropsConfig.create(c.defaultPlayProps)),i},b.registerSound=function(a,c,d,e,f){var g={src:a,id:c,data:d,defaultPlayProps:f};a instanceof Object&&a.src&&(e=c,g=a),g=createjs.LoadItem.create(g),g.path=e,null==e||g.src instanceof Object||(g.src=e+a);var h=b._registerSound(g);if(!h)return!1;if(b._preloadHash[g.src]||(b._preloadHash[g.src]=[]),b._preloadHash[g.src].push(g),1==b._preloadHash[g.src].length)h.on("complete",createjs.proxy(this._handleLoadComplete,this)),h.on("error",createjs.proxy(this._handleLoadError,this)),b.activePlugin.preload(h);else if(1==b._preloadHash[g.src][0])return!0;return g},b.registerSounds=function(a,b){var c=[];a.path&&(b?b+=a.path:b=a.path,a=a.manifest);for(var d=0,e=a.length;e>d;d++)c[d]=createjs.Sound.registerSound(a[d].src,a[d].id,a[d].data,b,a[d].defaultPlayProps);return c},b.removeSound=function(c,d){if(null==b.activePlugin)return!1;c instanceof Object&&c.src&&(c=c.src);var e;if(c instanceof Object?e=b._parseSrc(c):(c=b._getSrcById(c).src,e=b._parsePath(c)),null==e)return!1;c=e.src,null!=d&&(c=d+c);for(var f in b._idHash)b._idHash[f].src==c&&delete b._idHash[f];return a.removeSrc(c),delete b._preloadHash[c],b.activePlugin.removeSound(c),!0},b.removeSounds=function(a,b){var c=[];a.path&&(b?b+=a.path:b=a.path,a=a.manifest);for(var d=0,e=a.length;e>d;d++)c[d]=createjs.Sound.removeSound(a[d].src,b);return c},b.removeAllSounds=function(){b._idHash={},b._preloadHash={},a.removeAll(),b.activePlugin&&b.activePlugin.removeAllSounds()},b.loadComplete=function(a){if(!b.isReady())return!1;var c=b._parsePath(a);return a=c?b._getSrcById(c.src).src:b._getSrcById(a).src,void 0==b._preloadHash[a]?!1:1==b._preloadHash[a][0]},b._parsePath=function(a){"string"!=typeof a&&(a=a.toString());var c=a.match(b.FILE_PATTERN);if(null==c)return!1;for(var d=c[4],e=c[5],f=b.capabilities,g=0;!f[e];)if(e=b.alternateExtensions[g++],g>b.alternateExtensions.length)return null;a=a.replace("."+c[5],"."+e);var h={name:d,src:a,extension:e};return h},b._parseSrc=function(a){var c={name:void 0,src:void 0,extension:void 0},d=b.capabilities;for(var e in a)if(a.hasOwnProperty(e)&&d[e]){c.src=a[e],c.extension=e;break}if(!c.src)return!1;var f=c.src.lastIndexOf("/");return c.name=-1!=f?c.src.slice(f+1):c.src,c},b.play=function(a,c,d,e,f,g,h,i,j){var k;k=createjs.PlayPropsConfig.create(c instanceof Object||c instanceof createjs.PlayPropsConfig?c:{interrupt:c,delay:d,offset:e,loop:f,volume:g,pan:h,startTime:i,duration:j});var l=b.createInstance(a,k.startTime,k.duration),m=b._playInstance(l,k);return m||l._playFailed(),l},b.createInstance=function(c,d,e){if(!b.initializeDefaultPlugins())return new createjs.DefaultSoundInstance(c,d,e);var f=b._defaultPlayPropsHash[c];c=b._getSrcById(c);var g=b._parsePath(c.src),h=null; -return null!=g&&null!=g.src?(a.create(g.src),null==d&&(d=c.startTime),h=b.activePlugin.create(g.src,d,e||c.duration),f=f||b._defaultPlayPropsHash[g.src],f&&h.applyPlayProps(f)):h=new createjs.DefaultSoundInstance(c,d,e),h.uniqueId=b._lastID++,h},b.stop=function(){for(var a=this._instances,b=a.length;b--;)a[b].stop()},b.setVolume=function(a){if(null==Number(a))return!1;if(a=Math.max(0,Math.min(1,a)),b._masterVolume=a,!this.activePlugin||!this.activePlugin.setVolume||!this.activePlugin.setVolume(a))for(var c=this._instances,d=0,e=c.length;e>d;d++)c[d].setMasterVolume(a)},b.getVolume=function(){return this._masterVolume},b.setMute=function(a){if(null==a)return!1;if(this._masterMute=a,!this.activePlugin||!this.activePlugin.setMute||!this.activePlugin.setMute(a))for(var b=this._instances,c=0,d=b.length;d>c;c++)b[c].setMasterMute(a);return!0},b.getMute=function(){return this._masterMute},b.setDefaultPlayProps=function(a,c){a=b._getSrcById(a),b._defaultPlayPropsHash[b._parsePath(a.src).src]=createjs.PlayPropsConfig.create(c)},b.getDefaultPlayProps=function(a){return a=b._getSrcById(a),b._defaultPlayPropsHash[b._parsePath(a.src).src]},b._playInstance=function(a,c){var d=b._defaultPlayPropsHash[a.src]||{};if(null==c.interrupt&&(c.interrupt=d.interrupt||b.defaultInterruptBehavior),null==c.delay&&(c.delay=d.delay||0),null==c.offset&&(c.offset=a.getPosition()),null==c.loop&&(c.loop=a.loop),null==c.volume&&(c.volume=a.volume),null==c.pan&&(c.pan=a.pan),0==c.delay){var e=b._beginPlaying(a,c);if(!e)return!1}else{var f=setTimeout(function(){b._beginPlaying(a,c)},c.delay);a.delayTimeoutId=f}return this._instances.push(a),!0},b._beginPlaying=function(b,c){if(!a.add(b,c.interrupt))return!1;var d=b._beginPlaying(c);if(!d){var e=createjs.indexOf(this._instances,b);return e>-1&&this._instances.splice(e,1),!1}return!0},b._getSrcById=function(a){return b._idHash[a]||{src:a}},b._playFinished=function(b){a.remove(b);var c=createjs.indexOf(this._instances,b);c>-1&&this._instances.splice(c,1)},createjs.Sound=Sound,a.channels={},a.create=function(b,c){var d=a.get(b);return null==d?(a.channels[b]=new a(b,c),!0):!1},a.removeSrc=function(b){var c=a.get(b);return null==c?!1:(c._removeAll(),delete a.channels[b],!0)},a.removeAll=function(){for(var b in a.channels)a.channels[b]._removeAll();a.channels={}},a.add=function(b,c){var d=a.get(b.src);return null==d?!1:d._add(b,c)},a.remove=function(b){var c=a.get(b.src);return null==c?!1:(c._remove(b),!0)},a.maxPerChannel=function(){return c.maxDefault},a.get=function(b){return a.channels[b]};var c=a.prototype;c.constructor=a,c.src=null,c.max=null,c.maxDefault=100,c.length=0,c.init=function(a,b){this.src=a,this.max=b||this.maxDefault,-1==this.max&&(this.max=this.maxDefault),this._instances=[]},c._get=function(a){return this._instances[a]},c._add=function(a,b){return this._getSlot(b,a)?(this._instances.push(a),this.length++,!0):!1},c._remove=function(a){var b=createjs.indexOf(this._instances,a);return-1==b?!1:(this._instances.splice(b,1),this.length--,!0)},c._removeAll=function(){for(var a=this.length-1;a>=0;a--)this._instances[a].stop()},c._getSlot=function(a){var b,c;if(a!=Sound.INTERRUPT_NONE&&(c=this._get(0),null==c))return!0;for(var d=0,e=this.max;e>d;d++){if(b=this._get(d),null==b)return!0;if(b.playState==Sound.PLAY_FINISHED||b.playState==Sound.PLAY_INTERRUPTED||b.playState==Sound.PLAY_FAILED){c=b;break}a!=Sound.INTERRUPT_NONE&&(a==Sound.INTERRUPT_EARLY&&b.getPosition()c.getPosition())&&(c=b)}return null!=c?(c._interrupt(),this._remove(c),!0):!1},c.toString=function(){return"[Sound SoundChannel]"}}(),this.createjs=this.createjs||{},function(){"use strict";var AbstractSoundInstance=function(a,b,c,d){this.EventDispatcher_constructor(),this.src=a,this.uniqueId=-1,this.playState=null,this.delayTimeoutId=null,this._volume=1,Object.defineProperty(this,"volume",{get:this.getVolume,set:this.setVolume}),this._pan=0,Object.defineProperty(this,"pan",{get:this.getPan,set:this.setPan}),this._startTime=Math.max(0,b||0),Object.defineProperty(this,"startTime",{get:this.getStartTime,set:this.setStartTime}),this._duration=Math.max(0,c||0),Object.defineProperty(this,"duration",{get:this.getDuration,set:this.setDuration}),this._playbackResource=null,Object.defineProperty(this,"playbackResource",{get:this.getPlaybackResource,set:this.setPlaybackResource}),d!==!1&&d!==!0&&this.setPlaybackResource(d),this._position=0,Object.defineProperty(this,"position",{get:this.getPosition,set:this.setPosition}),this._loop=0,Object.defineProperty(this,"loop",{get:this.getLoop,set:this.setLoop}),this._muted=!1,Object.defineProperty(this,"muted",{get:this.getMuted,set:this.setMuted}),this._paused=!1,Object.defineProperty(this,"paused",{get:this.getPaused,set:this.setPaused})},a=createjs.extend(AbstractSoundInstance,createjs.EventDispatcher);a.play=function(a,b,c,d,e,f){var g;return g=createjs.PlayPropsConfig.create(a instanceof Object||a instanceof createjs.PlayPropsConfig?a:{interrupt:a,delay:b,offset:c,loop:d,volume:e,pan:f}),this.playState==createjs.Sound.PLAY_SUCCEEDED?(this.applyPlayProps(g),void(this._paused&&this.setPaused(!1))):(this._cleanUp(),createjs.Sound._playInstance(this,g),this)},a.stop=function(){return this._position=0,this._paused=!1,this._handleStop(),this._cleanUp(),this.playState=createjs.Sound.PLAY_FINISHED,this},a.destroy=function(){this._cleanUp(),this.src=null,this.playbackResource=null,this.removeAllEventListeners()},a.applyPlayProps=function(a){return null!=a.offset&&this.setPosition(a.offset),null!=a.loop&&this.setLoop(a.loop),null!=a.volume&&this.setVolume(a.volume),null!=a.pan&&this.setPan(a.pan),null!=a.startTime&&(this.setStartTime(a.startTime),this.setDuration(a.duration)),this},a.toString=function(){return"[AbstractSoundInstance]"},a.getPaused=function(){return this._paused},a.setPaused=function(a){return a!==!0&&a!==!1||this._paused==a||1==a&&this.playState!=createjs.Sound.PLAY_SUCCEEDED?void 0:(this._paused=a,a?this._pause():this._resume(),clearTimeout(this.delayTimeoutId),this)},a.setVolume=function(a){return a==this._volume?this:(this._volume=Math.max(0,Math.min(1,a)),this._muted||this._updateVolume(),this)},a.getVolume=function(){return this._volume},a.setMuted=function(a){return a===!0||a===!1?(this._muted=a,this._updateVolume(),this):void 0},a.getMuted=function(){return this._muted},a.setPan=function(a){return a==this._pan?this:(this._pan=Math.max(-1,Math.min(1,a)),this._updatePan(),this)},a.getPan=function(){return this._pan},a.getPosition=function(){return this._paused||this.playState!=createjs.Sound.PLAY_SUCCEEDED||(this._position=this._calculateCurrentPosition()),this._position},a.setPosition=function(a){return this._position=Math.max(0,a),this.playState==createjs.Sound.PLAY_SUCCEEDED&&this._updatePosition(),this},a.getStartTime=function(){return this._startTime},a.setStartTime=function(a){return a==this._startTime?this:(this._startTime=Math.max(0,a||0),this._updateStartTime(),this)},a.getDuration=function(){return this._duration},a.setDuration=function(a){return a==this._duration?this:(this._duration=Math.max(0,a||0),this._updateDuration(),this)},a.setPlaybackResource=function(a){return this._playbackResource=a,0==this._duration&&this._setDurationFromSource(),this},a.getPlaybackResource=function(){return this._playbackResource},a.getLoop=function(){return this._loop},a.setLoop=function(a){null!=this._playbackResource&&(0!=this._loop&&0==a?this._removeLooping(a):0==this._loop&&0!=a&&this._addLooping(a)),this._loop=a},a._sendEvent=function(a){var b=new createjs.Event(a);this.dispatchEvent(b)},a._cleanUp=function(){clearTimeout(this.delayTimeoutId),this._handleCleanUp(),this._paused=!1,createjs.Sound._playFinished(this)},a._interrupt=function(){this._cleanUp(),this.playState=createjs.Sound.PLAY_INTERRUPTED,this._sendEvent("interrupted")},a._beginPlaying=function(a){return this.setPosition(a.offset),this.setLoop(a.loop),this.setVolume(a.volume),this.setPan(a.pan),null!=a.startTime&&(this.setStartTime(a.startTime),this.setDuration(a.duration)),null!=this._playbackResource&&this._positionc;c++){var e=this._soundInstances[b][c];e.setPlaybackResource(this._audioSources[b])}},a._handlePreloadError=function(){},a._updateVolume=function(){},createjs.AbstractPlugin=AbstractPlugin}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.AbstractLoader_constructor(a,!0,createjs.AbstractLoader.SOUND)}var b=createjs.extend(a,createjs.AbstractLoader);a.context=null,b.toString=function(){return"[WebAudioLoader]"},b._createRequest=function(){this._request=new createjs.XHRRequest(this._item,!1),this._request.setResponseType("arraybuffer")},b._sendComplete=function(){a.context.decodeAudioData(this._rawResult,createjs.proxy(this._handleAudioDecoded,this),createjs.proxy(this._sendError,this))},b._handleAudioDecoded=function(a){this._result=a,this.AbstractLoader__sendComplete()},createjs.WebAudioLoader=createjs.promote(a,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function WebAudioSoundInstance(a,c,d,e){this.AbstractSoundInstance_constructor(a,c,d,e),this.gainNode=b.context.createGain(),this.panNode=b.context.createPanner(),this.panNode.panningModel=b._panningModel,this.panNode.connect(this.gainNode),this._updatePan(),this.sourceNode=null,this._soundCompleteTimeout=null,this._sourceNodeNext=null,this._playbackStartTime=0,this._endedHandler=createjs.proxy(this._handleSoundComplete,this)}var a=createjs.extend(WebAudioSoundInstance,createjs.AbstractSoundInstance),b=WebAudioSoundInstance;b.context=null,b._scratchBuffer=null,b.destinationNode=null,b._panningModel="equalpower",a.destroy=function(){this.AbstractSoundInstance_destroy(),this.panNode.disconnect(0),this.panNode=null,this.gainNode.disconnect(0),this.gainNode=null},a.toString=function(){return"[WebAudioSoundInstance]"},a._updatePan=function(){this.panNode.setPosition(this._pan,0,-.5)},a._removeLooping=function(){this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext)},a._addLooping=function(){this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0))},a._setDurationFromSource=function(){this._duration=1e3*this.playbackResource.duration},a._handleCleanUp=function(){this.sourceNode&&this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext)),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(0),clearTimeout(this._soundCompleteTimeout),this._playbackStartTime=0},a._cleanUpAudioNode=function(a){if(a){a.stop(0),a.disconnect(0);try{a.buffer=b._scratchBuffer}catch(c){}a=null}return a},a._handleSoundReady=function(){this.gainNode.connect(b.destinationNode);var a=.001*this._duration,c=.001*this._position;c>a&&(c=a),this.sourceNode=this._createAndPlayAudioNode(b.context.currentTime-a,c),this._playbackStartTime=this.sourceNode.startTime-c,this._soundCompleteTimeout=setTimeout(this._endedHandler,1e3*(a-c)),0!=this._loop&&(this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0))},a._createAndPlayAudioNode=function(a,c){var d=b.context.createBufferSource();d.buffer=this.playbackResource,d.connect(this.panNode);var e=.001*this._duration;return d.startTime=a+e,d.start(d.startTime,c+.001*this._startTime,e-c),d},a._pause=function(){this._position=1e3*(b.context.currentTime-this._playbackStartTime),this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(0),clearTimeout(this._soundCompleteTimeout)},a._resume=function(){this._handleSoundReady()},a._updateVolume=function(){var a=this._muted?0:this._volume;a!=this.gainNode.gain.value&&(this.gainNode.gain.value=a)},a._calculateCurrentPosition=function(){return 1e3*(b.context.currentTime-this._playbackStartTime)},a._updatePosition=function(){this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext),clearTimeout(this._soundCompleteTimeout),this._paused||this._handleSoundReady()},a._handleLoop=function(){this._cleanUpAudioNode(this.sourceNode),this.sourceNode=this._sourceNodeNext,this._playbackStartTime=this.sourceNode.startTime,this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0),this._soundCompleteTimeout=setTimeout(this._endedHandler,this._duration)},a._updateDuration=function(){this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._pause(),this._resume())},createjs.WebAudioSoundInstance=createjs.promote(WebAudioSoundInstance,"AbstractSoundInstance")}(),this.createjs=this.createjs||{},function(){"use strict";function WebAudioPlugin(){this.AbstractPlugin_constructor(),this._panningModel=b._panningModel,this.context=b.context,this.dynamicsCompressorNode=this.context.createDynamicsCompressor(),this.dynamicsCompressorNode.connect(this.context.destination),this.gainNode=this.context.createGain(),this.gainNode.connect(this.dynamicsCompressorNode),createjs.WebAudioSoundInstance.destinationNode=this.gainNode,this._capabilities=b._capabilities,this._loaderClass=createjs.WebAudioLoader,this._soundInstanceClass=createjs.WebAudioSoundInstance,this._addPropsToClasses()}var a=createjs.extend(WebAudioPlugin,createjs.AbstractPlugin),b=WebAudioPlugin;b._capabilities=null,b._panningModel="equalpower",b.context=null,b._scratchBuffer=null,b._unlocked=!1,b.isSupported=function(){var a=createjs.BrowserDetect.isIOS||createjs.BrowserDetect.isAndroid||createjs.BrowserDetect.isBlackberry;return"file:"!=location.protocol||a||this._isFileXHRSupported()?(b._generateCapabilities(),null==b.context?!1:!0):!1},b.playEmptySound=function(){if(null!=b.context){var a=b.context.createBufferSource();a.buffer=b._scratchBuffer,a.connect(b.context.destination),a.start(0,0,0)}},b._isFileXHRSupported=function(){var a=!0,b=new XMLHttpRequest;try{b.open("GET","WebAudioPluginTest.fail",!1)}catch(c){return a=!1}b.onerror=function(){a=!1},b.onload=function(){a=404==this.status||200==this.status||0==this.status&&""!=this.response};try{b.send()}catch(c){a=!1}return a},b._generateCapabilities=function(){if(null==b._capabilities){var a=document.createElement("audio");if(null==a.canPlayType)return null;if(null==b.context)if(window.AudioContext)b.context=new AudioContext;else{if(!window.webkitAudioContext)return null;b.context=new webkitAudioContext}null==b._scratchBuffer&&(b._scratchBuffer=b.context.createBuffer(1,1,22050)),b._compatibilitySetUp(),"ontouchstart"in window&&"running"!=b.context.state&&(b._unlock(),document.addEventListener("mousedown",b._unlock,!0),document.addEventListener("touchend",b._unlock,!0)),b._capabilities={panning:!0,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}b.context.destination.numberOfChannels<2&&(b._capabilities.panning=!1)}},b._compatibilitySetUp=function(){if(b._panningModel="equalpower",!b.context.createGain){b.context.createGain=b.context.createGainNode;var a=b.context.createBufferSource();a.__proto__.start=a.__proto__.noteGrainOn,a.__proto__.stop=a.__proto__.noteOff,b._panningModel=0}},b._unlock=function(){b._unlocked||(b.playEmptySound(),"running"==b.context.state&&(document.removeEventListener("mousedown",b._unlock,!0),document.removeEventListener("touchend",b._unlock,!0),b._unlocked=!0))},a.toString=function(){return"[WebAudioPlugin]"},a._addPropsToClasses=function(){var a=this._soundInstanceClass;a.context=this.context,a._scratchBuffer=b._scratchBuffer,a.destinationNode=this.gainNode,a._panningModel=this._panningModel,this._loaderClass.context=this.context},a._updateVolume=function(){var a=createjs.Sound._masterMute?0:this._volume;a!=this.gainNode.gain.value&&(this.gainNode.gain.value=a)},createjs.WebAudioPlugin=createjs.promote(WebAudioPlugin,"AbstractPlugin")}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioTagPool(){throw"HTMLAudioTagPool cannot be instantiated"}function a(){this._tags=[]}var b=HTMLAudioTagPool;b._tags={},b._tagPool=new a,b._tagUsed={},b.get=function(a){var c=b._tags[a];return null==c?(c=b._tags[a]=b._tagPool.get(),c.src=a):b._tagUsed[a]?(c=b._tagPool.get(),c.src=a):b._tagUsed[a]=!0,c},b.set=function(a,c){c==b._tags[a]?b._tagUsed[a]=!1:b._tagPool.set(c)},b.remove=function(a){var c=b._tags[a];return null==c?!1:(b._tagPool.set(c),delete b._tags[a],delete b._tagUsed[a],!0)},b.getDuration=function(a){var c=b._tags[a];return null!=c&&c.duration?1e3*c.duration:0},createjs.HTMLAudioTagPool=HTMLAudioTagPool;var c=a.prototype;c.constructor=a,c.get=function(){var a;return a=0==this._tags.length?this._createTag():this._tags.pop(),null==a.parentNode&&document.body.appendChild(a),a},c.set=function(a){var b=createjs.indexOf(this._tags,a);-1==b&&(this._tags.src=null,this._tags.push(a))},c.toString=function(){return"[TagPool]"},c._createTag=function(){var a=document.createElement("audio");return a.autoplay=!1,a.preload="none",a}}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioSoundInstance(a,b,c,d){this.AbstractSoundInstance_constructor(a,b,c,d),this._audioSpriteStopTime=null,this._delayTimeoutId=null,this._endedHandler=createjs.proxy(this._handleSoundComplete,this),this._readyHandler=createjs.proxy(this._handleTagReady,this),this._stalledHandler=createjs.proxy(this._playFailed,this),this._audioSpriteEndHandler=createjs.proxy(this._handleAudioSpriteLoop,this),this._loopHandler=createjs.proxy(this._handleSoundComplete,this),c?this._audioSpriteStopTime=.001*(b+c):this._duration=createjs.HTMLAudioTagPool.getDuration(this.src)}var a=createjs.extend(HTMLAudioSoundInstance,createjs.AbstractSoundInstance);a.setMasterVolume=function(){this._updateVolume()},a.setMasterMute=function(){this._updateVolume()},a.toString=function(){return"[HTMLAudioSoundInstance]"},a._removeLooping=function(){null!=this._playbackResource&&(this._playbackResource.loop=!1,this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._addLooping=function(){null==this._playbackResource||this._audioSpriteStopTime||(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.loop=!0)},a._handleCleanUp=function(){var a=this._playbackResource;if(null!=a){a.pause(),a.loop=!1,a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1);try{a.currentTime=this._startTime}catch(b){}createjs.HTMLAudioTagPool.set(this.src,a),this._playbackResource=null}},a._beginPlaying=function(a){return this._playbackResource=createjs.HTMLAudioTagPool.get(this.src),this.AbstractSoundInstance__beginPlaying(a)},a._handleSoundReady=function(){if(4!==this._playbackResource.readyState){var a=this._playbackResource;return a.addEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),a.addEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),a.preload="auto",void a.load()}this._updateVolume(),this._playbackResource.currentTime=.001*(this._startTime+this._position),this._audioSpriteStopTime?this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1):(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),0!=this._loop&&(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.loop=!0)),this._playbackResource.play()},a._handleTagReady=function(){this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),this._handleSoundReady()},a._pause=function(){this._playbackResource.pause()},a._resume=function(){this._playbackResource.play()},a._updateVolume=function(){if(null!=this._playbackResource){var a=this._muted||createjs.Sound._masterMute?0:this._volume*createjs.Sound._masterVolume;a!=this._playbackResource.volume&&(this._playbackResource.volume=a)}},a._calculateCurrentPosition=function(){return 1e3*this._playbackResource.currentTime-this._startTime},a._updatePosition=function(){this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._handleSetPositionSeek,!1);try{this._playbackResource.currentTime=.001*(this._position+this._startTime)}catch(a){this._handleSetPositionSeek(null)}},a._handleSetPositionSeek=function(){null!=this._playbackResource&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._handleSetPositionSeek,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._handleAudioSpriteLoop=function(){this._playbackResource.currentTime<=this._audioSpriteStopTime||(this._playbackResource.pause(),0==this._loop?this._handleSoundComplete(null):(this._position=0,this._loop--,this._playbackResource.currentTime=.001*this._startTime,this._paused||this._playbackResource.play(),this._sendEvent("loop")))},a._handleLoop=function(){0==this._loop&&(this._playbackResource.loop=!1,this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._updateStartTime=function(){this._audioSpriteStopTime=.001*(this._startTime+this._duration),this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1))},a._updateDuration=function(){this._audioSpriteStopTime=.001*(this._startTime+this._duration),this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1))},a._setDurationFromSource=function(){this._duration=createjs.HTMLAudioTagPool.getDuration(this.src),this._playbackResource=null},createjs.HTMLAudioSoundInstance=createjs.promote(HTMLAudioSoundInstance,"AbstractSoundInstance")}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioPlugin(){this.AbstractPlugin_constructor(),this.defaultNumChannels=2,this._capabilities=b._capabilities,this._loaderClass=createjs.SoundLoader,this._soundInstanceClass=createjs.HTMLAudioSoundInstance}var a=createjs.extend(HTMLAudioPlugin,createjs.AbstractPlugin),b=HTMLAudioPlugin;b.MAX_INSTANCES=30,b._AUDIO_READY="canplaythrough",b._AUDIO_ENDED="ended",b._AUDIO_SEEKED="seeked",b._AUDIO_STALLED="stalled",b._TIME_UPDATE="timeupdate",b._capabilities=null,b.isSupported=function(){return b._generateCapabilities(),null!=b._capabilities},b._generateCapabilities=function(){if(null==b._capabilities){var a=document.createElement("audio");if(null==a.canPlayType)return null;b._capabilities={panning:!1,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}}},a.register=function(a){var b=createjs.HTMLAudioTagPool.get(a.src),c=this.AbstractPlugin_register(a);return c.setTag(b),c},a.removeSound=function(a){this.AbstractPlugin_removeSound(a),createjs.HTMLAudioTagPool.remove(a)},a.create=function(a,b,c){var d=this.AbstractPlugin_create(a,b,c);return d.setPlaybackResource(null),d},a.toString=function(){return"[HTMLAudioPlugin]"},a.setVolume=a.getVolume=a.setMute=null,createjs.HTMLAudioPlugin=createjs.promote(HTMLAudioPlugin,"AbstractPlugin")}(); \ No newline at end of file diff --git a/lib/soundjs-NEXT.combined.js b/lib/soundjs-NEXT.js similarity index 90% rename from lib/soundjs-NEXT.combined.js rename to lib/soundjs-NEXT.js index 141f6adf..44fc637c 100644 --- a/lib/soundjs-NEXT.combined.js +++ b/lib/soundjs-NEXT.js @@ -57,7 +57,7 @@ this.createjs = this.createjs || {}; * @type String * @static **/ - s.buildDate = /*=date*/"Fri, 04 Dec 2015 17:24:04 GMT"; // injected by build process + s.buildDate = /*=date*/"Thu, 12 Oct 2017 16:33:45 GMT"; // injected by build process })(); @@ -158,7 +158,49 @@ createjs.promote = function(subclass, prefix) { }; //############################################################################## -// IndexOf.js +// deprecate.js +//############################################################################## + +this.createjs = this.createjs||{}; + +/** + * @class Utility Methods + */ + +/** + * Wraps deprecated methods so they still be used, but throw warnings to developers. + * + * obj.deprecatedMethod = createjs.deprecate("Old Method Name", obj._fallbackMethod); + * + * The recommended approach for deprecated properties is: + * + * try { + * Obj ect.defineProperties(object, { + * readyOnlyProp: { get: createjs.deprecate("readOnlyProp", function() { return this.alternateProp; }) }, + * readWriteProp: { + * get: createjs.deprecate("readOnlyProp", function() { return this.alternateProp; }), + * set: createjs.deprecate("readOnlyProp", function(val) { this.alternateProp = val; }) + * }); + * } catch (e) {} + * + * @method deprecate + * @param {Function} [fallbackMethod=null] A method to call when the deprecated method is used. See the example for how + * @param {String} [name=null] The name of the method or property to display in the console warning. + * to deprecate properties. + * @return {Function} If a fallbackMethod is supplied, returns a closure that will call the fallback method after + * logging the warning in the console. + */ +createjs.deprecate = function(fallbackMethod, name) { + "use strict"; + return function() { + var msg = "Deprecated property or method '"+name+"'. See docs for info."; + console && (console.warn ? console.warn(msg) : console.log(msg)); + return fallbackMethod && fallbackMethod.apply(this, arguments); + } +}; + +//############################################################################## +// indexOf.js //############################################################################## this.createjs = this.createjs||{}; @@ -190,7 +232,7 @@ createjs.indexOf = function (array, searchElement){ }; //############################################################################## -// Proxy.js +// proxy.js //############################################################################## this.createjs = this.createjs||{}; @@ -377,20 +419,6 @@ this.createjs = this.createjs||{}; } var p = EventDispatcher.prototype; - /** - * REMOVED. Removed in favor of using `MySuperClass_constructor`. - * See {{#crossLink "Utility Methods/extend"}}{{/crossLink}} and {{#crossLink "Utility Methods/promote"}}{{/crossLink}} - * for details. - * - * There is an inheritance tutorial distributed with EaselJS in /tutorials/Inheritance. - * - * @method initialize - * @protected - * @deprecated - */ - // p.initialize = function() {}; // searchable for devs wondering where it is. - - // static public methods: /** * Static initializer to mix EventDispatcher methods into a target object or prototype. @@ -658,17 +686,15 @@ this.createjs = this.createjs||{}; // private methods: /** * @method _dispatchEvent - * @param {Object | String | Event} eventObj + * @param {Object | Event} eventObj * @param {Object} eventPhase * @protected **/ p._dispatchEvent = function(eventObj, eventPhase) { - var l, listeners = (eventPhase==1) ? this._captureListeners : this._listeners; - if (eventObj && listeners) { - var arr = listeners[eventObj.type]; - if (!arr||!(l=arr.length)) { return; } + var l, arr, listeners = (eventPhase <= 2) ? this._captureListeners : this._listeners; + if (eventObj && listeners && (arr = listeners[eventObj.type]) && (l=arr.length)) { try { eventObj.currentTarget = this; } catch (e) {} - try { eventObj.eventPhase = eventPhase; } catch (e) {} + try { eventObj.eventPhase = eventPhase|0; } catch (e) {} eventObj.removed = false; arr = arr.slice(); // to avoid issues with items being removed or added during the dispatch @@ -682,6 +708,7 @@ this.createjs = this.createjs||{}; } } } + if (eventPhase === 2) { this._dispatchEvent(eventObj, 2.1); } }; @@ -824,19 +851,6 @@ this.createjs = this.createjs||{}; } var p = Event.prototype; - /** - * REMOVED. Removed in favor of using `MySuperClass_constructor`. - * See {{#crossLink "Utility Methods/extend"}}{{/crossLink}} and {{#crossLink "Utility Methods/promote"}}{{/crossLink}} - * for details. - * - * There is an inheritance tutorial distributed with EaselJS in /tutorials/Inheritance. - * - * @method initialize - * @protected - * @deprecated - */ - // p.initialize = function() {}; // searchable for devs wondering where it is. - // public methods: /** * Sets {{#crossLink "Event/defaultPrevented"}}{{/crossLink}} to true if the event is cancelable. @@ -1104,14 +1118,14 @@ this.createjs = this.createjs || {}; this.data = null; /** - * The request method used for HTTP calls. Both {{#crossLink "AbstractLoader/GET:property"}}{{/crossLink}} or - * {{#crossLink "AbstractLoader/POST:property"}}{{/crossLink}} request types are supported, and are defined as + * The request method used for HTTP calls. Both {{#crossLink "Methods/GET:property"}}{{/crossLink}} or + * {{#crossLink "Methods/POST:property"}}{{/crossLink}} request types are supported, and are defined as * constants on {{#crossLink "AbstractLoader"}}{{/crossLink}}. * @property method * @type {String} - * @default get + * @default GET */ - this.method = createjs.LoadItem.GET; + this.method = createjs.Methods.GET; /** * An object hash of name/value pairs to send to the server. @@ -1228,246 +1242,423 @@ this.createjs = this.createjs || {}; }()); //############################################################################## -// RequestUtils.js +// Methods.js //############################################################################## -(function () { +this.createjs = this.createjs || {}; - /** - * Utilities that assist with parsing load items, and determining file types, etc. - * @class RequestUtils - */ +(function() { var s = {}; /** - * The Regular Expression used to test file URLS for an absolute path. - * @property ABSOLUTE_PATH - * @type {RegExp} - * @static - */ - s.ABSOLUTE_PATT = /^(?:\w+:)?\/{2}/i; - - /** - * The Regular Expression used to test file URLS for a relative path. - * @property RELATIVE_PATH - * @type {RegExp} - * @static - */ - s.RELATIVE_PATT = (/^[./]*?\//i); - - /** - * The Regular Expression used to test file URLS for an extension. Note that URIs must already have the query string - * removed. - * @property EXTENSION_PATT - * @type {RegExp} + * Defines a POST request, use for a method value when loading data. + * @property POST + * @type {string} + * @default post * @static */ - s.EXTENSION_PATT = /\/?[^/]+\.(\w{1,5})$/i; + s.POST = "POST"; /** - * Parse a file path to determine the information we need to work with it. Currently, PreloadJS needs to know: - *
      - *
    • If the path is absolute. Absolute paths start with a protocol (such as `http://`, `file://`, or - * `//networkPath`)
    • - *
    • If the path is relative. Relative paths start with `../` or `/path` (or similar)
    • - *
    • The file extension. This is determined by the filename with an extension. Query strings are dropped, and - * the file path is expected to follow the format `name.ext`.
    • - *
    - * @method parseURI - * @param {String} path - * @returns {Object} An Object with an `absolute` and `relative` Boolean values, as well as an optional 'extension` - * property, which is the lowercase extension. + * Defines a GET request, use for a method value when loading data. + * @property GET + * @type {string} + * @default get * @static */ - s.parseURI = function (path) { - var info = {absolute: false, relative: false}; - if (path == null) { return info; } + s.GET = "GET"; - // Drop the query string - var queryIndex = path.indexOf("?"); - if (queryIndex > -1) { - path = path.substr(0, queryIndex); - } + createjs.Methods = s; +}()); - // Absolute - var match; - if (s.ABSOLUTE_PATT.test(path)) { - info.absolute = true; +//############################################################################## +// Types.js +//############################################################################## - // Relative - } else if (s.RELATIVE_PATT.test(path)) { - info.relative = true; - } +this.createjs = this.createjs || {}; - // Extension - if (match = path.match(s.EXTENSION_PATT)) { - info.extension = match[1].toLowerCase(); - } - return info; - }; +(function() { + var s = {}; /** - * Formats an object into a query string for either a POST or GET request. - * @method formatQueryString - * @param {Object} data The data to convert to a query string. - * @param {Array} [query] Existing name/value pairs to append on to this query. + * The preload type for generic binary types. Note that images are loaded as binary files when using XHR. + * @property BINARY + * @type {String} + * @default binary * @static + * @since 0.6.0 */ - s.formatQueryString = function (data, query) { - if (data == null) { - throw new Error('You must specify data.'); - } - var params = []; - for (var n in data) { - params.push(n + '=' + escape(data[n])); - } - if (query) { - params = params.concat(query); - } - return params.join('&'); - }; + s.BINARY = "binary"; /** - * A utility method that builds a file path using a source and a data object, and formats it into a new path. - * @method buildPath - * @param {String} src The source path to add values to. - * @param {Object} [data] Object used to append values to this request as a query string. Existing parameters on the - * path will be preserved. - * @returns {string} A formatted string that contains the path and the supplied parameters. + * The preload type for css files. CSS files are loaded using a <link> when loaded with XHR, or a + * <style> tag when loaded with tags. + * @property CSS + * @type {String} + * @default css * @static + * @since 0.6.0 */ - s.buildPath = function (src, data) { - if (data == null) { - return src; - } - - var query = []; - var idx = src.indexOf('?'); - - if (idx != -1) { - var q = src.slice(idx + 1); - query = query.concat(q.split('&')); - } - - if (idx != -1) { - return src.slice(0, idx) + '?' + this.formatQueryString(data, query); - } else { - return src + '?' + this.formatQueryString(data, query); - } - }; + s.CSS = "css"; /** - * @method isCrossDomain - * @param {LoadItem|Object} item A load item with a `src` property. - * @return {Boolean} If the load item is loading from a different domain than the current location. + * The preload type for font files. + * @property FONT + * @type {String} + * @default font * @static + * @since 0.9.0 */ - s.isCrossDomain = function (item) { - var target = document.createElement("a"); - target.href = item.src; - - var host = document.createElement("a"); - host.href = location.href; - - var crossdomain = (target.hostname != "") && - (target.port != host.port || - target.protocol != host.protocol || - target.hostname != host.hostname); - return crossdomain; - }; + s.FONT = "font"; /** - * @method isLocal - * @param {LoadItem|Object} item A load item with a `src` property - * @return {Boolean} If the load item is loading from the "file:" protocol. Assume that the host must be local as - * well. + * The preload type for fonts specified with CSS (such as Google fonts) + * @property FONTCSS + * @type {String} + * @default fontcss * @static + * @since 0.9.0 */ - s.isLocal = function (item) { - var target = document.createElement("a"); - target.href = item.src; - return target.hostname == "" && target.protocol == "file:"; - }; + s.FONTCSS = "fontcss"; /** - * Determine if a specific type should be loaded as a binary file. Currently, only images and items marked - * specifically as "binary" are loaded as binary. Note that audio is not a binary type, as we can not play - * back using an audio tag if it is loaded as binary. Plugins can change the item type to binary to ensure they get - * a binary result to work with. Binary files are loaded using XHR2. Types are defined as static constants on - * {{#crossLink "AbstractLoader"}}{{/crossLink}}. - * @method isBinary - * @param {String} type The item type. - * @return {Boolean} If the specified type is binary. + * The preload type for image files, usually png, gif, or jpg/jpeg. Images are loaded into an <image> tag. + * @property IMAGE + * @type {String} + * @default image * @static + * @since 0.6.0 */ - s.isBinary = function (type) { - switch (type) { - case createjs.AbstractLoader.IMAGE: - case createjs.AbstractLoader.BINARY: - return true; - default: - return false; - } - }; + s.IMAGE = "image"; /** - * Check if item is a valid HTMLImageElement - * @method isImageTag - * @param {Object} item - * @returns {Boolean} + * The preload type for javascript files, usually with the "js" file extension. JavaScript files are loaded into a + * <script> tag. + * + * Since version 0.4.1+, due to how tag-loaded scripts work, all JavaScript files are automatically injected into + * the body of the document to maintain parity between XHR and tag-loaded scripts. In version 0.4.0 and earlier, + * only tag-loaded scripts are injected. + * @property JAVASCRIPT + * @type {String} + * @default javascript * @static + * @since 0.6.0 */ - s.isImageTag = function(item) { - return item instanceof HTMLImageElement; - }; + s.JAVASCRIPT = "javascript"; /** - * Check if item is a valid HTMLAudioElement - * @method isAudioTag - * @param {Object} item - * @returns {Boolean} + * The preload type for json files, usually with the "json" file extension. JSON data is loaded and parsed into a + * JavaScript object. Note that if a `callback` is present on the load item, the file will be loaded with JSONP, + * no matter what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} property is set to, and the JSON + * must contain a matching wrapper function. + * @property JSON + * @type {String} + * @default json * @static + * @since 0.6.0 */ - s.isAudioTag = function(item) { - if (window.HTMLAudioElement) { - return item instanceof HTMLAudioElement; - } else { - return false; - } - }; + s.JSON = "json"; /** - * Check if item is a valid HTMLVideoElement - * @method isVideoTag - * @param {Object} item - * @returns {Boolean} + * The preload type for jsonp files, usually with the "json" file extension. JSON data is loaded and parsed into a + * JavaScript object. You are required to pass a callback parameter that matches the function wrapper in the JSON. + * Note that JSONP will always be used if there is a callback present, no matter what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} + * property is set to. + * @property JSONP + * @type {String} + * @default jsonp * @static + * @since 0.6.0 */ - s.isVideoTag = function(item) { - if (window.HTMLVideoElement) { - return item instanceof HTMLVideoElement; - } else { - return false; - } - }; + s.JSONP = "jsonp"; /** - * Determine if a specific type is a text-based asset, and should be loaded as UTF-8. - * @method isText + * The preload type for json-based manifest files, usually with the "json" file extension. The JSON data is loaded + * and parsed into a JavaScript object. PreloadJS will then look for a "manifest" property in the JSON, which is an + * Array of files to load, following the same format as the {{#crossLink "LoadQueue/loadManifest"}}{{/crossLink}} + * method. If a "callback" is specified on the manifest object, then it will be loaded using JSONP instead, + * regardless of what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} property is set to. + * @property MANIFEST + * @type {String} + * @default manifest + * @static + * @since 0.6.0 + */ + s.MANIFEST = "manifest"; + + /** + * The preload type for sound files, usually mp3, ogg, or wav. When loading via tags, audio is loaded into an + * <audio> tag. + * @property SOUND + * @type {String} + * @default sound + * @static + * @since 0.6.0 + */ + s.SOUND = "sound"; + + /** + * The preload type for video files, usually mp4, ts, or ogg. When loading via tags, video is loaded into an + * <video> tag. + * @property VIDEO + * @type {String} + * @default video + * @static + * @since 0.6.0 + */ + s.VIDEO = "video"; + + /** + * The preload type for SpriteSheet files. SpriteSheet files are JSON files that contain string image paths. + * @property SPRITESHEET + * @type {String} + * @default spritesheet + * @static + * @since 0.6.0 + */ + s.SPRITESHEET = "spritesheet"; + + /** + * The preload type for SVG files. + * @property SVG + * @type {String} + * @default svg + * @static + * @since 0.6.0 + */ + s.SVG = "svg"; + + /** + * The preload type for text files, which is also the default file type if the type can not be determined. Text is + * loaded as raw text. + * @property TEXT + * @type {String} + * @default text + * @static + * @since 0.6.0 + */ + s.TEXT = "text"; + + /** + * The preload type for xml files. XML is loaded into an XML document. + * @property XML + * @type {String} + * @default xml + * @static + * @since 0.6.0 + */ + s.XML = "xml"; + + createjs.Types = s; +}()); + +//############################################################################## +// Elements.js +//############################################################################## + +(function () { + + /** + * Convenience methods for creating various elements used by PrelaodJS. + * + * @class DomUtils + */ + var s = {}; + + s.a = function() { + return s.el("a"); + } + + s.svg = function() { + return s.el("svg"); + } + + s.object = function() { + return s.el("object"); + } + + s.image = function() { + return s.el("image"); + } + + s.img = function() { + return s.el("img"); + } + + s.style = function() { + return s.el("style"); + } + + s.link = function() { + return s.el("link"); + } + + s.script = function() { + return s.el("script"); + } + + s.audio = function() { + return s.el("audio"); + } + + s.video = function() { + return s.el("video"); + } + + s.text = function(value) { + return document.createTextNode(value); + } + + s.el = function(name) { + return document.createElement(name); + } + + createjs.Elements = s; + +}()); + +//############################################################################## +// DomUtils.js +//############################################################################## + +(function () { + + /** + * A few utilities for interacting with the dom. + * @class DomUtils + */ + var s = { + container: null + }; + + s.appendToHead = function (el) { + s.getHead().appendChild(el); + } + + s.appendToBody = function (el) { + if (s.container == null) { + s.container = document.createElement("div"); + s.container.id = "preloadjs-container"; + var style = s.container.style; + style.visibility = "hidden"; + style.position = "absolute"; + style.width = s.container.style.height = "10px"; + style.overflow = "hidden"; + style.transform = style.msTransform = style.webkitTransform = style.oTransform = "translate(-10px, -10px)"; //LM: Not working + s.getBody().appendChild(s.container); + } + s.container.appendChild(el); + } + + s.getHead = function () { + return document.head || document.getElementsByTagName("head")[0]; + } + + s.getBody = function () { + return document.body || document.getElementsByTagName("body")[0]; + } + + s.removeChild = function(el) { + if (el.parent) { + el.parent.removeChild(el); + } + } + + /** + * Check if item is a valid HTMLImageElement + * @method isImageTag + * @param {Object} item + * @returns {Boolean} + * @static + */ + s.isImageTag = function(item) { + return item instanceof HTMLImageElement; + }; + + /** + * Check if item is a valid HTMLAudioElement + * @method isAudioTag + * @param {Object} item + * @returns {Boolean} + * @static + */ + s.isAudioTag = function(item) { + if (window.HTMLAudioElement) { + return item instanceof HTMLAudioElement; + } else { + return false; + } + }; + + /** + * Check if item is a valid HTMLVideoElement + * @method isVideoTag + * @param {Object} item + * @returns {Boolean} + * @static + */ + s.isVideoTag = function(item) { + if (window.HTMLVideoElement) { + return item instanceof HTMLVideoElement; + } else { + return false; + } + }; + + createjs.DomUtils = s; + +}()); + +//############################################################################## +// RequestUtils.js +//############################################################################## + +(function () { + + /** + * Utilities that assist with parsing load items, and determining file types, etc. + * @class RequestUtils + */ + var s = {}; + + /** + * Determine if a specific type should be loaded as a binary file. Currently, only images and items marked + * specifically as "binary" are loaded as binary. Note that audio is not a binary type, as we can not play + * back using an audio tag if it is loaded as binary. Plugins can change the item type to binary to ensure they get + * a binary result to work with. Binary files are loaded using XHR2. Types are defined as static constants on + * {{#crossLink "AbstractLoader"}}{{/crossLink}}. + * @method isBinary + * @param {String} type The item type. + * @return {Boolean} If the specified type is binary. + * @static + */ + s.isBinary = function (type) { + switch (type) { + case createjs.Types.IMAGE: + case createjs.Types.BINARY: + return true; + default: + return false; + } + }; + + /** + * Determine if a specific type is a text-based asset, and should be loaded as UTF-8. + * @method isText * @param {String} type The item type. * @return {Boolean} If the specified type is text. * @static */ s.isText = function (type) { switch (type) { - case createjs.AbstractLoader.TEXT: - case createjs.AbstractLoader.JSON: - case createjs.AbstractLoader.MANIFEST: - case createjs.AbstractLoader.XML: - case createjs.AbstractLoader.CSS: - case createjs.AbstractLoader.SVG: - case createjs.AbstractLoader.JAVASCRIPT: - case createjs.AbstractLoader.SPRITESHEET: + case createjs.Types.TEXT: + case createjs.Types.JSON: + case createjs.Types.MANIFEST: + case createjs.Types.XML: + case createjs.Types.CSS: + case createjs.Types.SVG: + case createjs.Types.JAVASCRIPT: + case createjs.Types.SPRITESHEET: return true; default: return false; @@ -1479,13 +1670,13 @@ this.createjs = this.createjs || {}; * if it is an unusual extension. * @method getTypeByExtension * @param {String} extension The file extension to use to determine the load type. - * @return {String} The determined load type (for example, AbstractLoader.IMAGE). Will return `null` if + * @return {String} The determined load type (for example, `createjs.Types.IMAGE`). Will return `null` if * the type can not be determined by the extension. * @static */ s.getTypeByExtension = function (extension) { if (extension == null) { - return createjs.AbstractLoader.TEXT; + return createjs.Types.TEXT; } switch (extension.toLowerCase()) { @@ -1495,31 +1686,222 @@ this.createjs = this.createjs || {}; case "png": case "webp": case "bmp": - return createjs.AbstractLoader.IMAGE; + return createjs.Types.IMAGE; case "ogg": case "mp3": case "webm": - return createjs.AbstractLoader.SOUND; + return createjs.Types.SOUND; case "mp4": case "webm": case "ts": - return createjs.AbstractLoader.VIDEO; + return createjs.Types.VIDEO; case "json": - return createjs.AbstractLoader.JSON; + return createjs.Types.JSON; case "xml": - return createjs.AbstractLoader.XML; + return createjs.Types.XML; case "css": - return createjs.AbstractLoader.CSS; + return createjs.Types.CSS; case "js": - return createjs.AbstractLoader.JAVASCRIPT; + return createjs.Types.JAVASCRIPT; case 'svg': - return createjs.AbstractLoader.SVG; + return createjs.Types.SVG; default: - return createjs.AbstractLoader.TEXT; + return createjs.Types.TEXT; } }; - createjs.RequestUtils = s; + createjs.RequestUtils = s; + +}()); + +//############################################################################## +// URLUtils.js +//############################################################################## + +(function () { + + /** + * Utilities that assist with parsing load items, and determining file types, etc. + * @class URLUtils + */ + var s = {}; + + /** + * The Regular Expression used to test file URLS for an absolute path. + * @property ABSOLUTE_PATH + * @type {RegExp} + * @static + */ + s.ABSOLUTE_PATT = /^(?:\w+:)?\/{2}/i; + + /** + * The Regular Expression used to test file URLS for a relative path. + * @property RELATIVE_PATH + * @type {RegExp} + * @static + */ + s.RELATIVE_PATT = (/^[./]*?\//i); + + /** + * The Regular Expression used to test file URLS for an extension. Note that URIs must already have the query string + * removed. + * @property EXTENSION_PATT + * @type {RegExp} + * @static + */ + s.EXTENSION_PATT = /\/?[^/]+\.(\w{1,5})$/i; + + /** + * Parse a file path to determine the information we need to work with it. Currently, PreloadJS needs to know: + *
      + *
    • If the path is absolute. Absolute paths start with a protocol (such as `http://`, `file://`, or + * `//networkPath`)
    • + *
    • If the path is relative. Relative paths start with `../` or `/path` (or similar)
    • + *
    • The file extension. This is determined by the filename with an extension. Query strings are dropped, and + * the file path is expected to follow the format `name.ext`.
    • + *
    + * + * @method parseURI + * @param {String} path + * @returns {Object} An Object with an `absolute` and `relative` Boolean values, + * the pieces of the path (protocol, hostname, port, pathname, search, hash, host) + * as well as an optional 'extension` property, which is the lowercase extension. + * + * @static + */ + s.parseURI = function (path) { + var info = { + absolute: false, + relative: false, + protocol: null, + hostname: null, + port: null, + pathname: null, + search: null, + hash: null, + host: null + }; + + if (path == null) { return info; } + + // Inject the path parts. + var parser = createjs.Elements.a(); + parser.href = path; + + for (var n in info) { + if (n in parser) { + info[n] = parser[n]; + } + } + + // Drop the query string + var queryIndex = path.indexOf("?"); + if (queryIndex > -1) { + path = path.substr(0, queryIndex); + } + + // Absolute + var match; + if (s.ABSOLUTE_PATT.test(path)) { + info.absolute = true; + + // Relative + } else if (s.RELATIVE_PATT.test(path)) { + info.relative = true; + } + + // Extension + if (match = path.match(s.EXTENSION_PATT)) { + info.extension = match[1].toLowerCase(); + } + + return info; + }; + + /** + * Formats an object into a query string for either a POST or GET request. + * @method formatQueryString + * @param {Object} data The data to convert to a query string. + * @param {Array} [query] Existing name/value pairs to append on to this query. + * @static + */ + s.formatQueryString = function (data, query) { + if (data == null) { + throw new Error("You must specify data."); + } + var params = []; + for (var n in data) { + params.push(n + "=" + escape(data[n])); + } + if (query) { + params = params.concat(query); + } + return params.join("&"); + }; + + /** + * A utility method that builds a file path using a source and a data object, and formats it into a new path. + * @method buildURI + * @param {String} src The source path to add values to. + * @param {Object} [data] Object used to append values to this request as a query string. Existing parameters on the + * path will be preserved. + * @returns {string} A formatted string that contains the path and the supplied parameters. + * @static + */ + s.buildURI = function (src, data) { + if (data == null) { + return src; + } + + var query = []; + var idx = src.indexOf("?"); + + if (idx != -1) { + var q = src.slice(idx + 1); + query = query.concat(q.split("&")); + } + + if (idx != -1) { + return src.slice(0, idx) + "?" + this.formatQueryString(data, query); + } else { + return src + "?" + this.formatQueryString(data, query); + } + }; + + /** + * @method isCrossDomain + * @param {LoadItem|Object} item A load item with a `src` property. + * @return {Boolean} If the load item is loading from a different domain than the current location. + * @static + */ + s.isCrossDomain = function (item) { + var target = createjs.Elements.a(); + target.href = item.src; + + var host = createjs.Elements.a(); + host.href = location.href; + + var crossdomain = (target.hostname != "") && + (target.port != host.port || + target.protocol != host.protocol || + target.hostname != host.hostname); + return crossdomain; + }; + + /** + * @method isLocal + * @param {LoadItem|Object} item A load item with a `src` property + * @return {Boolean} If the load item is loading from the "file:" protocol. Assume that the host must be local as + * well. + * @static + */ + s.isLocal = function (item) { + var target = createjs.Elements.a(); + target.href = item.src; + return target.hostname == "" && target.protocol == "file:"; + }; + + createjs.URLUtils = s; }()); @@ -1689,176 +2071,29 @@ this.createjs = this.createjs || {}; var p = createjs.extend(AbstractLoader, createjs.EventDispatcher); var s = AbstractLoader; - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - - /** - * Defines a POST request, use for a method value when loading data. - * @property POST - * @type {string} - * @default post - * @static - */ - s.POST = "POST"; - - /** - * Defines a GET request, use for a method value when loading data. - * @property GET - * @type {string} - * @default get - * @static - */ - s.GET = "GET"; - - /** - * The preload type for generic binary types. Note that images are loaded as binary files when using XHR. - * @property BINARY - * @type {String} - * @default binary - * @static - * @since 0.6.0 - */ - s.BINARY = "binary"; - - /** - * The preload type for css files. CSS files are loaded using a <link> when loaded with XHR, or a - * <style> tag when loaded with tags. - * @property CSS - * @type {String} - * @default css - * @static - * @since 0.6.0 - */ - s.CSS = "css"; - - /** - * The preload type for image files, usually png, gif, or jpg/jpeg. Images are loaded into an <image> tag. - * @property IMAGE - * @type {String} - * @default image - * @static - * @since 0.6.0 - */ - s.IMAGE = "image"; - - /** - * The preload type for javascript files, usually with the "js" file extension. JavaScript files are loaded into a - * <script> tag. - * - * Since version 0.4.1+, due to how tag-loaded scripts work, all JavaScript files are automatically injected into - * the body of the document to maintain parity between XHR and tag-loaded scripts. In version 0.4.0 and earlier, - * only tag-loaded scripts are injected. - * @property JAVASCRIPT - * @type {String} - * @default javascript - * @static - * @since 0.6.0 - */ - s.JAVASCRIPT = "javascript"; - - /** - * The preload type for json files, usually with the "json" file extension. JSON data is loaded and parsed into a - * JavaScript object. Note that if a `callback` is present on the load item, the file will be loaded with JSONP, - * no matter what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} property is set to, and the JSON - * must contain a matching wrapper function. - * @property JSON - * @type {String} - * @default json - * @static - * @since 0.6.0 - */ - s.JSON = "json"; - - /** - * The preload type for jsonp files, usually with the "json" file extension. JSON data is loaded and parsed into a - * JavaScript object. You are required to pass a callback parameter that matches the function wrapper in the JSON. - * Note that JSONP will always be used if there is a callback present, no matter what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} - * property is set to. - * @property JSONP - * @type {String} - * @default jsonp - * @static - * @since 0.6.0 - */ - s.JSONP = "jsonp"; - - /** - * The preload type for json-based manifest files, usually with the "json" file extension. The JSON data is loaded - * and parsed into a JavaScript object. PreloadJS will then look for a "manifest" property in the JSON, which is an - * Array of files to load, following the same format as the {{#crossLink "LoadQueue/loadManifest"}}{{/crossLink}} - * method. If a "callback" is specified on the manifest object, then it will be loaded using JSONP instead, - * regardless of what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} property is set to. - * @property MANIFEST - * @type {String} - * @default manifest - * @static - * @since 0.6.0 - */ - s.MANIFEST = "manifest"; - - /** - * The preload type for sound files, usually mp3, ogg, or wav. When loading via tags, audio is loaded into an - * <audio> tag. - * @property SOUND - * @type {String} - * @default sound - * @static - * @since 0.6.0 - */ - s.SOUND = "sound"; - - /** - * The preload type for video files, usually mp4, ts, or ogg. When loading via tags, video is loaded into an - * <video> tag. - * @property VIDEO - * @type {String} - * @default video - * @static - * @since 0.6.0 - */ - s.VIDEO = "video"; - - /** - * The preload type for SpriteSheet files. SpriteSheet files are JSON files that contain string image paths. - * @property SPRITESHEET - * @type {String} - * @default spritesheet - * @static - * @since 0.6.0 - */ - s.SPRITESHEET = "spritesheet"; - - /** - * The preload type for SVG files. - * @property SVG - * @type {String} - * @default svg - * @static - * @since 0.6.0 - */ - s.SVG = "svg"; - - /** - * The preload type for text files, which is also the default file type if the type can not be determined. Text is - * loaded as raw text. - * @property TEXT - * @type {String} - * @default text - * @static - * @since 0.6.0 - */ - s.TEXT = "text"; - - /** - * The preload type for xml files. XML is loaded into an XML document. - * @property XML - * @type {String} - * @default xml - * @static - * @since 0.6.0 - */ - s.XML = "xml"; + // Remove these @deprecated properties after 1.0 + try { + Object.defineProperties(s, { + POST: { get: createjs.deprecate(function() { return createjs.Methods.POST; }, "AbstractLoader.POST") }, + GET: { get: createjs.deprecate(function() { return createjs.Methods.GET; }, "AbstractLoader.GET") }, + + BINARY: { get: createjs.deprecate(function() { return createjs.Types.BINARY; }, "AbstractLoader.BINARY") }, + CSS: { get: createjs.deprecate(function() { return createjs.Types.CSS; }, "AbstractLoader.CSS") }, + FONT: { get: createjs.deprecate(function() { return createjs.Types.FONT; }, "AbstractLoader.FONT") }, + FONTCSS: { get: createjs.deprecate(function() { return createjs.Types.FONTCSS; }, "AbstractLoader.FONTCSS") }, + IMAGE: { get: createjs.deprecate(function() { return createjs.Types.IMAGE; }, "AbstractLoader.IMAGE") }, + JAVASCRIPT: { get: createjs.deprecate(function() { return createjs.Types.JAVASCRIPT; }, "AbstractLoader.JAVASCRIPT") }, + JSON: { get: createjs.deprecate(function() { return createjs.Types.JSON; }, "AbstractLoader.JSON") }, + JSONP: { get: createjs.deprecate(function() { return createjs.Types.JSONP; }, "AbstractLoader.JSONP") }, + MANIFEST: { get: createjs.deprecate(function() { return createjs.Types.MANIFEST; }, "AbstractLoader.MANIFEST") }, + SOUND: { get: createjs.deprecate(function() { return createjs.Types.SOUND; }, "AbstractLoader.SOUND") }, + VIDEO: { get: createjs.deprecate(function() { return createjs.Types.VIDEO; }, "AbstractLoader.VIDEO") }, + SPRITESHEET: { get: createjs.deprecate(function() { return createjs.Types.SPRITESHEET; }, "AbstractLoader.SPRITESHEET") }, + SVG: { get: createjs.deprecate(function() { return createjs.Types.SVG; }, "AbstractLoader.SVG") }, + TEXT: { get: createjs.deprecate(function() { return createjs.Types.TEXT; }, "AbstractLoader.TEXT") }, + XML: { get: createjs.deprecate(function() { return createjs.Types.XML; }, "AbstractLoader.XML") } + }); + } catch (e) {} // Events /** @@ -1897,7 +2132,7 @@ this.createjs = this.createjs || {}; * This enables loaders to maintain internal queues, and surface file load errors. * @event fileerror * @param {Object} target The object that dispatched the event. - * @param {String} type The even type ("fileerror") + * @param {String} type The event type ("fileerror") * @param {LoadItem|object} The item that encountered the error * @since 0.6.0 */ @@ -2180,11 +2415,13 @@ this.createjs = this.createjs || {}; case "complete": this._rawResult = event.target._response; var result = this.resultFormatter && this.resultFormatter(this); + // The resultFormatter is asynchronous if (result instanceof Function) { result.call(this, createjs.proxy(this._resultFormatSuccess, this), createjs.proxy(this._resultFormatFailed, this) ); + // The result formatter is synchronous } else { this._result = result || this._rawResult; this._sendComplete(); @@ -2231,16 +2468,6 @@ this.createjs = this.createjs || {}; this._sendError(event); }; - /** - * @method buildPath - * @protected - * @deprecated Use the {{#crossLink "RequestUtils"}}{{/crossLink}} method {{#crossLink "RequestUtils/buildPath"}}{{/crossLink}} - * instead. - */ - p.buildPath = function (src, data) { - return createjs.RequestUtils.buildPath(src, data); - }; - /** * @method toString * @return {String} a string representation of the instance. @@ -2454,13 +2681,6 @@ this.createjs = this.createjs || {}; */ this._addedToDOM = false; - /** - * Determines what the tags initial style.visibility was, so we can set it correctly after a load. - * - * @type {null} - * @private - */ - this._startTagVisibility = null; }; var p = createjs.extend(TagRequest, createjs.AbstractRequest); @@ -2476,15 +2696,13 @@ this.createjs = this.createjs || {}; this.dispatchEvent(evt); - this._hideTag(); - this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), this._item.loadTimeout); this._tag[this._tagSrcAttribute] = this._item.src; // wdg:: Append the tag AFTER setting the src, or SVG loading on iOS will fail. if (this._tag.parentNode == null) { - window.document.body.appendChild(this._tag); + createjs.DomUtils.appendToBody(this._tag); this._addedToDOM = true; } }; @@ -2534,7 +2752,6 @@ this.createjs = this.createjs || {}; this._result = this.resultFormatter && this.resultFormatter(this) || this._rawResult; this._clean(); - this._showTag(); this.dispatchEvent("complete"); }; @@ -2565,15 +2782,6 @@ this.createjs = this.createjs || {}; clearTimeout(this._loadTimeout); }; - p._hideTag = function() { - this._startTagVisibility = this._tag.style.visibility; - this._tag.style.visibility = "hidden"; - }; - - p._showTag = function() { - this._tag.style.visibility = this._startTagVisibility; - }; - /** * Handle a stalled audio event. The main place this happens is with HTMLAudio in Chrome when playing back audio * that is already in a load, but not complete. @@ -2859,10 +3067,10 @@ this.createjs = this.createjs || {}; // Sometimes we get back 404s immediately, particularly when there is a cross origin request. // note this does not catch in Chrome try { - if (!this._item.values || this._item.method == createjs.AbstractLoader.GET) { + if (!this._item.values) { this._request.send(); - } else if (this._item.method == createjs.AbstractLoader.POST) { - this._request.send(createjs.RequestUtils.formatQueryString(this._item.values)); + } else { + this._request.send(createjs.URLUtils.formatQueryString(this._item.values)); } } catch (error) { this.dispatchEvent(new createjs.ErrorEvent("XHR_SEND", null, error)); @@ -2980,6 +3188,9 @@ this.createjs = this.createjs || {}; /** * The XHR request has completed. This is called by the XHR request directly, or by a readyStateChange that has * request.readyState == 4. Only the first call to this method will be processed. + * + * Note that This method uses {{#crossLink "_checkError"}}{{/crossLink}} to determine if the server has returned an + * error code. * @method _handleLoad * @param {Object} event The XHR load event. * @private @@ -3026,30 +3237,36 @@ this.createjs = this.createjs || {}; */ p._handleTimeout = function (event) { this._clean(); - this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_TIMEOUT", null, event)); }; // Protected /** - * Determine if there is an error in the current load. This checks the status of the request for problem codes. Note - * that this does not check for an actual response. Currently, it only checks for 404 or 0 error code. + * Determine if there is an error in the current load. + * Currently this checks the status of the request for problem codes, and not actual response content: + *
      + *
    • Status codes between 400 and 599 (HTTP error range)
    • + *
    • A status of 0, but *only when the application is running on a server*. If the application is running + * on `file:`, then it may incorrectly treat an error on local (or embedded applications) as a successful + * load.
    • + *
    * @method _checkError - * @return {int} If the request status returns an error code. + * @return {Error} An error with the status code in the `message` argument. * @private */ p._checkError = function () { - //LM: Probably need additional handlers here, maybe 501 var status = parseInt(this._request.status); - - switch (status) { - case 404: // Not Found - case 0: // Not Loaded - return new Error(status); + if (status >= 400 && status <= 599) { + return new Error(status); + } else if (status == 0) { + if ((/^https?:/).test(location.protocol)) { return new Error(0); } + return null; // Likely an embedded app. + } else { + return null; } - return null; }; + /** * Validate the response. Different browsers have different approaches, some of which throw errors when accessed * in other browsers. If there is no response, the _response property will remain null. @@ -3099,7 +3316,7 @@ this.createjs = this.createjs || {}; */ p._createXHR = function (item) { // Check for cross-domain loads. We can't fully support them, but we can try. - var crossdomain = createjs.RequestUtils.isCrossDomain(item); + var crossdomain = createjs.URLUtils.isCrossDomain(item); var headers = {}; // Create the request. Fallback to whatever support we have. @@ -3138,21 +3355,21 @@ this.createjs = this.createjs || {}; this._xhrLevel = (typeof req.responseType === "string") ? 2 : 1; var src = null; - if (item.method == createjs.AbstractLoader.GET) { - src = createjs.RequestUtils.buildPath(item.src, item.values); + if (item.method == createjs.Methods.GET) { + src = createjs.URLUtils.buildURI(item.src, item.values); } else { src = item.src; } // Open the request. Set cross-domain flags if it is supported (XHR level 1 only) - req.open(item.method || createjs.AbstractLoader.GET, src, true); + req.open(item.method || createjs.Methods.GET, src, true); if (crossdomain && req instanceof XMLHttpRequest && this._xhrLevel == 1) { headers["Origin"] = location.origin; } // To send data we need to set the Content-type header) - if (item.values && item.method == createjs.AbstractLoader.POST) { + if (item.values && item.method == createjs.Methods.POST) { headers["Content-Type"] = "application/x-www-form-urlencoded"; } @@ -3236,15 +3453,15 @@ this.createjs = this.createjs || {}; * @constructor */ function SoundLoader(loadItem, preferXHR) { - this.AbstractMediaLoader_constructor(loadItem, preferXHR, createjs.AbstractLoader.SOUND); + this.AbstractMediaLoader_constructor(loadItem, preferXHR, createjs.Types.SOUND); // protected properties - if (createjs.RequestUtils.isAudioTag(loadItem)) { + if (createjs.DomUtils.isAudioTag(loadItem)) { this._tag = loadItem; - } else if (createjs.RequestUtils.isAudioTag(loadItem.src)) { + } else if (createjs.DomUtils.isAudioTag(loadItem.src)) { this._tag = loadItem; - } else if (createjs.RequestUtils.isAudioTag(loadItem.tag)) { - this._tag = createjs.RequestUtils.isAudioTag(loadItem) ? loadItem : loadItem.src; + } else if (createjs.DomUtils.isAudioTag(loadItem.tag)) { + this._tag = createjs.DomUtils.isAudioTag(loadItem) ? loadItem : loadItem.src; } if (this._tag != null) { @@ -3258,19 +3475,19 @@ this.createjs = this.createjs || {}; // static methods /** * Determines if the loader can load a specific item. This loader can only load items that are of type - * {{#crossLink "AbstractLoader/SOUND:property"}}{{/crossLink}}. + * {{#crossLink "Types/SOUND:property"}}{{/crossLink}}. * @method canLoadItem * @param {LoadItem|Object} item The LoadItem that a LoadQueue is trying to load. * @returns {Boolean} Whether the loader can load the item. * @static */ s.canLoadItem = function (item) { - return item.type == createjs.AbstractLoader.SOUND; + return item.type == createjs.Types.SOUND; }; // protected methods p._createTag = function (src) { - var tag = document.createElement("audio"); + var tag = createjs.Elements.audio(); tag.autoplay = false; tag.preload = "none"; @@ -3383,9 +3600,10 @@ this.createjs = this.createjs || {}; * *

    Example

    * - * var ppc = new createjs.PlayPropsConfig().set({interrupt: createjs.Sound.INTERRUPT_ANY, loop: -1, volume: 0.5}) - * createjs.Sound.play("mySound", ppc); - * mySoundInstance.play(ppc); + * var props = new createjs.PlayPropsConfig().set({interrupt: createjs.Sound.INTERRUPT_ANY, loop: -1, volume: 0.5}) + * createjs.Sound.play("mySound", props); + * // OR + * mySoundInstance.play(props); * * @class PlayPropsConfig * @constructor @@ -3477,12 +3695,14 @@ this.createjs = this.createjs || {}; * @static */ s.create = function (value) { - if (value instanceof s || value instanceof Object) { - var ppc = new createjs.PlayPropsConfig(); - ppc.set(value); - return ppc; - } else { - throw new Error("Type not recognized."); + if (typeof(value) === "string") { + // Handle the old API gracefully. + console && (console.warn || console.log)("Deprecated behaviour. Sound.play takes a configuration object instead of individual arguments. See docs for info."); + return new createjs.PlayPropsConfig().set({interrupt:value}); + } else if (value == null || value instanceof s || value instanceof Object) { + return new createjs.PlayPropsConfig().set(value); + } else if (value == null) { + throw new Error("PlayProps configuration not recognized."); } }; @@ -3499,7 +3719,9 @@ this.createjs = this.createjs || {}; * @return {PlayPropsConfig} Returns the instance the method is called on (useful for chaining calls.) */ p.set = function(props) { - for (var n in props) { this[n] = props[n]; } + if (props != null) { + for (var n in props) { this[n] = props[n]; } + } return this; }; @@ -3827,7 +4049,7 @@ this.createjs = this.createjs || {}; * @property FILE_PATTERN * @type {RegExp} * @static - * @protected + * @private */ s.FILE_PATTERN = /^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/; @@ -3885,36 +4107,63 @@ this.createjs = this.createjs || {}; // class getter / setter properties + /** * Set the master volume of Sound. The master volume is multiplied against each sound's individual volume. For * example, if master volume is 0.5 and a sound's volume is 0.5, the resulting volume is 0.25. To set individual - * sound volume, use AbstractSoundInstance {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} instead. + * sound volume, use AbstractSoundInstance {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} + * instead. * *

    Example

    * * createjs.Sound.volume = 0.5; * - * * @property volume * @type {Number} * @default 1 * @since 0.6.1 */ + + /** + * The internal volume level. Use {{#crossLink "Sound/volume:property"}}{{/crossLink}} to adjust the master volume. + * @property _masterVolume + * @type {number} + * @default 1 + * @private + */ s._masterVolume = 1; - Object.defineProperty(s, "volume", { - get: function () {return this._masterVolume;}, - set: function (value) { - if (Number(value) == null) {return false;} - value = Math.max(0, Math.min(1, value)); - s._masterVolume = value; - if (!this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(value)) { - var instances = this._instances; - for (var i = 0, l = instances.length; i < l; i++) { - instances[i].setMasterVolume(value); - } - } + + /** + * Use the {{#crossLink "Sound/volume:property"}}{{/crossLink}} property instead. + * @method _getMasterVolume + * @private + * @static + * @return {Number} + **/ + s._getMasterVolume = function() { + return this._masterVolume; + }; + // Sound.getMasterVolume is @deprecated. Remove for 1.1+ + s.getVolume = createjs.deprecate(s._getMasterVolume, "Sound.getVolume"); + /** + * Use the {{#crossLink "Sound/volume:property"}}{{/crossLink}} property instead. + * @method _setMasterVolume + * @static + * @private + **/ + s._setMasterVolume = function(value) { + if (Number(value) == null) { return; } + value = Math.max(0, Math.min(1, value)); + s._masterVolume = value; + if (!this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(value)) { + var instances = this._instances; + for (var i = 0, l = instances.length; i < l; i++) { + instances[i].setMasterVolume(value); } - }); + } + }; + // Sound.stMasterVolume is @deprecated. Remove for 1.1+ + s.setVolume = createjs.deprecate(s._setMasterVolume, "Sound.setVolume"); /** * Mute/Unmute all audio. Note that muted audio still plays at 0 volume. This global mute value is maintained @@ -3931,23 +4180,40 @@ this.createjs = this.createjs || {}; * @default false * @since 0.6.1 */ - s._masterMute = false; - // OJR references to the methods were not working, so the code had to be duplicated here - Object.defineProperty(s, "muted", { - get: function () {return this._masterMute;}, - set: function (value) { - if (value == null) {return false;} - - this._masterMute = value; - if (!this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(value)) { - var instances = this._instances; - for (var i = 0, l = instances.length; i < l; i++) { - instances[i].setMasterMute(value); - } - } - return true; + s._masterMute = false; + + /** + * Use the {{#crossLink "Sound/muted:property"}}{{/crossLink}} property instead. + * @method _getMute + * @returns {Boolean} + * @static + * @private + */ + s._getMute = function () { + return this._masterMute; + }; + // Sound.getMute is @deprecated. Remove for 1.1+ + s.getMute = createjs.deprecate(s._getMute, "Sound.getMute"); + + /** + * Use the {{#crossLink "Sound/muted:property"}}{{/crossLink}} property instead. + * @method _setMute + * @param {Boolean} value The muted value + * @static + * @private + */ + s._setMute = function (value) { + if (value == null) { return; } + this._masterMute = value; + if (!this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(value)) { + var instances = this._instances; + for (var i = 0, l = instances.length; i < l; i++) { + instances[i].setMasterMute(value); } - }); + } + }; + // Sound.setMute is @deprecated. Remove for 1.1+ + s.setMute = createjs.deprecate(s._setMute, "Sound.setMute"); /** * Get the active plugins capabilities, which help determine if a plugin can be used in the current environment, @@ -3983,25 +4249,36 @@ this.createjs = this.createjs || {}; * @readOnly * @since 0.6.1 */ - Object.defineProperty(s, "capabilities", { - get: function () { - if (s.activePlugin == null) {return null;} - return s.activePlugin._capabilities; - }, - set: function (value) { return false;} + + /** + * Use the {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} property instead. + * @returns {null} + * @private + */ + s._getCapabilities = function() { + if (s.activePlugin == null) { return null; } + return s.activePlugin._capabilities; + }; + // Sound.getCapabilities is @deprecated. Remove for 1.1+ + s.getCapabilities = createjs.deprecate(s._getCapabilities, "Sound.getCapabilities"); + + Object.defineProperties(s, { + volume: { get: s._getMasterVolume, set: s._setMasterVolume }, + muted: { get: s._getMute, set: s._setMute }, + capabilities: { get: s._getCapabilities } }); // Class Private properties /** - * Determines if the plugins have been registered. If false, the first call to play() will instantiate the default + * Determines if the plugins have been registered. If false, the first call to {{#crossLink "play"}}{{/crossLink}} will instantiate the default * plugins ({{#crossLink "WebAudioPlugin"}}{{/crossLink}}, followed by {{#crossLink "HTMLAudioPlugin"}}{{/crossLink}}). * If plugins have been registered, but none are applicable, then sound playback will fail. * @property _pluginsRegistered * @type {Boolean} * @default false * @static - * @protected + * @private */ s._pluginsRegistered = false; @@ -4010,19 +4287,19 @@ this.createjs = this.createjs || {}; * @property _lastID * @type {Number} * @static - * @protected + * @private */ s._lastID = 0; /** * An array containing all currently playing instances. This allows Sound to control the volume, mute, and playback of - * all instances when using static APIs like {{#crossLink "Sound/stop"}}{{/crossLink}} and {{#crossLink "Sound/setVolume"}}{{/crossLink}}. + * all instances when using static APIs like {{#crossLink "Sound/stop"}}{{/crossLink}} and {{#crossLink "Sound/volume:property"}}{{/crossLink}}. * When an instance has finished playback, it gets removed via the {{#crossLink "Sound/finishedPlaying"}}{{/crossLink}} * method. If the user replays an instance, it gets added back in via the {{#crossLink "Sound/_beginPlaying"}}{{/crossLink}} * method. * @property _instances * @type {Array} - * @protected + * @private * @static */ s._instances = []; @@ -4031,7 +4308,7 @@ this.createjs = this.createjs || {}; * An object hash storing objects with sound sources, startTime, and duration via there corresponding ID. * @property _idHash * @type {Object} - * @protected + * @private * @static */ s._idHash = {}; @@ -4042,7 +4319,7 @@ this.createjs = this.createjs || {}; * and data. * @property _preloadHash * @type {Object} - * @protected + * @private * @static */ s._preloadHash = {}; @@ -4052,7 +4329,7 @@ this.createjs = this.createjs || {}; * {{#crossLink "Sound/registerSound"}}{{/crossLink}} and {{#crossLink "Sound/registerSounds"}}{{/crossLink}}. * @property _defaultPlayPropsHash * @type {Object} - * @protected + * @private * @static * @since 0.6.1 */ @@ -4109,7 +4386,7 @@ this.createjs = this.createjs || {}; *
  • types: A list of file types that are supported by Sound (currently supports "sound").
  • *
  • extensions: A list of file extensions that are supported by Sound (see {{#crossLink "Sound/SUPPORTED_EXTENSIONS:property"}}{{/crossLink}}).
  • * @static - * @protected + * @private */ s.getPreloadHandlers = function () { return { @@ -4123,7 +4400,7 @@ this.createjs = this.createjs || {}; * Used to dispatch fileload events from internal loading. * @method _handleLoadComplete * @param event A loader event. - * @protected + * @private * @static * @since 0.6.0 */ @@ -4150,7 +4427,7 @@ this.createjs = this.createjs || {}; /** * Used to dispatch error events from internal preloading. * @param event - * @protected + * @private * @since 0.6.0 * @static */ @@ -4255,44 +4532,17 @@ this.createjs = this.createjs || {}; return (s.activePlugin != null); }; - /** - * Deprecated, please use {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} instead. - * - * @method getCapabilities - * @return {Object} An object containing the capabilities of the active plugin. - * @static - * @deprecated - */ - s.getCapabilities = function () { - if (s.activePlugin == null) {return null;} - return s.activePlugin._capabilities; - }; - - /** - * Deprecated, please use {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} instead. - * - * @method getCapability - * @param {String} key The capability to retrieve - * @return {Number|Boolean} The value of the capability. - * @static - * @see getCapabilities - * @deprecated - */ - s.getCapability = function (key) { - if (s.activePlugin == null) {return null;} - return s.activePlugin._capabilities[key]; - }; - /** * Process manifest items from PreloadJS. This method is intended * for usage by a plugin, and not for direct interaction. * @method initLoad * @param {Object} src The object to load. * @return {Object|AbstractLoader} An instance of AbstractLoader. - * @protected + * @private * @static */ s.initLoad = function (loadItem) { + if (loadItem.type == "video") { return true; } // Don't handle video. PreloadJS's plugin model is really aggressive. return s._registerSound(loadItem); }; @@ -4406,7 +4656,7 @@ this.createjs = this.createjs || {}; loadItem = createjs.LoadItem.create(loadItem); loadItem.path = basePath; - if (basePath != null && !(loadItem.src instanceof Object)) {loadItem.src = basePath + src;} + if (basePath != null && !(loadItem.src instanceof Object)) {loadItem.src = basePath + loadItem.src;} var loader = s._registerSound(loadItem); if(!loader) {return false;} @@ -4415,8 +4665,8 @@ this.createjs = this.createjs || {}; s._preloadHash[loadItem.src].push(loadItem); if (s._preloadHash[loadItem.src].length == 1) { // OJR note this will disallow reloading a sound if loading fails or the source changes - loader.on("complete", createjs.proxy(this._handleLoadComplete, this)); - loader.on("error", createjs.proxy(this._handleLoadError, this)); + loader.on("complete", this._handleLoadComplete, this); + loader.on("error", this._handleLoadError, this); s.activePlugin.preload(loader); } else { if (s._preloadHash[loadItem.src][0] == true) {return true;} @@ -4624,7 +4874,7 @@ this.createjs = this.createjs || {}; * @param {String} value The path to an audio source. * @return {Object} A formatted object that can be registered with the {{#crossLink "Sound/activePlugin:property"}}{{/crossLink}} * and returned to a preloader like PreloadJS. - * @protected + * @private * @static */ s._parsePath = function (value) { @@ -4654,7 +4904,7 @@ this.createjs = this.createjs || {}; * @param {Object} value The paths to an audio source, indexed by extension type. * @return {Object} A formatted object that can be registered with the {{#crossLink "Sound/activePlugin:property"}}{{/crossLink}} * and returned to a preloader like PreloadJS. - * @protected + * @private * @static */ s._parseSrc = function (value) { @@ -4684,11 +4934,12 @@ this.createjs = this.createjs || {}; Static API. --------------- */ /** - * Play a sound and get a {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} to control. If the sound fails to play, a - * AbstractSoundInstance will still be returned, and have a playState of {{#crossLink "Sound/PLAY_FAILED:property"}}{{/crossLink}}. - * Note that even on sounds with failed playback, you may still be able to call AbstractSoundInstance {{#crossLink "AbstractSoundInstance/play"}}{{/crossLink}}, - * since the failure could be due to lack of available channels. If the src does not have a supported extension or - * if there is no available plugin, a default AbstractSoundInstance will be returned which will not play any audio, but will not generate errors. + * Play a sound and get a {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} to control. If the sound fails to + * play, an AbstractSoundInstance will still be returned, and have a playState of {{#crossLink "Sound/PLAY_FAILED:property"}}{{/crossLink}}. + * Note that even on sounds with failed playback, you may still be able to call the {{#crossLink "AbstractSoundInstance/play"}}{{/crossLink}}, + * method, since the failure could be due to lack of available channels. If the src does not have a supported + * extension or if there is no available plugin, a default AbstractSoundInstance will still be returned, which will + * not play any audio, but will not generate errors. * *

    Example

    * @@ -4700,40 +4951,19 @@ this.createjs = this.createjs || {}; * var myInstance = createjs.Sound.play("myID", {interrupt: createjs.Sound.INTERRUPT_ANY, loop:-1}); * } * - * NOTE to create an audio sprite that has not already been registered, both startTime and duration need to be set. + * NOTE: To create an audio sprite that has not already been registered, both startTime and duration need to be set. * This is only when creating a new audio sprite, not when playing using the id of an already registered audio sprite. * - * Parameters Deprecated
    - * The parameters for this method are deprecated in favor of a single parameter that is an Object or {{#crossLink "PlayPropsConfig"}}{{/crossLink}}. - * * @method play * @param {String} src The src or ID of the audio. - * @param {String | Object} [interrupt="none"|options] This parameter will be renamed playProps in the next release.
    - * This parameter can be an instance of {{#crossLink "PlayPropsConfig"}}{{/crossLink}} or an Object that contains any or all optional properties by name, - * including: interrupt, delay, offset, loop, volume, pan, startTime, and duration (see the above code sample). - *
    OR
    - * Deprecated How to interrupt any currently playing instances of audio with the same source, - * if the maximum number of instances of the sound are already playing. Values are defined as INTERRUPT_TYPE - * constants on the Sound class, with the default defined by {{#crossLink "Sound/defaultInterruptBehavior:property"}}{{/crossLink}}. - * @param {Number} [delay=0] Deprecated The amount of time to delay the start of audio playback, in milliseconds. - * @param {Number} [offset=0] Deprecated The offset from the start of the audio to begin playback, in milliseconds. - * @param {Number} [loop=0] Deprecated How many times the audio loops when it reaches the end of playback. The default is 0 (no - * loops), and -1 can be used for infinite playback. - * @param {Number} [volume=1] Deprecated The volume of the sound, between 0 and 1. Note that the master volume is applied - * against the individual volume. - * @param {Number} [pan=0] Deprecated The left-right pan of the sound (if supported), between -1 (left) and 1 (right). - * @param {Number} [startTime=null] Deprecated To create an audio sprite (with duration), the initial offset to start playback and loop from, in milliseconds. - * @param {Number} [duration=null] Deprecated To create an audio sprite (with startTime), the amount of time to play the clip for, in milliseconds. - * @return {AbstractSoundInstance} A {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} that can be controlled after it is created. + * @param {Object | PlayPropsConfig} props A PlayPropsConfig instance, or an object that contains the parameters to + * play a sound. See the {{#crossLink "PlayPropsConfig"}}{{/crossLink}} for more info. + * @return {AbstractSoundInstance} A {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} that can be controlled + * after it is created. * @static */ - s.play = function (src, interrupt, delay, offset, loop, volume, pan, startTime, duration) { - var playProps; - if (interrupt instanceof Object || interrupt instanceof createjs.PlayPropsConfig) { - playProps = createjs.PlayPropsConfig.create(interrupt); - } else { - playProps = createjs.PlayPropsConfig.create({interrupt:interrupt, delay:delay, offset:offset, loop:loop, volume:volume, pan:pan, startTime:startTime, duration:duration}); - } + s.play = function (src, props) { + var playProps = createjs.PlayPropsConfig.create(props); var instance = s.createInstance(src, playProps.startTime, playProps.duration); var ok = s._playInstance(instance, playProps); if (!ok) {instance._playFailed();} @@ -4769,7 +4999,7 @@ this.createjs = this.createjs || {}; * @static */ s.createInstance = function (src, startTime, duration) { - if (!s.initializeDefaultPlugins()) {return new createjs.DefaultSoundInstance(src, startTime, duration);} + if (!s.initializeDefaultPlugins()) { return new createjs.DefaultSoundInstance(src, startTime, duration); } var defaultPlayProps = s._defaultPlayPropsHash[src]; // for audio sprites, which create and store defaults by id src = s._getSrcById(src); @@ -4779,11 +5009,11 @@ this.createjs = this.createjs || {}; var instance = null; if (details != null && details.src != null) { SoundChannel.create(details.src); - if (startTime == null) {startTime = src.startTime;} + if (startTime == null) { startTime = src.startTime; } instance = s.activePlugin.create(details.src, startTime, duration || src.duration); defaultPlayProps = defaultPlayProps || s._defaultPlayPropsHash[details.src]; - if(defaultPlayProps) { + if (defaultPlayProps) { instance.applyPlayProps(defaultPlayProps); } } else { @@ -4813,74 +5043,6 @@ this.createjs = this.createjs || {}; } }; - /** - * Deprecated, please use {{#crossLink "Sound/volume:property"}}{{/crossLink}} instead. - * - * @method setVolume - * @param {Number} value The master volume value. The acceptable range is 0-1. - * @static - * @deprecated - */ - s.setVolume = function (value) { - if (Number(value) == null) {return false;} - value = Math.max(0, Math.min(1, value)); - s._masterVolume = value; - if (!this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(value)) { - var instances = this._instances; - for (var i = 0, l = instances.length; i < l; i++) { - instances[i].setMasterVolume(value); - } - } - }; - - /** - * Deprecated, please use {{#crossLink "Sound/volume:property"}}{{/crossLink}} instead. - * - * @method getVolume - * @return {Number} The master volume, in a range of 0-1. - * @static - * @deprecated - */ - s.getVolume = function () { - return this._masterVolume; - }; - - /** - * Deprecated, please use {{#crossLink "Sound/muted:property"}}{{/crossLink}} instead. - * - * @method setMute - * @param {Boolean} value Whether the audio should be muted or not. - * @return {Boolean} If the mute was set. - * @static - * @since 0.4.0 - * @deprecated - */ - s.setMute = function (value) { - if (value == null) {return false;} - - this._masterMute = value; - if (!this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(value)) { - var instances = this._instances; - for (var i = 0, l = instances.length; i < l; i++) { - instances[i].setMasterMute(value); - } - } - return true; - }; - - /** - * Deprecated, please use {{#crossLink "Sound/muted:property"}}{{/crossLink}} instead. - * - * @method getMute - * @return {Boolean} The mute value of Sound. - * @static - * @since 0.4.0 - * @deprecated - */ - s.getMute = function () { - return this._masterMute; - }; - /** * Set the default playback properties for all new SoundInstances of the passed in src or ID. * See {{#crossLink "PlayPropsConfig"}}{{/crossLink}} for available properties. @@ -4921,14 +5083,14 @@ this.createjs = this.createjs || {}; * @param {PlayPropsConfig} playProps A PlayPropsConfig object. * @return {Boolean} If the sound can start playing. Sounds that fail immediately will return false. Sounds that * have a delay will return true, but may still fail to play. - * @protected + * @private * @static */ s._playInstance = function (instance, playProps) { var defaultPlayProps = s._defaultPlayPropsHash[instance.src] || {}; if (playProps.interrupt == null) {playProps.interrupt = defaultPlayProps.interrupt || s.defaultInterruptBehavior}; if (playProps.delay == null) {playProps.delay = defaultPlayProps.delay || 0;} - if (playProps.offset == null) {playProps.offset = instance.getPosition();} + if (playProps.offset == null) {playProps.offset = instance.position;} if (playProps.loop == null) {playProps.loop = instance.loop;} if (playProps.volume == null) {playProps.volume = instance.volume;} if (playProps.pan == null) {playProps.pan = instance.pan;} @@ -4957,7 +5119,7 @@ this.createjs = this.createjs || {}; * @param {PlayPropsConfig} playProps A PlayPropsConfig object. * @return {Boolean} If the sound can start playing. If there are no available channels, or the instance fails to * start, this will return false. - * @protected + * @private * @static */ s._beginPlaying = function (instance, playProps) { @@ -4979,7 +5141,7 @@ this.createjs = this.createjs || {}; * @method _getSrcById * @param {String} value The ID the sound was registered with. * @return {String} The source of the sound if it has been registered with this ID or the value that was passed in. - * @protected + * @private * @static */ s._getSrcById = function (value) { @@ -4992,7 +5154,7 @@ this.createjs = this.createjs || {}; * instances themselves. * @method _playFinished * @param {AbstractSoundInstance} instance The instance that finished playback. - * @protected + * @private * @static */ s._playFinished = function (instance) { @@ -5123,20 +5285,6 @@ this.createjs = this.createjs || {}; var p = SoundChannel.prototype; p.constructor = SoundChannel; - /** - * REMOVED. Removed in favor of using `MySuperClass_constructor`. - * See {{#crossLink "Utility Methods/extend"}}{{/crossLink}} and {{#crossLink "Utility Methods/promote"}}{{/crossLink}} - * for details. - * - * There is an inheritance tutorial distributed with EaselJS in /tutorials/Inheritance. - * - * @method initialize - * @protected - * @deprecated - */ - // p.initialize = function() {}; // searchable for devs wondering where it is. - - /** * The source of the channel. * #property src @@ -5270,8 +5418,8 @@ this.createjs = this.createjs || {}; } // Audio is a better candidate than the current target, according to playhead - if ((interrupt == Sound.INTERRUPT_EARLY && target.getPosition() < replacement.getPosition()) || - (interrupt == Sound.INTERRUPT_LATE && target.getPosition() > replacement.getPosition())) { + if ((interrupt == Sound.INTERRUPT_EARLY && target.position < replacement.position) || + (interrupt == Sound.INTERRUPT_LATE && target.position > replacement.position)) { replacement = target; } } @@ -5392,7 +5540,7 @@ this.createjs = this.createjs || {}; * The volume of the sound, between 0 and 1. * * The actual output volume of a sound can be calculated using: - * myInstance.volume * createjs.Sound.getVolume(); + * myInstance.volume * createjs.Sound._getVolume(); * * @property volume * @type {Number} @@ -5400,24 +5548,27 @@ this.createjs = this.createjs || {}; */ this._volume = 1; Object.defineProperty(this, "volume", { - get: this.getVolume, - set: this.setVolume + get: this._getVolume, + set: this._setVolume }); + this.getVolume = createjs.deprecate(this._getVolume, "AbstractSoundInstance.getVolume"); + this.setVolume = createjs.deprecate(this._setVolume, "AbstractSoundInstance.setVolume"); /** * The pan of the sound, between -1 (left) and 1 (right). Note that pan is not supported by HTML Audio. * - *
    Note in WebAudioPlugin this only gives us the "x" value of what is actually 3D audio. - * + * Note in WebAudioPlugin this only gives us the "x" value of what is actually 3D audio * @property pan * @type {Number} * @default 0 */ this._pan = 0; Object.defineProperty(this, "pan", { - get: this.getPan, - set: this.setPan + get: this._getPan, + set: this._setPan }); + this.getPan = createjs.deprecate(this._getPan, "AbstractSoundInstance.getPan"); + this.setPan = createjs.deprecate(this._setPan, "AbstractSoundInstance.setPan"); /** * Audio sprite property used to determine the starting offset. @@ -5428,9 +5579,11 @@ this.createjs = this.createjs || {}; */ this._startTime = Math.max(0, startTime || 0); Object.defineProperty(this, "startTime", { - get: this.getStartTime, - set: this.setStartTime + get: this._getStartTime, + set: this._setStartTime }); + this.getStartTime = createjs.deprecate(this._getStartTime, "AbstractSoundInstance.getStartTime"); + this.setStartTime = createjs.deprecate(this._setStartTime, "AbstractSoundInstance.setStartTime"); /** * Sets or gets the length of the audio clip, value is in milliseconds. @@ -5442,9 +5595,11 @@ this.createjs = this.createjs || {}; */ this._duration = Math.max(0, duration || 0); Object.defineProperty(this, "duration", { - get: this.getDuration, - set: this.setDuration + get: this._getDuration, + set: this._setDuration }); + this.getDuration = createjs.deprecate(this._getDuration, "AbstractSoundInstance.getDuration"); + this.setDuration = createjs.deprecate(this._setDuration, "AbstractSoundInstance.setDuration"); /** * Object that holds plugin specific resource need for audio playback. @@ -5457,10 +5612,12 @@ this.createjs = this.createjs || {}; */ this._playbackResource = null; Object.defineProperty(this, "playbackResource", { - get: this.getPlaybackResource, - set: this.setPlaybackResource + get: this._getPlaybackResource, + set: this._setPlaybackResource }); - if(playbackResource !== false && playbackResource !== true) { this.setPlaybackResource(playbackResource); } + if(playbackResource !== false && playbackResource !== true) { this._setPlaybackResource(playbackResource); } + this.getPlaybackResource = createjs.deprecate(this._getPlaybackResource, "AbstractSoundInstance.getPlaybackResource"); + this.setPlaybackResource = createjs.deprecate(this._setPlaybackResource, "AbstractSoundInstance.setPlaybackResource"); /** * The position of the playhead in milliseconds. This can be set while a sound is playing, paused, or stopped. @@ -5472,9 +5629,11 @@ this.createjs = this.createjs || {}; */ this._position = 0; Object.defineProperty(this, "position", { - get: this.getPosition, - set: this.setPosition + get: this._getPosition, + set: this._setPosition }); + this.getPosition = createjs.deprecate(this._getPosition, "AbstractSoundInstance.getPosition"); + this.setPosition = createjs.deprecate(this._setPosition, "AbstractSoundInstance.setPosition"); /** * The number of play loops remaining. Negative values will loop infinitely. @@ -5487,9 +5646,11 @@ this.createjs = this.createjs || {}; */ this._loop = 0; Object.defineProperty(this, "loop", { - get: this.getLoop, - set: this.setLoop + get: this._getLoop, + set: this._setLoop }); + this.getLoop = createjs.deprecate(this._getLoop, "AbstractSoundInstance.getLoop"); + this.setLoop = createjs.deprecate(this._setLoop, "AbstractSoundInstance.setLoop"); /** * Mutes or unmutes the current audio instance. @@ -5501,9 +5662,11 @@ this.createjs = this.createjs || {}; */ this._muted = false; Object.defineProperty(this, "muted", { - get: this.getMuted, - set: this.setMuted + get: this._getMuted, + set: this._setMuted }); + this.getMuted = createjs.deprecate(this._getMuted, "AbstractSoundInstance.getMuted"); + this.setMuted = createjs.deprecate(this._setMuted, "AbstractSoundInstance.setMuted"); /** * Pauses or resumes the current audio instance. @@ -5513,9 +5676,11 @@ this.createjs = this.createjs || {}; */ this._paused = false; Object.defineProperty(this, "paused", { - get: this.getPaused, - set: this.setPaused + get: this._getPaused, + set: this._setPaused }); + this.getPaused = createjs.deprecate(this._getPaused, "AbstractSoundInstance.getPaused"); + this.setPaused = createjs.deprecate(this._setPaused, "AbstractSoundInstance.setPaused"); // Events @@ -5566,10 +5731,6 @@ this.createjs = this.createjs || {}; var p = createjs.extend(AbstractSoundInstance, createjs.EventDispatcher); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Public Methods: /** * Play an instance. This method is intended to be called on SoundInstances that already exist (created @@ -5586,34 +5747,15 @@ this.createjs = this.createjs || {}; * The parameters for this method are deprecated in favor of a single parameter that is an Object or {{#crossLink "PlayPropsConfig"}}{{/crossLink}}. * * @method play - * @param {String | Object} [interrupt="none"|options] This parameter will be renamed playProps in the next release.
    - * This parameter can be an instance of {{#crossLink "PlayPropsConfig"}}{{/crossLink}} or an Object that contains any or all optional properties by name, - * including: interrupt, delay, offset, loop, volume, pan, startTime, and duration (see the above code sample). - *
    OR
    - * Deprecated How to interrupt any currently playing instances of audio with the same source, - * if the maximum number of instances of the sound are already playing. Values are defined as INTERRUPT_TYPE - * constants on the Sound class, with the default defined by {{#crossLink "Sound/defaultInterruptBehavior:property"}}{{/crossLink}}. - * @param {Number} [delay=0] Deprecated The amount of time to delay the start of audio playback, in milliseconds. - * @param {Number} [offset=0] Deprecated The offset from the start of the audio to begin playback, in milliseconds. - * @param {Number} [loop=0] Deprecated How many times the audio loops when it reaches the end of playback. The default is 0 (no - * loops), and -1 can be used for infinite playback. - * @param {Number} [volume=1] Deprecated The volume of the sound, between 0 and 1. Note that the master volume is applied - * against the individual volume. - * @param {Number} [pan=0] Deprecated The left-right pan of the sound (if supported), between -1 (left) and 1 (right). - * Note that pan is not supported for HTML Audio. + * @param {Object | PlayPropsConfig} props A PlayPropsConfig instance, or an object that contains the parameters to + * play a sound. See the {{#crossLink "PlayPropsConfig"}}{{/crossLink}} for more info. * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. */ - p.play = function (interrupt, delay, offset, loop, volume, pan) { - var playProps; - if (interrupt instanceof Object || interrupt instanceof createjs.PlayPropsConfig) { - playProps = createjs.PlayPropsConfig.create(interrupt); - } else { - playProps = createjs.PlayPropsConfig.create({interrupt:interrupt, delay:delay, offset:offset, loop:loop, volume:volume, pan:pan}); - } - + p.play = function (props) { + var playProps = createjs.PlayPropsConfig.create(props); if (this.playState == createjs.Sound.PLAY_SUCCEEDED) { this.applyPlayProps(playProps); - if (this._paused) { this.setPaused(false); } + if (this._paused) { this._setPaused(false); } return; } this._cleanUp(); @@ -5664,13 +5806,13 @@ this.createjs = this.createjs || {}; * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. */ p.applyPlayProps = function(playProps) { - if (playProps.offset != null) { this.setPosition(playProps.offset) } - if (playProps.loop != null) { this.setLoop(playProps.loop); } - if (playProps.volume != null) { this.setVolume(playProps.volume); } - if (playProps.pan != null) { this.setPan(playProps.pan); } + if (playProps.offset != null) { this._setPosition(playProps.offset) } + if (playProps.loop != null) { this._setLoop(playProps.loop); } + if (playProps.volume != null) { this._setVolume(playProps.volume); } + if (playProps.pan != null) { this._setPan(playProps.pan); } if (playProps.startTime != null) { - this.setStartTime(playProps.startTime); - this.setDuration(playProps.duration); + this._setStartTime(playProps.startTime); + this._setDuration(playProps.duration); } return this; }; @@ -5681,27 +5823,25 @@ this.createjs = this.createjs || {}; // get/set methods that allow support for IE8 /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/paused:property"}}{{/crossLink}} directly as a property, - * - * @deprecated - * @method getPaused - * @returns {boolean} If the instance is currently paused + * Please use {{#crossLink "AbstractSoundInstance/paused:property"}}{{/crossLink}} directly as a property. + * @method _getPaused + * @protected + * @return {boolean} If the instance is currently paused * @since 0.6.0 */ - p.getPaused = function() { + p._getPaused = function() { return this._paused; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/paused:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPaused + * Please use {{#crossLink "AbstractSoundInstance/paused:property"}}{{/crossLink}} directly as a property + * @method _setPaused + * @protected * @param {boolean} value * @since 0.6.0 * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. */ - p.setPaused = function (value) { + p._setPaused = function (value) { if ((value !== true && value !== false) || this._paused == value) {return;} if (value == true && this.playState != createjs.Sound.PLAY_SUCCEEDED) {return;} this._paused = value; @@ -5715,14 +5855,13 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setVolume + * Please use {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} directly as a property + * @method _setVolume + * @protected * @param {Number} value The volume to set, between 0 and 1. * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. */ - p.setVolume = function (value) { + p._setVolume = function (value) { if (value == this._volume) { return this; } this._volume = Math.max(0, Math.min(1, value)); if (!this._muted) { @@ -5732,26 +5871,24 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getVolume + * Please use {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} directly as a property + * @method _getVolume + * @protected * @return {Number} The current volume of the sound instance. */ - p.getVolume = function () { + p._getVolume = function () { return this._volume; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/muted:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setMuted + * Please use {{#crossLink "AbstractSoundInstance/muted:property"}}{{/crossLink}} directly as a property + * @method _setMuted + * @protected * @param {Boolean} value If the sound should be muted. * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. * @since 0.6.0 */ - p.setMuted = function (value) { + p._setMuted = function (value) { if (value !== true && value !== false) {return;} this._muted = value; this._updateVolume(); @@ -5759,26 +5896,24 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/muted:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getMuted + * Please use {{#crossLink "AbstractSoundInstance/muted:property"}}{{/crossLink}} directly as a property + * @method _getMuted + * @protected * @return {Boolean} If the sound is muted. * @since 0.6.0 */ - p.getMuted = function () { + p._getMuted = function () { return this._muted; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/pan:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPan + * Please use {{#crossLink "AbstractSoundInstance/pan:property"}}{{/crossLink}} directly as a property + * @method _setPan + * @protected * @param {Number} value The pan value, between -1 (left) and 1 (right). * @return {AbstractSoundInstance} Returns reference to itself for chaining calls */ - p.setPan = function (value) { + p._setPan = function (value) { if(value == this._pan) { return this; } this._pan = Math.max(-1, Math.min(1, value)); this._updatePan(); @@ -5786,24 +5921,22 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/pan:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getPan + * Please use {{#crossLink "AbstractSoundInstance/pan:property"}}{{/crossLink}} directly as a property + * @method _getPan + * @protected * @return {Number} The value of the pan, between -1 (left) and 1 (right). */ - p.getPan = function () { + p._getPan = function () { return this._pan; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/position:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getPosition + * Please use {{#crossLink "AbstractSoundInstance/position:property"}}{{/crossLink}} directly as a property + * @method _getPosition + * @protected * @return {Number} The position of the playhead in the sound, in milliseconds. */ - p.getPosition = function () { + p._getPosition = function () { if (!this._paused && this.playState == createjs.Sound.PLAY_SUCCEEDED) { this._position = this._calculateCurrentPosition(); } @@ -5811,14 +5944,13 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/position:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPosition + * Please use {{#crossLink "AbstractSoundInstance/position:property"}}{{/crossLink}} directly as a property + * @method _setPosition + * @protected * @param {Number} value The position to place the playhead, in milliseconds. * @return {AbstractSoundInstance} Returns reference to itself for chaining calls */ - p.setPosition = function (value) { + p._setPosition = function (value) { this._position = Math.max(0, value); if (this.playState == createjs.Sound.PLAY_SUCCEEDED) { this._updatePosition(); @@ -5827,25 +5959,23 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/startTime:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getStartTime + * Please use {{#crossLink "AbstractSoundInstance/startTime:property"}}{{/crossLink}} directly as a property + * @method _getStartTime + * @protected * @return {Number} The startTime of the sound instance in milliseconds. */ - p.getStartTime = function () { + p._getStartTime = function () { return this._startTime; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/startTime:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setStartTime + * Please use {{#crossLink "AbstractSoundInstance/startTime:property"}}{{/crossLink}} directly as a property + * @method _setStartTime + * @protected * @param {number} value The new startTime time in milli seconds. * @return {AbstractSoundInstance} Returns reference to itself for chaining calls */ - p.setStartTime = function (value) { + p._setStartTime = function (value) { if (value == this._startTime) { return this; } this._startTime = Math.max(0, value || 0); this._updateStartTime(); @@ -5853,26 +5983,24 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/duration:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getDuration + * Please use {{#crossLink "AbstractSoundInstance/duration:property"}}{{/crossLink}} directly as a property + * @method _getDuration + * @protected * @return {Number} The duration of the sound instance in milliseconds. */ - p.getDuration = function () { + p._getDuration = function () { return this._duration; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/duration:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setDuration + * Please use {{#crossLink "AbstractSoundInstance/duration:property"}}{{/crossLink}} directly as a property + * @method _setDuration + * @protected * @param {number} value The new duration time in milli seconds. * @return {AbstractSoundInstance} Returns reference to itself for chaining calls * @since 0.6.0 */ - p.setDuration = function (value) { + p._setDuration = function (value) { if (value == this._duration) { return this; } this._duration = Math.max(0, value || 0); this._updateDuration(); @@ -5880,54 +6008,50 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/playbackResource:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPlayback + * Please use {{#crossLink "AbstractSoundInstance/playbackResource:property"}}{{/crossLink}} directly as a property + * @method _setPlaybackResource + * @protected * @param {Object} value The new playback resource. * @return {AbstractSoundInstance} Returns reference to itself for chaining calls * @since 0.6.0 **/ - p.setPlaybackResource = function (value) { + p._setPlaybackResource = function (value) { this._playbackResource = value; - if (this._duration == 0) { this._setDurationFromSource(); } + if (this._duration == 0 && this._playbackResource) { this._setDurationFromSource(); } return this; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/playbackResource:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPlayback + * Please use {{#crossLink "AbstractSoundInstance/playbackResource:property"}}{{/crossLink}} directly as a property + * @method _getPlaybackResource + * @protected * @param {Object} value The new playback resource. * @return {Object} playback resource used for playing audio * @since 0.6.0 **/ - p.getPlaybackResource = function () { + p._getPlaybackResource = function () { return this._playbackResource; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/loop:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getLoop + * Please use {{#crossLink "AbstractSoundInstance/loop:property"}}{{/crossLink}} directly as a property + * @method _getLoop + * @protected * @return {number} * @since 0.6.0 **/ - p.getLoop = function () { + p._getLoop = function () { return this._loop; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/loop:property"}}{{/crossLink}} directly as a property, - * - * @deprecated - * @method setLoop + * Please use {{#crossLink "AbstractSoundInstance/loop:property"}}{{/crossLink}} directly as a property + * @method _setLoop + * @protected * @param {number} value The number of times to loop after play. * @since 0.6.0 */ - p.setLoop = function (value) { + p._setLoop = function (value) { if(this._playbackResource != null) { // remove looping if (this._loop != 0 && value == 0) { @@ -5988,13 +6112,13 @@ this.createjs = this.createjs || {}; */ // OJR FlashAudioSoundInstance overwrites p._beginPlaying = function (playProps) { - this.setPosition(playProps.offset); - this.setLoop(playProps.loop); - this.setVolume(playProps.volume); - this.setPan(playProps.pan); + this._setPosition(playProps.offset); + this._setLoop(playProps.loop); + this._setVolume(playProps.volume); + this._setPan(playProps.pan); if (playProps.startTime != null) { - this.setStartTime(playProps.startTime); - this.setDuration(playProps.duration); + this._setStartTime(playProps.startTime); + this._setDuration(playProps.duration); } if (this._playbackResource != null && this._position < this._duration) { @@ -6279,20 +6403,6 @@ this.createjs = this.createjs || {}; }; var p = AbstractPlugin.prototype; - /** - * REMOVED. Removed in favor of using `MySuperClass_constructor`. - * See {{#crossLink "Utility Methods/extend"}}{{/crossLink}} and {{#crossLink "Utility Methods/promote"}}{{/crossLink}} - * for details. - * - * There is an inheritance tutorial distributed with EaselJS in /tutorials/Inheritance. - * - * @method initialize - * @protected - * @deprecated - */ - // p.initialize = function() {}; // searchable for devs wondering where it is. - - // Static Properties: // NOTE THESE PROPERTIES NEED TO BE ADDED TO EACH PLUGIN /** @@ -6300,7 +6410,7 @@ this.createjs = this.createjs || {}; * @property _capabilities * @type {Object} * @default null - * @protected + * @private * @static */ AbstractPlugin._capabilities = null; @@ -6411,7 +6521,15 @@ this.createjs = this.createjs || {}; this.preload(this.register(src)); } var si = new this._soundInstanceClass(src, startTime, duration, this._audioSources[src]); - this._soundInstances[src].push(si); + if(this._soundInstances[src]){ + this._soundInstances[src].push(si); + } + + // Plugins that don't have a setVolume should implement a setMasterVolune/setMasterMute + // So we have to check that here. + si.setMasterVolume && si.setMasterVolume(createjs.Sound.volume); + si.setMasterMute && si.setMasterMute(createjs.Sound.muted); + return si; }; @@ -6442,7 +6560,7 @@ this.createjs = this.createjs || {}; * Mute all sounds via the plugin. * @method setMute * @param {Boolean} value If all sound should be muted or not. Note that plugin-level muting just looks up - * the mute value of Sound {{#crossLink "Sound/getMute"}}{{/crossLink}}, so this property is not used here. + * the mute value of Sound {{#crossLink "Sound/muted:property"}}{{/crossLink}}, so this property is not used here. * @return {Boolean} If the mute call succeeds. */ p.setMute = function (value) { @@ -6460,6 +6578,7 @@ this.createjs = this.createjs || {}; /** * Handles internal preload completion. * @method _handlePreloadComplete + * @param event * @protected */ p._handlePreloadComplete = function (event) { @@ -6467,13 +6586,14 @@ this.createjs = this.createjs || {}; this._audioSources[src] = event.result; for (var i = 0, l = this._soundInstances[src].length; i < l; i++) { var item = this._soundInstances[src][i]; - item.setPlaybackResource(this._audioSources[src]); + item.playbackResource = this._audioSources[src]; // ToDo consider adding play call here if playstate == playfailed + this._soundInstances[src] = null; } }; /** - * Handles internal preload erros + * Handles internal preload errors * @method _handlePreloadError * @param event * @protected @@ -6513,15 +6633,11 @@ this.createjs = this.createjs || {}; * @protected */ function Loader(loadItem) { - this.AbstractLoader_constructor(loadItem, true, createjs.AbstractLoader.SOUND); + this.AbstractLoader_constructor(loadItem, true, createjs.Types.SOUND); }; var p = createjs.extend(Loader, createjs.AbstractLoader); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - /** * web audio context required for decoding audio * @property context @@ -6667,10 +6783,6 @@ this.createjs = this.createjs || {}; var p = createjs.extend(WebAudioSoundInstance, createjs.AbstractSoundInstance); var s = WebAudioSoundInstance; - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - /** * Note this is only intended for use by advanced users. *
    Audio context used to create nodes. This is and needs to be the same context used by {{#crossLink "WebAudioPlugin"}}{{/crossLink}}. @@ -6757,7 +6869,7 @@ this.createjs = this.createjs || {}; clearTimeout(this._soundCompleteTimeout); - this._playbackStartTime = 0; // This is used by getPosition + this._playbackStartTime = 0; // This is used by _getPosition }; /** @@ -6774,7 +6886,9 @@ this.createjs = this.createjs || {}; audioNode.disconnect(0); // necessary to prevent leak on iOS Safari 7-9. will throw in almost all other // browser implementations. - try { audioNode.buffer = s._scratchBuffer; } catch(e) {} + if ( createjs.BrowserDetect.isIOS ) { + try { audioNode.buffer = s._scratchBuffer; } catch(e) {} + } audioNode = null; } return audioNode; @@ -6783,9 +6897,8 @@ this.createjs = this.createjs || {}; p._handleSoundReady = function (event) { this.gainNode.connect(s.destinationNode); // this line can cause a memory leak. Nodes need to be disconnected from the audioDestination or any sequence that leads to it. - var dur = this._duration * 0.001; - var pos = this._position * 0.001; - if (pos > dur) {pos = dur;} + var dur = this._duration * 0.001, + pos = Math.min(Math.max(0, this._position) * 0.001, dur); this.sourceNode = this._createAndPlayAudioNode((s.context.currentTime - dur), pos); this._playbackStartTime = this.sourceNode.startTime - pos; @@ -6974,10 +7087,6 @@ this.createjs = this.createjs || {}; } var p = createjs.extend(WebAudioPlugin, createjs.AbstractPlugin); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static Properties var s = WebAudioPlugin; /** @@ -6986,7 +7095,7 @@ this.createjs = this.createjs || {}; * @property _capabilities * @type {Object} * @default null - * @protected + * @private * @static */ s._capabilities = null; @@ -6995,7 +7104,7 @@ this.createjs = this.createjs || {}; * Value to set panning model to equal power for WebAudioSoundInstance. Can be "equalpower" or 0 depending on browser implementation. * @property _panningModel * @type {Number / String} - * @protected + * @private * @static */ s._panningModel = "equalpower"; @@ -7022,7 +7131,7 @@ this.createjs = this.createjs || {}; * * @property _scratchBuffer * @type {AudioBuffer} - * @protected + * @private * @static */ s._scratchBuffer = null; @@ -7037,6 +7146,14 @@ this.createjs = this.createjs || {}; */ s._unlocked = false; + /** + * The default sample rate used when checking for iOS compatibility. See {{#crossLink "WebAudioPlugin/_createAudioContext"}}{{/crossLink}}. + * @property DEFAULT_SAMPLE_REATE + * @type {number} + * @default 44100 + * @static + */ + s.DEFAULT_SAMPLE_RATE = 44100; // Static Public Methods /** @@ -7086,7 +7203,7 @@ this.createjs = this.createjs || {}; * @method _isFileXHRSupported * @return {Boolean} If XHR is supported. * @since 0.4.2 - * @protected + * @private * @static */ s._isFileXHRSupported = function() { @@ -7115,11 +7232,11 @@ this.createjs = this.createjs || {}; }; /** - * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} + * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} * method for an overview of plugin capabilities. * @method _generateCapabilities * @static - * @protected + * @private */ s._generateCapabilities = function () { if (s._capabilities != null) {return;} @@ -7128,13 +7245,8 @@ this.createjs = this.createjs || {}; if (t.canPlayType == null) {return null;} if (s.context == null) { - if (window.AudioContext) { - s.context = new AudioContext(); - } else if (window.webkitAudioContext) { - s.context = new webkitAudioContext(); - } else { - return null; - } + s.context = s._createAudioContext(); + if (s.context == null) { return null; } } if (s._scratchBuffer == null) { s._scratchBuffer = s.context.createBuffer(1, 1, 22050); @@ -7146,10 +7258,10 @@ this.createjs = this.createjs || {}; if ("ontouchstart" in window && s.context.state != "running") { s._unlock(); // When played inside of a touch event, this will enable audio on iOS immediately. document.addEventListener("mousedown", s._unlock, true); + document.addEventListener("touchstart", s._unlock, true); document.addEventListener("touchend", s._unlock, true); } - s._capabilities = { panning:true, volume:true, @@ -7172,6 +7284,43 @@ this.createjs = this.createjs || {}; } }; + /** + * Create an audio context for the sound. + * + * This method handles both vendor prefixes (specifically webkit support), as well as a case on iOS where + * audio played with a different sample rate may play garbled when first started. The default sample rate is + * 44,100, however it can be changed using the {{#crossLink "WebAudioPlugin/DEFAULT_SAMPLE_RATE:property"}}{{/crossLink}}. + * @method _createAudioContext + * @return {AudioContext | webkitAudioContext} + * @private + * @static + * @since 1.0.0 + */ + s._createAudioContext = function() { + // Slightly modified version of https://github.com/Jam3/ios-safe-audio-context + // Resolves issues with first-run contexts playing garbled on iOS. + var AudioCtor = (window.AudioContext || window.webkitAudioContext); + if (AudioCtor == null) { return null; } + var context = new AudioCtor(); + + // Check if hack is necessary. Only occurs in iOS6+ devices + // and only when you first boot the iPhone, or play a audio/video + // with a different sample rate + if (/(iPhone|iPad)/i.test(navigator.userAgent) + && context.sampleRate !== s.DEFAULT_SAMPLE_RATE) { + var buffer = context.createBuffer(1, 1, s.DEFAULT_SAMPLE_RATE), + dummy = context.createBufferSource(); + dummy.buffer = buffer; + dummy.connect(context.destination); + dummy.start(0); + dummy.disconnect(); + context.close() // dispose old context + + context = new AudioCtor(); + } + return context; + } + /** * Set up compatibility if only deprecated web audio calls are supported. * See http://www.w3.org/TR/webaudio/#DeprecationNotes @@ -7180,7 +7329,7 @@ this.createjs = this.createjs || {}; * * @method _compatibilitySetUp * @static - * @protected + * @private * @since 0.4.2 */ s._compatibilitySetUp = function() { @@ -7218,6 +7367,7 @@ this.createjs = this.createjs || {}; if (s.context.state == "running") { document.removeEventListener("mousedown", s._unlock, true); document.removeEventListener("touchend", s._unlock, true); + document.removeEventListener("touchstart", s._unlock, true); s._unlocked = true; } }; @@ -7290,7 +7440,7 @@ this.createjs = this.createjs || {}; * @property _tags * @type {{}} * @static - * @protected + * @private */ s._tags = {}; @@ -7299,7 +7449,7 @@ this.createjs = this.createjs || {}; * @property _tagPool * @type {TagPool} * @static - * @protected + * @private */ s._tagPool = new TagPool(); @@ -7307,7 +7457,7 @@ this.createjs = this.createjs || {}; * A hash lookup of if a base audio tag is available, indexed by the audio source * @property _tagsUsed * @type {{}} - * @protected + * @private * @static */ s._tagUsed = {}; @@ -7506,10 +7656,6 @@ this.createjs = this.createjs || {}; } var p = createjs.extend(HTMLAudioSoundInstance, createjs.AbstractSoundInstance); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Public Methods /** * Called by {{#crossLink "Sound"}}{{/crossLink}} when plugin does not handle master volume. @@ -7775,18 +7921,6 @@ this.createjs = this.createjs || {}; // Public Properties - /** - * This is no longer needed as we are now using object pooling for tags. - * - * NOTE this property only exists as a limitation of HTML audio. - * @property defaultNumChannels - * @type {Number} - * @default 2 - * @since 0.4.0 - * @deprecated - */ - this.defaultNumChannels = 2; - this._capabilities = s._capabilities; this._loaderClass = createjs.SoundLoader; @@ -7796,10 +7930,6 @@ this.createjs = this.createjs || {}; var p = createjs.extend(HTMLAudioPlugin, createjs.AbstractPlugin); var s = HTMLAudioPlugin; - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static Properties /** * The maximum number of instances that can be loaded or played. This is a browser limitation, primarily limited to IE9. @@ -7818,7 +7948,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default canplaythrough * @static - * @protected + * @private */ s._AUDIO_READY = "canplaythrough"; @@ -7828,7 +7958,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default ended * @static - * @protected + * @private */ s._AUDIO_ENDED = "ended"; @@ -7838,7 +7968,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default seeked * @static - * @protected + * @private */ s._AUDIO_SEEKED = "seeked"; @@ -7848,7 +7978,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default stalled * @static - * @protected + * @private */ s._AUDIO_STALLED = "stalled"; @@ -7859,17 +7989,17 @@ this.createjs = this.createjs || {}; * @type {String} * @default timeupdate * @static - * @protected + * @private */ s._TIME_UPDATE = "timeupdate"; /** * The capabilities of the plugin. This is generated via the {{#crossLink "HTMLAudioPlugin/_generateCapabilities"}}{{/crossLink}} - * method. Please see the Sound {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} method for an overview of all + * method. Please see the Sound {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} method for an overview of all * of the available properties. * @property _capabilities * @type {Object} - * @protected + * @private * @static */ s._capabilities = null; @@ -7889,11 +8019,11 @@ this.createjs = this.createjs || {}; }; /** - * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} + * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} * method for an overview of plugin capabilities. * @method _generateCapabilities * @static - * @protected + * @private */ s._generateCapabilities = function () { if (s._capabilities != null) {return;} @@ -7933,7 +8063,7 @@ this.createjs = this.createjs || {}; p.create = function (src, startTime, duration) { var si = this.AbstractPlugin_create(src, startTime, duration); - si.setPlaybackResource(null); + si.playbackResource = null; return si; }; diff --git a/lib/soundjs-NEXT.min.js b/lib/soundjs-NEXT.min.js index 5160bece..12c58262 100644 --- a/lib/soundjs-NEXT.min.js +++ b/lib/soundjs-NEXT.min.js @@ -14,5 +14,6 @@ * SoundJS FlashAudioPlugin also includes swfobject (http://code.google.com/p/swfobject/) */ -this.createjs=this.createjs||{},function(){var a=createjs.SoundJS=createjs.SoundJS||{};a.version="NEXT",a.buildDate="Fri, 04 Dec 2015 17:24:04 GMT"}(),this.createjs=this.createjs||{},createjs.extend=function(a,b){"use strict";function c(){this.constructor=a}return c.prototype=b.prototype,a.prototype=new c},this.createjs=this.createjs||{},createjs.promote=function(a,b){"use strict";var c=a.prototype,d=Object.getPrototypeOf&&Object.getPrototypeOf(c)||c.__proto__;if(d){c[(b+="_")+"constructor"]=d.constructor;for(var e in d)c.hasOwnProperty(e)&&"function"==typeof d[e]&&(c[b+e]=d[e])}return a},this.createjs=this.createjs||{},createjs.indexOf=function(a,b){"use strict";for(var c=0,d=a.length;d>c;c++)if(b===a[c])return c;return-1},this.createjs=this.createjs||{},function(){"use strict";createjs.proxy=function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,Array.prototype.slice.call(arguments,0).concat(c))}}}(),this.createjs=this.createjs||{},function(){"use strict";function BrowserDetect(){throw"BrowserDetect cannot be instantiated"}var a=BrowserDetect.agent=window.navigator.userAgent;BrowserDetect.isWindowPhone=a.indexOf("IEMobile")>-1||a.indexOf("Windows Phone")>-1,BrowserDetect.isFirefox=a.indexOf("Firefox")>-1,BrowserDetect.isOpera=null!=window.opera,BrowserDetect.isChrome=a.indexOf("Chrome")>-1,BrowserDetect.isIOS=(a.indexOf("iPod")>-1||a.indexOf("iPhone")>-1||a.indexOf("iPad")>-1)&&!BrowserDetect.isWindowPhone,BrowserDetect.isAndroid=a.indexOf("Android")>-1&&!BrowserDetect.isWindowPhone,BrowserDetect.isBlackberry=a.indexOf("Blackberry")>-1,createjs.BrowserDetect=BrowserDetect}(),this.createjs=this.createjs||{},function(){"use strict";function EventDispatcher(){this._listeners=null,this._captureListeners=null}var a=EventDispatcher.prototype;EventDispatcher.initialize=function(b){b.addEventListener=a.addEventListener,b.on=a.on,b.removeEventListener=b.off=a.removeEventListener,b.removeAllEventListeners=a.removeAllEventListeners,b.hasEventListener=a.hasEventListener,b.dispatchEvent=a.dispatchEvent,b._dispatchEvent=a._dispatchEvent,b.willTrigger=a.willTrigger},a.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},a.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},a.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},a.off=a.removeEventListener,a.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},a.dispatchEvent=function(a,b,c){if("string"==typeof a){var d=this._listeners;if(!(b||d&&d[a]))return!0;a=new createjs.Event(a,b,c)}else a.target&&a.clone&&(a=a.clone());try{a.target=this}catch(e){}if(a.bubbles&&this.parent){for(var f=this,g=[f];f.parent;)g.push(f=f.parent);var h,i=g.length;for(h=i-1;h>=0&&!a.propagationStopped;h--)g[h]._dispatchEvent(a,1+(0==h));for(h=1;i>h&&!a.propagationStopped;h++)g[h]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return!a.defaultPrevented},a.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},a.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1},a.toString=function(){return"[EventDispatcher]"},a._dispatchEvent=function(a,b){var c,d=1==b?this._captureListeners:this._listeners;if(a&&d){var e=d[a.type];if(!e||!(c=e.length))return;try{a.currentTarget=this}catch(f){}try{a.eventPhase=b}catch(f){}a.removed=!1,e=e.slice();for(var g=0;c>g&&!a.immediatePropagationStopped;g++){var h=e[g];h.handleEvent?h.handleEvent(a):h(a),a.removed&&(this.off(a.type,h,1==b),a.removed=!1)}}},createjs.EventDispatcher=EventDispatcher}(),this.createjs=this.createjs||{},function(){"use strict";function Event(a,b,c){this.type=a,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!b,this.cancelable=!!c,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var a=Event.prototype;a.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},a.stopPropagation=function(){this.propagationStopped=!0},a.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},a.remove=function(){this.removed=!0},a.clone=function(){return new Event(this.type,this.bubbles,this.cancelable)},a.set=function(a){for(var b in a)this[b]=a[b];return this},a.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=Event}(),this.createjs=this.createjs||{},function(){"use strict";function ErrorEvent(a,b,c){this.Event_constructor("error"),this.title=a,this.message=b,this.data=c}var a=createjs.extend(ErrorEvent,createjs.Event);a.clone=function(){return new createjs.ErrorEvent(this.title,this.message,this.data)},createjs.ErrorEvent=createjs.promote(ErrorEvent,"Event")}(),this.createjs=this.createjs||{},function(){"use strict";function ProgressEvent(a,b){this.Event_constructor("progress"),this.loaded=a,this.total=null==b?1:b,this.progress=0==b?0:this.loaded/this.total}var a=createjs.extend(ProgressEvent,createjs.Event);a.clone=function(){return new createjs.ProgressEvent(this.loaded,this.total)},createjs.ProgressEvent=createjs.promote(ProgressEvent,"Event")}(window),this.createjs=this.createjs||{},function(){"use strict";function LoadItem(){this.src=null,this.type=null,this.id=null,this.maintainOrder=!1,this.callback=null,this.data=null,this.method=createjs.LoadItem.GET,this.values=null,this.headers=null,this.withCredentials=!1,this.mimeType=null,this.crossOrigin=null,this.loadTimeout=b.LOAD_TIMEOUT_DEFAULT}var a=LoadItem.prototype={},b=LoadItem;b.LOAD_TIMEOUT_DEFAULT=8e3,b.create=function(a){if("string"==typeof a){var c=new LoadItem;return c.src=a,c}if(a instanceof b)return a;if(a instanceof Object&&a.src)return null==a.loadTimeout&&(a.loadTimeout=b.LOAD_TIMEOUT_DEFAULT),a;throw new Error("Type not recognized.")},a.set=function(a){for(var b in a)this[b]=a[b];return this},createjs.LoadItem=b}(),function(){var a={};a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[.\/]*?\//i,a.EXTENSION_PATT=/\/?[^\/]+\.(\w{1,5})$/i,a.parseURI=function(b){var c={absolute:!1,relative:!1};if(null==b)return c;var d=b.indexOf("?");d>-1&&(b=b.substr(0,d));var e;return a.ABSOLUTE_PATT.test(b)?c.absolute=!0:a.RELATIVE_PATT.test(b)&&(c.relative=!0),(e=b.match(a.EXTENSION_PATT))&&(c.extension=e[1].toLowerCase()),c},a.formatQueryString=function(a,b){if(null==a)throw new Error("You must specify data.");var c=[];for(var d in a)c.push(d+"="+escape(a[d]));return b&&(c=c.concat(b)),c.join("&")},a.buildPath=function(a,b){if(null==b)return a;var c=[],d=a.indexOf("?");if(-1!=d){var e=a.slice(d+1);c=c.concat(e.split("&"))}return-1!=d?a.slice(0,d)+"?"+this.formatQueryString(b,c):a+"?"+this.formatQueryString(b,c)},a.isCrossDomain=function(a){var b=document.createElement("a");b.href=a.src;var c=document.createElement("a");c.href=location.href;var d=""!=b.hostname&&(b.port!=c.port||b.protocol!=c.protocol||b.hostname!=c.hostname);return d},a.isLocal=function(a){var b=document.createElement("a");return b.href=a.src,""==b.hostname&&"file:"==b.protocol},a.isBinary=function(a){switch(a){case createjs.AbstractLoader.IMAGE:case createjs.AbstractLoader.BINARY:return!0;default:return!1}},a.isImageTag=function(a){return a instanceof HTMLImageElement},a.isAudioTag=function(a){return window.HTMLAudioElement?a instanceof HTMLAudioElement:!1},a.isVideoTag=function(a){return window.HTMLVideoElement?a instanceof HTMLVideoElement:!1},a.isText=function(a){switch(a){case createjs.AbstractLoader.TEXT:case createjs.AbstractLoader.JSON:case createjs.AbstractLoader.MANIFEST:case createjs.AbstractLoader.XML:case createjs.AbstractLoader.CSS:case createjs.AbstractLoader.SVG:case createjs.AbstractLoader.JAVASCRIPT:case createjs.AbstractLoader.SPRITESHEET:return!0;default:return!1}},a.getTypeByExtension=function(a){if(null==a)return createjs.AbstractLoader.TEXT;switch(a.toLowerCase()){case"jpeg":case"jpg":case"gif":case"png":case"webp":case"bmp":return createjs.AbstractLoader.IMAGE;case"ogg":case"mp3":case"webm":return createjs.AbstractLoader.SOUND;case"mp4":case"webm":case"ts":return createjs.AbstractLoader.VIDEO;case"json":return createjs.AbstractLoader.JSON;case"xml":return createjs.AbstractLoader.XML;case"css":return createjs.AbstractLoader.CSS;case"js":return createjs.AbstractLoader.JAVASCRIPT;case"svg":return createjs.AbstractLoader.SVG;default:return createjs.AbstractLoader.TEXT}},createjs.RequestUtils=a}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractLoader(a,b,c){this.EventDispatcher_constructor(),this.loaded=!1,this.canceled=!1,this.progress=0,this.type=c,this.resultFormatter=null,this._item=a?createjs.LoadItem.create(a):null,this._preferXHR=b,this._result=null,this._rawResult=null,this._loadedItems=null,this._tagSrcAttribute=null,this._tag=null}var a=createjs.extend(AbstractLoader,createjs.EventDispatcher),b=AbstractLoader;b.POST="POST",b.GET="GET",b.BINARY="binary",b.CSS="css",b.IMAGE="image",b.JAVASCRIPT="javascript",b.JSON="json",b.JSONP="jsonp",b.MANIFEST="manifest",b.SOUND="sound",b.VIDEO="video",b.SPRITESHEET="spritesheet",b.SVG="svg",b.TEXT="text",b.XML="xml",a.getItem=function(){return this._item},a.getResult=function(a){return a?this._rawResult:this._result},a.getTag=function(){return this._tag},a.setTag=function(a){this._tag=a},a.load=function(){this._createRequest(),this._request.on("complete",this,this),this._request.on("progress",this,this),this._request.on("loadStart",this,this),this._request.on("abort",this,this),this._request.on("timeout",this,this),this._request.on("error",this,this);var a=new createjs.Event("initialize");a.loader=this._request,this.dispatchEvent(a),this._request.load()},a.cancel=function(){this.canceled=!0,this.destroy()},a.destroy=function(){this._request&&(this._request.removeAllEventListeners(),this._request.destroy()),this._request=null,this._item=null,this._rawResult=null,this._result=null,this._loadItems=null,this.removeAllEventListeners()},a.getLoadedItems=function(){return this._loadedItems},a._createRequest=function(){this._request=this._preferXHR?new createjs.XHRRequest(this._item):new createjs.TagRequest(this._item,this._tag||this._createTag(),this._tagSrcAttribute)},a._createTag=function(){return null},a._sendLoadStart=function(){this._isCanceled()||this.dispatchEvent("loadstart")},a._sendProgress=function(a){if(!this._isCanceled()){var b=null;"number"==typeof a?(this.progress=a,b=new createjs.ProgressEvent(this.progress)):(b=a,this.progress=a.loaded/a.total,b.progress=this.progress,(isNaN(this.progress)||1/0==this.progress)&&(this.progress=0)),this.hasEventListener("progress")&&this.dispatchEvent(b)}},a._sendComplete=function(){if(!this._isCanceled()){this.loaded=!0;var a=new createjs.Event("complete");a.rawResult=this._rawResult,null!=this._result&&(a.result=this._result),this.dispatchEvent(a)}},a._sendError=function(a){!this._isCanceled()&&this.hasEventListener("error")&&(null==a&&(a=new createjs.ErrorEvent("PRELOAD_ERROR_EMPTY")),this.dispatchEvent(a))},a._isCanceled=function(){return null==window.createjs||this.canceled?!0:!1},a.resultFormatter=null,a.handleEvent=function(a){switch(a.type){case"complete":this._rawResult=a.target._response;var b=this.resultFormatter&&this.resultFormatter(this);b instanceof Function?b.call(this,createjs.proxy(this._resultFormatSuccess,this),createjs.proxy(this._resultFormatFailed,this)):(this._result=b||this._rawResult,this._sendComplete());break;case"progress":this._sendProgress(a);break;case"error":this._sendError(a);break;case"loadstart":this._sendLoadStart();break;case"abort":case"timeout":this._isCanceled()||this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_"+a.type.toUpperCase()+"_ERROR"))}},a._resultFormatSuccess=function(a){this._result=a,this._sendComplete()},a._resultFormatFailed=function(a){this._sendError(a)},a.buildPath=function(a,b){return createjs.RequestUtils.buildPath(a,b)},a.toString=function(){return"[PreloadJS AbstractLoader]"},createjs.AbstractLoader=createjs.promote(AbstractLoader,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractMediaLoader(a,b,c){this.AbstractLoader_constructor(a,b,c),this.resultFormatter=this._formatResult,this._tagSrcAttribute="src",this.on("initialize",this._updateXHR,this)}var a=createjs.extend(AbstractMediaLoader,createjs.AbstractLoader);a.load=function(){this._tag||(this._tag=this._createTag(this._item.src)),this._tag.preload="auto",this._tag.load(),this.AbstractLoader_load()},a._createTag=function(){},a._createRequest=function(){this._request=this._preferXHR?new createjs.XHRRequest(this._item):new createjs.MediaTagRequest(this._item,this._tag||this._createTag(),this._tagSrcAttribute)},a._updateXHR=function(a){a.loader.setResponseType&&a.loader.setResponseType("blob")},a._formatResult=function(a){if(this._tag.removeEventListener&&this._tag.removeEventListener("canplaythrough",this._loadedHandler),this._tag.onstalled=null,this._preferXHR){var b=window.URL||window.webkitURL,c=a.getResult(!0);a.getTag().src=b.createObjectURL(c)}return a.getTag()},createjs.AbstractMediaLoader=createjs.promote(AbstractMediaLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";var AbstractRequest=function(a){this._item=a},a=createjs.extend(AbstractRequest,createjs.EventDispatcher);a.load=function(){},a.destroy=function(){},a.cancel=function(){},createjs.AbstractRequest=createjs.promote(AbstractRequest,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function TagRequest(a,b,c){this.AbstractRequest_constructor(a),this._tag=b,this._tagSrcAttribute=c,this._loadedHandler=createjs.proxy(this._handleTagComplete,this),this._addedToDOM=!1,this._startTagVisibility=null}var a=createjs.extend(TagRequest,createjs.AbstractRequest);a.load=function(){this._tag.onload=createjs.proxy(this._handleTagComplete,this),this._tag.onreadystatechange=createjs.proxy(this._handleReadyStateChange,this),this._tag.onerror=createjs.proxy(this._handleError,this);var a=new createjs.Event("initialize");a.loader=this._tag,this.dispatchEvent(a),this._hideTag(),this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout),this._tag[this._tagSrcAttribute]=this._item.src,null==this._tag.parentNode&&(window.document.body.appendChild(this._tag),this._addedToDOM=!0)},a.destroy=function(){this._clean(),this._tag=null,this.AbstractRequest_destroy()},a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this._tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleTagComplete()},a._handleError=function(){this._clean(),this.dispatchEvent("error")},a._handleTagComplete=function(){this._rawResult=this._tag,this._result=this.resultFormatter&&this.resultFormatter(this)||this._rawResult,this._clean(),this._showTag(),this.dispatchEvent("complete")},a._handleTimeout=function(){this._clean(),this.dispatchEvent(new createjs.Event("timeout"))},a._clean=function(){this._tag.onload=null,this._tag.onreadystatechange=null,this._tag.onerror=null,this._addedToDOM&&null!=this._tag.parentNode&&this._tag.parentNode.removeChild(this._tag),clearTimeout(this._loadTimeout)},a._hideTag=function(){this._startTagVisibility=this._tag.style.visibility,this._tag.style.visibility="hidden"},a._showTag=function(){this._tag.style.visibility=this._startTagVisibility},a._handleStalled=function(){},createjs.TagRequest=createjs.promote(TagRequest,"AbstractRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function MediaTagRequest(a,b,c){this.AbstractRequest_constructor(a),this._tag=b,this._tagSrcAttribute=c,this._loadedHandler=createjs.proxy(this._handleTagComplete,this)}var a=createjs.extend(MediaTagRequest,createjs.TagRequest);a.load=function(){var a=createjs.proxy(this._handleStalled,this);this._stalledCallback=a;var b=createjs.proxy(this._handleProgress,this);this._handleProgress=b,this._tag.addEventListener("stalled",a),this._tag.addEventListener("progress",b),this._tag.addEventListener&&this._tag.addEventListener("canplaythrough",this._loadedHandler,!1),this.TagRequest_load()},a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this._tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleTagComplete()},a._handleStalled=function(){},a._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.ProgressEvent(a.loaded,a.total);this.dispatchEvent(b)}},a._clean=function(){this._tag.removeEventListener&&this._tag.removeEventListener("canplaythrough",this._loadedHandler),this._tag.removeEventListener("stalled",this._stalledCallback),this._tag.removeEventListener("progress",this._progressCallback),this.TagRequest__clean()},createjs.MediaTagRequest=createjs.promote(MediaTagRequest,"TagRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function XHRRequest(a){this.AbstractRequest_constructor(a),this._request=null,this._loadTimeout=null,this._xhrLevel=1,this._response=null,this._rawResponse=null,this._canceled=!1,this._handleLoadStartProxy=createjs.proxy(this._handleLoadStart,this),this._handleProgressProxy=createjs.proxy(this._handleProgress,this),this._handleAbortProxy=createjs.proxy(this._handleAbort,this),this._handleErrorProxy=createjs.proxy(this._handleError,this),this._handleTimeoutProxy=createjs.proxy(this._handleTimeout,this),this._handleLoadProxy=createjs.proxy(this._handleLoad,this),this._handleReadyStateChangeProxy=createjs.proxy(this._handleReadyStateChange,this),!this._createXHR(a)}var a=createjs.extend(XHRRequest,createjs.AbstractRequest);XHRRequest.ACTIVEX_VERSIONS=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],a.getResult=function(a){return a&&this._rawResponse?this._rawResponse:this._response},a.cancel=function(){this.canceled=!0,this._clean(),this._request.abort()},a.load=function(){if(null==this._request)return void this._handleError();null!=this._request.addEventListener?(this._request.addEventListener("loadstart",this._handleLoadStartProxy,!1),this._request.addEventListener("progress",this._handleProgressProxy,!1),this._request.addEventListener("abort",this._handleAbortProxy,!1),this._request.addEventListener("error",this._handleErrorProxy,!1),this._request.addEventListener("timeout",this._handleTimeoutProxy,!1),this._request.addEventListener("load",this._handleLoadProxy,!1),this._request.addEventListener("readystatechange",this._handleReadyStateChangeProxy,!1)):(this._request.onloadstart=this._handleLoadStartProxy,this._request.onprogress=this._handleProgressProxy,this._request.onabort=this._handleAbortProxy,this._request.onerror=this._handleErrorProxy,this._request.ontimeout=this._handleTimeoutProxy,this._request.onload=this._handleLoadProxy,this._request.onreadystatechange=this._handleReadyStateChangeProxy),1==this._xhrLevel&&(this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout));try{this._item.values&&this._item.method!=createjs.AbstractLoader.GET?this._item.method==createjs.AbstractLoader.POST&&this._request.send(createjs.RequestUtils.formatQueryString(this._item.values)):this._request.send()}catch(a){this.dispatchEvent(new createjs.ErrorEvent("XHR_SEND",null,a))}},a.setResponseType=function(a){"blob"===a&&(a=window.URL?"blob":"arraybuffer",this._responseType=a),this._request.responseType=a},a.getAllResponseHeaders=function(){return this._request.getAllResponseHeaders instanceof Function?this._request.getAllResponseHeaders():null},a.getResponseHeader=function(a){return this._request.getResponseHeader instanceof Function?this._request.getResponseHeader(a):null},a._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.ProgressEvent(a.loaded,a.total);this.dispatchEvent(b)}},a._handleLoadStart=function(){clearTimeout(this._loadTimeout),this.dispatchEvent("loadstart")},a._handleAbort=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent("XHR_ABORTED",null,a))},a._handleError=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent(a.message))},a._handleReadyStateChange=function(){4==this._request.readyState&&this._handleLoad()},a._handleLoad=function(){if(!this.loaded){this.loaded=!0;var a=this._checkError();if(a)return void this._handleError(a);if(this._response=this._getResponse(),"arraybuffer"===this._responseType)try{this._response=new Blob([this._response])}catch(b){if(window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,"TypeError"===b.name&&window.BlobBuilder){var c=new BlobBuilder;c.append(this._response),this._response=c.getBlob()}}this._clean(),this.dispatchEvent(new createjs.Event("complete"))}},a._handleTimeout=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_TIMEOUT",null,a))},a._checkError=function(){var a=parseInt(this._request.status);switch(a){case 404:case 0:return new Error(a)}return null},a._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(a){}return null},a._createXHR=function(a){var b=createjs.RequestUtils.isCrossDomain(a),c={},d=null;if(window.XMLHttpRequest)d=new XMLHttpRequest,b&&void 0===d.withCredentials&&window.XDomainRequest&&(d=new XDomainRequest);else{for(var e=0,f=s.ACTIVEX_VERSIONS.length;f>e;e++){var g=s.ACTIVEX_VERSIONS[e];try{d=new ActiveXObject(g);break}catch(h){}}if(null==d)return!1}null==a.mimeType&&createjs.RequestUtils.isText(a.type)&&(a.mimeType="text/plain; charset=utf-8"),a.mimeType&&d.overrideMimeType&&d.overrideMimeType(a.mimeType),this._xhrLevel="string"==typeof d.responseType?2:1;var i=null;if(i=a.method==createjs.AbstractLoader.GET?createjs.RequestUtils.buildPath(a.src,a.values):a.src,d.open(a.method||createjs.AbstractLoader.GET,i,!0),b&&d instanceof XMLHttpRequest&&1==this._xhrLevel&&(c.Origin=location.origin),a.values&&a.method==createjs.AbstractLoader.POST&&(c["Content-Type"]="application/x-www-form-urlencoded"),b||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest"),a.headers)for(var j in a.headers)c[j]=a.headers[j];for(j in c)d.setRequestHeader(j,c[j]);return d instanceof XMLHttpRequest&&void 0!==a.withCredentials&&(d.withCredentials=a.withCredentials),this._request=d,!0},a._clean=function(){clearTimeout(this._loadTimeout),null!=this._request.removeEventListener?(this._request.removeEventListener("loadstart",this._handleLoadStartProxy),this._request.removeEventListener("progress",this._handleProgressProxy),this._request.removeEventListener("abort",this._handleAbortProxy),this._request.removeEventListener("error",this._handleErrorProxy),this._request.removeEventListener("timeout",this._handleTimeoutProxy),this._request.removeEventListener("load",this._handleLoadProxy),this._request.removeEventListener("readystatechange",this._handleReadyStateChangeProxy)):(this._request.onloadstart=null,this._request.onprogress=null,this._request.onabort=null,this._request.onerror=null,this._request.ontimeout=null,this._request.onload=null,this._request.onreadystatechange=null)},a.toString=function(){return"[PreloadJS XHRRequest]"},createjs.XHRRequest=createjs.promote(XHRRequest,"AbstractRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function SoundLoader(a,b){this.AbstractMediaLoader_constructor(a,b,createjs.AbstractLoader.SOUND),createjs.RequestUtils.isAudioTag(a)?this._tag=a:createjs.RequestUtils.isAudioTag(a.src)?this._tag=a:createjs.RequestUtils.isAudioTag(a.tag)&&(this._tag=createjs.RequestUtils.isAudioTag(a)?a:a.src),null!=this._tag&&(this._preferXHR=!1)}var a=createjs.extend(SoundLoader,createjs.AbstractMediaLoader),b=SoundLoader;b.canLoadItem=function(a){return a.type==createjs.AbstractLoader.SOUND},a._createTag=function(a){var b=document.createElement("audio");return b.autoplay=!1,b.preload="none",b.src=a,b},createjs.SoundLoader=createjs.promote(SoundLoader,"AbstractMediaLoader")}(),this.createjs=this.createjs||{},function(){"use strict";var PlayPropsConfig=function(){this.interrupt=null,this.delay=null,this.offset=null,this.loop=null,this.volume=null,this.pan=null,this.startTime=null,this.duration=null},a=PlayPropsConfig.prototype={},b=PlayPropsConfig;b.create=function(a){if(a instanceof b||a instanceof Object){var c=new createjs.PlayPropsConfig;return c.set(a),c}throw new Error("Type not recognized.")},a.set=function(a){for(var b in a)this[b]=a[b];return this},a.toString=function(){return"[PlayPropsConfig]"},createjs.PlayPropsConfig=b}(),this.createjs=this.createjs||{},function(){"use strict";function Sound(){throw"Sound cannot be instantiated"}function a(a,b){this.init(a,b)}var b=Sound;b.INTERRUPT_ANY="any",b.INTERRUPT_EARLY="early",b.INTERRUPT_LATE="late",b.INTERRUPT_NONE="none",b.PLAY_INITED="playInited",b.PLAY_SUCCEEDED="playSucceeded",b.PLAY_INTERRUPTED="playInterrupted",b.PLAY_FINISHED="playFinished",b.PLAY_FAILED="playFailed",b.SUPPORTED_EXTENSIONS=["mp3","ogg","opus","mpeg","wav","m4a","mp4","aiff","wma","mid"],b.EXTENSION_MAP={m4a:"mp4"},b.FILE_PATTERN=/^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([\/.]*?(?:[^?]+)?\/)?((?:[^\/?]+)\.(\w+))(?:\?(\S+)?)?$/,b.defaultInterruptBehavior=b.INTERRUPT_NONE,b.alternateExtensions=[],b.activePlugin=null,b._masterVolume=1,Object.defineProperty(b,"volume",{get:function(){return this._masterVolume},set:function(a){if(null==Number(a))return!1;if(a=Math.max(0,Math.min(1,a)),b._masterVolume=a,!this.activePlugin||!this.activePlugin.setVolume||!this.activePlugin.setVolume(a))for(var c=this._instances,d=0,e=c.length;e>d;d++)c[d].setMasterVolume(a)}}),b._masterMute=!1,Object.defineProperty(b,"muted",{get:function(){return this._masterMute},set:function(a){if(null==a)return!1;if(this._masterMute=a,!this.activePlugin||!this.activePlugin.setMute||!this.activePlugin.setMute(a))for(var b=this._instances,c=0,d=b.length;d>c;c++)b[c].setMasterMute(a);return!0}}),Object.defineProperty(b,"capabilities",{get:function(){return null==b.activePlugin?null:b.activePlugin._capabilities},set:function(){return!1}}),b._pluginsRegistered=!1,b._lastID=0,b._instances=[],b._idHash={},b._preloadHash={},b._defaultPlayPropsHash={},b.addEventListener=null,b.removeEventListener=null,b.removeAllEventListeners=null,b.dispatchEvent=null,b.hasEventListener=null,b._listeners=null,createjs.EventDispatcher.initialize(b),b.getPreloadHandlers=function(){return{callback:createjs.proxy(b.initLoad,b),types:["sound"],extensions:b.SUPPORTED_EXTENSIONS}},b._handleLoadComplete=function(a){var c=a.target.getItem().src;if(b._preloadHash[c])for(var d=0,e=b._preloadHash[c].length;e>d;d++){var f=b._preloadHash[c][d];if(b._preloadHash[c][d]=!0,b.hasEventListener("fileload")){var a=new createjs.Event("fileload");a.src=f.src,a.id=f.id,a.data=f.data,a.sprite=f.sprite,b.dispatchEvent(a)}}},b._handleLoadError=function(a){var c=a.target.getItem().src;if(b._preloadHash[c])for(var d=0,e=b._preloadHash[c].length;e>d;d++){var f=b._preloadHash[c][d];if(b._preloadHash[c][d]=!1,b.hasEventListener("fileerror")){var a=new createjs.Event("fileerror");a.src=f.src,a.id=f.id,a.data=f.data,a.sprite=f.sprite,b.dispatchEvent(a)}}},b._registerPlugin=function(a){return a.isSupported()?(b.activePlugin=new a,!0):!1},b.registerPlugins=function(a){b._pluginsRegistered=!0;for(var c=0,d=a.length;d>c;c++)if(b._registerPlugin(a[c]))return!0;return!1},b.initializeDefaultPlugins=function(){return null!=b.activePlugin?!0:b._pluginsRegistered?!1:b.registerPlugins([createjs.WebAudioPlugin,createjs.HTMLAudioPlugin])?!0:!1},b.isReady=function(){return null!=b.activePlugin},b.getCapabilities=function(){return null==b.activePlugin?null:b.activePlugin._capabilities},b.getCapability=function(a){return null==b.activePlugin?null:b.activePlugin._capabilities[a]},b.initLoad=function(a){return b._registerSound(a)},b._registerSound=function(c){if(!b.initializeDefaultPlugins())return!1;var d;if(c.src instanceof Object?(d=b._parseSrc(c.src),d.src=c.path+d.src):d=b._parsePath(c.src),null==d)return!1;c.src=d.src,c.type="sound";var e=c.data,f=null;if(null!=e&&(isNaN(e.channels)?isNaN(e)||(f=parseInt(e)):f=parseInt(e.channels),e.audioSprite))for(var g,h=e.audioSprite.length;h--;)g=e.audioSprite[h],b._idHash[g.id]={src:c.src,startTime:parseInt(g.startTime),duration:parseInt(g.duration)},g.defaultPlayProps&&(b._defaultPlayPropsHash[g.id]=createjs.PlayPropsConfig.create(g.defaultPlayProps));null!=c.id&&(b._idHash[c.id]={src:c.src});var i=b.activePlugin.register(c);return a.create(c.src,f),null!=e&&isNaN(e)?c.data.channels=f||a.maxPerChannel():c.data=f||a.maxPerChannel(),i.type&&(c.type=i.type),c.defaultPlayProps&&(b._defaultPlayPropsHash[c.src]=createjs.PlayPropsConfig.create(c.defaultPlayProps)),i},b.registerSound=function(a,c,d,e,f){var g={src:a,id:c,data:d,defaultPlayProps:f};a instanceof Object&&a.src&&(e=c,g=a),g=createjs.LoadItem.create(g),g.path=e,null==e||g.src instanceof Object||(g.src=e+a);var h=b._registerSound(g);if(!h)return!1;if(b._preloadHash[g.src]||(b._preloadHash[g.src]=[]),b._preloadHash[g.src].push(g),1==b._preloadHash[g.src].length)h.on("complete",createjs.proxy(this._handleLoadComplete,this)),h.on("error",createjs.proxy(this._handleLoadError,this)),b.activePlugin.preload(h);else if(1==b._preloadHash[g.src][0])return!0;return g},b.registerSounds=function(a,b){var c=[];a.path&&(b?b+=a.path:b=a.path,a=a.manifest);for(var d=0,e=a.length;e>d;d++)c[d]=createjs.Sound.registerSound(a[d].src,a[d].id,a[d].data,b,a[d].defaultPlayProps);return c},b.removeSound=function(c,d){if(null==b.activePlugin)return!1;c instanceof Object&&c.src&&(c=c.src);var e;if(c instanceof Object?e=b._parseSrc(c):(c=b._getSrcById(c).src,e=b._parsePath(c)),null==e)return!1;c=e.src,null!=d&&(c=d+c);for(var f in b._idHash)b._idHash[f].src==c&&delete b._idHash[f];return a.removeSrc(c),delete b._preloadHash[c],b.activePlugin.removeSound(c),!0},b.removeSounds=function(a,b){var c=[];a.path&&(b?b+=a.path:b=a.path,a=a.manifest);for(var d=0,e=a.length;e>d;d++)c[d]=createjs.Sound.removeSound(a[d].src,b);return c},b.removeAllSounds=function(){b._idHash={},b._preloadHash={},a.removeAll(),b.activePlugin&&b.activePlugin.removeAllSounds()},b.loadComplete=function(a){if(!b.isReady())return!1;var c=b._parsePath(a);return a=c?b._getSrcById(c.src).src:b._getSrcById(a).src,void 0==b._preloadHash[a]?!1:1==b._preloadHash[a][0]},b._parsePath=function(a){"string"!=typeof a&&(a=a.toString());var c=a.match(b.FILE_PATTERN);if(null==c)return!1;for(var d=c[4],e=c[5],f=b.capabilities,g=0;!f[e];)if(e=b.alternateExtensions[g++],g>b.alternateExtensions.length)return null;a=a.replace("."+c[5],"."+e);var h={name:d,src:a,extension:e};return h},b._parseSrc=function(a){var c={name:void 0,src:void 0,extension:void 0},d=b.capabilities;for(var e in a)if(a.hasOwnProperty(e)&&d[e]){c.src=a[e],c.extension=e;break}if(!c.src)return!1;var f=c.src.lastIndexOf("/");return c.name=-1!=f?c.src.slice(f+1):c.src,c},b.play=function(a,c,d,e,f,g,h,i,j){var k;k=createjs.PlayPropsConfig.create(c instanceof Object||c instanceof createjs.PlayPropsConfig?c:{interrupt:c,delay:d,offset:e,loop:f,volume:g,pan:h,startTime:i,duration:j});var l=b.createInstance(a,k.startTime,k.duration),m=b._playInstance(l,k);return m||l._playFailed(),l},b.createInstance=function(c,d,e){if(!b.initializeDefaultPlugins())return new createjs.DefaultSoundInstance(c,d,e);var f=b._defaultPlayPropsHash[c];c=b._getSrcById(c);var g=b._parsePath(c.src),h=null; -return null!=g&&null!=g.src?(a.create(g.src),null==d&&(d=c.startTime),h=b.activePlugin.create(g.src,d,e||c.duration),f=f||b._defaultPlayPropsHash[g.src],f&&h.applyPlayProps(f)):h=new createjs.DefaultSoundInstance(c,d,e),h.uniqueId=b._lastID++,h},b.stop=function(){for(var a=this._instances,b=a.length;b--;)a[b].stop()},b.setVolume=function(a){if(null==Number(a))return!1;if(a=Math.max(0,Math.min(1,a)),b._masterVolume=a,!this.activePlugin||!this.activePlugin.setVolume||!this.activePlugin.setVolume(a))for(var c=this._instances,d=0,e=c.length;e>d;d++)c[d].setMasterVolume(a)},b.getVolume=function(){return this._masterVolume},b.setMute=function(a){if(null==a)return!1;if(this._masterMute=a,!this.activePlugin||!this.activePlugin.setMute||!this.activePlugin.setMute(a))for(var b=this._instances,c=0,d=b.length;d>c;c++)b[c].setMasterMute(a);return!0},b.getMute=function(){return this._masterMute},b.setDefaultPlayProps=function(a,c){a=b._getSrcById(a),b._defaultPlayPropsHash[b._parsePath(a.src).src]=createjs.PlayPropsConfig.create(c)},b.getDefaultPlayProps=function(a){return a=b._getSrcById(a),b._defaultPlayPropsHash[b._parsePath(a.src).src]},b._playInstance=function(a,c){var d=b._defaultPlayPropsHash[a.src]||{};if(null==c.interrupt&&(c.interrupt=d.interrupt||b.defaultInterruptBehavior),null==c.delay&&(c.delay=d.delay||0),null==c.offset&&(c.offset=a.getPosition()),null==c.loop&&(c.loop=a.loop),null==c.volume&&(c.volume=a.volume),null==c.pan&&(c.pan=a.pan),0==c.delay){var e=b._beginPlaying(a,c);if(!e)return!1}else{var f=setTimeout(function(){b._beginPlaying(a,c)},c.delay);a.delayTimeoutId=f}return this._instances.push(a),!0},b._beginPlaying=function(b,c){if(!a.add(b,c.interrupt))return!1;var d=b._beginPlaying(c);if(!d){var e=createjs.indexOf(this._instances,b);return e>-1&&this._instances.splice(e,1),!1}return!0},b._getSrcById=function(a){return b._idHash[a]||{src:a}},b._playFinished=function(b){a.remove(b);var c=createjs.indexOf(this._instances,b);c>-1&&this._instances.splice(c,1)},createjs.Sound=Sound,a.channels={},a.create=function(b,c){var d=a.get(b);return null==d?(a.channels[b]=new a(b,c),!0):!1},a.removeSrc=function(b){var c=a.get(b);return null==c?!1:(c._removeAll(),delete a.channels[b],!0)},a.removeAll=function(){for(var b in a.channels)a.channels[b]._removeAll();a.channels={}},a.add=function(b,c){var d=a.get(b.src);return null==d?!1:d._add(b,c)},a.remove=function(b){var c=a.get(b.src);return null==c?!1:(c._remove(b),!0)},a.maxPerChannel=function(){return c.maxDefault},a.get=function(b){return a.channels[b]};var c=a.prototype;c.constructor=a,c.src=null,c.max=null,c.maxDefault=100,c.length=0,c.init=function(a,b){this.src=a,this.max=b||this.maxDefault,-1==this.max&&(this.max=this.maxDefault),this._instances=[]},c._get=function(a){return this._instances[a]},c._add=function(a,b){return this._getSlot(b,a)?(this._instances.push(a),this.length++,!0):!1},c._remove=function(a){var b=createjs.indexOf(this._instances,a);return-1==b?!1:(this._instances.splice(b,1),this.length--,!0)},c._removeAll=function(){for(var a=this.length-1;a>=0;a--)this._instances[a].stop()},c._getSlot=function(a){var b,c;if(a!=Sound.INTERRUPT_NONE&&(c=this._get(0),null==c))return!0;for(var d=0,e=this.max;e>d;d++){if(b=this._get(d),null==b)return!0;if(b.playState==Sound.PLAY_FINISHED||b.playState==Sound.PLAY_INTERRUPTED||b.playState==Sound.PLAY_FAILED){c=b;break}a!=Sound.INTERRUPT_NONE&&(a==Sound.INTERRUPT_EARLY&&b.getPosition()c.getPosition())&&(c=b)}return null!=c?(c._interrupt(),this._remove(c),!0):!1},c.toString=function(){return"[Sound SoundChannel]"}}(),this.createjs=this.createjs||{},function(){"use strict";var AbstractSoundInstance=function(a,b,c,d){this.EventDispatcher_constructor(),this.src=a,this.uniqueId=-1,this.playState=null,this.delayTimeoutId=null,this._volume=1,Object.defineProperty(this,"volume",{get:this.getVolume,set:this.setVolume}),this._pan=0,Object.defineProperty(this,"pan",{get:this.getPan,set:this.setPan}),this._startTime=Math.max(0,b||0),Object.defineProperty(this,"startTime",{get:this.getStartTime,set:this.setStartTime}),this._duration=Math.max(0,c||0),Object.defineProperty(this,"duration",{get:this.getDuration,set:this.setDuration}),this._playbackResource=null,Object.defineProperty(this,"playbackResource",{get:this.getPlaybackResource,set:this.setPlaybackResource}),d!==!1&&d!==!0&&this.setPlaybackResource(d),this._position=0,Object.defineProperty(this,"position",{get:this.getPosition,set:this.setPosition}),this._loop=0,Object.defineProperty(this,"loop",{get:this.getLoop,set:this.setLoop}),this._muted=!1,Object.defineProperty(this,"muted",{get:this.getMuted,set:this.setMuted}),this._paused=!1,Object.defineProperty(this,"paused",{get:this.getPaused,set:this.setPaused})},a=createjs.extend(AbstractSoundInstance,createjs.EventDispatcher);a.play=function(a,b,c,d,e,f){var g;return g=createjs.PlayPropsConfig.create(a instanceof Object||a instanceof createjs.PlayPropsConfig?a:{interrupt:a,delay:b,offset:c,loop:d,volume:e,pan:f}),this.playState==createjs.Sound.PLAY_SUCCEEDED?(this.applyPlayProps(g),void(this._paused&&this.setPaused(!1))):(this._cleanUp(),createjs.Sound._playInstance(this,g),this)},a.stop=function(){return this._position=0,this._paused=!1,this._handleStop(),this._cleanUp(),this.playState=createjs.Sound.PLAY_FINISHED,this},a.destroy=function(){this._cleanUp(),this.src=null,this.playbackResource=null,this.removeAllEventListeners()},a.applyPlayProps=function(a){return null!=a.offset&&this.setPosition(a.offset),null!=a.loop&&this.setLoop(a.loop),null!=a.volume&&this.setVolume(a.volume),null!=a.pan&&this.setPan(a.pan),null!=a.startTime&&(this.setStartTime(a.startTime),this.setDuration(a.duration)),this},a.toString=function(){return"[AbstractSoundInstance]"},a.getPaused=function(){return this._paused},a.setPaused=function(a){return a!==!0&&a!==!1||this._paused==a||1==a&&this.playState!=createjs.Sound.PLAY_SUCCEEDED?void 0:(this._paused=a,a?this._pause():this._resume(),clearTimeout(this.delayTimeoutId),this)},a.setVolume=function(a){return a==this._volume?this:(this._volume=Math.max(0,Math.min(1,a)),this._muted||this._updateVolume(),this)},a.getVolume=function(){return this._volume},a.setMuted=function(a){return a===!0||a===!1?(this._muted=a,this._updateVolume(),this):void 0},a.getMuted=function(){return this._muted},a.setPan=function(a){return a==this._pan?this:(this._pan=Math.max(-1,Math.min(1,a)),this._updatePan(),this)},a.getPan=function(){return this._pan},a.getPosition=function(){return this._paused||this.playState!=createjs.Sound.PLAY_SUCCEEDED||(this._position=this._calculateCurrentPosition()),this._position},a.setPosition=function(a){return this._position=Math.max(0,a),this.playState==createjs.Sound.PLAY_SUCCEEDED&&this._updatePosition(),this},a.getStartTime=function(){return this._startTime},a.setStartTime=function(a){return a==this._startTime?this:(this._startTime=Math.max(0,a||0),this._updateStartTime(),this)},a.getDuration=function(){return this._duration},a.setDuration=function(a){return a==this._duration?this:(this._duration=Math.max(0,a||0),this._updateDuration(),this)},a.setPlaybackResource=function(a){return this._playbackResource=a,0==this._duration&&this._setDurationFromSource(),this},a.getPlaybackResource=function(){return this._playbackResource},a.getLoop=function(){return this._loop},a.setLoop=function(a){null!=this._playbackResource&&(0!=this._loop&&0==a?this._removeLooping(a):0==this._loop&&0!=a&&this._addLooping(a)),this._loop=a},a._sendEvent=function(a){var b=new createjs.Event(a);this.dispatchEvent(b)},a._cleanUp=function(){clearTimeout(this.delayTimeoutId),this._handleCleanUp(),this._paused=!1,createjs.Sound._playFinished(this)},a._interrupt=function(){this._cleanUp(),this.playState=createjs.Sound.PLAY_INTERRUPTED,this._sendEvent("interrupted")},a._beginPlaying=function(a){return this.setPosition(a.offset),this.setLoop(a.loop),this.setVolume(a.volume),this.setPan(a.pan),null!=a.startTime&&(this.setStartTime(a.startTime),this.setDuration(a.duration)),null!=this._playbackResource&&this._positionc;c++){var e=this._soundInstances[b][c];e.setPlaybackResource(this._audioSources[b])}},a._handlePreloadError=function(){},a._updateVolume=function(){},createjs.AbstractPlugin=AbstractPlugin}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.AbstractLoader_constructor(a,!0,createjs.AbstractLoader.SOUND)}var b=createjs.extend(a,createjs.AbstractLoader);a.context=null,b.toString=function(){return"[WebAudioLoader]"},b._createRequest=function(){this._request=new createjs.XHRRequest(this._item,!1),this._request.setResponseType("arraybuffer")},b._sendComplete=function(){a.context.decodeAudioData(this._rawResult,createjs.proxy(this._handleAudioDecoded,this),createjs.proxy(this._sendError,this))},b._handleAudioDecoded=function(a){this._result=a,this.AbstractLoader__sendComplete()},createjs.WebAudioLoader=createjs.promote(a,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function WebAudioSoundInstance(a,c,d,e){this.AbstractSoundInstance_constructor(a,c,d,e),this.gainNode=b.context.createGain(),this.panNode=b.context.createPanner(),this.panNode.panningModel=b._panningModel,this.panNode.connect(this.gainNode),this._updatePan(),this.sourceNode=null,this._soundCompleteTimeout=null,this._sourceNodeNext=null,this._playbackStartTime=0,this._endedHandler=createjs.proxy(this._handleSoundComplete,this)}var a=createjs.extend(WebAudioSoundInstance,createjs.AbstractSoundInstance),b=WebAudioSoundInstance;b.context=null,b._scratchBuffer=null,b.destinationNode=null,b._panningModel="equalpower",a.destroy=function(){this.AbstractSoundInstance_destroy(),this.panNode.disconnect(0),this.panNode=null,this.gainNode.disconnect(0),this.gainNode=null},a.toString=function(){return"[WebAudioSoundInstance]"},a._updatePan=function(){this.panNode.setPosition(this._pan,0,-.5)},a._removeLooping=function(){this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext)},a._addLooping=function(){this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0))},a._setDurationFromSource=function(){this._duration=1e3*this.playbackResource.duration},a._handleCleanUp=function(){this.sourceNode&&this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext)),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(0),clearTimeout(this._soundCompleteTimeout),this._playbackStartTime=0},a._cleanUpAudioNode=function(a){if(a){a.stop(0),a.disconnect(0);try{a.buffer=b._scratchBuffer}catch(c){}a=null}return a},a._handleSoundReady=function(){this.gainNode.connect(b.destinationNode);var a=.001*this._duration,c=.001*this._position;c>a&&(c=a),this.sourceNode=this._createAndPlayAudioNode(b.context.currentTime-a,c),this._playbackStartTime=this.sourceNode.startTime-c,this._soundCompleteTimeout=setTimeout(this._endedHandler,1e3*(a-c)),0!=this._loop&&(this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0))},a._createAndPlayAudioNode=function(a,c){var d=b.context.createBufferSource();d.buffer=this.playbackResource,d.connect(this.panNode);var e=.001*this._duration;return d.startTime=a+e,d.start(d.startTime,c+.001*this._startTime,e-c),d},a._pause=function(){this._position=1e3*(b.context.currentTime-this._playbackStartTime),this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(0),clearTimeout(this._soundCompleteTimeout)},a._resume=function(){this._handleSoundReady()},a._updateVolume=function(){var a=this._muted?0:this._volume;a!=this.gainNode.gain.value&&(this.gainNode.gain.value=a)},a._calculateCurrentPosition=function(){return 1e3*(b.context.currentTime-this._playbackStartTime)},a._updatePosition=function(){this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext),clearTimeout(this._soundCompleteTimeout),this._paused||this._handleSoundReady()},a._handleLoop=function(){this._cleanUpAudioNode(this.sourceNode),this.sourceNode=this._sourceNodeNext,this._playbackStartTime=this.sourceNode.startTime,this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0),this._soundCompleteTimeout=setTimeout(this._endedHandler,this._duration)},a._updateDuration=function(){this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._pause(),this._resume())},createjs.WebAudioSoundInstance=createjs.promote(WebAudioSoundInstance,"AbstractSoundInstance")}(),this.createjs=this.createjs||{},function(){"use strict";function WebAudioPlugin(){this.AbstractPlugin_constructor(),this._panningModel=b._panningModel,this.context=b.context,this.dynamicsCompressorNode=this.context.createDynamicsCompressor(),this.dynamicsCompressorNode.connect(this.context.destination),this.gainNode=this.context.createGain(),this.gainNode.connect(this.dynamicsCompressorNode),createjs.WebAudioSoundInstance.destinationNode=this.gainNode,this._capabilities=b._capabilities,this._loaderClass=createjs.WebAudioLoader,this._soundInstanceClass=createjs.WebAudioSoundInstance,this._addPropsToClasses()}var a=createjs.extend(WebAudioPlugin,createjs.AbstractPlugin),b=WebAudioPlugin;b._capabilities=null,b._panningModel="equalpower",b.context=null,b._scratchBuffer=null,b._unlocked=!1,b.isSupported=function(){var a=createjs.BrowserDetect.isIOS||createjs.BrowserDetect.isAndroid||createjs.BrowserDetect.isBlackberry;return"file:"!=location.protocol||a||this._isFileXHRSupported()?(b._generateCapabilities(),null==b.context?!1:!0):!1},b.playEmptySound=function(){if(null!=b.context){var a=b.context.createBufferSource();a.buffer=b._scratchBuffer,a.connect(b.context.destination),a.start(0,0,0)}},b._isFileXHRSupported=function(){var a=!0,b=new XMLHttpRequest;try{b.open("GET","WebAudioPluginTest.fail",!1)}catch(c){return a=!1}b.onerror=function(){a=!1},b.onload=function(){a=404==this.status||200==this.status||0==this.status&&""!=this.response};try{b.send()}catch(c){a=!1}return a},b._generateCapabilities=function(){if(null==b._capabilities){var a=document.createElement("audio");if(null==a.canPlayType)return null;if(null==b.context)if(window.AudioContext)b.context=new AudioContext;else{if(!window.webkitAudioContext)return null;b.context=new webkitAudioContext}null==b._scratchBuffer&&(b._scratchBuffer=b.context.createBuffer(1,1,22050)),b._compatibilitySetUp(),"ontouchstart"in window&&"running"!=b.context.state&&(b._unlock(),document.addEventListener("mousedown",b._unlock,!0),document.addEventListener("touchend",b._unlock,!0)),b._capabilities={panning:!0,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}b.context.destination.numberOfChannels<2&&(b._capabilities.panning=!1)}},b._compatibilitySetUp=function(){if(b._panningModel="equalpower",!b.context.createGain){b.context.createGain=b.context.createGainNode;var a=b.context.createBufferSource();a.__proto__.start=a.__proto__.noteGrainOn,a.__proto__.stop=a.__proto__.noteOff,b._panningModel=0}},b._unlock=function(){b._unlocked||(b.playEmptySound(),"running"==b.context.state&&(document.removeEventListener("mousedown",b._unlock,!0),document.removeEventListener("touchend",b._unlock,!0),b._unlocked=!0))},a.toString=function(){return"[WebAudioPlugin]"},a._addPropsToClasses=function(){var a=this._soundInstanceClass;a.context=this.context,a._scratchBuffer=b._scratchBuffer,a.destinationNode=this.gainNode,a._panningModel=this._panningModel,this._loaderClass.context=this.context},a._updateVolume=function(){var a=createjs.Sound._masterMute?0:this._volume;a!=this.gainNode.gain.value&&(this.gainNode.gain.value=a)},createjs.WebAudioPlugin=createjs.promote(WebAudioPlugin,"AbstractPlugin")}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioTagPool(){throw"HTMLAudioTagPool cannot be instantiated"}function a(){this._tags=[]}var b=HTMLAudioTagPool;b._tags={},b._tagPool=new a,b._tagUsed={},b.get=function(a){var c=b._tags[a];return null==c?(c=b._tags[a]=b._tagPool.get(),c.src=a):b._tagUsed[a]?(c=b._tagPool.get(),c.src=a):b._tagUsed[a]=!0,c},b.set=function(a,c){c==b._tags[a]?b._tagUsed[a]=!1:b._tagPool.set(c)},b.remove=function(a){var c=b._tags[a];return null==c?!1:(b._tagPool.set(c),delete b._tags[a],delete b._tagUsed[a],!0)},b.getDuration=function(a){var c=b._tags[a];return null!=c&&c.duration?1e3*c.duration:0},createjs.HTMLAudioTagPool=HTMLAudioTagPool;var c=a.prototype;c.constructor=a,c.get=function(){var a;return a=0==this._tags.length?this._createTag():this._tags.pop(),null==a.parentNode&&document.body.appendChild(a),a},c.set=function(a){var b=createjs.indexOf(this._tags,a);-1==b&&(this._tags.src=null,this._tags.push(a))},c.toString=function(){return"[TagPool]"},c._createTag=function(){var a=document.createElement("audio");return a.autoplay=!1,a.preload="none",a}}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioSoundInstance(a,b,c,d){this.AbstractSoundInstance_constructor(a,b,c,d),this._audioSpriteStopTime=null,this._delayTimeoutId=null,this._endedHandler=createjs.proxy(this._handleSoundComplete,this),this._readyHandler=createjs.proxy(this._handleTagReady,this),this._stalledHandler=createjs.proxy(this._playFailed,this),this._audioSpriteEndHandler=createjs.proxy(this._handleAudioSpriteLoop,this),this._loopHandler=createjs.proxy(this._handleSoundComplete,this),c?this._audioSpriteStopTime=.001*(b+c):this._duration=createjs.HTMLAudioTagPool.getDuration(this.src)}var a=createjs.extend(HTMLAudioSoundInstance,createjs.AbstractSoundInstance);a.setMasterVolume=function(){this._updateVolume()},a.setMasterMute=function(){this._updateVolume()},a.toString=function(){return"[HTMLAudioSoundInstance]"},a._removeLooping=function(){null!=this._playbackResource&&(this._playbackResource.loop=!1,this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._addLooping=function(){null==this._playbackResource||this._audioSpriteStopTime||(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.loop=!0)},a._handleCleanUp=function(){var a=this._playbackResource;if(null!=a){a.pause(),a.loop=!1,a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1);try{a.currentTime=this._startTime}catch(b){}createjs.HTMLAudioTagPool.set(this.src,a),this._playbackResource=null}},a._beginPlaying=function(a){return this._playbackResource=createjs.HTMLAudioTagPool.get(this.src),this.AbstractSoundInstance__beginPlaying(a)},a._handleSoundReady=function(){if(4!==this._playbackResource.readyState){var a=this._playbackResource;return a.addEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),a.addEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),a.preload="auto",void a.load()}this._updateVolume(),this._playbackResource.currentTime=.001*(this._startTime+this._position),this._audioSpriteStopTime?this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1):(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),0!=this._loop&&(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.loop=!0)),this._playbackResource.play()},a._handleTagReady=function(){this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),this._handleSoundReady()},a._pause=function(){this._playbackResource.pause()},a._resume=function(){this._playbackResource.play()},a._updateVolume=function(){if(null!=this._playbackResource){var a=this._muted||createjs.Sound._masterMute?0:this._volume*createjs.Sound._masterVolume;a!=this._playbackResource.volume&&(this._playbackResource.volume=a)}},a._calculateCurrentPosition=function(){return 1e3*this._playbackResource.currentTime-this._startTime},a._updatePosition=function(){this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._handleSetPositionSeek,!1);try{this._playbackResource.currentTime=.001*(this._position+this._startTime)}catch(a){this._handleSetPositionSeek(null)}},a._handleSetPositionSeek=function(){null!=this._playbackResource&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._handleSetPositionSeek,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._handleAudioSpriteLoop=function(){this._playbackResource.currentTime<=this._audioSpriteStopTime||(this._playbackResource.pause(),0==this._loop?this._handleSoundComplete(null):(this._position=0,this._loop--,this._playbackResource.currentTime=.001*this._startTime,this._paused||this._playbackResource.play(),this._sendEvent("loop")))},a._handleLoop=function(){0==this._loop&&(this._playbackResource.loop=!1,this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._updateStartTime=function(){this._audioSpriteStopTime=.001*(this._startTime+this._duration),this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1))},a._updateDuration=function(){this._audioSpriteStopTime=.001*(this._startTime+this._duration),this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1))},a._setDurationFromSource=function(){this._duration=createjs.HTMLAudioTagPool.getDuration(this.src),this._playbackResource=null},createjs.HTMLAudioSoundInstance=createjs.promote(HTMLAudioSoundInstance,"AbstractSoundInstance")}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioPlugin(){this.AbstractPlugin_constructor(),this.defaultNumChannels=2,this._capabilities=b._capabilities,this._loaderClass=createjs.SoundLoader,this._soundInstanceClass=createjs.HTMLAudioSoundInstance}var a=createjs.extend(HTMLAudioPlugin,createjs.AbstractPlugin),b=HTMLAudioPlugin;b.MAX_INSTANCES=30,b._AUDIO_READY="canplaythrough",b._AUDIO_ENDED="ended",b._AUDIO_SEEKED="seeked",b._AUDIO_STALLED="stalled",b._TIME_UPDATE="timeupdate",b._capabilities=null,b.isSupported=function(){return b._generateCapabilities(),null!=b._capabilities},b._generateCapabilities=function(){if(null==b._capabilities){var a=document.createElement("audio");if(null==a.canPlayType)return null;b._capabilities={panning:!1,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}}},a.register=function(a){var b=createjs.HTMLAudioTagPool.get(a.src),c=this.AbstractPlugin_register(a);return c.setTag(b),c},a.removeSound=function(a){this.AbstractPlugin_removeSound(a),createjs.HTMLAudioTagPool.remove(a)},a.create=function(a,b,c){var d=this.AbstractPlugin_create(a,b,c);return d.setPlaybackResource(null),d},a.toString=function(){return"[HTMLAudioPlugin]"},a.setVolume=a.getVolume=a.setMute=null,createjs.HTMLAudioPlugin=createjs.promote(HTMLAudioPlugin,"AbstractPlugin")}(); \ No newline at end of file +this.createjs=this.createjs||{},function(){var a=createjs.SoundJS=createjs.SoundJS||{};a.version="NEXT",a.buildDate="Thu, 12 Oct 2017 16:33:45 GMT"}(),this.createjs=this.createjs||{},createjs.extend=function(a,b){"use strict";function c(){this.constructor=a}return c.prototype=b.prototype,a.prototype=new c},this.createjs=this.createjs||{},createjs.promote=function(a,b){"use strict";var c=a.prototype,d=Object.getPrototypeOf&&Object.getPrototypeOf(c)||c.__proto__;if(d){c[(b+="_")+"constructor"]=d.constructor;for(var e in d)c.hasOwnProperty(e)&&"function"==typeof d[e]&&(c[b+e]=d[e])}return a},this.createjs=this.createjs||{},createjs.deprecate=function(a,b){"use strict";return function(){var c="Deprecated property or method '"+b+"'. See docs for info.";return console&&(console.warn?console.warn(c):console.log(c)),a&&a.apply(this,arguments)}},this.createjs=this.createjs||{},createjs.indexOf=function(a,b){"use strict";for(var c=0,d=a.length;d>c;c++)if(b===a[c])return c;return-1},this.createjs=this.createjs||{},function(){"use strict";createjs.proxy=function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,Array.prototype.slice.call(arguments,0).concat(c))}}}(),this.createjs=this.createjs||{},function(){"use strict";function BrowserDetect(){throw"BrowserDetect cannot be instantiated"}var a=BrowserDetect.agent=window.navigator.userAgent;BrowserDetect.isWindowPhone=a.indexOf("IEMobile")>-1||a.indexOf("Windows Phone")>-1,BrowserDetect.isFirefox=a.indexOf("Firefox")>-1,BrowserDetect.isOpera=null!=window.opera,BrowserDetect.isChrome=a.indexOf("Chrome")>-1,BrowserDetect.isIOS=(a.indexOf("iPod")>-1||a.indexOf("iPhone")>-1||a.indexOf("iPad")>-1)&&!BrowserDetect.isWindowPhone,BrowserDetect.isAndroid=a.indexOf("Android")>-1&&!BrowserDetect.isWindowPhone,BrowserDetect.isBlackberry=a.indexOf("Blackberry")>-1,createjs.BrowserDetect=BrowserDetect}(),this.createjs=this.createjs||{},function(){"use strict";function EventDispatcher(){this._listeners=null,this._captureListeners=null}var a=EventDispatcher.prototype;EventDispatcher.initialize=function(b){b.addEventListener=a.addEventListener,b.on=a.on,b.removeEventListener=b.off=a.removeEventListener,b.removeAllEventListeners=a.removeAllEventListeners,b.hasEventListener=a.hasEventListener,b.dispatchEvent=a.dispatchEvent,b._dispatchEvent=a._dispatchEvent,b.willTrigger=a.willTrigger},a.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},a.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},a.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},a.off=a.removeEventListener,a.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},a.dispatchEvent=function(a,b,c){if("string"==typeof a){var d=this._listeners;if(!(b||d&&d[a]))return!0;a=new createjs.Event(a,b,c)}else a.target&&a.clone&&(a=a.clone());try{a.target=this}catch(e){}if(a.bubbles&&this.parent){for(var f=this,g=[f];f.parent;)g.push(f=f.parent);var h,i=g.length;for(h=i-1;h>=0&&!a.propagationStopped;h--)g[h]._dispatchEvent(a,1+(0==h));for(h=1;i>h&&!a.propagationStopped;h++)g[h]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return!a.defaultPrevented},a.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},a.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1},a.toString=function(){return"[EventDispatcher]"},a._dispatchEvent=function(a,b){var c,d,e=2>=b?this._captureListeners:this._listeners;if(a&&e&&(d=e[a.type])&&(c=d.length)){try{a.currentTarget=this}catch(f){}try{a.eventPhase=0|b}catch(f){}a.removed=!1,d=d.slice();for(var g=0;c>g&&!a.immediatePropagationStopped;g++){var h=d[g];h.handleEvent?h.handleEvent(a):h(a),a.removed&&(this.off(a.type,h,1==b),a.removed=!1)}}2===b&&this._dispatchEvent(a,2.1)},createjs.EventDispatcher=EventDispatcher}(),this.createjs=this.createjs||{},function(){"use strict";function Event(a,b,c){this.type=a,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!b,this.cancelable=!!c,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var a=Event.prototype;a.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},a.stopPropagation=function(){this.propagationStopped=!0},a.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},a.remove=function(){this.removed=!0},a.clone=function(){return new Event(this.type,this.bubbles,this.cancelable)},a.set=function(a){for(var b in a)this[b]=a[b];return this},a.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=Event}(),this.createjs=this.createjs||{},function(){"use strict";function ErrorEvent(a,b,c){this.Event_constructor("error"),this.title=a,this.message=b,this.data=c}var a=createjs.extend(ErrorEvent,createjs.Event);a.clone=function(){return new createjs.ErrorEvent(this.title,this.message,this.data)},createjs.ErrorEvent=createjs.promote(ErrorEvent,"Event")}(),this.createjs=this.createjs||{},function(){"use strict";function ProgressEvent(a,b){this.Event_constructor("progress"),this.loaded=a,this.total=null==b?1:b,this.progress=0==b?0:this.loaded/this.total}var a=createjs.extend(ProgressEvent,createjs.Event);a.clone=function(){return new createjs.ProgressEvent(this.loaded,this.total)},createjs.ProgressEvent=createjs.promote(ProgressEvent,"Event")}(window),this.createjs=this.createjs||{},function(){"use strict";function LoadItem(){this.src=null,this.type=null,this.id=null,this.maintainOrder=!1,this.callback=null,this.data=null,this.method=createjs.Methods.GET,this.values=null,this.headers=null,this.withCredentials=!1,this.mimeType=null,this.crossOrigin=null,this.loadTimeout=b.LOAD_TIMEOUT_DEFAULT}var a=LoadItem.prototype={},b=LoadItem;b.LOAD_TIMEOUT_DEFAULT=8e3,b.create=function(a){if("string"==typeof a){var c=new LoadItem;return c.src=a,c}if(a instanceof b)return a;if(a instanceof Object&&a.src)return null==a.loadTimeout&&(a.loadTimeout=b.LOAD_TIMEOUT_DEFAULT),a;throw new Error("Type not recognized.")},a.set=function(a){for(var b in a)this[b]=a[b];return this},createjs.LoadItem=b}(),this.createjs=this.createjs||{},function(){var a={};a.POST="POST",a.GET="GET",createjs.Methods=a}(),this.createjs=this.createjs||{},function(){var a={};a.BINARY="binary",a.CSS="css",a.FONT="font",a.FONTCSS="fontcss",a.IMAGE="image",a.JAVASCRIPT="javascript",a.JSON="json",a.JSONP="jsonp",a.MANIFEST="manifest",a.SOUND="sound",a.VIDEO="video",a.SPRITESHEET="spritesheet",a.SVG="svg",a.TEXT="text",a.XML="xml",createjs.Types=a}(),function(){var a={};a.a=function(){return a.el("a")},a.svg=function(){return a.el("svg")},a.object=function(){return a.el("object")},a.image=function(){return a.el("image")},a.img=function(){return a.el("img")},a.style=function(){return a.el("style")},a.link=function(){return a.el("link")},a.script=function(){return a.el("script")},a.audio=function(){return a.el("audio")},a.video=function(){return a.el("video")},a.text=function(a){return document.createTextNode(a)},a.el=function(a){return document.createElement(a)},createjs.Elements=a}(),function(){var a={container:null};a.appendToHead=function(b){a.getHead().appendChild(b)},a.appendToBody=function(b){if(null==a.container){a.container=document.createElement("div"),a.container.id="preloadjs-container";var c=a.container.style;c.visibility="hidden",c.position="absolute",c.width=a.container.style.height="10px",c.overflow="hidden",c.transform=c.msTransform=c.webkitTransform=c.oTransform="translate(-10px, -10px)",a.getBody().appendChild(a.container)}a.container.appendChild(b)},a.getHead=function(){return document.head||document.getElementsByTagName("head")[0]},a.getBody=function(){return document.body||document.getElementsByTagName("body")[0]},a.removeChild=function(a){a.parent&&a.parent.removeChild(a)},a.isImageTag=function(a){return a instanceof HTMLImageElement},a.isAudioTag=function(a){return window.HTMLAudioElement?a instanceof HTMLAudioElement:!1},a.isVideoTag=function(a){return window.HTMLVideoElement?a instanceof HTMLVideoElement:!1},createjs.DomUtils=a}(),function(){var a={};a.isBinary=function(a){switch(a){case createjs.Types.IMAGE:case createjs.Types.BINARY:return!0;default:return!1}},a.isText=function(a){switch(a){case createjs.Types.TEXT:case createjs.Types.JSON:case createjs.Types.MANIFEST:case createjs.Types.XML:case createjs.Types.CSS:case createjs.Types.SVG:case createjs.Types.JAVASCRIPT:case createjs.Types.SPRITESHEET:return!0;default:return!1}},a.getTypeByExtension=function(a){if(null==a)return createjs.Types.TEXT;switch(a.toLowerCase()){case"jpeg":case"jpg":case"gif":case"png":case"webp":case"bmp":return createjs.Types.IMAGE;case"ogg":case"mp3":case"webm":return createjs.Types.SOUND;case"mp4":case"webm":case"ts":return createjs.Types.VIDEO;case"json":return createjs.Types.JSON;case"xml":return createjs.Types.XML;case"css":return createjs.Types.CSS;case"js":return createjs.Types.JAVASCRIPT;case"svg":return createjs.Types.SVG;default:return createjs.Types.TEXT}},createjs.RequestUtils=a}(),function(){var a={};a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[.\/]*?\//i,a.EXTENSION_PATT=/\/?[^\/]+\.(\w{1,5})$/i,a.parseURI=function(b){var c={absolute:!1,relative:!1,protocol:null,hostname:null,port:null,pathname:null,search:null,hash:null,host:null};if(null==b)return c;var d=createjs.Elements.a();d.href=b;for(var e in c)e in d&&(c[e]=d[e]);var f=b.indexOf("?");f>-1&&(b=b.substr(0,f));var g;return a.ABSOLUTE_PATT.test(b)?c.absolute=!0:a.RELATIVE_PATT.test(b)&&(c.relative=!0),(g=b.match(a.EXTENSION_PATT))&&(c.extension=g[1].toLowerCase()),c},a.formatQueryString=function(a,b){if(null==a)throw new Error("You must specify data.");var c=[];for(var d in a)c.push(d+"="+escape(a[d]));return b&&(c=c.concat(b)),c.join("&")},a.buildURI=function(a,b){if(null==b)return a;var c=[],d=a.indexOf("?");if(-1!=d){var e=a.slice(d+1);c=c.concat(e.split("&"))}return-1!=d?a.slice(0,d)+"?"+this.formatQueryString(b,c):a+"?"+this.formatQueryString(b,c)},a.isCrossDomain=function(a){var b=createjs.Elements.a();b.href=a.src;var c=createjs.Elements.a();c.href=location.href;var d=""!=b.hostname&&(b.port!=c.port||b.protocol!=c.protocol||b.hostname!=c.hostname);return d},a.isLocal=function(a){var b=createjs.Elements.a();return b.href=a.src,""==b.hostname&&"file:"==b.protocol},createjs.URLUtils=a}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractLoader(a,b,c){this.EventDispatcher_constructor(),this.loaded=!1,this.canceled=!1,this.progress=0,this.type=c,this.resultFormatter=null,this._item=a?createjs.LoadItem.create(a):null,this._preferXHR=b,this._result=null,this._rawResult=null,this._loadedItems=null,this._tagSrcAttribute=null,this._tag=null}var a=createjs.extend(AbstractLoader,createjs.EventDispatcher),b=AbstractLoader;try{Object.defineProperties(b,{POST:{get:createjs.deprecate(function(){return createjs.Methods.POST},"AbstractLoader.POST")},GET:{get:createjs.deprecate(function(){return createjs.Methods.GET},"AbstractLoader.GET")},BINARY:{get:createjs.deprecate(function(){return createjs.Types.BINARY},"AbstractLoader.BINARY")},CSS:{get:createjs.deprecate(function(){return createjs.Types.CSS},"AbstractLoader.CSS")},FONT:{get:createjs.deprecate(function(){return createjs.Types.FONT},"AbstractLoader.FONT")},FONTCSS:{get:createjs.deprecate(function(){return createjs.Types.FONTCSS},"AbstractLoader.FONTCSS")},IMAGE:{get:createjs.deprecate(function(){return createjs.Types.IMAGE},"AbstractLoader.IMAGE")},JAVASCRIPT:{get:createjs.deprecate(function(){return createjs.Types.JAVASCRIPT},"AbstractLoader.JAVASCRIPT")},JSON:{get:createjs.deprecate(function(){return createjs.Types.JSON},"AbstractLoader.JSON")},JSONP:{get:createjs.deprecate(function(){return createjs.Types.JSONP},"AbstractLoader.JSONP")},MANIFEST:{get:createjs.deprecate(function(){return createjs.Types.MANIFEST},"AbstractLoader.MANIFEST")},SOUND:{get:createjs.deprecate(function(){return createjs.Types.SOUND},"AbstractLoader.SOUND")},VIDEO:{get:createjs.deprecate(function(){return createjs.Types.VIDEO},"AbstractLoader.VIDEO")},SPRITESHEET:{get:createjs.deprecate(function(){return createjs.Types.SPRITESHEET},"AbstractLoader.SPRITESHEET")},SVG:{get:createjs.deprecate(function(){return createjs.Types.SVG},"AbstractLoader.SVG")},TEXT:{get:createjs.deprecate(function(){return createjs.Types.TEXT},"AbstractLoader.TEXT")},XML:{get:createjs.deprecate(function(){return createjs.Types.XML},"AbstractLoader.XML")}})}catch(c){}a.getItem=function(){return this._item},a.getResult=function(a){return a?this._rawResult:this._result},a.getTag=function(){return this._tag},a.setTag=function(a){this._tag=a},a.load=function(){this._createRequest(),this._request.on("complete",this,this),this._request.on("progress",this,this),this._request.on("loadStart",this,this),this._request.on("abort",this,this),this._request.on("timeout",this,this),this._request.on("error",this,this);var a=new createjs.Event("initialize");a.loader=this._request,this.dispatchEvent(a),this._request.load()},a.cancel=function(){this.canceled=!0,this.destroy()},a.destroy=function(){this._request&&(this._request.removeAllEventListeners(),this._request.destroy()),this._request=null,this._item=null,this._rawResult=null,this._result=null,this._loadItems=null,this.removeAllEventListeners()},a.getLoadedItems=function(){return this._loadedItems},a._createRequest=function(){this._request=this._preferXHR?new createjs.XHRRequest(this._item):new createjs.TagRequest(this._item,this._tag||this._createTag(),this._tagSrcAttribute)},a._createTag=function(){return null},a._sendLoadStart=function(){this._isCanceled()||this.dispatchEvent("loadstart")},a._sendProgress=function(a){if(!this._isCanceled()){var b=null;"number"==typeof a?(this.progress=a,b=new createjs.ProgressEvent(this.progress)):(b=a,this.progress=a.loaded/a.total,b.progress=this.progress,(isNaN(this.progress)||1/0==this.progress)&&(this.progress=0)),this.hasEventListener("progress")&&this.dispatchEvent(b)}},a._sendComplete=function(){if(!this._isCanceled()){this.loaded=!0;var a=new createjs.Event("complete");a.rawResult=this._rawResult,null!=this._result&&(a.result=this._result),this.dispatchEvent(a)}},a._sendError=function(a){!this._isCanceled()&&this.hasEventListener("error")&&(null==a&&(a=new createjs.ErrorEvent("PRELOAD_ERROR_EMPTY")),this.dispatchEvent(a))},a._isCanceled=function(){return null==window.createjs||this.canceled?!0:!1},a.resultFormatter=null,a.handleEvent=function(a){switch(a.type){case"complete":this._rawResult=a.target._response;var b=this.resultFormatter&&this.resultFormatter(this);b instanceof Function?b.call(this,createjs.proxy(this._resultFormatSuccess,this),createjs.proxy(this._resultFormatFailed,this)):(this._result=b||this._rawResult,this._sendComplete());break;case"progress":this._sendProgress(a);break;case"error":this._sendError(a);break;case"loadstart":this._sendLoadStart();break;case"abort":case"timeout":this._isCanceled()||this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_"+a.type.toUpperCase()+"_ERROR"))}},a._resultFormatSuccess=function(a){this._result=a,this._sendComplete()},a._resultFormatFailed=function(a){this._sendError(a)},a.toString=function(){return"[PreloadJS AbstractLoader]"},createjs.AbstractLoader=createjs.promote(AbstractLoader,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractMediaLoader(a,b,c){this.AbstractLoader_constructor(a,b,c),this.resultFormatter=this._formatResult,this._tagSrcAttribute="src",this.on("initialize",this._updateXHR,this)}var a=createjs.extend(AbstractMediaLoader,createjs.AbstractLoader);a.load=function(){this._tag||(this._tag=this._createTag(this._item.src)),this._tag.preload="auto",this._tag.load(),this.AbstractLoader_load()},a._createTag=function(){},a._createRequest=function(){this._request=this._preferXHR?new createjs.XHRRequest(this._item):new createjs.MediaTagRequest(this._item,this._tag||this._createTag(),this._tagSrcAttribute)},a._updateXHR=function(a){a.loader.setResponseType&&a.loader.setResponseType("blob")},a._formatResult=function(a){if(this._tag.removeEventListener&&this._tag.removeEventListener("canplaythrough",this._loadedHandler),this._tag.onstalled=null,this._preferXHR){var b=window.URL||window.webkitURL,c=a.getResult(!0);a.getTag().src=b.createObjectURL(c)}return a.getTag()},createjs.AbstractMediaLoader=createjs.promote(AbstractMediaLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";var AbstractRequest=function(a){this._item=a},a=createjs.extend(AbstractRequest,createjs.EventDispatcher);a.load=function(){},a.destroy=function(){},a.cancel=function(){},createjs.AbstractRequest=createjs.promote(AbstractRequest,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function TagRequest(a,b,c){this.AbstractRequest_constructor(a),this._tag=b,this._tagSrcAttribute=c,this._loadedHandler=createjs.proxy(this._handleTagComplete,this),this._addedToDOM=!1}var a=createjs.extend(TagRequest,createjs.AbstractRequest);a.load=function(){this._tag.onload=createjs.proxy(this._handleTagComplete,this),this._tag.onreadystatechange=createjs.proxy(this._handleReadyStateChange,this),this._tag.onerror=createjs.proxy(this._handleError,this);var a=new createjs.Event("initialize");a.loader=this._tag,this.dispatchEvent(a),this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout),this._tag[this._tagSrcAttribute]=this._item.src,null==this._tag.parentNode&&(createjs.DomUtils.appendToBody(this._tag),this._addedToDOM=!0)},a.destroy=function(){this._clean(),this._tag=null,this.AbstractRequest_destroy()},a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this._tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleTagComplete()},a._handleError=function(){this._clean(),this.dispatchEvent("error")},a._handleTagComplete=function(){this._rawResult=this._tag,this._result=this.resultFormatter&&this.resultFormatter(this)||this._rawResult,this._clean(),this.dispatchEvent("complete")},a._handleTimeout=function(){this._clean(),this.dispatchEvent(new createjs.Event("timeout"))},a._clean=function(){this._tag.onload=null,this._tag.onreadystatechange=null,this._tag.onerror=null,this._addedToDOM&&null!=this._tag.parentNode&&this._tag.parentNode.removeChild(this._tag),clearTimeout(this._loadTimeout)},a._handleStalled=function(){},createjs.TagRequest=createjs.promote(TagRequest,"AbstractRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function MediaTagRequest(a,b,c){this.AbstractRequest_constructor(a),this._tag=b,this._tagSrcAttribute=c,this._loadedHandler=createjs.proxy(this._handleTagComplete,this)}var a=createjs.extend(MediaTagRequest,createjs.TagRequest);a.load=function(){var a=createjs.proxy(this._handleStalled,this);this._stalledCallback=a;var b=createjs.proxy(this._handleProgress,this);this._handleProgress=b,this._tag.addEventListener("stalled",a),this._tag.addEventListener("progress",b),this._tag.addEventListener&&this._tag.addEventListener("canplaythrough",this._loadedHandler,!1),this.TagRequest_load()},a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this._tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleTagComplete()},a._handleStalled=function(){},a._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.ProgressEvent(a.loaded,a.total);this.dispatchEvent(b)}},a._clean=function(){this._tag.removeEventListener&&this._tag.removeEventListener("canplaythrough",this._loadedHandler),this._tag.removeEventListener("stalled",this._stalledCallback),this._tag.removeEventListener("progress",this._progressCallback),this.TagRequest__clean()},createjs.MediaTagRequest=createjs.promote(MediaTagRequest,"TagRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function XHRRequest(a){this.AbstractRequest_constructor(a),this._request=null,this._loadTimeout=null,this._xhrLevel=1,this._response=null,this._rawResponse=null,this._canceled=!1,this._handleLoadStartProxy=createjs.proxy(this._handleLoadStart,this),this._handleProgressProxy=createjs.proxy(this._handleProgress,this),this._handleAbortProxy=createjs.proxy(this._handleAbort,this),this._handleErrorProxy=createjs.proxy(this._handleError,this),this._handleTimeoutProxy=createjs.proxy(this._handleTimeout,this),this._handleLoadProxy=createjs.proxy(this._handleLoad,this),this._handleReadyStateChangeProxy=createjs.proxy(this._handleReadyStateChange,this),!this._createXHR(a)}var a=createjs.extend(XHRRequest,createjs.AbstractRequest);XHRRequest.ACTIVEX_VERSIONS=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],a.getResult=function(a){return a&&this._rawResponse?this._rawResponse:this._response},a.cancel=function(){this.canceled=!0,this._clean(),this._request.abort()},a.load=function(){if(null==this._request)return void this._handleError();null!=this._request.addEventListener?(this._request.addEventListener("loadstart",this._handleLoadStartProxy,!1),this._request.addEventListener("progress",this._handleProgressProxy,!1),this._request.addEventListener("abort",this._handleAbortProxy,!1),this._request.addEventListener("error",this._handleErrorProxy,!1),this._request.addEventListener("timeout",this._handleTimeoutProxy,!1),this._request.addEventListener("load",this._handleLoadProxy,!1),this._request.addEventListener("readystatechange",this._handleReadyStateChangeProxy,!1)):(this._request.onloadstart=this._handleLoadStartProxy,this._request.onprogress=this._handleProgressProxy,this._request.onabort=this._handleAbortProxy,this._request.onerror=this._handleErrorProxy,this._request.ontimeout=this._handleTimeoutProxy,this._request.onload=this._handleLoadProxy,this._request.onreadystatechange=this._handleReadyStateChangeProxy),1==this._xhrLevel&&(this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout));try{this._item.values?this._request.send(createjs.URLUtils.formatQueryString(this._item.values)):this._request.send()}catch(a){this.dispatchEvent(new createjs.ErrorEvent("XHR_SEND",null,a))}},a.setResponseType=function(a){"blob"===a&&(a=window.URL?"blob":"arraybuffer",this._responseType=a),this._request.responseType=a},a.getAllResponseHeaders=function(){return this._request.getAllResponseHeaders instanceof Function?this._request.getAllResponseHeaders():null},a.getResponseHeader=function(a){return this._request.getResponseHeader instanceof Function?this._request.getResponseHeader(a):null},a._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.ProgressEvent(a.loaded,a.total);this.dispatchEvent(b)}},a._handleLoadStart=function(){clearTimeout(this._loadTimeout),this.dispatchEvent("loadstart")},a._handleAbort=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent("XHR_ABORTED",null,a))},a._handleError=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent(a.message))},a._handleReadyStateChange=function(){4==this._request.readyState&&this._handleLoad()},a._handleLoad=function(){if(!this.loaded){this.loaded=!0;var a=this._checkError();if(a)return void this._handleError(a);if(this._response=this._getResponse(),"arraybuffer"===this._responseType)try{this._response=new Blob([this._response])}catch(b){if(window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,"TypeError"===b.name&&window.BlobBuilder){var c=new BlobBuilder;c.append(this._response),this._response=c.getBlob()}}this._clean(),this.dispatchEvent(new createjs.Event("complete"))}},a._handleTimeout=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_TIMEOUT",null,a))},a._checkError=function(){var a=parseInt(this._request.status);return a>=400&&599>=a?new Error(a):0==a&&/^https?:/.test(location.protocol)?new Error(0):null},a._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(a){}return null},a._createXHR=function(a){var b=createjs.URLUtils.isCrossDomain(a),c={},d=null;if(window.XMLHttpRequest)d=new XMLHttpRequest,b&&void 0===d.withCredentials&&window.XDomainRequest&&(d=new XDomainRequest);else{for(var e=0,f=s.ACTIVEX_VERSIONS.length;f>e;e++){var g=s.ACTIVEX_VERSIONS[e];try{d=new ActiveXObject(g);break}catch(h){}}if(null==d)return!1}null==a.mimeType&&createjs.RequestUtils.isText(a.type)&&(a.mimeType="text/plain; charset=utf-8"),a.mimeType&&d.overrideMimeType&&d.overrideMimeType(a.mimeType),this._xhrLevel="string"==typeof d.responseType?2:1;var i=null;if(i=a.method==createjs.Methods.GET?createjs.URLUtils.buildURI(a.src,a.values):a.src,d.open(a.method||createjs.Methods.GET,i,!0),b&&d instanceof XMLHttpRequest&&1==this._xhrLevel&&(c.Origin=location.origin),a.values&&a.method==createjs.Methods.POST&&(c["Content-Type"]="application/x-www-form-urlencoded"),b||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest"),a.headers)for(var j in a.headers)c[j]=a.headers[j];for(j in c)d.setRequestHeader(j,c[j]);return d instanceof XMLHttpRequest&&void 0!==a.withCredentials&&(d.withCredentials=a.withCredentials),this._request=d,!0},a._clean=function(){clearTimeout(this._loadTimeout),null!=this._request.removeEventListener?(this._request.removeEventListener("loadstart",this._handleLoadStartProxy),this._request.removeEventListener("progress",this._handleProgressProxy),this._request.removeEventListener("abort",this._handleAbortProxy),this._request.removeEventListener("error",this._handleErrorProxy),this._request.removeEventListener("timeout",this._handleTimeoutProxy),this._request.removeEventListener("load",this._handleLoadProxy),this._request.removeEventListener("readystatechange",this._handleReadyStateChangeProxy)):(this._request.onloadstart=null,this._request.onprogress=null,this._request.onabort=null,this._request.onerror=null,this._request.ontimeout=null,this._request.onload=null,this._request.onreadystatechange=null)},a.toString=function(){return"[PreloadJS XHRRequest]"},createjs.XHRRequest=createjs.promote(XHRRequest,"AbstractRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function SoundLoader(a,b){this.AbstractMediaLoader_constructor(a,b,createjs.Types.SOUND),createjs.DomUtils.isAudioTag(a)?this._tag=a:createjs.DomUtils.isAudioTag(a.src)?this._tag=a:createjs.DomUtils.isAudioTag(a.tag)&&(this._tag=createjs.DomUtils.isAudioTag(a)?a:a.src),null!=this._tag&&(this._preferXHR=!1)}var a=createjs.extend(SoundLoader,createjs.AbstractMediaLoader),b=SoundLoader;b.canLoadItem=function(a){return a.type==createjs.Types.SOUND},a._createTag=function(a){var b=createjs.Elements.audio();return b.autoplay=!1,b.preload="none",b.src=a,b},createjs.SoundLoader=createjs.promote(SoundLoader,"AbstractMediaLoader")}(),this.createjs=this.createjs||{},function(){"use strict";var PlayPropsConfig=function(){this.interrupt=null,this.delay=null,this.offset=null,this.loop=null,this.volume=null,this.pan=null,this.startTime=null,this.duration=null},a=PlayPropsConfig.prototype={},b=PlayPropsConfig;b.create=function(a){if("string"==typeof a)return console&&(console.warn||console.log)("Deprecated behaviour. Sound.play takes a configuration object instead of individual arguments. See docs for info."),(new createjs.PlayPropsConfig).set({interrupt:a});if(null==a||a instanceof b||a instanceof Object)return(new createjs.PlayPropsConfig).set(a);if(null==a)throw new Error("PlayProps configuration not recognized.")},a.set=function(a){if(null!=a)for(var b in a)this[b]=a[b];return this},a.toString=function(){return"[PlayPropsConfig]"},createjs.PlayPropsConfig=b}(),this.createjs=this.createjs||{},function(){"use strict";function Sound(){throw"Sound cannot be instantiated"}function a(a,b){this.init(a,b)}var b=Sound;b.INTERRUPT_ANY="any",b.INTERRUPT_EARLY="early",b.INTERRUPT_LATE="late",b.INTERRUPT_NONE="none",b.PLAY_INITED="playInited",b.PLAY_SUCCEEDED="playSucceeded",b.PLAY_INTERRUPTED="playInterrupted",b.PLAY_FINISHED="playFinished",b.PLAY_FAILED="playFailed",b.SUPPORTED_EXTENSIONS=["mp3","ogg","opus","mpeg","wav","m4a","mp4","aiff","wma","mid"],b.EXTENSION_MAP={m4a:"mp4"},b.FILE_PATTERN=/^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([\/.]*?(?:[^?]+)?\/)?((?:[^\/?]+)\.(\w+))(?:\?(\S+)?)?$/,b.defaultInterruptBehavior=b.INTERRUPT_NONE,b.alternateExtensions=[],b.activePlugin=null,b._masterVolume=1,b._getMasterVolume=function(){return this._masterVolume},b.getVolume=createjs.deprecate(b._getMasterVolume,"Sound.getVolume"),b._setMasterVolume=function(a){if(null!=Number(a)&&(a=Math.max(0,Math.min(1,a)),b._masterVolume=a,!this.activePlugin||!this.activePlugin.setVolume||!this.activePlugin.setVolume(a)))for(var c=this._instances,d=0,e=c.length;e>d;d++)c[d].setMasterVolume(a)},b.setVolume=createjs.deprecate(b._setMasterVolume,"Sound.setVolume"),b._masterMute=!1,b._getMute=function(){return this._masterMute},b.getMute=createjs.deprecate(b._getMute,"Sound.getMute"),b._setMute=function(a){if(null!=a&&(this._masterMute=a,!this.activePlugin||!this.activePlugin.setMute||!this.activePlugin.setMute(a)))for(var b=this._instances,c=0,d=b.length;d>c;c++)b[c].setMasterMute(a)},b.setMute=createjs.deprecate(b._setMute,"Sound.setMute"),b._getCapabilities=function(){return null==b.activePlugin?null:b.activePlugin._capabilities},b.getCapabilities=createjs.deprecate(b._getCapabilities,"Sound.getCapabilities"),Object.defineProperties(b,{volume:{get:b._getMasterVolume,set:b._setMasterVolume},muted:{get:b._getMute,set:b._setMute},capabilities:{get:b._getCapabilities}}),b._pluginsRegistered=!1,b._lastID=0,b._instances=[],b._idHash={},b._preloadHash={},b._defaultPlayPropsHash={},b.addEventListener=null,b.removeEventListener=null,b.removeAllEventListeners=null,b.dispatchEvent=null,b.hasEventListener=null,b._listeners=null,createjs.EventDispatcher.initialize(b),b.getPreloadHandlers=function(){return{callback:createjs.proxy(b.initLoad,b),types:["sound"],extensions:b.SUPPORTED_EXTENSIONS}},b._handleLoadComplete=function(a){var c=a.target.getItem().src;if(b._preloadHash[c])for(var d=0,e=b._preloadHash[c].length;e>d;d++){var f=b._preloadHash[c][d];if(b._preloadHash[c][d]=!0,b.hasEventListener("fileload")){var a=new createjs.Event("fileload");a.src=f.src,a.id=f.id,a.data=f.data,a.sprite=f.sprite,b.dispatchEvent(a)}}},b._handleLoadError=function(a){var c=a.target.getItem().src;if(b._preloadHash[c])for(var d=0,e=b._preloadHash[c].length;e>d;d++){var f=b._preloadHash[c][d];if(b._preloadHash[c][d]=!1,b.hasEventListener("fileerror")){var a=new createjs.Event("fileerror");a.src=f.src,a.id=f.id,a.data=f.data,a.sprite=f.sprite,b.dispatchEvent(a)}}},b._registerPlugin=function(a){return a.isSupported()?(b.activePlugin=new a,!0):!1},b.registerPlugins=function(a){b._pluginsRegistered=!0;for(var c=0,d=a.length;d>c;c++)if(b._registerPlugin(a[c]))return!0;return!1},b.initializeDefaultPlugins=function(){return null!=b.activePlugin?!0:b._pluginsRegistered?!1:b.registerPlugins([createjs.WebAudioPlugin,createjs.HTMLAudioPlugin])?!0:!1},b.isReady=function(){return null!=b.activePlugin},b.initLoad=function(a){return"video"==a.type?!0:b._registerSound(a)},b._registerSound=function(c){if(!b.initializeDefaultPlugins())return!1;var d;if(c.src instanceof Object?(d=b._parseSrc(c.src),d.src=c.path+d.src):d=b._parsePath(c.src),null==d)return!1; +c.src=d.src,c.type="sound";var e=c.data,f=null;if(null!=e&&(isNaN(e.channels)?isNaN(e)||(f=parseInt(e)):f=parseInt(e.channels),e.audioSprite))for(var g,h=e.audioSprite.length;h--;)g=e.audioSprite[h],b._idHash[g.id]={src:c.src,startTime:parseInt(g.startTime),duration:parseInt(g.duration)},g.defaultPlayProps&&(b._defaultPlayPropsHash[g.id]=createjs.PlayPropsConfig.create(g.defaultPlayProps));null!=c.id&&(b._idHash[c.id]={src:c.src});var i=b.activePlugin.register(c);return a.create(c.src,f),null!=e&&isNaN(e)?c.data.channels=f||a.maxPerChannel():c.data=f||a.maxPerChannel(),i.type&&(c.type=i.type),c.defaultPlayProps&&(b._defaultPlayPropsHash[c.src]=createjs.PlayPropsConfig.create(c.defaultPlayProps)),i},b.registerSound=function(a,c,d,e,f){var g={src:a,id:c,data:d,defaultPlayProps:f};a instanceof Object&&a.src&&(e=c,g=a),g=createjs.LoadItem.create(g),g.path=e,null==e||g.src instanceof Object||(g.src=e+g.src);var h=b._registerSound(g);if(!h)return!1;if(b._preloadHash[g.src]||(b._preloadHash[g.src]=[]),b._preloadHash[g.src].push(g),1==b._preloadHash[g.src].length)h.on("complete",this._handleLoadComplete,this),h.on("error",this._handleLoadError,this),b.activePlugin.preload(h);else if(1==b._preloadHash[g.src][0])return!0;return g},b.registerSounds=function(a,b){var c=[];a.path&&(b?b+=a.path:b=a.path,a=a.manifest);for(var d=0,e=a.length;e>d;d++)c[d]=createjs.Sound.registerSound(a[d].src,a[d].id,a[d].data,b,a[d].defaultPlayProps);return c},b.removeSound=function(c,d){if(null==b.activePlugin)return!1;c instanceof Object&&c.src&&(c=c.src);var e;if(c instanceof Object?e=b._parseSrc(c):(c=b._getSrcById(c).src,e=b._parsePath(c)),null==e)return!1;c=e.src,null!=d&&(c=d+c);for(var f in b._idHash)b._idHash[f].src==c&&delete b._idHash[f];return a.removeSrc(c),delete b._preloadHash[c],b.activePlugin.removeSound(c),!0},b.removeSounds=function(a,b){var c=[];a.path&&(b?b+=a.path:b=a.path,a=a.manifest);for(var d=0,e=a.length;e>d;d++)c[d]=createjs.Sound.removeSound(a[d].src,b);return c},b.removeAllSounds=function(){b._idHash={},b._preloadHash={},a.removeAll(),b.activePlugin&&b.activePlugin.removeAllSounds()},b.loadComplete=function(a){if(!b.isReady())return!1;var c=b._parsePath(a);return a=c?b._getSrcById(c.src).src:b._getSrcById(a).src,void 0==b._preloadHash[a]?!1:1==b._preloadHash[a][0]},b._parsePath=function(a){"string"!=typeof a&&(a=a.toString());var c=a.match(b.FILE_PATTERN);if(null==c)return!1;for(var d=c[4],e=c[5],f=b.capabilities,g=0;!f[e];)if(e=b.alternateExtensions[g++],g>b.alternateExtensions.length)return null;a=a.replace("."+c[5],"."+e);var h={name:d,src:a,extension:e};return h},b._parseSrc=function(a){var c={name:void 0,src:void 0,extension:void 0},d=b.capabilities;for(var e in a)if(a.hasOwnProperty(e)&&d[e]){c.src=a[e],c.extension=e;break}if(!c.src)return!1;var f=c.src.lastIndexOf("/");return c.name=-1!=f?c.src.slice(f+1):c.src,c},b.play=function(a,c){var d=createjs.PlayPropsConfig.create(c),e=b.createInstance(a,d.startTime,d.duration),f=b._playInstance(e,d);return f||e._playFailed(),e},b.createInstance=function(c,d,e){if(!b.initializeDefaultPlugins())return new createjs.DefaultSoundInstance(c,d,e);var f=b._defaultPlayPropsHash[c];c=b._getSrcById(c);var g=b._parsePath(c.src),h=null;return null!=g&&null!=g.src?(a.create(g.src),null==d&&(d=c.startTime),h=b.activePlugin.create(g.src,d,e||c.duration),f=f||b._defaultPlayPropsHash[g.src],f&&h.applyPlayProps(f)):h=new createjs.DefaultSoundInstance(c,d,e),h.uniqueId=b._lastID++,h},b.stop=function(){for(var a=this._instances,b=a.length;b--;)a[b].stop()},b.setDefaultPlayProps=function(a,c){a=b._getSrcById(a),b._defaultPlayPropsHash[b._parsePath(a.src).src]=createjs.PlayPropsConfig.create(c)},b.getDefaultPlayProps=function(a){return a=b._getSrcById(a),b._defaultPlayPropsHash[b._parsePath(a.src).src]},b._playInstance=function(a,c){var d=b._defaultPlayPropsHash[a.src]||{};if(null==c.interrupt&&(c.interrupt=d.interrupt||b.defaultInterruptBehavior),null==c.delay&&(c.delay=d.delay||0),null==c.offset&&(c.offset=a.position),null==c.loop&&(c.loop=a.loop),null==c.volume&&(c.volume=a.volume),null==c.pan&&(c.pan=a.pan),0==c.delay){var e=b._beginPlaying(a,c);if(!e)return!1}else{var f=setTimeout(function(){b._beginPlaying(a,c)},c.delay);a.delayTimeoutId=f}return this._instances.push(a),!0},b._beginPlaying=function(b,c){if(!a.add(b,c.interrupt))return!1;var d=b._beginPlaying(c);if(!d){var e=createjs.indexOf(this._instances,b);return e>-1&&this._instances.splice(e,1),!1}return!0},b._getSrcById=function(a){return b._idHash[a]||{src:a}},b._playFinished=function(b){a.remove(b);var c=createjs.indexOf(this._instances,b);c>-1&&this._instances.splice(c,1)},createjs.Sound=Sound,a.channels={},a.create=function(b,c){var d=a.get(b);return null==d?(a.channels[b]=new a(b,c),!0):!1},a.removeSrc=function(b){var c=a.get(b);return null==c?!1:(c._removeAll(),delete a.channels[b],!0)},a.removeAll=function(){for(var b in a.channels)a.channels[b]._removeAll();a.channels={}},a.add=function(b,c){var d=a.get(b.src);return null==d?!1:d._add(b,c)},a.remove=function(b){var c=a.get(b.src);return null==c?!1:(c._remove(b),!0)},a.maxPerChannel=function(){return c.maxDefault},a.get=function(b){return a.channels[b]};var c=a.prototype;c.constructor=a,c.src=null,c.max=null,c.maxDefault=100,c.length=0,c.init=function(a,b){this.src=a,this.max=b||this.maxDefault,-1==this.max&&(this.max=this.maxDefault),this._instances=[]},c._get=function(a){return this._instances[a]},c._add=function(a,b){return this._getSlot(b,a)?(this._instances.push(a),this.length++,!0):!1},c._remove=function(a){var b=createjs.indexOf(this._instances,a);return-1==b?!1:(this._instances.splice(b,1),this.length--,!0)},c._removeAll=function(){for(var a=this.length-1;a>=0;a--)this._instances[a].stop()},c._getSlot=function(a){var b,c;if(a!=Sound.INTERRUPT_NONE&&(c=this._get(0),null==c))return!0;for(var d=0,e=this.max;e>d;d++){if(b=this._get(d),null==b)return!0;if(b.playState==Sound.PLAY_FINISHED||b.playState==Sound.PLAY_INTERRUPTED||b.playState==Sound.PLAY_FAILED){c=b;break}a!=Sound.INTERRUPT_NONE&&(a==Sound.INTERRUPT_EARLY&&b.positionc.position)&&(c=b)}return null!=c?(c._interrupt(),this._remove(c),!0):!1},c.toString=function(){return"[Sound SoundChannel]"}}(),this.createjs=this.createjs||{},function(){"use strict";var AbstractSoundInstance=function(a,b,c,d){this.EventDispatcher_constructor(),this.src=a,this.uniqueId=-1,this.playState=null,this.delayTimeoutId=null,this._volume=1,Object.defineProperty(this,"volume",{get:this._getVolume,set:this._setVolume}),this.getVolume=createjs.deprecate(this._getVolume,"AbstractSoundInstance.getVolume"),this.setVolume=createjs.deprecate(this._setVolume,"AbstractSoundInstance.setVolume"),this._pan=0,Object.defineProperty(this,"pan",{get:this._getPan,set:this._setPan}),this.getPan=createjs.deprecate(this._getPan,"AbstractSoundInstance.getPan"),this.setPan=createjs.deprecate(this._setPan,"AbstractSoundInstance.setPan"),this._startTime=Math.max(0,b||0),Object.defineProperty(this,"startTime",{get:this._getStartTime,set:this._setStartTime}),this.getStartTime=createjs.deprecate(this._getStartTime,"AbstractSoundInstance.getStartTime"),this.setStartTime=createjs.deprecate(this._setStartTime,"AbstractSoundInstance.setStartTime"),this._duration=Math.max(0,c||0),Object.defineProperty(this,"duration",{get:this._getDuration,set:this._setDuration}),this.getDuration=createjs.deprecate(this._getDuration,"AbstractSoundInstance.getDuration"),this.setDuration=createjs.deprecate(this._setDuration,"AbstractSoundInstance.setDuration"),this._playbackResource=null,Object.defineProperty(this,"playbackResource",{get:this._getPlaybackResource,set:this._setPlaybackResource}),d!==!1&&d!==!0&&this._setPlaybackResource(d),this.getPlaybackResource=createjs.deprecate(this._getPlaybackResource,"AbstractSoundInstance.getPlaybackResource"),this.setPlaybackResource=createjs.deprecate(this._setPlaybackResource,"AbstractSoundInstance.setPlaybackResource"),this._position=0,Object.defineProperty(this,"position",{get:this._getPosition,set:this._setPosition}),this.getPosition=createjs.deprecate(this._getPosition,"AbstractSoundInstance.getPosition"),this.setPosition=createjs.deprecate(this._setPosition,"AbstractSoundInstance.setPosition"),this._loop=0,Object.defineProperty(this,"loop",{get:this._getLoop,set:this._setLoop}),this.getLoop=createjs.deprecate(this._getLoop,"AbstractSoundInstance.getLoop"),this.setLoop=createjs.deprecate(this._setLoop,"AbstractSoundInstance.setLoop"),this._muted=!1,Object.defineProperty(this,"muted",{get:this._getMuted,set:this._setMuted}),this.getMuted=createjs.deprecate(this._getMuted,"AbstractSoundInstance.getMuted"),this.setMuted=createjs.deprecate(this._setMuted,"AbstractSoundInstance.setMuted"),this._paused=!1,Object.defineProperty(this,"paused",{get:this._getPaused,set:this._setPaused}),this.getPaused=createjs.deprecate(this._getPaused,"AbstractSoundInstance.getPaused"),this.setPaused=createjs.deprecate(this._setPaused,"AbstractSoundInstance.setPaused")},a=createjs.extend(AbstractSoundInstance,createjs.EventDispatcher);a.play=function(a){var b=createjs.PlayPropsConfig.create(a);return this.playState==createjs.Sound.PLAY_SUCCEEDED?(this.applyPlayProps(b),void(this._paused&&this._setPaused(!1))):(this._cleanUp(),createjs.Sound._playInstance(this,b),this)},a.stop=function(){return this._position=0,this._paused=!1,this._handleStop(),this._cleanUp(),this.playState=createjs.Sound.PLAY_FINISHED,this},a.destroy=function(){this._cleanUp(),this.src=null,this.playbackResource=null,this.removeAllEventListeners()},a.applyPlayProps=function(a){return null!=a.offset&&this._setPosition(a.offset),null!=a.loop&&this._setLoop(a.loop),null!=a.volume&&this._setVolume(a.volume),null!=a.pan&&this._setPan(a.pan),null!=a.startTime&&(this._setStartTime(a.startTime),this._setDuration(a.duration)),this},a.toString=function(){return"[AbstractSoundInstance]"},a._getPaused=function(){return this._paused},a._setPaused=function(a){return a!==!0&&a!==!1||this._paused==a||1==a&&this.playState!=createjs.Sound.PLAY_SUCCEEDED?void 0:(this._paused=a,a?this._pause():this._resume(),clearTimeout(this.delayTimeoutId),this)},a._setVolume=function(a){return a==this._volume?this:(this._volume=Math.max(0,Math.min(1,a)),this._muted||this._updateVolume(),this)},a._getVolume=function(){return this._volume},a._setMuted=function(a){return a===!0||a===!1?(this._muted=a,this._updateVolume(),this):void 0},a._getMuted=function(){return this._muted},a._setPan=function(a){return a==this._pan?this:(this._pan=Math.max(-1,Math.min(1,a)),this._updatePan(),this)},a._getPan=function(){return this._pan},a._getPosition=function(){return this._paused||this.playState!=createjs.Sound.PLAY_SUCCEEDED||(this._position=this._calculateCurrentPosition()),this._position},a._setPosition=function(a){return this._position=Math.max(0,a),this.playState==createjs.Sound.PLAY_SUCCEEDED&&this._updatePosition(),this},a._getStartTime=function(){return this._startTime},a._setStartTime=function(a){return a==this._startTime?this:(this._startTime=Math.max(0,a||0),this._updateStartTime(),this)},a._getDuration=function(){return this._duration},a._setDuration=function(a){return a==this._duration?this:(this._duration=Math.max(0,a||0),this._updateDuration(),this)},a._setPlaybackResource=function(a){return this._playbackResource=a,0==this._duration&&this._playbackResource&&this._setDurationFromSource(),this},a._getPlaybackResource=function(){return this._playbackResource},a._getLoop=function(){return this._loop},a._setLoop=function(a){null!=this._playbackResource&&(0!=this._loop&&0==a?this._removeLooping(a):0==this._loop&&0!=a&&this._addLooping(a)),this._loop=a},a._sendEvent=function(a){var b=new createjs.Event(a);this.dispatchEvent(b)},a._cleanUp=function(){clearTimeout(this.delayTimeoutId),this._handleCleanUp(),this._paused=!1,createjs.Sound._playFinished(this)},a._interrupt=function(){this._cleanUp(),this.playState=createjs.Sound.PLAY_INTERRUPTED,this._sendEvent("interrupted")},a._beginPlaying=function(a){return this._setPosition(a.offset),this._setLoop(a.loop),this._setVolume(a.volume),this._setPan(a.pan),null!=a.startTime&&(this._setStartTime(a.startTime),this._setDuration(a.duration)),null!=this._playbackResource&&this._positionc;c++){var e=this._soundInstances[b][c];e.playbackResource=this._audioSources[b],this._soundInstances[b]=null}},a._handlePreloadError=function(){},a._updateVolume=function(){},createjs.AbstractPlugin=AbstractPlugin}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.AbstractLoader_constructor(a,!0,createjs.Types.SOUND)}var b=createjs.extend(a,createjs.AbstractLoader);a.context=null,b.toString=function(){return"[WebAudioLoader]"},b._createRequest=function(){this._request=new createjs.XHRRequest(this._item,!1),this._request.setResponseType("arraybuffer")},b._sendComplete=function(){a.context.decodeAudioData(this._rawResult,createjs.proxy(this._handleAudioDecoded,this),createjs.proxy(this._sendError,this))},b._handleAudioDecoded=function(a){this._result=a,this.AbstractLoader__sendComplete()},createjs.WebAudioLoader=createjs.promote(a,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function WebAudioSoundInstance(a,c,d,e){this.AbstractSoundInstance_constructor(a,c,d,e),this.gainNode=b.context.createGain(),this.panNode=b.context.createPanner(),this.panNode.panningModel=b._panningModel,this.panNode.connect(this.gainNode),this._updatePan(),this.sourceNode=null,this._soundCompleteTimeout=null,this._sourceNodeNext=null,this._playbackStartTime=0,this._endedHandler=createjs.proxy(this._handleSoundComplete,this)}var a=createjs.extend(WebAudioSoundInstance,createjs.AbstractSoundInstance),b=WebAudioSoundInstance;b.context=null,b._scratchBuffer=null,b.destinationNode=null,b._panningModel="equalpower",a.destroy=function(){this.AbstractSoundInstance_destroy(),this.panNode.disconnect(0),this.panNode=null,this.gainNode.disconnect(0),this.gainNode=null},a.toString=function(){return"[WebAudioSoundInstance]"},a._updatePan=function(){this.panNode.setPosition(this._pan,0,-.5)},a._removeLooping=function(){this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext)},a._addLooping=function(){this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0))},a._setDurationFromSource=function(){this._duration=1e3*this.playbackResource.duration},a._handleCleanUp=function(){this.sourceNode&&this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext)),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(0),clearTimeout(this._soundCompleteTimeout),this._playbackStartTime=0},a._cleanUpAudioNode=function(a){if(a){if(a.stop(0),a.disconnect(0),createjs.BrowserDetect.isIOS)try{a.buffer=b._scratchBuffer}catch(c){}a=null}return a},a._handleSoundReady=function(){this.gainNode.connect(b.destinationNode);var a=.001*this._duration,c=Math.min(.001*Math.max(0,this._position),a);this.sourceNode=this._createAndPlayAudioNode(b.context.currentTime-a,c),this._playbackStartTime=this.sourceNode.startTime-c,this._soundCompleteTimeout=setTimeout(this._endedHandler,1e3*(a-c)),0!=this._loop&&(this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0))},a._createAndPlayAudioNode=function(a,c){var d=b.context.createBufferSource();d.buffer=this.playbackResource,d.connect(this.panNode);var e=.001*this._duration;return d.startTime=a+e,d.start(d.startTime,c+.001*this._startTime,e-c),d},a._pause=function(){this._position=1e3*(b.context.currentTime-this._playbackStartTime),this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(0),clearTimeout(this._soundCompleteTimeout)},a._resume=function(){this._handleSoundReady()},a._updateVolume=function(){var a=this._muted?0:this._volume;a!=this.gainNode.gain.value&&(this.gainNode.gain.value=a)},a._calculateCurrentPosition=function(){return 1e3*(b.context.currentTime-this._playbackStartTime)},a._updatePosition=function(){this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext),clearTimeout(this._soundCompleteTimeout),this._paused||this._handleSoundReady()},a._handleLoop=function(){this._cleanUpAudioNode(this.sourceNode),this.sourceNode=this._sourceNodeNext,this._playbackStartTime=this.sourceNode.startTime,this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0),this._soundCompleteTimeout=setTimeout(this._endedHandler,this._duration)},a._updateDuration=function(){this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._pause(),this._resume())},createjs.WebAudioSoundInstance=createjs.promote(WebAudioSoundInstance,"AbstractSoundInstance")}(),this.createjs=this.createjs||{},function(){"use strict";function WebAudioPlugin(){this.AbstractPlugin_constructor(),this._panningModel=b._panningModel,this.context=b.context,this.dynamicsCompressorNode=this.context.createDynamicsCompressor(),this.dynamicsCompressorNode.connect(this.context.destination),this.gainNode=this.context.createGain(),this.gainNode.connect(this.dynamicsCompressorNode),createjs.WebAudioSoundInstance.destinationNode=this.gainNode,this._capabilities=b._capabilities,this._loaderClass=createjs.WebAudioLoader,this._soundInstanceClass=createjs.WebAudioSoundInstance,this._addPropsToClasses()}var a=createjs.extend(WebAudioPlugin,createjs.AbstractPlugin),b=WebAudioPlugin;b._capabilities=null,b._panningModel="equalpower",b.context=null,b._scratchBuffer=null,b._unlocked=!1,b.DEFAULT_SAMPLE_RATE=44100,b.isSupported=function(){var a=createjs.BrowserDetect.isIOS||createjs.BrowserDetect.isAndroid||createjs.BrowserDetect.isBlackberry;return"file:"!=location.protocol||a||this._isFileXHRSupported()?(b._generateCapabilities(),null==b.context?!1:!0):!1},b.playEmptySound=function(){if(null!=b.context){var a=b.context.createBufferSource();a.buffer=b._scratchBuffer,a.connect(b.context.destination),a.start(0,0,0)}},b._isFileXHRSupported=function(){var a=!0,b=new XMLHttpRequest;try{b.open("GET","WebAudioPluginTest.fail",!1)}catch(c){return a=!1}b.onerror=function(){a=!1},b.onload=function(){a=404==this.status||200==this.status||0==this.status&&""!=this.response};try{b.send()}catch(c){a=!1}return a},b._generateCapabilities=function(){if(null==b._capabilities){var a=document.createElement("audio");if(null==a.canPlayType)return null;if(null==b.context&&(b.context=b._createAudioContext(),null==b.context))return null;null==b._scratchBuffer&&(b._scratchBuffer=b.context.createBuffer(1,1,22050)),b._compatibilitySetUp(),"ontouchstart"in window&&"running"!=b.context.state&&(b._unlock(),document.addEventListener("mousedown",b._unlock,!0),document.addEventListener("touchstart",b._unlock,!0),document.addEventListener("touchend",b._unlock,!0)),b._capabilities={panning:!0,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}b.context.destination.numberOfChannels<2&&(b._capabilities.panning=!1)}},b._createAudioContext=function(){var a=window.AudioContext||window.webkitAudioContext;if(null==a)return null;var c=new a;if(/(iPhone|iPad)/i.test(navigator.userAgent)&&c.sampleRate!==b.DEFAULT_SAMPLE_RATE){var d=c.createBuffer(1,1,b.DEFAULT_SAMPLE_RATE),e=c.createBufferSource();e.buffer=d,e.connect(c.destination),e.start(0),e.disconnect(),c.close(),c=new a}return c},b._compatibilitySetUp=function(){if(b._panningModel="equalpower",!b.context.createGain){b.context.createGain=b.context.createGainNode;var a=b.context.createBufferSource();a.__proto__.start=a.__proto__.noteGrainOn,a.__proto__.stop=a.__proto__.noteOff,b._panningModel=0}},b._unlock=function(){b._unlocked||(b.playEmptySound(),"running"==b.context.state&&(document.removeEventListener("mousedown",b._unlock,!0),document.removeEventListener("touchend",b._unlock,!0),document.removeEventListener("touchstart",b._unlock,!0),b._unlocked=!0))},a.toString=function(){return"[WebAudioPlugin]"},a._addPropsToClasses=function(){var a=this._soundInstanceClass;a.context=this.context,a._scratchBuffer=b._scratchBuffer,a.destinationNode=this.gainNode,a._panningModel=this._panningModel,this._loaderClass.context=this.context},a._updateVolume=function(){var a=createjs.Sound._masterMute?0:this._volume;a!=this.gainNode.gain.value&&(this.gainNode.gain.value=a)},createjs.WebAudioPlugin=createjs.promote(WebAudioPlugin,"AbstractPlugin")}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioTagPool(){throw"HTMLAudioTagPool cannot be instantiated"}function a(){this._tags=[]}var b=HTMLAudioTagPool;b._tags={},b._tagPool=new a,b._tagUsed={},b.get=function(a){var c=b._tags[a];return null==c?(c=b._tags[a]=b._tagPool.get(),c.src=a):b._tagUsed[a]?(c=b._tagPool.get(),c.src=a):b._tagUsed[a]=!0,c},b.set=function(a,c){c==b._tags[a]?b._tagUsed[a]=!1:b._tagPool.set(c)},b.remove=function(a){var c=b._tags[a];return null==c?!1:(b._tagPool.set(c),delete b._tags[a],delete b._tagUsed[a],!0)},b.getDuration=function(a){var c=b._tags[a];return null!=c&&c.duration?1e3*c.duration:0},createjs.HTMLAudioTagPool=HTMLAudioTagPool;var c=a.prototype;c.constructor=a,c.get=function(){var a;return a=0==this._tags.length?this._createTag():this._tags.pop(),null==a.parentNode&&document.body.appendChild(a),a},c.set=function(a){var b=createjs.indexOf(this._tags,a);-1==b&&(this._tags.src=null,this._tags.push(a))},c.toString=function(){return"[TagPool]"},c._createTag=function(){var a=document.createElement("audio");return a.autoplay=!1,a.preload="none",a}}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioSoundInstance(a,b,c,d){this.AbstractSoundInstance_constructor(a,b,c,d),this._audioSpriteStopTime=null,this._delayTimeoutId=null,this._endedHandler=createjs.proxy(this._handleSoundComplete,this),this._readyHandler=createjs.proxy(this._handleTagReady,this),this._stalledHandler=createjs.proxy(this._playFailed,this),this._audioSpriteEndHandler=createjs.proxy(this._handleAudioSpriteLoop,this),this._loopHandler=createjs.proxy(this._handleSoundComplete,this),c?this._audioSpriteStopTime=.001*(b+c):this._duration=createjs.HTMLAudioTagPool.getDuration(this.src)}var a=createjs.extend(HTMLAudioSoundInstance,createjs.AbstractSoundInstance);a.setMasterVolume=function(){this._updateVolume()},a.setMasterMute=function(){this._updateVolume()},a.toString=function(){return"[HTMLAudioSoundInstance]"},a._removeLooping=function(){null!=this._playbackResource&&(this._playbackResource.loop=!1,this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._addLooping=function(){null==this._playbackResource||this._audioSpriteStopTime||(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.loop=!0)},a._handleCleanUp=function(){var a=this._playbackResource;if(null!=a){a.pause(),a.loop=!1,a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1);try{a.currentTime=this._startTime}catch(b){}createjs.HTMLAudioTagPool.set(this.src,a),this._playbackResource=null}},a._beginPlaying=function(a){return this._playbackResource=createjs.HTMLAudioTagPool.get(this.src),this.AbstractSoundInstance__beginPlaying(a)},a._handleSoundReady=function(){if(4!==this._playbackResource.readyState){var a=this._playbackResource;return a.addEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),a.addEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),a.preload="auto",void a.load()}this._updateVolume(),this._playbackResource.currentTime=.001*(this._startTime+this._position),this._audioSpriteStopTime?this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1):(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),0!=this._loop&&(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.loop=!0)),this._playbackResource.play()},a._handleTagReady=function(){this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),this._handleSoundReady()},a._pause=function(){this._playbackResource.pause()},a._resume=function(){this._playbackResource.play()},a._updateVolume=function(){if(null!=this._playbackResource){var a=this._muted||createjs.Sound._masterMute?0:this._volume*createjs.Sound._masterVolume;a!=this._playbackResource.volume&&(this._playbackResource.volume=a)}},a._calculateCurrentPosition=function(){return 1e3*this._playbackResource.currentTime-this._startTime},a._updatePosition=function(){this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._handleSetPositionSeek,!1);try{this._playbackResource.currentTime=.001*(this._position+this._startTime)}catch(a){this._handleSetPositionSeek(null)}},a._handleSetPositionSeek=function(){null!=this._playbackResource&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._handleSetPositionSeek,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._handleAudioSpriteLoop=function(){this._playbackResource.currentTime<=this._audioSpriteStopTime||(this._playbackResource.pause(),0==this._loop?this._handleSoundComplete(null):(this._position=0,this._loop--,this._playbackResource.currentTime=.001*this._startTime,this._paused||this._playbackResource.play(),this._sendEvent("loop")))},a._handleLoop=function(){0==this._loop&&(this._playbackResource.loop=!1,this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._updateStartTime=function(){this._audioSpriteStopTime=.001*(this._startTime+this._duration),this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1))},a._updateDuration=function(){this._audioSpriteStopTime=.001*(this._startTime+this._duration),this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1))},a._setDurationFromSource=function(){this._duration=createjs.HTMLAudioTagPool.getDuration(this.src),this._playbackResource=null},createjs.HTMLAudioSoundInstance=createjs.promote(HTMLAudioSoundInstance,"AbstractSoundInstance")}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioPlugin(){this.AbstractPlugin_constructor(),this._capabilities=b._capabilities,this._loaderClass=createjs.SoundLoader,this._soundInstanceClass=createjs.HTMLAudioSoundInstance}var a=createjs.extend(HTMLAudioPlugin,createjs.AbstractPlugin),b=HTMLAudioPlugin;b.MAX_INSTANCES=30,b._AUDIO_READY="canplaythrough",b._AUDIO_ENDED="ended",b._AUDIO_SEEKED="seeked",b._AUDIO_STALLED="stalled",b._TIME_UPDATE="timeupdate",b._capabilities=null,b.isSupported=function(){return b._generateCapabilities(),null!=b._capabilities},b._generateCapabilities=function(){if(null==b._capabilities){var a=document.createElement("audio");if(null==a.canPlayType)return null;b._capabilities={panning:!1,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}}},a.register=function(a){var b=createjs.HTMLAudioTagPool.get(a.src),c=this.AbstractPlugin_register(a);return c.setTag(b),c},a.removeSound=function(a){this.AbstractPlugin_removeSound(a),createjs.HTMLAudioTagPool.remove(a)},a.create=function(a,b,c){var d=this.AbstractPlugin_create(a,b,c);return d.playbackResource=null,d},a.toString=function(){return"[HTMLAudioPlugin]"},a.setVolume=a.getVolume=a.setMute=null,createjs.HTMLAudioPlugin=createjs.promote(HTMLAudioPlugin,"AbstractPlugin") +}(); \ No newline at end of file diff --git a/lib/soundjs-0.6.2.combined.js b/lib/soundjs.js similarity index 90% rename from lib/soundjs-0.6.2.combined.js rename to lib/soundjs.js index a7273c79..8797a113 100644 --- a/lib/soundjs-0.6.2.combined.js +++ b/lib/soundjs.js @@ -49,7 +49,7 @@ this.createjs = this.createjs || {}; * @type String * @static **/ - s.version = /*=version*/"0.6.2"; // injected by build process + s.version = /*=version*/"1.0.0"; // injected by build process /** * The build date for this release in UTC format. @@ -57,7 +57,7 @@ this.createjs = this.createjs || {}; * @type String * @static **/ - s.buildDate = /*=date*/"Thu, 26 Nov 2015 20:44:31 GMT"; // injected by build process + s.buildDate = /*=date*/"Thu, 12 Oct 2017 16:34:05 GMT"; // injected by build process })(); @@ -158,7 +158,49 @@ createjs.promote = function(subclass, prefix) { }; //############################################################################## -// IndexOf.js +// deprecate.js +//############################################################################## + +this.createjs = this.createjs||{}; + +/** + * @class Utility Methods + */ + +/** + * Wraps deprecated methods so they still be used, but throw warnings to developers. + * + * obj.deprecatedMethod = createjs.deprecate("Old Method Name", obj._fallbackMethod); + * + * The recommended approach for deprecated properties is: + * + * try { + * Obj ect.defineProperties(object, { + * readyOnlyProp: { get: createjs.deprecate("readOnlyProp", function() { return this.alternateProp; }) }, + * readWriteProp: { + * get: createjs.deprecate("readOnlyProp", function() { return this.alternateProp; }), + * set: createjs.deprecate("readOnlyProp", function(val) { this.alternateProp = val; }) + * }); + * } catch (e) {} + * + * @method deprecate + * @param {Function} [fallbackMethod=null] A method to call when the deprecated method is used. See the example for how + * @param {String} [name=null] The name of the method or property to display in the console warning. + * to deprecate properties. + * @return {Function} If a fallbackMethod is supplied, returns a closure that will call the fallback method after + * logging the warning in the console. + */ +createjs.deprecate = function(fallbackMethod, name) { + "use strict"; + return function() { + var msg = "Deprecated property or method '"+name+"'. See docs for info."; + console && (console.warn ? console.warn(msg) : console.log(msg)); + return fallbackMethod && fallbackMethod.apply(this, arguments); + } +}; + +//############################################################################## +// indexOf.js //############################################################################## this.createjs = this.createjs||{}; @@ -190,7 +232,7 @@ createjs.indexOf = function (array, searchElement){ }; //############################################################################## -// Proxy.js +// proxy.js //############################################################################## this.createjs = this.createjs||{}; @@ -296,396 +338,381 @@ this.createjs = this.createjs||{}; // EventDispatcher.js //############################################################################## -this.createjs = this.createjs||{}; - -(function() { - "use strict"; - - -// constructor: - /** - * EventDispatcher provides methods for managing queues of event listeners and dispatching events. - * - * You can either extend EventDispatcher or mix its methods into an existing prototype or instance by using the - * EventDispatcher {{#crossLink "EventDispatcher/initialize"}}{{/crossLink}} method. - * - * Together with the CreateJS Event class, EventDispatcher provides an extended event model that is based on the - * DOM Level 2 event model, including addEventListener, removeEventListener, and dispatchEvent. It supports - * bubbling / capture, preventDefault, stopPropagation, stopImmediatePropagation, and handleEvent. - * - * EventDispatcher also exposes a {{#crossLink "EventDispatcher/on"}}{{/crossLink}} method, which makes it easier - * to create scoped listeners, listeners that only run once, and listeners with associated arbitrary data. The - * {{#crossLink "EventDispatcher/off"}}{{/crossLink}} method is merely an alias to - * {{#crossLink "EventDispatcher/removeEventListener"}}{{/crossLink}}. - * - * Another addition to the DOM Level 2 model is the {{#crossLink "EventDispatcher/removeAllEventListeners"}}{{/crossLink}} - * method, which can be used to listeners for all events, or listeners for a specific event. The Event object also - * includes a {{#crossLink "Event/remove"}}{{/crossLink}} method which removes the active listener. - * - *

    Example

    - * Add EventDispatcher capabilities to the "MyClass" class. - * - * EventDispatcher.initialize(MyClass.prototype); - * - * Add an event (see {{#crossLink "EventDispatcher/addEventListener"}}{{/crossLink}}). - * - * instance.addEventListener("eventName", handlerMethod); - * function handlerMethod(event) { - * console.log(event.target + " Was Clicked"); - * } - * - * Maintaining proper scope
    - * Scope (ie. "this") can be be a challenge with events. Using the {{#crossLink "EventDispatcher/on"}}{{/crossLink}} - * method to subscribe to events simplifies this. - * - * instance.addEventListener("click", function(event) { - * console.log(instance == this); // false, scope is ambiguous. - * }); - * - * instance.on("click", function(event) { - * console.log(instance == this); // true, "on" uses dispatcher scope by default. - * }); - * - * If you want to use addEventListener instead, you may want to use function.bind() or a similar proxy to manage - * scope. - * - * Browser support - * The event model in CreateJS can be used separately from the suite in any project, however the inheritance model - * requires modern browsers (IE9+). - * - * - * @class EventDispatcher - * @constructor - **/ - function EventDispatcher() { - - - // private properties: - /** - * @protected - * @property _listeners - * @type Object - **/ - this._listeners = null; - - /** - * @protected - * @property _captureListeners - * @type Object - **/ - this._captureListeners = null; - } - var p = EventDispatcher.prototype; - - /** - * REMOVED. Removed in favor of using `MySuperClass_constructor`. - * See {{#crossLink "Utility Methods/extend"}}{{/crossLink}} and {{#crossLink "Utility Methods/promote"}}{{/crossLink}} - * for details. - * - * There is an inheritance tutorial distributed with EaselJS in /tutorials/Inheritance. - * - * @method initialize - * @protected - * @deprecated - */ - // p.initialize = function() {}; // searchable for devs wondering where it is. - - -// static public methods: - /** - * Static initializer to mix EventDispatcher methods into a target object or prototype. - * - * EventDispatcher.initialize(MyClass.prototype); // add to the prototype of the class - * EventDispatcher.initialize(myObject); // add to a specific instance - * - * @method initialize - * @static - * @param {Object} target The target object to inject EventDispatcher methods into. This can be an instance or a - * prototype. - **/ - EventDispatcher.initialize = function(target) { - target.addEventListener = p.addEventListener; - target.on = p.on; - target.removeEventListener = target.off = p.removeEventListener; - target.removeAllEventListeners = p.removeAllEventListeners; - target.hasEventListener = p.hasEventListener; - target.dispatchEvent = p.dispatchEvent; - target._dispatchEvent = p._dispatchEvent; - target.willTrigger = p.willTrigger; - }; - - -// public methods: - /** - * Adds the specified event listener. Note that adding multiple listeners to the same function will result in - * multiple callbacks getting fired. - * - *

    Example

    - * - * displayObject.addEventListener("click", handleClick); - * function handleClick(event) { - * // Click happened. - * } - * - * @method addEventListener - * @param {String} type The string type of the event. - * @param {Function | Object} listener An object with a handleEvent method, or a function that will be called when - * the event is dispatched. - * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. - * @return {Function | Object} Returns the listener for chaining or assignment. - **/ - p.addEventListener = function(type, listener, useCapture) { - var listeners; - if (useCapture) { - listeners = this._captureListeners = this._captureListeners||{}; - } else { - listeners = this._listeners = this._listeners||{}; - } - var arr = listeners[type]; - if (arr) { this.removeEventListener(type, listener, useCapture); } - arr = listeners[type]; // remove may have deleted the array - if (!arr) { listeners[type] = [listener]; } - else { arr.push(listener); } - return listener; - }; - - /** - * A shortcut method for using addEventListener that makes it easier to specify an execution scope, have a listener - * only run once, associate arbitrary data with the listener, and remove the listener. - * - * This method works by creating an anonymous wrapper function and subscribing it with addEventListener. - * The wrapper function is returned for use with `removeEventListener` (or `off`). - * - * IMPORTANT: To remove a listener added with `on`, you must pass in the returned wrapper function as the listener, or use - * {{#crossLink "Event/remove"}}{{/crossLink}}. Likewise, each time you call `on` a NEW wrapper function is subscribed, so multiple calls - * to `on` with the same params will create multiple listeners. - * - *

    Example

    - * - * var listener = myBtn.on("click", handleClick, null, false, {count:3}); - * function handleClick(evt, data) { - * data.count -= 1; - * console.log(this == myBtn); // true - scope defaults to the dispatcher - * if (data.count == 0) { - * alert("clicked 3 times!"); - * myBtn.off("click", listener); - * // alternately: evt.remove(); - * } - * } - * - * @method on - * @param {String} type The string type of the event. - * @param {Function | Object} listener An object with a handleEvent method, or a function that will be called when - * the event is dispatched. - * @param {Object} [scope] The scope to execute the listener in. Defaults to the dispatcher/currentTarget for function listeners, and to the listener itself for object listeners (ie. using handleEvent). - * @param {Boolean} [once=false] If true, the listener will remove itself after the first time it is triggered. - * @param {*} [data] Arbitrary data that will be included as the second parameter when the listener is called. - * @param {Boolean} [useCapture=false] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. - * @return {Function} Returns the anonymous function that was created and assigned as the listener. This is needed to remove the listener later using .removeEventListener. - **/ - p.on = function(type, listener, scope, once, data, useCapture) { - if (listener.handleEvent) { - scope = scope||listener; - listener = listener.handleEvent; - } - scope = scope||this; - return this.addEventListener(type, function(evt) { - listener.call(scope, evt, data); - once&&evt.remove(); - }, useCapture); - }; - - /** - * Removes the specified event listener. - * - * Important Note: that you must pass the exact function reference used when the event was added. If a proxy - * function, or function closure is used as the callback, the proxy/closure reference must be used - a new proxy or - * closure will not work. - * - *

    Example

    - * - * displayObject.removeEventListener("click", handleClick); - * - * @method removeEventListener - * @param {String} type The string type of the event. - * @param {Function | Object} listener The listener function or object. - * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. - **/ - p.removeEventListener = function(type, listener, useCapture) { - var listeners = useCapture ? this._captureListeners : this._listeners; - if (!listeners) { return; } - var arr = listeners[type]; - if (!arr) { return; } - for (var i=0,l=arr.length; iIMPORTANT: To remove a listener added with `on`, you must pass in the returned wrapper function as the listener. See - * {{#crossLink "EventDispatcher/on"}}{{/crossLink}} for an example. - * - * @method off - * @param {String} type The string type of the event. - * @param {Function | Object} listener The listener function or object. - * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. - **/ - p.off = p.removeEventListener; - - /** - * Removes all listeners for the specified type, or all listeners of all types. - * - *

    Example

    - * - * // Remove all listeners - * displayObject.removeAllEventListeners(); - * - * // Remove all click listeners - * displayObject.removeAllEventListeners("click"); - * - * @method removeAllEventListeners - * @param {String} [type] The string type of the event. If omitted, all listeners for all types will be removed. - **/ - p.removeAllEventListeners = function(type) { - if (!type) { this._listeners = this._captureListeners = null; } - else { - if (this._listeners) { delete(this._listeners[type]); } - if (this._captureListeners) { delete(this._captureListeners[type]); } - } - }; - - /** - * Dispatches the specified event to all listeners. - * - *

    Example

    - * - * // Use a string event - * this.dispatchEvent("complete"); - * - * // Use an Event instance - * var event = new createjs.Event("progress"); - * this.dispatchEvent(event); - * - * @method dispatchEvent - * @param {Object | String | Event} eventObj An object with a "type" property, or a string type. - * While a generic object will work, it is recommended to use a CreateJS Event instance. If a string is used, - * dispatchEvent will construct an Event instance if necessary with the specified type. This latter approach can - * be used to avoid event object instantiation for non-bubbling events that may not have any listeners. - * @param {Boolean} [bubbles] Specifies the `bubbles` value when a string was passed to eventObj. - * @param {Boolean} [cancelable] Specifies the `cancelable` value when a string was passed to eventObj. - * @return {Boolean} Returns false if `preventDefault()` was called on a cancelable event, true otherwise. - **/ - p.dispatchEvent = function(eventObj, bubbles, cancelable) { - if (typeof eventObj == "string") { - // skip everything if there's no listeners and it doesn't bubble: - var listeners = this._listeners; - if (!bubbles && (!listeners || !listeners[eventObj])) { return true; } - eventObj = new createjs.Event(eventObj, bubbles, cancelable); - } else if (eventObj.target && eventObj.clone) { - // redispatching an active event object, so clone it: - eventObj = eventObj.clone(); - } - - // TODO: it would be nice to eliminate this. Maybe in favour of evtObj instanceof Event? Or !!evtObj.createEvent - try { eventObj.target = this; } catch (e) {} // try/catch allows redispatching of native events - - if (!eventObj.bubbles || !this.parent) { - this._dispatchEvent(eventObj, 2); - } else { - var top=this, list=[top]; - while (top.parent) { list.push(top = top.parent); } - var i, l=list.length; - - // capture & atTarget - for (i=l-1; i>=0 && !eventObj.propagationStopped; i--) { - list[i]._dispatchEvent(eventObj, 1+(i==0)); - } - // bubbling - for (i=1; iExample + * Add EventDispatcher capabilities to the "MyClass" class. + * + * EventDispatcher.initialize(MyClass.prototype); + * + * Add an event (see {{#crossLink "EventDispatcher/addEventListener"}}{{/crossLink}}). + * + * instance.addEventListener("eventName", handlerMethod); + * function handlerMethod(event) { + * console.log(event.target + " Was Clicked"); + * } + * + * Maintaining proper scope
    + * Scope (ie. "this") can be be a challenge with events. Using the {{#crossLink "EventDispatcher/on"}}{{/crossLink}} + * method to subscribe to events simplifies this. + * + * instance.addEventListener("click", function(event) { + * console.log(instance == this); // false, scope is ambiguous. + * }); + * + * instance.on("click", function(event) { + * console.log(instance == this); // true, "on" uses dispatcher scope by default. + * }); + * + * If you want to use addEventListener instead, you may want to use function.bind() or a similar proxy to manage + * scope. + * + * Browser support + * The event model in CreateJS can be used separately from the suite in any project, however the inheritance model + * requires modern browsers (IE9+). + * + * + * @class EventDispatcher + * @constructor + **/ + function EventDispatcher() { + + + // private properties: + /** + * @protected + * @property _listeners + * @type Object + **/ + this._listeners = null; + + /** + * @protected + * @property _captureListeners + * @type Object + **/ + this._captureListeners = null; + } + var p = EventDispatcher.prototype; + +// static public methods: + /** + * Static initializer to mix EventDispatcher methods into a target object or prototype. + * + * EventDispatcher.initialize(MyClass.prototype); // add to the prototype of the class + * EventDispatcher.initialize(myObject); // add to a specific instance + * + * @method initialize + * @static + * @param {Object} target The target object to inject EventDispatcher methods into. This can be an instance or a + * prototype. + **/ + EventDispatcher.initialize = function(target) { + target.addEventListener = p.addEventListener; + target.on = p.on; + target.removeEventListener = target.off = p.removeEventListener; + target.removeAllEventListeners = p.removeAllEventListeners; + target.hasEventListener = p.hasEventListener; + target.dispatchEvent = p.dispatchEvent; + target._dispatchEvent = p._dispatchEvent; + target.willTrigger = p.willTrigger; + }; + + +// public methods: + /** + * Adds the specified event listener. Note that adding multiple listeners to the same function will result in + * multiple callbacks getting fired. + * + *

    Example

    + * + * displayObject.addEventListener("click", handleClick); + * function handleClick(event) { + * // Click happened. + * } + * + * @method addEventListener + * @param {String} type The string type of the event. + * @param {Function | Object} listener An object with a handleEvent method, or a function that will be called when + * the event is dispatched. + * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. + * @return {Function | Object} Returns the listener for chaining or assignment. + **/ + p.addEventListener = function(type, listener, useCapture) { + var listeners; + if (useCapture) { + listeners = this._captureListeners = this._captureListeners||{}; + } else { + listeners = this._listeners = this._listeners||{}; + } + var arr = listeners[type]; + if (arr) { this.removeEventListener(type, listener, useCapture); } + arr = listeners[type]; // remove may have deleted the array + if (!arr) { listeners[type] = [listener]; } + else { arr.push(listener); } + return listener; + }; + + /** + * A shortcut method for using addEventListener that makes it easier to specify an execution scope, have a listener + * only run once, associate arbitrary data with the listener, and remove the listener. + * + * This method works by creating an anonymous wrapper function and subscribing it with addEventListener. + * The wrapper function is returned for use with `removeEventListener` (or `off`). + * + * IMPORTANT: To remove a listener added with `on`, you must pass in the returned wrapper function as the listener, or use + * {{#crossLink "Event/remove"}}{{/crossLink}}. Likewise, each time you call `on` a NEW wrapper function is subscribed, so multiple calls + * to `on` with the same params will create multiple listeners. + * + *

    Example

    + * + * var listener = myBtn.on("click", handleClick, null, false, {count:3}); + * function handleClick(evt, data) { + * data.count -= 1; + * console.log(this == myBtn); // true - scope defaults to the dispatcher + * if (data.count == 0) { + * alert("clicked 3 times!"); + * myBtn.off("click", listener); + * // alternately: evt.remove(); + * } + * } + * + * @method on + * @param {String} type The string type of the event. + * @param {Function | Object} listener An object with a handleEvent method, or a function that will be called when + * the event is dispatched. + * @param {Object} [scope] The scope to execute the listener in. Defaults to the dispatcher/currentTarget for function listeners, and to the listener itself for object listeners (ie. using handleEvent). + * @param {Boolean} [once=false] If true, the listener will remove itself after the first time it is triggered. + * @param {*} [data] Arbitrary data that will be included as the second parameter when the listener is called. + * @param {Boolean} [useCapture=false] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. + * @return {Function} Returns the anonymous function that was created and assigned as the listener. This is needed to remove the listener later using .removeEventListener. + **/ + p.on = function(type, listener, scope, once, data, useCapture) { + if (listener.handleEvent) { + scope = scope||listener; + listener = listener.handleEvent; + } + scope = scope||this; + return this.addEventListener(type, function(evt) { + listener.call(scope, evt, data); + once&&evt.remove(); + }, useCapture); + }; + + /** + * Removes the specified event listener. + * + * Important Note: that you must pass the exact function reference used when the event was added. If a proxy + * function, or function closure is used as the callback, the proxy/closure reference must be used - a new proxy or + * closure will not work. + * + *

    Example

    + * + * displayObject.removeEventListener("click", handleClick); + * + * @method removeEventListener + * @param {String} type The string type of the event. + * @param {Function | Object} listener The listener function or object. + * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. + **/ + p.removeEventListener = function(type, listener, useCapture) { + var listeners = useCapture ? this._captureListeners : this._listeners; + if (!listeners) { return; } + var arr = listeners[type]; + if (!arr) { return; } + for (var i=0,l=arr.length; iIMPORTANT: To remove a listener added with `on`, you must pass in the returned wrapper function as the listener. See + * {{#crossLink "EventDispatcher/on"}}{{/crossLink}} for an example. + * + * @method off + * @param {String} type The string type of the event. + * @param {Function | Object} listener The listener function or object. + * @param {Boolean} [useCapture] For events that bubble, indicates whether to listen for the event in the capture or bubbling/target phase. + **/ + p.off = p.removeEventListener; + + /** + * Removes all listeners for the specified type, or all listeners of all types. + * + *

    Example

    + * + * // Remove all listeners + * displayObject.removeAllEventListeners(); + * + * // Remove all click listeners + * displayObject.removeAllEventListeners("click"); + * + * @method removeAllEventListeners + * @param {String} [type] The string type of the event. If omitted, all listeners for all types will be removed. + **/ + p.removeAllEventListeners = function(type) { + if (!type) { this._listeners = this._captureListeners = null; } + else { + if (this._listeners) { delete(this._listeners[type]); } + if (this._captureListeners) { delete(this._captureListeners[type]); } + } + }; + + /** + * Dispatches the specified event to all listeners. + * + *

    Example

    + * + * // Use a string event + * this.dispatchEvent("complete"); + * + * // Use an Event instance + * var event = new createjs.Event("progress"); + * this.dispatchEvent(event); + * + * @method dispatchEvent + * @param {Object | String | Event} eventObj An object with a "type" property, or a string type. + * While a generic object will work, it is recommended to use a CreateJS Event instance. If a string is used, + * dispatchEvent will construct an Event instance if necessary with the specified type. This latter approach can + * be used to avoid event object instantiation for non-bubbling events that may not have any listeners. + * @param {Boolean} [bubbles] Specifies the `bubbles` value when a string was passed to eventObj. + * @param {Boolean} [cancelable] Specifies the `cancelable` value when a string was passed to eventObj. + * @return {Boolean} Returns false if `preventDefault()` was called on a cancelable event, true otherwise. + **/ + p.dispatchEvent = function(eventObj, bubbles, cancelable) { + if (typeof eventObj == "string") { + // skip everything if there's no listeners and it doesn't bubble: + var listeners = this._listeners; + if (!bubbles && (!listeners || !listeners[eventObj])) { return true; } + eventObj = new createjs.Event(eventObj, bubbles, cancelable); + } else if (eventObj.target && eventObj.clone) { + // redispatching an active event object, so clone it: + eventObj = eventObj.clone(); + } + + // TODO: it would be nice to eliminate this. Maybe in favour of evtObj instanceof Event? Or !!evtObj.createEvent + try { eventObj.target = this; } catch (e) {} // try/catch allows redispatching of native events + + if (!eventObj.bubbles || !this.parent) { + this._dispatchEvent(eventObj, 2); + } else { + var top=this, list=[top]; + while (top.parent) { list.push(top = top.parent); } + var i, l=list.length; + + // capture & atTarget + for (i=l-1; i>=0 && !eventObj.propagationStopped; i--) { + list[i]._dispatchEvent(eventObj, 1+(i==0)); + } + // bubbling + for (i=1; iREMOVED. Removed in favor of using `MySuperClass_constructor`. - * See {{#crossLink "Utility Methods/extend"}}{{/crossLink}} and {{#crossLink "Utility Methods/promote"}}{{/crossLink}} - * for details. - * - * There is an inheritance tutorial distributed with EaselJS in /tutorials/Inheritance. - * - * @method initialize - * @protected - * @deprecated - */ - // p.initialize = function() {}; // searchable for devs wondering where it is. - // public methods: /** * Sets {{#crossLink "Event/defaultPrevented"}}{{/crossLink}} to true if the event is cancelable. @@ -1104,14 +1118,14 @@ this.createjs = this.createjs || {}; this.data = null; /** - * The request method used for HTTP calls. Both {{#crossLink "AbstractLoader/GET:property"}}{{/crossLink}} or - * {{#crossLink "AbstractLoader/POST:property"}}{{/crossLink}} request types are supported, and are defined as + * The request method used for HTTP calls. Both {{#crossLink "Methods/GET:property"}}{{/crossLink}} or + * {{#crossLink "Methods/POST:property"}}{{/crossLink}} request types are supported, and are defined as * constants on {{#crossLink "AbstractLoader"}}{{/crossLink}}. * @property method * @type {String} - * @default get + * @default GET */ - this.method = createjs.LoadItem.GET; + this.method = createjs.Methods.GET; /** * An object hash of name/value pairs to send to the server. @@ -1228,188 +1242,328 @@ this.createjs = this.createjs || {}; }()); //############################################################################## -// RequestUtils.js +// Methods.js //############################################################################## -(function () { +this.createjs = this.createjs || {}; - /** - * Utilities that assist with parsing load items, and determining file types, etc. - * @class RequestUtils - */ +(function() { var s = {}; /** - * The Regular Expression used to test file URLS for an absolute path. - * @property ABSOLUTE_PATH - * @type {RegExp} + * Defines a POST request, use for a method value when loading data. + * @property POST + * @type {string} + * @default post * @static */ - s.ABSOLUTE_PATT = /^(?:\w+:)?\/{2}/i; + s.POST = "POST"; /** - * The Regular Expression used to test file URLS for a relative path. - * @property RELATIVE_PATH - * @type {RegExp} + * Defines a GET request, use for a method value when loading data. + * @property GET + * @type {string} + * @default get * @static */ - s.RELATIVE_PATT = (/^[./]*?\//i); + s.GET = "GET"; + + createjs.Methods = s; +}()); + +//############################################################################## +// Types.js +//############################################################################## + +this.createjs = this.createjs || {}; + +(function() { + var s = {}; /** - * The Regular Expression used to test file URLS for an extension. Note that URIs must already have the query string - * removed. - * @property EXTENSION_PATT - * @type {RegExp} + * The preload type for generic binary types. Note that images are loaded as binary files when using XHR. + * @property BINARY + * @type {String} + * @default binary * @static + * @since 0.6.0 */ - s.EXTENSION_PATT = /\/?[^/]+\.(\w{1,5})$/i; + s.BINARY = "binary"; /** - * Parse a file path to determine the information we need to work with it. Currently, PreloadJS needs to know: - *
      - *
    • If the path is absolute. Absolute paths start with a protocol (such as `http://`, `file://`, or - * `//networkPath`)
    • - *
    • If the path is relative. Relative paths start with `../` or `/path` (or similar)
    • - *
    • The file extension. This is determined by the filename with an extension. Query strings are dropped, and - * the file path is expected to follow the format `name.ext`.
    • - *
    - * @method parseURI - * @param {String} path - * @returns {Object} An Object with an `absolute` and `relative` Boolean values, as well as an optional 'extension` - * property, which is the lowercase extension. + * The preload type for css files. CSS files are loaded using a <link> when loaded with XHR, or a + * <style> tag when loaded with tags. + * @property CSS + * @type {String} + * @default css * @static + * @since 0.6.0 */ - s.parseURI = function (path) { - var info = {absolute: false, relative: false}; - if (path == null) { return info; } + s.CSS = "css"; - // Drop the query string - var queryIndex = path.indexOf("?"); - if (queryIndex > -1) { - path = path.substr(0, queryIndex); - } + /** + * The preload type for font files. + * @property FONT + * @type {String} + * @default font + * @static + * @since 0.9.0 + */ + s.FONT = "font"; - // Absolute - var match; - if (s.ABSOLUTE_PATT.test(path)) { - info.absolute = true; + /** + * The preload type for fonts specified with CSS (such as Google fonts) + * @property FONTCSS + * @type {String} + * @default fontcss + * @static + * @since 0.9.0 + */ + s.FONTCSS = "fontcss"; - // Relative - } else if (s.RELATIVE_PATT.test(path)) { - info.relative = true; - } - - // Extension - if (match = path.match(s.EXTENSION_PATT)) { - info.extension = match[1].toLowerCase(); - } - return info; - }; + /** + * The preload type for image files, usually png, gif, or jpg/jpeg. Images are loaded into an <image> tag. + * @property IMAGE + * @type {String} + * @default image + * @static + * @since 0.6.0 + */ + s.IMAGE = "image"; /** - * Formats an object into a query string for either a POST or GET request. - * @method formatQueryString - * @param {Object} data The data to convert to a query string. - * @param {Array} [query] Existing name/value pairs to append on to this query. + * The preload type for javascript files, usually with the "js" file extension. JavaScript files are loaded into a + * <script> tag. + * + * Since version 0.4.1+, due to how tag-loaded scripts work, all JavaScript files are automatically injected into + * the body of the document to maintain parity between XHR and tag-loaded scripts. In version 0.4.0 and earlier, + * only tag-loaded scripts are injected. + * @property JAVASCRIPT + * @type {String} + * @default javascript * @static + * @since 0.6.0 */ - s.formatQueryString = function (data, query) { - if (data == null) { - throw new Error('You must specify data.'); - } - var params = []; - for (var n in data) { - params.push(n + '=' + escape(data[n])); - } - if (query) { - params = params.concat(query); - } - return params.join('&'); - }; + s.JAVASCRIPT = "javascript"; /** - * A utility method that builds a file path using a source and a data object, and formats it into a new path. - * @method buildPath - * @param {String} src The source path to add values to. - * @param {Object} [data] Object used to append values to this request as a query string. Existing parameters on the - * path will be preserved. - * @returns {string} A formatted string that contains the path and the supplied parameters. + * The preload type for json files, usually with the "json" file extension. JSON data is loaded and parsed into a + * JavaScript object. Note that if a `callback` is present on the load item, the file will be loaded with JSONP, + * no matter what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} property is set to, and the JSON + * must contain a matching wrapper function. + * @property JSON + * @type {String} + * @default json * @static + * @since 0.6.0 */ - s.buildPath = function (src, data) { - if (data == null) { - return src; - } + s.JSON = "json"; - var query = []; - var idx = src.indexOf('?'); + /** + * The preload type for jsonp files, usually with the "json" file extension. JSON data is loaded and parsed into a + * JavaScript object. You are required to pass a callback parameter that matches the function wrapper in the JSON. + * Note that JSONP will always be used if there is a callback present, no matter what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} + * property is set to. + * @property JSONP + * @type {String} + * @default jsonp + * @static + * @since 0.6.0 + */ + s.JSONP = "jsonp"; - if (idx != -1) { - var q = src.slice(idx + 1); - query = query.concat(q.split('&')); - } + /** + * The preload type for json-based manifest files, usually with the "json" file extension. The JSON data is loaded + * and parsed into a JavaScript object. PreloadJS will then look for a "manifest" property in the JSON, which is an + * Array of files to load, following the same format as the {{#crossLink "LoadQueue/loadManifest"}}{{/crossLink}} + * method. If a "callback" is specified on the manifest object, then it will be loaded using JSONP instead, + * regardless of what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} property is set to. + * @property MANIFEST + * @type {String} + * @default manifest + * @static + * @since 0.6.0 + */ + s.MANIFEST = "manifest"; - if (idx != -1) { - return src.slice(0, idx) + '?' + this.formatQueryString(data, query); - } else { - return src + '?' + this.formatQueryString(data, query); - } - }; + /** + * The preload type for sound files, usually mp3, ogg, or wav. When loading via tags, audio is loaded into an + * <audio> tag. + * @property SOUND + * @type {String} + * @default sound + * @static + * @since 0.6.0 + */ + s.SOUND = "sound"; /** - * @method isCrossDomain - * @param {LoadItem|Object} item A load item with a `src` property. - * @return {Boolean} If the load item is loading from a different domain than the current location. + * The preload type for video files, usually mp4, ts, or ogg. When loading via tags, video is loaded into an + * <video> tag. + * @property VIDEO + * @type {String} + * @default video * @static + * @since 0.6.0 */ - s.isCrossDomain = function (item) { - var target = document.createElement("a"); - target.href = item.src; + s.VIDEO = "video"; - var host = document.createElement("a"); - host.href = location.href; + /** + * The preload type for SpriteSheet files. SpriteSheet files are JSON files that contain string image paths. + * @property SPRITESHEET + * @type {String} + * @default spritesheet + * @static + * @since 0.6.0 + */ + s.SPRITESHEET = "spritesheet"; - var crossdomain = (target.hostname != "") && - (target.port != host.port || - target.protocol != host.protocol || - target.hostname != host.hostname); - return crossdomain; - }; + /** + * The preload type for SVG files. + * @property SVG + * @type {String} + * @default svg + * @static + * @since 0.6.0 + */ + s.SVG = "svg"; /** - * @method isLocal - * @param {LoadItem|Object} item A load item with a `src` property - * @return {Boolean} If the load item is loading from the "file:" protocol. Assume that the host must be local as - * well. + * The preload type for text files, which is also the default file type if the type can not be determined. Text is + * loaded as raw text. + * @property TEXT + * @type {String} + * @default text * @static + * @since 0.6.0 */ - s.isLocal = function (item) { - var target = document.createElement("a"); - target.href = item.src; - return target.hostname == "" && target.protocol == "file:"; - }; + s.TEXT = "text"; /** - * Determine if a specific type should be loaded as a binary file. Currently, only images and items marked - * specifically as "binary" are loaded as binary. Note that audio is not a binary type, as we can not play - * back using an audio tag if it is loaded as binary. Plugins can change the item type to binary to ensure they get - * a binary result to work with. Binary files are loaded using XHR2. Types are defined as static constants on - * {{#crossLink "AbstractLoader"}}{{/crossLink}}. - * @method isBinary - * @param {String} type The item type. - * @return {Boolean} If the specified type is binary. + * The preload type for xml files. XML is loaded into an XML document. + * @property XML + * @type {String} + * @default xml * @static + * @since 0.6.0 */ - s.isBinary = function (type) { - switch (type) { - case createjs.AbstractLoader.IMAGE: - case createjs.AbstractLoader.BINARY: - return true; - default: - return false; - } + s.XML = "xml"; + + createjs.Types = s; +}()); + +//############################################################################## +// Elements.js +//############################################################################## + +(function () { + + /** + * Convenience methods for creating various elements used by PrelaodJS. + * + * @class DomUtils + */ + var s = {}; + + s.a = function() { + return s.el("a"); + } + + s.svg = function() { + return s.el("svg"); + } + + s.object = function() { + return s.el("object"); + } + + s.image = function() { + return s.el("image"); + } + + s.img = function() { + return s.el("img"); + } + + s.style = function() { + return s.el("style"); + } + + s.link = function() { + return s.el("link"); + } + + s.script = function() { + return s.el("script"); + } + + s.audio = function() { + return s.el("audio"); + } + + s.video = function() { + return s.el("video"); + } + + s.text = function(value) { + return document.createTextNode(value); + } + + s.el = function(name) { + return document.createElement(name); + } + + createjs.Elements = s; + +}()); + +//############################################################################## +// DomUtils.js +//############################################################################## + +(function () { + + /** + * A few utilities for interacting with the dom. + * @class DomUtils + */ + var s = { + container: null }; + s.appendToHead = function (el) { + s.getHead().appendChild(el); + } + + s.appendToBody = function (el) { + if (s.container == null) { + s.container = document.createElement("div"); + s.container.id = "preloadjs-container"; + var style = s.container.style; + style.visibility = "hidden"; + style.position = "absolute"; + style.width = s.container.style.height = "10px"; + style.overflow = "hidden"; + style.transform = style.msTransform = style.webkitTransform = style.oTransform = "translate(-10px, -10px)"; //LM: Not working + s.getBody().appendChild(s.container); + } + s.container.appendChild(el); + } + + s.getHead = function () { + return document.head || document.getElementsByTagName("head")[0]; + } + + s.getBody = function () { + return document.body || document.getElementsByTagName("body")[0]; + } + + s.removeChild = function(el) { + if (el.parent) { + el.parent.removeChild(el); + } + } + /** * Check if item is a valid HTMLImageElement * @method isImageTag @@ -1451,6 +1605,43 @@ this.createjs = this.createjs || {}; } }; + createjs.DomUtils = s; + +}()); + +//############################################################################## +// RequestUtils.js +//############################################################################## + +(function () { + + /** + * Utilities that assist with parsing load items, and determining file types, etc. + * @class RequestUtils + */ + var s = {}; + + /** + * Determine if a specific type should be loaded as a binary file. Currently, only images and items marked + * specifically as "binary" are loaded as binary. Note that audio is not a binary type, as we can not play + * back using an audio tag if it is loaded as binary. Plugins can change the item type to binary to ensure they get + * a binary result to work with. Binary files are loaded using XHR2. Types are defined as static constants on + * {{#crossLink "AbstractLoader"}}{{/crossLink}}. + * @method isBinary + * @param {String} type The item type. + * @return {Boolean} If the specified type is binary. + * @static + */ + s.isBinary = function (type) { + switch (type) { + case createjs.Types.IMAGE: + case createjs.Types.BINARY: + return true; + default: + return false; + } + }; + /** * Determine if a specific type is a text-based asset, and should be loaded as UTF-8. * @method isText @@ -1460,14 +1651,14 @@ this.createjs = this.createjs || {}; */ s.isText = function (type) { switch (type) { - case createjs.AbstractLoader.TEXT: - case createjs.AbstractLoader.JSON: - case createjs.AbstractLoader.MANIFEST: - case createjs.AbstractLoader.XML: - case createjs.AbstractLoader.CSS: - case createjs.AbstractLoader.SVG: - case createjs.AbstractLoader.JAVASCRIPT: - case createjs.AbstractLoader.SPRITESHEET: + case createjs.Types.TEXT: + case createjs.Types.JSON: + case createjs.Types.MANIFEST: + case createjs.Types.XML: + case createjs.Types.CSS: + case createjs.Types.SVG: + case createjs.Types.JAVASCRIPT: + case createjs.Types.SPRITESHEET: return true; default: return false; @@ -1479,13 +1670,13 @@ this.createjs = this.createjs || {}; * if it is an unusual extension. * @method getTypeByExtension * @param {String} extension The file extension to use to determine the load type. - * @return {String} The determined load type (for example, AbstractLoader.IMAGE). Will return `null` if + * @return {String} The determined load type (for example, `createjs.Types.IMAGE`). Will return `null` if * the type can not be determined by the extension. * @static */ s.getTypeByExtension = function (extension) { if (extension == null) { - return createjs.AbstractLoader.TEXT; + return createjs.Types.TEXT; } switch (extension.toLowerCase()) { @@ -1495,31 +1686,222 @@ this.createjs = this.createjs || {}; case "png": case "webp": case "bmp": - return createjs.AbstractLoader.IMAGE; + return createjs.Types.IMAGE; case "ogg": case "mp3": case "webm": - return createjs.AbstractLoader.SOUND; + return createjs.Types.SOUND; case "mp4": case "webm": case "ts": - return createjs.AbstractLoader.VIDEO; + return createjs.Types.VIDEO; case "json": - return createjs.AbstractLoader.JSON; + return createjs.Types.JSON; case "xml": - return createjs.AbstractLoader.XML; + return createjs.Types.XML; case "css": - return createjs.AbstractLoader.CSS; + return createjs.Types.CSS; case "js": - return createjs.AbstractLoader.JAVASCRIPT; + return createjs.Types.JAVASCRIPT; case 'svg': - return createjs.AbstractLoader.SVG; + return createjs.Types.SVG; default: - return createjs.AbstractLoader.TEXT; + return createjs.Types.TEXT; } }; - createjs.RequestUtils = s; + createjs.RequestUtils = s; + +}()); + +//############################################################################## +// URLUtils.js +//############################################################################## + +(function () { + + /** + * Utilities that assist with parsing load items, and determining file types, etc. + * @class URLUtils + */ + var s = {}; + + /** + * The Regular Expression used to test file URLS for an absolute path. + * @property ABSOLUTE_PATH + * @type {RegExp} + * @static + */ + s.ABSOLUTE_PATT = /^(?:\w+:)?\/{2}/i; + + /** + * The Regular Expression used to test file URLS for a relative path. + * @property RELATIVE_PATH + * @type {RegExp} + * @static + */ + s.RELATIVE_PATT = (/^[./]*?\//i); + + /** + * The Regular Expression used to test file URLS for an extension. Note that URIs must already have the query string + * removed. + * @property EXTENSION_PATT + * @type {RegExp} + * @static + */ + s.EXTENSION_PATT = /\/?[^/]+\.(\w{1,5})$/i; + + /** + * Parse a file path to determine the information we need to work with it. Currently, PreloadJS needs to know: + *
      + *
    • If the path is absolute. Absolute paths start with a protocol (such as `http://`, `file://`, or + * `//networkPath`)
    • + *
    • If the path is relative. Relative paths start with `../` or `/path` (or similar)
    • + *
    • The file extension. This is determined by the filename with an extension. Query strings are dropped, and + * the file path is expected to follow the format `name.ext`.
    • + *
    + * + * @method parseURI + * @param {String} path + * @returns {Object} An Object with an `absolute` and `relative` Boolean values, + * the pieces of the path (protocol, hostname, port, pathname, search, hash, host) + * as well as an optional 'extension` property, which is the lowercase extension. + * + * @static + */ + s.parseURI = function (path) { + var info = { + absolute: false, + relative: false, + protocol: null, + hostname: null, + port: null, + pathname: null, + search: null, + hash: null, + host: null + }; + + if (path == null) { return info; } + + // Inject the path parts. + var parser = createjs.Elements.a(); + parser.href = path; + + for (var n in info) { + if (n in parser) { + info[n] = parser[n]; + } + } + + // Drop the query string + var queryIndex = path.indexOf("?"); + if (queryIndex > -1) { + path = path.substr(0, queryIndex); + } + + // Absolute + var match; + if (s.ABSOLUTE_PATT.test(path)) { + info.absolute = true; + + // Relative + } else if (s.RELATIVE_PATT.test(path)) { + info.relative = true; + } + + // Extension + if (match = path.match(s.EXTENSION_PATT)) { + info.extension = match[1].toLowerCase(); + } + + return info; + }; + + /** + * Formats an object into a query string for either a POST or GET request. + * @method formatQueryString + * @param {Object} data The data to convert to a query string. + * @param {Array} [query] Existing name/value pairs to append on to this query. + * @static + */ + s.formatQueryString = function (data, query) { + if (data == null) { + throw new Error("You must specify data."); + } + var params = []; + for (var n in data) { + params.push(n + "=" + escape(data[n])); + } + if (query) { + params = params.concat(query); + } + return params.join("&"); + }; + + /** + * A utility method that builds a file path using a source and a data object, and formats it into a new path. + * @method buildURI + * @param {String} src The source path to add values to. + * @param {Object} [data] Object used to append values to this request as a query string. Existing parameters on the + * path will be preserved. + * @returns {string} A formatted string that contains the path and the supplied parameters. + * @static + */ + s.buildURI = function (src, data) { + if (data == null) { + return src; + } + + var query = []; + var idx = src.indexOf("?"); + + if (idx != -1) { + var q = src.slice(idx + 1); + query = query.concat(q.split("&")); + } + + if (idx != -1) { + return src.slice(0, idx) + "?" + this.formatQueryString(data, query); + } else { + return src + "?" + this.formatQueryString(data, query); + } + }; + + /** + * @method isCrossDomain + * @param {LoadItem|Object} item A load item with a `src` property. + * @return {Boolean} If the load item is loading from a different domain than the current location. + * @static + */ + s.isCrossDomain = function (item) { + var target = createjs.Elements.a(); + target.href = item.src; + + var host = createjs.Elements.a(); + host.href = location.href; + + var crossdomain = (target.hostname != "") && + (target.port != host.port || + target.protocol != host.protocol || + target.hostname != host.hostname); + return crossdomain; + }; + + /** + * @method isLocal + * @param {LoadItem|Object} item A load item with a `src` property + * @return {Boolean} If the load item is loading from the "file:" protocol. Assume that the host must be local as + * well. + * @static + */ + s.isLocal = function (item) { + var target = createjs.Elements.a(); + target.href = item.src; + return target.hostname == "" && target.protocol == "file:"; + }; + + createjs.URLUtils = s; }()); @@ -1689,176 +2071,29 @@ this.createjs = this.createjs || {}; var p = createjs.extend(AbstractLoader, createjs.EventDispatcher); var s = AbstractLoader; - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - - /** - * Defines a POST request, use for a method value when loading data. - * @property POST - * @type {string} - * @default post - * @static - */ - s.POST = "POST"; - - /** - * Defines a GET request, use for a method value when loading data. - * @property GET - * @type {string} - * @default get - * @static - */ - s.GET = "GET"; - - /** - * The preload type for generic binary types. Note that images are loaded as binary files when using XHR. - * @property BINARY - * @type {String} - * @default binary - * @static - * @since 0.6.0 - */ - s.BINARY = "binary"; - - /** - * The preload type for css files. CSS files are loaded using a <link> when loaded with XHR, or a - * <style> tag when loaded with tags. - * @property CSS - * @type {String} - * @default css - * @static - * @since 0.6.0 - */ - s.CSS = "css"; - - /** - * The preload type for image files, usually png, gif, or jpg/jpeg. Images are loaded into an <image> tag. - * @property IMAGE - * @type {String} - * @default image - * @static - * @since 0.6.0 - */ - s.IMAGE = "image"; - - /** - * The preload type for javascript files, usually with the "js" file extension. JavaScript files are loaded into a - * <script> tag. - * - * Since version 0.4.1+, due to how tag-loaded scripts work, all JavaScript files are automatically injected into - * the body of the document to maintain parity between XHR and tag-loaded scripts. In version 0.4.0 and earlier, - * only tag-loaded scripts are injected. - * @property JAVASCRIPT - * @type {String} - * @default javascript - * @static - * @since 0.6.0 - */ - s.JAVASCRIPT = "javascript"; - - /** - * The preload type for json files, usually with the "json" file extension. JSON data is loaded and parsed into a - * JavaScript object. Note that if a `callback` is present on the load item, the file will be loaded with JSONP, - * no matter what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} property is set to, and the JSON - * must contain a matching wrapper function. - * @property JSON - * @type {String} - * @default json - * @static - * @since 0.6.0 - */ - s.JSON = "json"; - - /** - * The preload type for jsonp files, usually with the "json" file extension. JSON data is loaded and parsed into a - * JavaScript object. You are required to pass a callback parameter that matches the function wrapper in the JSON. - * Note that JSONP will always be used if there is a callback present, no matter what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} - * property is set to. - * @property JSONP - * @type {String} - * @default jsonp - * @static - * @since 0.6.0 - */ - s.JSONP = "jsonp"; - - /** - * The preload type for json-based manifest files, usually with the "json" file extension. The JSON data is loaded - * and parsed into a JavaScript object. PreloadJS will then look for a "manifest" property in the JSON, which is an - * Array of files to load, following the same format as the {{#crossLink "LoadQueue/loadManifest"}}{{/crossLink}} - * method. If a "callback" is specified on the manifest object, then it will be loaded using JSONP instead, - * regardless of what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} property is set to. - * @property MANIFEST - * @type {String} - * @default manifest - * @static - * @since 0.6.0 - */ - s.MANIFEST = "manifest"; - - /** - * The preload type for sound files, usually mp3, ogg, or wav. When loading via tags, audio is loaded into an - * <audio> tag. - * @property SOUND - * @type {String} - * @default sound - * @static - * @since 0.6.0 - */ - s.SOUND = "sound"; - - /** - * The preload type for video files, usually mp4, ts, or ogg. When loading via tags, video is loaded into an - * <video> tag. - * @property VIDEO - * @type {String} - * @default video - * @static - * @since 0.6.0 - */ - s.VIDEO = "video"; - - /** - * The preload type for SpriteSheet files. SpriteSheet files are JSON files that contain string image paths. - * @property SPRITESHEET - * @type {String} - * @default spritesheet - * @static - * @since 0.6.0 - */ - s.SPRITESHEET = "spritesheet"; - - /** - * The preload type for SVG files. - * @property SVG - * @type {String} - * @default svg - * @static - * @since 0.6.0 - */ - s.SVG = "svg"; - - /** - * The preload type for text files, which is also the default file type if the type can not be determined. Text is - * loaded as raw text. - * @property TEXT - * @type {String} - * @default text - * @static - * @since 0.6.0 - */ - s.TEXT = "text"; - - /** - * The preload type for xml files. XML is loaded into an XML document. - * @property XML - * @type {String} - * @default xml - * @static - * @since 0.6.0 - */ - s.XML = "xml"; + // Remove these @deprecated properties after 1.0 + try { + Object.defineProperties(s, { + POST: { get: createjs.deprecate(function() { return createjs.Methods.POST; }, "AbstractLoader.POST") }, + GET: { get: createjs.deprecate(function() { return createjs.Methods.GET; }, "AbstractLoader.GET") }, + + BINARY: { get: createjs.deprecate(function() { return createjs.Types.BINARY; }, "AbstractLoader.BINARY") }, + CSS: { get: createjs.deprecate(function() { return createjs.Types.CSS; }, "AbstractLoader.CSS") }, + FONT: { get: createjs.deprecate(function() { return createjs.Types.FONT; }, "AbstractLoader.FONT") }, + FONTCSS: { get: createjs.deprecate(function() { return createjs.Types.FONTCSS; }, "AbstractLoader.FONTCSS") }, + IMAGE: { get: createjs.deprecate(function() { return createjs.Types.IMAGE; }, "AbstractLoader.IMAGE") }, + JAVASCRIPT: { get: createjs.deprecate(function() { return createjs.Types.JAVASCRIPT; }, "AbstractLoader.JAVASCRIPT") }, + JSON: { get: createjs.deprecate(function() { return createjs.Types.JSON; }, "AbstractLoader.JSON") }, + JSONP: { get: createjs.deprecate(function() { return createjs.Types.JSONP; }, "AbstractLoader.JSONP") }, + MANIFEST: { get: createjs.deprecate(function() { return createjs.Types.MANIFEST; }, "AbstractLoader.MANIFEST") }, + SOUND: { get: createjs.deprecate(function() { return createjs.Types.SOUND; }, "AbstractLoader.SOUND") }, + VIDEO: { get: createjs.deprecate(function() { return createjs.Types.VIDEO; }, "AbstractLoader.VIDEO") }, + SPRITESHEET: { get: createjs.deprecate(function() { return createjs.Types.SPRITESHEET; }, "AbstractLoader.SPRITESHEET") }, + SVG: { get: createjs.deprecate(function() { return createjs.Types.SVG; }, "AbstractLoader.SVG") }, + TEXT: { get: createjs.deprecate(function() { return createjs.Types.TEXT; }, "AbstractLoader.TEXT") }, + XML: { get: createjs.deprecate(function() { return createjs.Types.XML; }, "AbstractLoader.XML") } + }); + } catch (e) {} // Events /** @@ -1897,7 +2132,7 @@ this.createjs = this.createjs || {}; * This enables loaders to maintain internal queues, and surface file load errors. * @event fileerror * @param {Object} target The object that dispatched the event. - * @param {String} type The even type ("fileerror") + * @param {String} type The event type ("fileerror") * @param {LoadItem|object} The item that encountered the error * @since 0.6.0 */ @@ -2180,11 +2415,13 @@ this.createjs = this.createjs || {}; case "complete": this._rawResult = event.target._response; var result = this.resultFormatter && this.resultFormatter(this); + // The resultFormatter is asynchronous if (result instanceof Function) { result.call(this, createjs.proxy(this._resultFormatSuccess, this), createjs.proxy(this._resultFormatFailed, this) ); + // The result formatter is synchronous } else { this._result = result || this._rawResult; this._sendComplete(); @@ -2231,16 +2468,6 @@ this.createjs = this.createjs || {}; this._sendError(event); }; - /** - * @method buildPath - * @protected - * @deprecated Use the {{#crossLink "RequestUtils"}}{{/crossLink}} method {{#crossLink "RequestUtils/buildPath"}}{{/crossLink}} - * instead. - */ - p.buildPath = function (src, data) { - return createjs.RequestUtils.buildPath(src, data); - }; - /** * @method toString * @return {String} a string representation of the instance. @@ -2454,13 +2681,6 @@ this.createjs = this.createjs || {}; */ this._addedToDOM = false; - /** - * Determines what the tags initial style.visibility was, so we can set it correctly after a load. - * - * @type {null} - * @private - */ - this._startTagVisibility = null; }; var p = createjs.extend(TagRequest, createjs.AbstractRequest); @@ -2476,15 +2696,13 @@ this.createjs = this.createjs || {}; this.dispatchEvent(evt); - this._hideTag(); - this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), this._item.loadTimeout); this._tag[this._tagSrcAttribute] = this._item.src; // wdg:: Append the tag AFTER setting the src, or SVG loading on iOS will fail. if (this._tag.parentNode == null) { - window.document.body.appendChild(this._tag); + createjs.DomUtils.appendToBody(this._tag); this._addedToDOM = true; } }; @@ -2534,7 +2752,6 @@ this.createjs = this.createjs || {}; this._result = this.resultFormatter && this.resultFormatter(this) || this._rawResult; this._clean(); - this._showTag(); this.dispatchEvent("complete"); }; @@ -2565,15 +2782,6 @@ this.createjs = this.createjs || {}; clearTimeout(this._loadTimeout); }; - p._hideTag = function() { - this._startTagVisibility = this._tag.style.visibility; - this._tag.style.visibility = "hidden"; - }; - - p._showTag = function() { - this._tag.style.visibility = this._startTagVisibility; - }; - /** * Handle a stalled audio event. The main place this happens is with HTMLAudio in Chrome when playing back audio * that is already in a load, but not complete. @@ -2859,10 +3067,10 @@ this.createjs = this.createjs || {}; // Sometimes we get back 404s immediately, particularly when there is a cross origin request. // note this does not catch in Chrome try { - if (!this._item.values || this._item.method == createjs.AbstractLoader.GET) { + if (!this._item.values) { this._request.send(); - } else if (this._item.method == createjs.AbstractLoader.POST) { - this._request.send(createjs.RequestUtils.formatQueryString(this._item.values)); + } else { + this._request.send(createjs.URLUtils.formatQueryString(this._item.values)); } } catch (error) { this.dispatchEvent(new createjs.ErrorEvent("XHR_SEND", null, error)); @@ -2980,6 +3188,9 @@ this.createjs = this.createjs || {}; /** * The XHR request has completed. This is called by the XHR request directly, or by a readyStateChange that has * request.readyState == 4. Only the first call to this method will be processed. + * + * Note that This method uses {{#crossLink "_checkError"}}{{/crossLink}} to determine if the server has returned an + * error code. * @method _handleLoad * @param {Object} event The XHR load event. * @private @@ -3026,30 +3237,36 @@ this.createjs = this.createjs || {}; */ p._handleTimeout = function (event) { this._clean(); - this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_TIMEOUT", null, event)); }; // Protected /** - * Determine if there is an error in the current load. This checks the status of the request for problem codes. Note - * that this does not check for an actual response. Currently, it only checks for 404 or 0 error code. + * Determine if there is an error in the current load. + * Currently this checks the status of the request for problem codes, and not actual response content: + *
      + *
    • Status codes between 400 and 599 (HTTP error range)
    • + *
    • A status of 0, but *only when the application is running on a server*. If the application is running + * on `file:`, then it may incorrectly treat an error on local (or embedded applications) as a successful + * load.
    • + *
    * @method _checkError - * @return {int} If the request status returns an error code. + * @return {Error} An error with the status code in the `message` argument. * @private */ p._checkError = function () { - //LM: Probably need additional handlers here, maybe 501 var status = parseInt(this._request.status); - - switch (status) { - case 404: // Not Found - case 0: // Not Loaded - return new Error(status); + if (status >= 400 && status <= 599) { + return new Error(status); + } else if (status == 0) { + if ((/^https?:/).test(location.protocol)) { return new Error(0); } + return null; // Likely an embedded app. + } else { + return null; } - return null; }; + /** * Validate the response. Different browsers have different approaches, some of which throw errors when accessed * in other browsers. If there is no response, the _response property will remain null. @@ -3099,7 +3316,7 @@ this.createjs = this.createjs || {}; */ p._createXHR = function (item) { // Check for cross-domain loads. We can't fully support them, but we can try. - var crossdomain = createjs.RequestUtils.isCrossDomain(item); + var crossdomain = createjs.URLUtils.isCrossDomain(item); var headers = {}; // Create the request. Fallback to whatever support we have. @@ -3138,21 +3355,21 @@ this.createjs = this.createjs || {}; this._xhrLevel = (typeof req.responseType === "string") ? 2 : 1; var src = null; - if (item.method == createjs.AbstractLoader.GET) { - src = createjs.RequestUtils.buildPath(item.src, item.values); + if (item.method == createjs.Methods.GET) { + src = createjs.URLUtils.buildURI(item.src, item.values); } else { src = item.src; } // Open the request. Set cross-domain flags if it is supported (XHR level 1 only) - req.open(item.method || createjs.AbstractLoader.GET, src, true); + req.open(item.method || createjs.Methods.GET, src, true); if (crossdomain && req instanceof XMLHttpRequest && this._xhrLevel == 1) { headers["Origin"] = location.origin; } // To send data we need to set the Content-type header) - if (item.values && item.method == createjs.AbstractLoader.POST) { + if (item.values && item.method == createjs.Methods.POST) { headers["Content-Type"] = "application/x-www-form-urlencoded"; } @@ -3236,15 +3453,15 @@ this.createjs = this.createjs || {}; * @constructor */ function SoundLoader(loadItem, preferXHR) { - this.AbstractMediaLoader_constructor(loadItem, preferXHR, createjs.AbstractLoader.SOUND); + this.AbstractMediaLoader_constructor(loadItem, preferXHR, createjs.Types.SOUND); // protected properties - if (createjs.RequestUtils.isAudioTag(loadItem)) { + if (createjs.DomUtils.isAudioTag(loadItem)) { this._tag = loadItem; - } else if (createjs.RequestUtils.isAudioTag(loadItem.src)) { + } else if (createjs.DomUtils.isAudioTag(loadItem.src)) { this._tag = loadItem; - } else if (createjs.RequestUtils.isAudioTag(loadItem.tag)) { - this._tag = createjs.RequestUtils.isAudioTag(loadItem) ? loadItem : loadItem.src; + } else if (createjs.DomUtils.isAudioTag(loadItem.tag)) { + this._tag = createjs.DomUtils.isAudioTag(loadItem) ? loadItem : loadItem.src; } if (this._tag != null) { @@ -3258,19 +3475,19 @@ this.createjs = this.createjs || {}; // static methods /** * Determines if the loader can load a specific item. This loader can only load items that are of type - * {{#crossLink "AbstractLoader/SOUND:property"}}{{/crossLink}}. + * {{#crossLink "Types/SOUND:property"}}{{/crossLink}}. * @method canLoadItem * @param {LoadItem|Object} item The LoadItem that a LoadQueue is trying to load. * @returns {Boolean} Whether the loader can load the item. * @static */ s.canLoadItem = function (item) { - return item.type == createjs.AbstractLoader.SOUND; + return item.type == createjs.Types.SOUND; }; // protected methods p._createTag = function (src) { - var tag = document.createElement("audio"); + var tag = createjs.Elements.audio(); tag.autoplay = false; tag.preload = "none"; @@ -3383,9 +3600,10 @@ this.createjs = this.createjs || {}; * *

    Example

    * - * var ppc = new createjs.PlayPropsConfig().set({interrupt: createjs.Sound.INTERRUPT_ANY, loop: -1, volume: 0.5}) - * createjs.Sound.play("mySound", ppc); - * mySoundInstance.play(ppc); + * var props = new createjs.PlayPropsConfig().set({interrupt: createjs.Sound.INTERRUPT_ANY, loop: -1, volume: 0.5}) + * createjs.Sound.play("mySound", props); + * // OR + * mySoundInstance.play(props); * * @class PlayPropsConfig * @constructor @@ -3477,12 +3695,14 @@ this.createjs = this.createjs || {}; * @static */ s.create = function (value) { - if (value instanceof s || value instanceof Object) { - var ppc = new createjs.PlayPropsConfig(); - ppc.set(value); - return ppc; - } else { - throw new Error("Type not recognized."); + if (typeof(value) === "string") { + // Handle the old API gracefully. + console && (console.warn || console.log)("Deprecated behaviour. Sound.play takes a configuration object instead of individual arguments. See docs for info."); + return new createjs.PlayPropsConfig().set({interrupt:value}); + } else if (value == null || value instanceof s || value instanceof Object) { + return new createjs.PlayPropsConfig().set(value); + } else if (value == null) { + throw new Error("PlayProps configuration not recognized."); } }; @@ -3499,7 +3719,9 @@ this.createjs = this.createjs || {}; * @return {PlayPropsConfig} Returns the instance the method is called on (useful for chaining calls.) */ p.set = function(props) { - for (var n in props) { this[n] = props[n]; } + if (props != null) { + for (var n in props) { this[n] = props[n]; } + } return this; }; @@ -3827,7 +4049,7 @@ this.createjs = this.createjs || {}; * @property FILE_PATTERN * @type {RegExp} * @static - * @protected + * @private */ s.FILE_PATTERN = /^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/; @@ -3885,36 +4107,63 @@ this.createjs = this.createjs || {}; // class getter / setter properties + /** * Set the master volume of Sound. The master volume is multiplied against each sound's individual volume. For * example, if master volume is 0.5 and a sound's volume is 0.5, the resulting volume is 0.25. To set individual - * sound volume, use AbstractSoundInstance {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} instead. + * sound volume, use AbstractSoundInstance {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} + * instead. * *

    Example

    * * createjs.Sound.volume = 0.5; * - * * @property volume * @type {Number} * @default 1 * @since 0.6.1 */ + + /** + * The internal volume level. Use {{#crossLink "Sound/volume:property"}}{{/crossLink}} to adjust the master volume. + * @property _masterVolume + * @type {number} + * @default 1 + * @private + */ s._masterVolume = 1; - Object.defineProperty(s, "volume", { - get: function () {return this._masterVolume;}, - set: function (value) { - if (Number(value) == null) {return false;} - value = Math.max(0, Math.min(1, value)); - s._masterVolume = value; - if (!this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(value)) { - var instances = this._instances; - for (var i = 0, l = instances.length; i < l; i++) { - instances[i].setMasterVolume(value); - } - } + + /** + * Use the {{#crossLink "Sound/volume:property"}}{{/crossLink}} property instead. + * @method _getMasterVolume + * @private + * @static + * @return {Number} + **/ + s._getMasterVolume = function() { + return this._masterVolume; + }; + // Sound.getMasterVolume is @deprecated. Remove for 1.1+ + s.getVolume = createjs.deprecate(s._getMasterVolume, "Sound.getVolume"); + /** + * Use the {{#crossLink "Sound/volume:property"}}{{/crossLink}} property instead. + * @method _setMasterVolume + * @static + * @private + **/ + s._setMasterVolume = function(value) { + if (Number(value) == null) { return; } + value = Math.max(0, Math.min(1, value)); + s._masterVolume = value; + if (!this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(value)) { + var instances = this._instances; + for (var i = 0, l = instances.length; i < l; i++) { + instances[i].setMasterVolume(value); } - }); + } + }; + // Sound.stMasterVolume is @deprecated. Remove for 1.1+ + s.setVolume = createjs.deprecate(s._setMasterVolume, "Sound.setVolume"); /** * Mute/Unmute all audio. Note that muted audio still plays at 0 volume. This global mute value is maintained @@ -3931,23 +4180,40 @@ this.createjs = this.createjs || {}; * @default false * @since 0.6.1 */ - s._masterMute = false; - // OJR references to the methods were not working, so the code had to be duplicated here - Object.defineProperty(s, "muted", { - get: function () {return this._masterMute;}, - set: function (value) { - if (value == null) {return false;} - - this._masterMute = value; - if (!this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(value)) { - var instances = this._instances; - for (var i = 0, l = instances.length; i < l; i++) { - instances[i].setMasterMute(value); - } - } - return true; + s._masterMute = false; + + /** + * Use the {{#crossLink "Sound/muted:property"}}{{/crossLink}} property instead. + * @method _getMute + * @returns {Boolean} + * @static + * @private + */ + s._getMute = function () { + return this._masterMute; + }; + // Sound.getMute is @deprecated. Remove for 1.1+ + s.getMute = createjs.deprecate(s._getMute, "Sound.getMute"); + + /** + * Use the {{#crossLink "Sound/muted:property"}}{{/crossLink}} property instead. + * @method _setMute + * @param {Boolean} value The muted value + * @static + * @private + */ + s._setMute = function (value) { + if (value == null) { return; } + this._masterMute = value; + if (!this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(value)) { + var instances = this._instances; + for (var i = 0, l = instances.length; i < l; i++) { + instances[i].setMasterMute(value); } - }); + } + }; + // Sound.setMute is @deprecated. Remove for 1.1+ + s.setMute = createjs.deprecate(s._setMute, "Sound.setMute"); /** * Get the active plugins capabilities, which help determine if a plugin can be used in the current environment, @@ -3983,25 +4249,36 @@ this.createjs = this.createjs || {}; * @readOnly * @since 0.6.1 */ - Object.defineProperty(s, "capabilities", { - get: function () { - if (s.activePlugin == null) {return null;} - return s.activePlugin._capabilities; - }, - set: function (value) { return false;} + + /** + * Use the {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} property instead. + * @returns {null} + * @private + */ + s._getCapabilities = function() { + if (s.activePlugin == null) { return null; } + return s.activePlugin._capabilities; + }; + // Sound.getCapabilities is @deprecated. Remove for 1.1+ + s.getCapabilities = createjs.deprecate(s._getCapabilities, "Sound.getCapabilities"); + + Object.defineProperties(s, { + volume: { get: s._getMasterVolume, set: s._setMasterVolume }, + muted: { get: s._getMute, set: s._setMute }, + capabilities: { get: s._getCapabilities } }); // Class Private properties /** - * Determines if the plugins have been registered. If false, the first call to play() will instantiate the default + * Determines if the plugins have been registered. If false, the first call to {{#crossLink "play"}}{{/crossLink}} will instantiate the default * plugins ({{#crossLink "WebAudioPlugin"}}{{/crossLink}}, followed by {{#crossLink "HTMLAudioPlugin"}}{{/crossLink}}). * If plugins have been registered, but none are applicable, then sound playback will fail. * @property _pluginsRegistered * @type {Boolean} * @default false * @static - * @protected + * @private */ s._pluginsRegistered = false; @@ -4010,19 +4287,19 @@ this.createjs = this.createjs || {}; * @property _lastID * @type {Number} * @static - * @protected + * @private */ s._lastID = 0; /** * An array containing all currently playing instances. This allows Sound to control the volume, mute, and playback of - * all instances when using static APIs like {{#crossLink "Sound/stop"}}{{/crossLink}} and {{#crossLink "Sound/setVolume"}}{{/crossLink}}. + * all instances when using static APIs like {{#crossLink "Sound/stop"}}{{/crossLink}} and {{#crossLink "Sound/volume:property"}}{{/crossLink}}. * When an instance has finished playback, it gets removed via the {{#crossLink "Sound/finishedPlaying"}}{{/crossLink}} * method. If the user replays an instance, it gets added back in via the {{#crossLink "Sound/_beginPlaying"}}{{/crossLink}} * method. * @property _instances * @type {Array} - * @protected + * @private * @static */ s._instances = []; @@ -4031,7 +4308,7 @@ this.createjs = this.createjs || {}; * An object hash storing objects with sound sources, startTime, and duration via there corresponding ID. * @property _idHash * @type {Object} - * @protected + * @private * @static */ s._idHash = {}; @@ -4042,7 +4319,7 @@ this.createjs = this.createjs || {}; * and data. * @property _preloadHash * @type {Object} - * @protected + * @private * @static */ s._preloadHash = {}; @@ -4052,7 +4329,7 @@ this.createjs = this.createjs || {}; * {{#crossLink "Sound/registerSound"}}{{/crossLink}} and {{#crossLink "Sound/registerSounds"}}{{/crossLink}}. * @property _defaultPlayPropsHash * @type {Object} - * @protected + * @private * @static * @since 0.6.1 */ @@ -4109,7 +4386,7 @@ this.createjs = this.createjs || {}; *
  • types: A list of file types that are supported by Sound (currently supports "sound").
  • *
  • extensions: A list of file extensions that are supported by Sound (see {{#crossLink "Sound/SUPPORTED_EXTENSIONS:property"}}{{/crossLink}}).
  • * @static - * @protected + * @private */ s.getPreloadHandlers = function () { return { @@ -4123,7 +4400,7 @@ this.createjs = this.createjs || {}; * Used to dispatch fileload events from internal loading. * @method _handleLoadComplete * @param event A loader event. - * @protected + * @private * @static * @since 0.6.0 */ @@ -4150,7 +4427,7 @@ this.createjs = this.createjs || {}; /** * Used to dispatch error events from internal preloading. * @param event - * @protected + * @private * @since 0.6.0 * @static */ @@ -4255,44 +4532,17 @@ this.createjs = this.createjs || {}; return (s.activePlugin != null); }; - /** - * Deprecated, please use {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} instead. - * - * @method getCapabilities - * @return {Object} An object containing the capabilities of the active plugin. - * @static - * @deprecated - */ - s.getCapabilities = function () { - if (s.activePlugin == null) {return null;} - return s.activePlugin._capabilities; - }; - - /** - * Deprecated, please use {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} instead. - * - * @method getCapability - * @param {String} key The capability to retrieve - * @return {Number|Boolean} The value of the capability. - * @static - * @see getCapabilities - * @deprecated - */ - s.getCapability = function (key) { - if (s.activePlugin == null) {return null;} - return s.activePlugin._capabilities[key]; - }; - /** * Process manifest items from PreloadJS. This method is intended * for usage by a plugin, and not for direct interaction. * @method initLoad * @param {Object} src The object to load. * @return {Object|AbstractLoader} An instance of AbstractLoader. - * @protected + * @private * @static */ s.initLoad = function (loadItem) { + if (loadItem.type == "video") { return true; } // Don't handle video. PreloadJS's plugin model is really aggressive. return s._registerSound(loadItem); }; @@ -4406,7 +4656,7 @@ this.createjs = this.createjs || {}; loadItem = createjs.LoadItem.create(loadItem); loadItem.path = basePath; - if (basePath != null && !(loadItem.src instanceof Object)) {loadItem.src = basePath + src;} + if (basePath != null && !(loadItem.src instanceof Object)) {loadItem.src = basePath + loadItem.src;} var loader = s._registerSound(loadItem); if(!loader) {return false;} @@ -4415,8 +4665,8 @@ this.createjs = this.createjs || {}; s._preloadHash[loadItem.src].push(loadItem); if (s._preloadHash[loadItem.src].length == 1) { // OJR note this will disallow reloading a sound if loading fails or the source changes - loader.on("complete", createjs.proxy(this._handleLoadComplete, this)); - loader.on("error", createjs.proxy(this._handleLoadError, this)); + loader.on("complete", this._handleLoadComplete, this); + loader.on("error", this._handleLoadError, this); s.activePlugin.preload(loader); } else { if (s._preloadHash[loadItem.src][0] == true) {return true;} @@ -4437,7 +4687,7 @@ this.createjs = this.createjs || {}; * {src:"asset0.ogg", id:"example"}, * {src:"asset1.ogg", id:"1", data:6}, * {src:"asset2.mp3", id:"works"} - * {src:{mp3:"path1/asset3.mp3", ogg:"path2/asset3NoExtension}, id:"better"} + * {src:{mp3:"path1/asset3.mp3", ogg:"path2/asset3NoExtension"}, id:"better"} * ]; * createjs.Sound.alternateExtensions = ["mp3"]; // if the passed extension is not supported, try this extension * createjs.Sound.on("fileload", handleLoad); // call handleLoad when each sound loads @@ -4624,7 +4874,7 @@ this.createjs = this.createjs || {}; * @param {String} value The path to an audio source. * @return {Object} A formatted object that can be registered with the {{#crossLink "Sound/activePlugin:property"}}{{/crossLink}} * and returned to a preloader like PreloadJS. - * @protected + * @private * @static */ s._parsePath = function (value) { @@ -4654,7 +4904,7 @@ this.createjs = this.createjs || {}; * @param {Object} value The paths to an audio source, indexed by extension type. * @return {Object} A formatted object that can be registered with the {{#crossLink "Sound/activePlugin:property"}}{{/crossLink}} * and returned to a preloader like PreloadJS. - * @protected + * @private * @static */ s._parseSrc = function (value) { @@ -4684,11 +4934,12 @@ this.createjs = this.createjs || {}; Static API. --------------- */ /** - * Play a sound and get a {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} to control. If the sound fails to play, a - * AbstractSoundInstance will still be returned, and have a playState of {{#crossLink "Sound/PLAY_FAILED:property"}}{{/crossLink}}. - * Note that even on sounds with failed playback, you may still be able to call AbstractSoundInstance {{#crossLink "AbstractSoundInstance/play"}}{{/crossLink}}, - * since the failure could be due to lack of available channels. If the src does not have a supported extension or - * if there is no available plugin, a default AbstractSoundInstance will be returned which will not play any audio, but will not generate errors. + * Play a sound and get a {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} to control. If the sound fails to + * play, an AbstractSoundInstance will still be returned, and have a playState of {{#crossLink "Sound/PLAY_FAILED:property"}}{{/crossLink}}. + * Note that even on sounds with failed playback, you may still be able to call the {{#crossLink "AbstractSoundInstance/play"}}{{/crossLink}}, + * method, since the failure could be due to lack of available channels. If the src does not have a supported + * extension or if there is no available plugin, a default AbstractSoundInstance will still be returned, which will + * not play any audio, but will not generate errors. * *

    Example

    * @@ -4700,40 +4951,19 @@ this.createjs = this.createjs || {}; * var myInstance = createjs.Sound.play("myID", {interrupt: createjs.Sound.INTERRUPT_ANY, loop:-1}); * } * - * NOTE to create an audio sprite that has not already been registered, both startTime and duration need to be set. + * NOTE: To create an audio sprite that has not already been registered, both startTime and duration need to be set. * This is only when creating a new audio sprite, not when playing using the id of an already registered audio sprite. * - * Parameters Deprecated
    - * The parameters for this method are deprecated in favor of a single parameter that is an Object or {{#crossLink "PlayPropsConfig"}}{{/crossLink}}. - * * @method play * @param {String} src The src or ID of the audio. - * @param {String | Object} [interrupt="none"|options] This parameter will be renamed playProps in the next release.
    - * This parameter can be an instance of {{#crossLink "PlayPropsConfig"}}{{/crossLink}} or an Object that contains any or all optional properties by name, - * including: interrupt, delay, offset, loop, volume, pan, startTime, and duration (see the above code sample). - *
    OR
    - * Deprecated How to interrupt any currently playing instances of audio with the same source, - * if the maximum number of instances of the sound are already playing. Values are defined as INTERRUPT_TYPE - * constants on the Sound class, with the default defined by {{#crossLink "Sound/defaultInterruptBehavior:property"}}{{/crossLink}}. - * @param {Number} [delay=0] Deprecated The amount of time to delay the start of audio playback, in milliseconds. - * @param {Number} [offset=0] Deprecated The offset from the start of the audio to begin playback, in milliseconds. - * @param {Number} [loop=0] Deprecated How many times the audio loops when it reaches the end of playback. The default is 0 (no - * loops), and -1 can be used for infinite playback. - * @param {Number} [volume=1] Deprecated The volume of the sound, between 0 and 1. Note that the master volume is applied - * against the individual volume. - * @param {Number} [pan=0] Deprecated The left-right pan of the sound (if supported), between -1 (left) and 1 (right). - * @param {Number} [startTime=null] Deprecated To create an audio sprite (with duration), the initial offset to start playback and loop from, in milliseconds. - * @param {Number} [duration=null] Deprecated To create an audio sprite (with startTime), the amount of time to play the clip for, in milliseconds. - * @return {AbstractSoundInstance} A {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} that can be controlled after it is created. + * @param {Object | PlayPropsConfig} props A PlayPropsConfig instance, or an object that contains the parameters to + * play a sound. See the {{#crossLink "PlayPropsConfig"}}{{/crossLink}} for more info. + * @return {AbstractSoundInstance} A {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} that can be controlled + * after it is created. * @static */ - s.play = function (src, interrupt, delay, offset, loop, volume, pan, startTime, duration) { - var playProps; - if (interrupt instanceof Object || interrupt instanceof createjs.PlayPropsConfig) { - playProps = createjs.PlayPropsConfig.create(interrupt); - } else { - playProps = createjs.PlayPropsConfig.create({interrupt:interrupt, delay:delay, offset:offset, loop:loop, volume:volume, pan:pan, startTime:startTime, duration:duration}); - } + s.play = function (src, props) { + var playProps = createjs.PlayPropsConfig.create(props); var instance = s.createInstance(src, playProps.startTime, playProps.duration); var ok = s._playInstance(instance, playProps); if (!ok) {instance._playFailed();} @@ -4769,7 +4999,7 @@ this.createjs = this.createjs || {}; * @static */ s.createInstance = function (src, startTime, duration) { - if (!s.initializeDefaultPlugins()) {return new createjs.DefaultSoundInstance(src, startTime, duration);} + if (!s.initializeDefaultPlugins()) { return new createjs.DefaultSoundInstance(src, startTime, duration); } var defaultPlayProps = s._defaultPlayPropsHash[src]; // for audio sprites, which create and store defaults by id src = s._getSrcById(src); @@ -4779,11 +5009,11 @@ this.createjs = this.createjs || {}; var instance = null; if (details != null && details.src != null) { SoundChannel.create(details.src); - if (startTime == null) {startTime = src.startTime;} + if (startTime == null) { startTime = src.startTime; } instance = s.activePlugin.create(details.src, startTime, duration || src.duration); defaultPlayProps = defaultPlayProps || s._defaultPlayPropsHash[details.src]; - if(defaultPlayProps) { + if (defaultPlayProps) { instance.applyPlayProps(defaultPlayProps); } } else { @@ -4813,74 +5043,6 @@ this.createjs = this.createjs || {}; } }; - /** - * Deprecated, please use {{#crossLink "Sound/volume:property"}}{{/crossLink}} instead. - * - * @method setVolume - * @param {Number} value The master volume value. The acceptable range is 0-1. - * @static - * @deprecated - */ - s.setVolume = function (value) { - if (Number(value) == null) {return false;} - value = Math.max(0, Math.min(1, value)); - s._masterVolume = value; - if (!this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(value)) { - var instances = this._instances; - for (var i = 0, l = instances.length; i < l; i++) { - instances[i].setMasterVolume(value); - } - } - }; - - /** - * Deprecated, please use {{#crossLink "Sound/volume:property"}}{{/crossLink}} instead. - * - * @method getVolume - * @return {Number} The master volume, in a range of 0-1. - * @static - * @deprecated - */ - s.getVolume = function () { - return this._masterVolume; - }; - - /** - * Deprecated, please use {{#crossLink "Sound/muted:property"}}{{/crossLink}} instead. - * - * @method setMute - * @param {Boolean} value Whether the audio should be muted or not. - * @return {Boolean} If the mute was set. - * @static - * @since 0.4.0 - * @deprecated - */ - s.setMute = function (value) { - if (value == null) {return false;} - - this._masterMute = value; - if (!this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(value)) { - var instances = this._instances; - for (var i = 0, l = instances.length; i < l; i++) { - instances[i].setMasterMute(value); - } - } - return true; - }; - - /** - * Deprecated, please use {{#crossLink "Sound/muted:property"}}{{/crossLink}} instead. - * - * @method getMute - * @return {Boolean} The mute value of Sound. - * @static - * @since 0.4.0 - * @deprecated - */ - s.getMute = function () { - return this._masterMute; - }; - /** * Set the default playback properties for all new SoundInstances of the passed in src or ID. * See {{#crossLink "PlayPropsConfig"}}{{/crossLink}} for available properties. @@ -4921,14 +5083,14 @@ this.createjs = this.createjs || {}; * @param {PlayPropsConfig} playProps A PlayPropsConfig object. * @return {Boolean} If the sound can start playing. Sounds that fail immediately will return false. Sounds that * have a delay will return true, but may still fail to play. - * @protected + * @private * @static */ s._playInstance = function (instance, playProps) { var defaultPlayProps = s._defaultPlayPropsHash[instance.src] || {}; if (playProps.interrupt == null) {playProps.interrupt = defaultPlayProps.interrupt || s.defaultInterruptBehavior}; if (playProps.delay == null) {playProps.delay = defaultPlayProps.delay || 0;} - if (playProps.offset == null) {playProps.offset = instance.getPosition();} + if (playProps.offset == null) {playProps.offset = instance.position;} if (playProps.loop == null) {playProps.loop = instance.loop;} if (playProps.volume == null) {playProps.volume = instance.volume;} if (playProps.pan == null) {playProps.pan = instance.pan;} @@ -4957,7 +5119,7 @@ this.createjs = this.createjs || {}; * @param {PlayPropsConfig} playProps A PlayPropsConfig object. * @return {Boolean} If the sound can start playing. If there are no available channels, or the instance fails to * start, this will return false. - * @protected + * @private * @static */ s._beginPlaying = function (instance, playProps) { @@ -4979,7 +5141,7 @@ this.createjs = this.createjs || {}; * @method _getSrcById * @param {String} value The ID the sound was registered with. * @return {String} The source of the sound if it has been registered with this ID or the value that was passed in. - * @protected + * @private * @static */ s._getSrcById = function (value) { @@ -4992,7 +5154,7 @@ this.createjs = this.createjs || {}; * instances themselves. * @method _playFinished * @param {AbstractSoundInstance} instance The instance that finished playback. - * @protected + * @private * @static */ s._playFinished = function (instance) { @@ -5123,20 +5285,6 @@ this.createjs = this.createjs || {}; var p = SoundChannel.prototype; p.constructor = SoundChannel; - /** - * REMOVED. Removed in favor of using `MySuperClass_constructor`. - * See {{#crossLink "Utility Methods/extend"}}{{/crossLink}} and {{#crossLink "Utility Methods/promote"}}{{/crossLink}} - * for details. - * - * There is an inheritance tutorial distributed with EaselJS in /tutorials/Inheritance. - * - * @method initialize - * @protected - * @deprecated - */ - // p.initialize = function() {}; // searchable for devs wondering where it is. - - /** * The source of the channel. * #property src @@ -5270,8 +5418,8 @@ this.createjs = this.createjs || {}; } // Audio is a better candidate than the current target, according to playhead - if ((interrupt == Sound.INTERRUPT_EARLY && target.getPosition() < replacement.getPosition()) || - (interrupt == Sound.INTERRUPT_LATE && target.getPosition() > replacement.getPosition())) { + if ((interrupt == Sound.INTERRUPT_EARLY && target.position < replacement.position) || + (interrupt == Sound.INTERRUPT_LATE && target.position > replacement.position)) { replacement = target; } } @@ -5392,7 +5540,7 @@ this.createjs = this.createjs || {}; * The volume of the sound, between 0 and 1. * * The actual output volume of a sound can be calculated using: - * myInstance.volume * createjs.Sound.getVolume(); + * myInstance.volume * createjs.Sound._getVolume(); * * @property volume * @type {Number} @@ -5400,24 +5548,27 @@ this.createjs = this.createjs || {}; */ this._volume = 1; Object.defineProperty(this, "volume", { - get: this.getVolume, - set: this.setVolume + get: this._getVolume, + set: this._setVolume }); + this.getVolume = createjs.deprecate(this._getVolume, "AbstractSoundInstance.getVolume"); + this.setVolume = createjs.deprecate(this._setVolume, "AbstractSoundInstance.setVolume"); /** * The pan of the sound, between -1 (left) and 1 (right). Note that pan is not supported by HTML Audio. * - *
    Note in WebAudioPlugin this only gives us the "x" value of what is actually 3D audio. - * + * Note in WebAudioPlugin this only gives us the "x" value of what is actually 3D audio * @property pan * @type {Number} * @default 0 */ this._pan = 0; Object.defineProperty(this, "pan", { - get: this.getPan, - set: this.setPan + get: this._getPan, + set: this._setPan }); + this.getPan = createjs.deprecate(this._getPan, "AbstractSoundInstance.getPan"); + this.setPan = createjs.deprecate(this._setPan, "AbstractSoundInstance.setPan"); /** * Audio sprite property used to determine the starting offset. @@ -5428,9 +5579,11 @@ this.createjs = this.createjs || {}; */ this._startTime = Math.max(0, startTime || 0); Object.defineProperty(this, "startTime", { - get: this.getStartTime, - set: this.setStartTime + get: this._getStartTime, + set: this._setStartTime }); + this.getStartTime = createjs.deprecate(this._getStartTime, "AbstractSoundInstance.getStartTime"); + this.setStartTime = createjs.deprecate(this._setStartTime, "AbstractSoundInstance.setStartTime"); /** * Sets or gets the length of the audio clip, value is in milliseconds. @@ -5442,9 +5595,11 @@ this.createjs = this.createjs || {}; */ this._duration = Math.max(0, duration || 0); Object.defineProperty(this, "duration", { - get: this.getDuration, - set: this.setDuration + get: this._getDuration, + set: this._setDuration }); + this.getDuration = createjs.deprecate(this._getDuration, "AbstractSoundInstance.getDuration"); + this.setDuration = createjs.deprecate(this._setDuration, "AbstractSoundInstance.setDuration"); /** * Object that holds plugin specific resource need for audio playback. @@ -5457,10 +5612,12 @@ this.createjs = this.createjs || {}; */ this._playbackResource = null; Object.defineProperty(this, "playbackResource", { - get: this.getPlaybackResource, - set: this.setPlaybackResource + get: this._getPlaybackResource, + set: this._setPlaybackResource }); - if(playbackResource !== false && playbackResource !== true) { this.setPlaybackResource(playbackResource); } + if(playbackResource !== false && playbackResource !== true) { this._setPlaybackResource(playbackResource); } + this.getPlaybackResource = createjs.deprecate(this._getPlaybackResource, "AbstractSoundInstance.getPlaybackResource"); + this.setPlaybackResource = createjs.deprecate(this._setPlaybackResource, "AbstractSoundInstance.setPlaybackResource"); /** * The position of the playhead in milliseconds. This can be set while a sound is playing, paused, or stopped. @@ -5472,9 +5629,11 @@ this.createjs = this.createjs || {}; */ this._position = 0; Object.defineProperty(this, "position", { - get: this.getPosition, - set: this.setPosition + get: this._getPosition, + set: this._setPosition }); + this.getPosition = createjs.deprecate(this._getPosition, "AbstractSoundInstance.getPosition"); + this.setPosition = createjs.deprecate(this._setPosition, "AbstractSoundInstance.setPosition"); /** * The number of play loops remaining. Negative values will loop infinitely. @@ -5487,9 +5646,11 @@ this.createjs = this.createjs || {}; */ this._loop = 0; Object.defineProperty(this, "loop", { - get: this.getLoop, - set: this.setLoop + get: this._getLoop, + set: this._setLoop }); + this.getLoop = createjs.deprecate(this._getLoop, "AbstractSoundInstance.getLoop"); + this.setLoop = createjs.deprecate(this._setLoop, "AbstractSoundInstance.setLoop"); /** * Mutes or unmutes the current audio instance. @@ -5501,9 +5662,11 @@ this.createjs = this.createjs || {}; */ this._muted = false; Object.defineProperty(this, "muted", { - get: this.getMuted, - set: this.setMuted + get: this._getMuted, + set: this._setMuted }); + this.getMuted = createjs.deprecate(this._getMuted, "AbstractSoundInstance.getMuted"); + this.setMuted = createjs.deprecate(this._setMuted, "AbstractSoundInstance.setMuted"); /** * Pauses or resumes the current audio instance. @@ -5513,9 +5676,11 @@ this.createjs = this.createjs || {}; */ this._paused = false; Object.defineProperty(this, "paused", { - get: this.getPaused, - set: this.setPaused + get: this._getPaused, + set: this._setPaused }); + this.getPaused = createjs.deprecate(this._getPaused, "AbstractSoundInstance.getPaused"); + this.setPaused = createjs.deprecate(this._setPaused, "AbstractSoundInstance.setPaused"); // Events @@ -5566,10 +5731,6 @@ this.createjs = this.createjs || {}; var p = createjs.extend(AbstractSoundInstance, createjs.EventDispatcher); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Public Methods: /** * Play an instance. This method is intended to be called on SoundInstances that already exist (created @@ -5586,34 +5747,15 @@ this.createjs = this.createjs || {}; * The parameters for this method are deprecated in favor of a single parameter that is an Object or {{#crossLink "PlayPropsConfig"}}{{/crossLink}}. * * @method play - * @param {String | Object} [interrupt="none"|options] This parameter will be renamed playProps in the next release.
    - * This parameter can be an instance of {{#crossLink "PlayPropsConfig"}}{{/crossLink}} or an Object that contains any or all optional properties by name, - * including: interrupt, delay, offset, loop, volume, pan, startTime, and duration (see the above code sample). - *
    OR
    - * Deprecated How to interrupt any currently playing instances of audio with the same source, - * if the maximum number of instances of the sound are already playing. Values are defined as INTERRUPT_TYPE - * constants on the Sound class, with the default defined by {{#crossLink "Sound/defaultInterruptBehavior:property"}}{{/crossLink}}. - * @param {Number} [delay=0] Deprecated The amount of time to delay the start of audio playback, in milliseconds. - * @param {Number} [offset=0] Deprecated The offset from the start of the audio to begin playback, in milliseconds. - * @param {Number} [loop=0] Deprecated How many times the audio loops when it reaches the end of playback. The default is 0 (no - * loops), and -1 can be used for infinite playback. - * @param {Number} [volume=1] Deprecated The volume of the sound, between 0 and 1. Note that the master volume is applied - * against the individual volume. - * @param {Number} [pan=0] Deprecated The left-right pan of the sound (if supported), between -1 (left) and 1 (right). - * Note that pan is not supported for HTML Audio. + * @param {Object | PlayPropsConfig} props A PlayPropsConfig instance, or an object that contains the parameters to + * play a sound. See the {{#crossLink "PlayPropsConfig"}}{{/crossLink}} for more info. * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. */ - p.play = function (interrupt, delay, offset, loop, volume, pan) { - var playProps; - if (interrupt instanceof Object || interrupt instanceof createjs.PlayPropsConfig) { - playProps = createjs.PlayPropsConfig.create(interrupt); - } else { - playProps = createjs.PlayPropsConfig.create({interrupt:interrupt, delay:delay, offset:offset, loop:loop, volume:volume, pan:pan}); - } - + p.play = function (props) { + var playProps = createjs.PlayPropsConfig.create(props); if (this.playState == createjs.Sound.PLAY_SUCCEEDED) { this.applyPlayProps(playProps); - if (this._paused) { this.setPaused(false); } + if (this._paused) { this._setPaused(false); } return; } this._cleanUp(); @@ -5664,13 +5806,13 @@ this.createjs = this.createjs || {}; * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. */ p.applyPlayProps = function(playProps) { - if (playProps.offset != null) { this.setPosition(playProps.offset) } - if (playProps.loop != null) { this.setLoop(playProps.loop); } - if (playProps.volume != null) { this.setVolume(playProps.volume); } - if (playProps.pan != null) { this.setPan(playProps.pan); } + if (playProps.offset != null) { this._setPosition(playProps.offset) } + if (playProps.loop != null) { this._setLoop(playProps.loop); } + if (playProps.volume != null) { this._setVolume(playProps.volume); } + if (playProps.pan != null) { this._setPan(playProps.pan); } if (playProps.startTime != null) { - this.setStartTime(playProps.startTime); - this.setDuration(playProps.duration); + this._setStartTime(playProps.startTime); + this._setDuration(playProps.duration); } return this; }; @@ -5681,27 +5823,25 @@ this.createjs = this.createjs || {}; // get/set methods that allow support for IE8 /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/paused:property"}}{{/crossLink}} directly as a property, - * - * @deprecated - * @method getPaused - * @returns {boolean} If the instance is currently paused + * Please use {{#crossLink "AbstractSoundInstance/paused:property"}}{{/crossLink}} directly as a property. + * @method _getPaused + * @protected + * @return {boolean} If the instance is currently paused * @since 0.6.0 */ - p.getPaused = function() { + p._getPaused = function() { return this._paused; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/paused:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPaused + * Please use {{#crossLink "AbstractSoundInstance/paused:property"}}{{/crossLink}} directly as a property + * @method _setPaused + * @protected * @param {boolean} value * @since 0.6.0 * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. */ - p.setPaused = function (value) { + p._setPaused = function (value) { if ((value !== true && value !== false) || this._paused == value) {return;} if (value == true && this.playState != createjs.Sound.PLAY_SUCCEEDED) {return;} this._paused = value; @@ -5715,14 +5855,13 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setVolume + * Please use {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} directly as a property + * @method _setVolume + * @protected * @param {Number} value The volume to set, between 0 and 1. * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. */ - p.setVolume = function (value) { + p._setVolume = function (value) { if (value == this._volume) { return this; } this._volume = Math.max(0, Math.min(1, value)); if (!this._muted) { @@ -5732,26 +5871,24 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getVolume + * Please use {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} directly as a property + * @method _getVolume + * @protected * @return {Number} The current volume of the sound instance. */ - p.getVolume = function () { + p._getVolume = function () { return this._volume; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/muted:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setMuted + * Please use {{#crossLink "AbstractSoundInstance/muted:property"}}{{/crossLink}} directly as a property + * @method _setMuted + * @protected * @param {Boolean} value If the sound should be muted. * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. * @since 0.6.0 */ - p.setMuted = function (value) { + p._setMuted = function (value) { if (value !== true && value !== false) {return;} this._muted = value; this._updateVolume(); @@ -5759,26 +5896,24 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/muted:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getMuted + * Please use {{#crossLink "AbstractSoundInstance/muted:property"}}{{/crossLink}} directly as a property + * @method _getMuted + * @protected * @return {Boolean} If the sound is muted. * @since 0.6.0 */ - p.getMuted = function () { + p._getMuted = function () { return this._muted; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/pan:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPan + * Please use {{#crossLink "AbstractSoundInstance/pan:property"}}{{/crossLink}} directly as a property + * @method _setPan + * @protected * @param {Number} value The pan value, between -1 (left) and 1 (right). * @return {AbstractSoundInstance} Returns reference to itself for chaining calls */ - p.setPan = function (value) { + p._setPan = function (value) { if(value == this._pan) { return this; } this._pan = Math.max(-1, Math.min(1, value)); this._updatePan(); @@ -5786,24 +5921,22 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/pan:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getPan + * Please use {{#crossLink "AbstractSoundInstance/pan:property"}}{{/crossLink}} directly as a property + * @method _getPan + * @protected * @return {Number} The value of the pan, between -1 (left) and 1 (right). */ - p.getPan = function () { + p._getPan = function () { return this._pan; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/position:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getPosition + * Please use {{#crossLink "AbstractSoundInstance/position:property"}}{{/crossLink}} directly as a property + * @method _getPosition + * @protected * @return {Number} The position of the playhead in the sound, in milliseconds. */ - p.getPosition = function () { + p._getPosition = function () { if (!this._paused && this.playState == createjs.Sound.PLAY_SUCCEEDED) { this._position = this._calculateCurrentPosition(); } @@ -5811,14 +5944,13 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/position:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPosition + * Please use {{#crossLink "AbstractSoundInstance/position:property"}}{{/crossLink}} directly as a property + * @method _setPosition + * @protected * @param {Number} value The position to place the playhead, in milliseconds. * @return {AbstractSoundInstance} Returns reference to itself for chaining calls */ - p.setPosition = function (value) { + p._setPosition = function (value) { this._position = Math.max(0, value); if (this.playState == createjs.Sound.PLAY_SUCCEEDED) { this._updatePosition(); @@ -5827,25 +5959,23 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/startTime:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getStartTime + * Please use {{#crossLink "AbstractSoundInstance/startTime:property"}}{{/crossLink}} directly as a property + * @method _getStartTime + * @protected * @return {Number} The startTime of the sound instance in milliseconds. */ - p.getStartTime = function () { + p._getStartTime = function () { return this._startTime; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/startTime:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setStartTime + * Please use {{#crossLink "AbstractSoundInstance/startTime:property"}}{{/crossLink}} directly as a property + * @method _setStartTime + * @protected * @param {number} value The new startTime time in milli seconds. * @return {AbstractSoundInstance} Returns reference to itself for chaining calls */ - p.setStartTime = function (value) { + p._setStartTime = function (value) { if (value == this._startTime) { return this; } this._startTime = Math.max(0, value || 0); this._updateStartTime(); @@ -5853,26 +5983,24 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/duration:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getDuration + * Please use {{#crossLink "AbstractSoundInstance/duration:property"}}{{/crossLink}} directly as a property + * @method _getDuration + * @protected * @return {Number} The duration of the sound instance in milliseconds. */ - p.getDuration = function () { + p._getDuration = function () { return this._duration; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/duration:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setDuration + * Please use {{#crossLink "AbstractSoundInstance/duration:property"}}{{/crossLink}} directly as a property + * @method _setDuration + * @protected * @param {number} value The new duration time in milli seconds. * @return {AbstractSoundInstance} Returns reference to itself for chaining calls * @since 0.6.0 */ - p.setDuration = function (value) { + p._setDuration = function (value) { if (value == this._duration) { return this; } this._duration = Math.max(0, value || 0); this._updateDuration(); @@ -5880,54 +6008,50 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/playbackResource:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPlayback + * Please use {{#crossLink "AbstractSoundInstance/playbackResource:property"}}{{/crossLink}} directly as a property + * @method _setPlaybackResource + * @protected * @param {Object} value The new playback resource. * @return {AbstractSoundInstance} Returns reference to itself for chaining calls * @since 0.6.0 **/ - p.setPlaybackResource = function (value) { + p._setPlaybackResource = function (value) { this._playbackResource = value; - if (this._duration == 0) { this._setDurationFromSource(); } + if (this._duration == 0 && this._playbackResource) { this._setDurationFromSource(); } return this; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/playbackResource:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPlayback + * Please use {{#crossLink "AbstractSoundInstance/playbackResource:property"}}{{/crossLink}} directly as a property + * @method _getPlaybackResource + * @protected * @param {Object} value The new playback resource. * @return {Object} playback resource used for playing audio * @since 0.6.0 **/ - p.getPlaybackResource = function () { + p._getPlaybackResource = function () { return this._playbackResource; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/loop:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getLoop + * Please use {{#crossLink "AbstractSoundInstance/loop:property"}}{{/crossLink}} directly as a property + * @method _getLoop + * @protected * @return {number} * @since 0.6.0 **/ - p.getLoop = function () { + p._getLoop = function () { return this._loop; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/loop:property"}}{{/crossLink}} directly as a property, - * - * @deprecated - * @method setLoop + * Please use {{#crossLink "AbstractSoundInstance/loop:property"}}{{/crossLink}} directly as a property + * @method _setLoop + * @protected * @param {number} value The number of times to loop after play. * @since 0.6.0 */ - p.setLoop = function (value) { + p._setLoop = function (value) { if(this._playbackResource != null) { // remove looping if (this._loop != 0 && value == 0) { @@ -5988,13 +6112,13 @@ this.createjs = this.createjs || {}; */ // OJR FlashAudioSoundInstance overwrites p._beginPlaying = function (playProps) { - this.setPosition(playProps.offset); - this.setLoop(playProps.loop); - this.setVolume(playProps.volume); - this.setPan(playProps.pan); + this._setPosition(playProps.offset); + this._setLoop(playProps.loop); + this._setVolume(playProps.volume); + this._setPan(playProps.pan); if (playProps.startTime != null) { - this.setStartTime(playProps.startTime); - this.setDuration(playProps.duration); + this._setStartTime(playProps.startTime); + this._setDuration(playProps.duration); } if (this._playbackResource != null && this._position < this._duration) { @@ -6279,20 +6403,6 @@ this.createjs = this.createjs || {}; }; var p = AbstractPlugin.prototype; - /** - * REMOVED. Removed in favor of using `MySuperClass_constructor`. - * See {{#crossLink "Utility Methods/extend"}}{{/crossLink}} and {{#crossLink "Utility Methods/promote"}}{{/crossLink}} - * for details. - * - * There is an inheritance tutorial distributed with EaselJS in /tutorials/Inheritance. - * - * @method initialize - * @protected - * @deprecated - */ - // p.initialize = function() {}; // searchable for devs wondering where it is. - - // Static Properties: // NOTE THESE PROPERTIES NEED TO BE ADDED TO EACH PLUGIN /** @@ -6300,7 +6410,7 @@ this.createjs = this.createjs || {}; * @property _capabilities * @type {Object} * @default null - * @protected + * @private * @static */ AbstractPlugin._capabilities = null; @@ -6411,7 +6521,15 @@ this.createjs = this.createjs || {}; this.preload(this.register(src)); } var si = new this._soundInstanceClass(src, startTime, duration, this._audioSources[src]); - this._soundInstances[src].push(si); + if(this._soundInstances[src]){ + this._soundInstances[src].push(si); + } + + // Plugins that don't have a setVolume should implement a setMasterVolune/setMasterMute + // So we have to check that here. + si.setMasterVolume && si.setMasterVolume(createjs.Sound.volume); + si.setMasterMute && si.setMasterMute(createjs.Sound.muted); + return si; }; @@ -6442,7 +6560,7 @@ this.createjs = this.createjs || {}; * Mute all sounds via the plugin. * @method setMute * @param {Boolean} value If all sound should be muted or not. Note that plugin-level muting just looks up - * the mute value of Sound {{#crossLink "Sound/getMute"}}{{/crossLink}}, so this property is not used here. + * the mute value of Sound {{#crossLink "Sound/muted:property"}}{{/crossLink}}, so this property is not used here. * @return {Boolean} If the mute call succeeds. */ p.setMute = function (value) { @@ -6460,6 +6578,7 @@ this.createjs = this.createjs || {}; /** * Handles internal preload completion. * @method _handlePreloadComplete + * @param event * @protected */ p._handlePreloadComplete = function (event) { @@ -6467,13 +6586,14 @@ this.createjs = this.createjs || {}; this._audioSources[src] = event.result; for (var i = 0, l = this._soundInstances[src].length; i < l; i++) { var item = this._soundInstances[src][i]; - item.setPlaybackResource(this._audioSources[src]); + item.playbackResource = this._audioSources[src]; // ToDo consider adding play call here if playstate == playfailed + this._soundInstances[src] = null; } }; /** - * Handles internal preload erros + * Handles internal preload errors * @method _handlePreloadError * @param event * @protected @@ -6513,15 +6633,11 @@ this.createjs = this.createjs || {}; * @protected */ function Loader(loadItem) { - this.AbstractLoader_constructor(loadItem, true, createjs.AbstractLoader.SOUND); + this.AbstractLoader_constructor(loadItem, true, createjs.Types.SOUND); }; var p = createjs.extend(Loader, createjs.AbstractLoader); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - /** * web audio context required for decoding audio * @property context @@ -6667,10 +6783,6 @@ this.createjs = this.createjs || {}; var p = createjs.extend(WebAudioSoundInstance, createjs.AbstractSoundInstance); var s = WebAudioSoundInstance; - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - /** * Note this is only intended for use by advanced users. *
    Audio context used to create nodes. This is and needs to be the same context used by {{#crossLink "WebAudioPlugin"}}{{/crossLink}}. @@ -6757,7 +6869,7 @@ this.createjs = this.createjs || {}; clearTimeout(this._soundCompleteTimeout); - this._playbackStartTime = 0; // This is used by getPosition + this._playbackStartTime = 0; // This is used by _getPosition }; /** @@ -6774,7 +6886,9 @@ this.createjs = this.createjs || {}; audioNode.disconnect(0); // necessary to prevent leak on iOS Safari 7-9. will throw in almost all other // browser implementations. - try { audioNode.buffer = s._scratchBuffer; } catch(e) {} + if ( createjs.BrowserDetect.isIOS ) { + try { audioNode.buffer = s._scratchBuffer; } catch(e) {} + } audioNode = null; } return audioNode; @@ -6783,9 +6897,8 @@ this.createjs = this.createjs || {}; p._handleSoundReady = function (event) { this.gainNode.connect(s.destinationNode); // this line can cause a memory leak. Nodes need to be disconnected from the audioDestination or any sequence that leads to it. - var dur = this._duration * 0.001; - var pos = this._position * 0.001; - if (pos > dur) {pos = dur;} + var dur = this._duration * 0.001, + pos = Math.min(Math.max(0, this._position) * 0.001, dur); this.sourceNode = this._createAndPlayAudioNode((s.context.currentTime - dur), pos); this._playbackStartTime = this.sourceNode.startTime - pos; @@ -6974,10 +7087,6 @@ this.createjs = this.createjs || {}; } var p = createjs.extend(WebAudioPlugin, createjs.AbstractPlugin); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static Properties var s = WebAudioPlugin; /** @@ -6986,7 +7095,7 @@ this.createjs = this.createjs || {}; * @property _capabilities * @type {Object} * @default null - * @protected + * @private * @static */ s._capabilities = null; @@ -6995,7 +7104,7 @@ this.createjs = this.createjs || {}; * Value to set panning model to equal power for WebAudioSoundInstance. Can be "equalpower" or 0 depending on browser implementation. * @property _panningModel * @type {Number / String} - * @protected + * @private * @static */ s._panningModel = "equalpower"; @@ -7022,7 +7131,7 @@ this.createjs = this.createjs || {}; * * @property _scratchBuffer * @type {AudioBuffer} - * @protected + * @private * @static */ s._scratchBuffer = null; @@ -7037,6 +7146,14 @@ this.createjs = this.createjs || {}; */ s._unlocked = false; + /** + * The default sample rate used when checking for iOS compatibility. See {{#crossLink "WebAudioPlugin/_createAudioContext"}}{{/crossLink}}. + * @property DEFAULT_SAMPLE_REATE + * @type {number} + * @default 44100 + * @static + */ + s.DEFAULT_SAMPLE_RATE = 44100; // Static Public Methods /** @@ -7086,7 +7203,7 @@ this.createjs = this.createjs || {}; * @method _isFileXHRSupported * @return {Boolean} If XHR is supported. * @since 0.4.2 - * @protected + * @private * @static */ s._isFileXHRSupported = function() { @@ -7115,11 +7232,11 @@ this.createjs = this.createjs || {}; }; /** - * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} + * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} * method for an overview of plugin capabilities. * @method _generateCapabilities * @static - * @protected + * @private */ s._generateCapabilities = function () { if (s._capabilities != null) {return;} @@ -7128,13 +7245,8 @@ this.createjs = this.createjs || {}; if (t.canPlayType == null) {return null;} if (s.context == null) { - if (window.AudioContext) { - s.context = new AudioContext(); - } else if (window.webkitAudioContext) { - s.context = new webkitAudioContext(); - } else { - return null; - } + s.context = s._createAudioContext(); + if (s.context == null) { return null; } } if (s._scratchBuffer == null) { s._scratchBuffer = s.context.createBuffer(1, 1, 22050); @@ -7146,10 +7258,10 @@ this.createjs = this.createjs || {}; if ("ontouchstart" in window && s.context.state != "running") { s._unlock(); // When played inside of a touch event, this will enable audio on iOS immediately. document.addEventListener("mousedown", s._unlock, true); + document.addEventListener("touchstart", s._unlock, true); document.addEventListener("touchend", s._unlock, true); } - s._capabilities = { panning:true, volume:true, @@ -7172,6 +7284,43 @@ this.createjs = this.createjs || {}; } }; + /** + * Create an audio context for the sound. + * + * This method handles both vendor prefixes (specifically webkit support), as well as a case on iOS where + * audio played with a different sample rate may play garbled when first started. The default sample rate is + * 44,100, however it can be changed using the {{#crossLink "WebAudioPlugin/DEFAULT_SAMPLE_RATE:property"}}{{/crossLink}}. + * @method _createAudioContext + * @return {AudioContext | webkitAudioContext} + * @private + * @static + * @since 1.0.0 + */ + s._createAudioContext = function() { + // Slightly modified version of https://github.com/Jam3/ios-safe-audio-context + // Resolves issues with first-run contexts playing garbled on iOS. + var AudioCtor = (window.AudioContext || window.webkitAudioContext); + if (AudioCtor == null) { return null; } + var context = new AudioCtor(); + + // Check if hack is necessary. Only occurs in iOS6+ devices + // and only when you first boot the iPhone, or play a audio/video + // with a different sample rate + if (/(iPhone|iPad)/i.test(navigator.userAgent) + && context.sampleRate !== s.DEFAULT_SAMPLE_RATE) { + var buffer = context.createBuffer(1, 1, s.DEFAULT_SAMPLE_RATE), + dummy = context.createBufferSource(); + dummy.buffer = buffer; + dummy.connect(context.destination); + dummy.start(0); + dummy.disconnect(); + context.close() // dispose old context + + context = new AudioCtor(); + } + return context; + } + /** * Set up compatibility if only deprecated web audio calls are supported. * See http://www.w3.org/TR/webaudio/#DeprecationNotes @@ -7180,7 +7329,7 @@ this.createjs = this.createjs || {}; * * @method _compatibilitySetUp * @static - * @protected + * @private * @since 0.4.2 */ s._compatibilitySetUp = function() { @@ -7218,6 +7367,7 @@ this.createjs = this.createjs || {}; if (s.context.state == "running") { document.removeEventListener("mousedown", s._unlock, true); document.removeEventListener("touchend", s._unlock, true); + document.removeEventListener("touchstart", s._unlock, true); s._unlocked = true; } }; @@ -7290,7 +7440,7 @@ this.createjs = this.createjs || {}; * @property _tags * @type {{}} * @static - * @protected + * @private */ s._tags = {}; @@ -7299,7 +7449,7 @@ this.createjs = this.createjs || {}; * @property _tagPool * @type {TagPool} * @static - * @protected + * @private */ s._tagPool = new TagPool(); @@ -7307,7 +7457,7 @@ this.createjs = this.createjs || {}; * A hash lookup of if a base audio tag is available, indexed by the audio source * @property _tagsUsed * @type {{}} - * @protected + * @private * @static */ s._tagUsed = {}; @@ -7506,10 +7656,6 @@ this.createjs = this.createjs || {}; } var p = createjs.extend(HTMLAudioSoundInstance, createjs.AbstractSoundInstance); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Public Methods /** * Called by {{#crossLink "Sound"}}{{/crossLink}} when plugin does not handle master volume. @@ -7775,18 +7921,6 @@ this.createjs = this.createjs || {}; // Public Properties - /** - * This is no longer needed as we are now using object pooling for tags. - * - * NOTE this property only exists as a limitation of HTML audio. - * @property defaultNumChannels - * @type {Number} - * @default 2 - * @since 0.4.0 - * @deprecated - */ - this.defaultNumChannels = 2; - this._capabilities = s._capabilities; this._loaderClass = createjs.SoundLoader; @@ -7796,10 +7930,6 @@ this.createjs = this.createjs || {}; var p = createjs.extend(HTMLAudioPlugin, createjs.AbstractPlugin); var s = HTMLAudioPlugin; - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static Properties /** * The maximum number of instances that can be loaded or played. This is a browser limitation, primarily limited to IE9. @@ -7818,7 +7948,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default canplaythrough * @static - * @protected + * @private */ s._AUDIO_READY = "canplaythrough"; @@ -7828,7 +7958,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default ended * @static - * @protected + * @private */ s._AUDIO_ENDED = "ended"; @@ -7838,7 +7968,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default seeked * @static - * @protected + * @private */ s._AUDIO_SEEKED = "seeked"; @@ -7848,7 +7978,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default stalled * @static - * @protected + * @private */ s._AUDIO_STALLED = "stalled"; @@ -7859,17 +7989,17 @@ this.createjs = this.createjs || {}; * @type {String} * @default timeupdate * @static - * @protected + * @private */ s._TIME_UPDATE = "timeupdate"; /** * The capabilities of the plugin. This is generated via the {{#crossLink "HTMLAudioPlugin/_generateCapabilities"}}{{/crossLink}} - * method. Please see the Sound {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} method for an overview of all + * method. Please see the Sound {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} method for an overview of all * of the available properties. * @property _capabilities * @type {Object} - * @protected + * @private * @static */ s._capabilities = null; @@ -7889,11 +8019,11 @@ this.createjs = this.createjs || {}; }; /** - * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} + * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} * method for an overview of plugin capabilities. * @method _generateCapabilities * @static - * @protected + * @private */ s._generateCapabilities = function () { if (s._capabilities != null) {return;} @@ -7933,7 +8063,7 @@ this.createjs = this.createjs || {}; p.create = function (src, startTime, duration) { var si = this.AbstractPlugin_create(src, startTime, duration); - si.setPlaybackResource(null); + si.playbackResource = null; return si; }; diff --git a/lib/soundjs.min.js b/lib/soundjs.min.js new file mode 100644 index 00000000..500295ab --- /dev/null +++ b/lib/soundjs.min.js @@ -0,0 +1,19 @@ +/*! +* @license SoundJS +* Visit http://createjs.com/ for documentation, updates and examples. +* +* Copyright (c) 2011-2015 gskinner.com, inc. +* +* 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. +*/ + +/**! + * SoundJS FlashAudioPlugin also includes swfobject (http://code.google.com/p/swfobject/) + */ + +this.createjs=this.createjs||{},function(){var a=createjs.SoundJS=createjs.SoundJS||{};a.version="1.0.0",a.buildDate="Thu, 12 Oct 2017 16:34:05 GMT"}(),this.createjs=this.createjs||{},createjs.extend=function(a,b){"use strict";function c(){this.constructor=a}return c.prototype=b.prototype,a.prototype=new c},this.createjs=this.createjs||{},createjs.promote=function(a,b){"use strict";var c=a.prototype,d=Object.getPrototypeOf&&Object.getPrototypeOf(c)||c.__proto__;if(d){c[(b+="_")+"constructor"]=d.constructor;for(var e in d)c.hasOwnProperty(e)&&"function"==typeof d[e]&&(c[b+e]=d[e])}return a},this.createjs=this.createjs||{},createjs.deprecate=function(a,b){"use strict";return function(){var c="Deprecated property or method '"+b+"'. See docs for info.";return console&&(console.warn?console.warn(c):console.log(c)),a&&a.apply(this,arguments)}},this.createjs=this.createjs||{},createjs.indexOf=function(a,b){"use strict";for(var c=0,d=a.length;d>c;c++)if(b===a[c])return c;return-1},this.createjs=this.createjs||{},function(){"use strict";createjs.proxy=function(a,b){var c=Array.prototype.slice.call(arguments,2);return function(){return a.apply(b,Array.prototype.slice.call(arguments,0).concat(c))}}}(),this.createjs=this.createjs||{},function(){"use strict";function BrowserDetect(){throw"BrowserDetect cannot be instantiated"}var a=BrowserDetect.agent=window.navigator.userAgent;BrowserDetect.isWindowPhone=a.indexOf("IEMobile")>-1||a.indexOf("Windows Phone")>-1,BrowserDetect.isFirefox=a.indexOf("Firefox")>-1,BrowserDetect.isOpera=null!=window.opera,BrowserDetect.isChrome=a.indexOf("Chrome")>-1,BrowserDetect.isIOS=(a.indexOf("iPod")>-1||a.indexOf("iPhone")>-1||a.indexOf("iPad")>-1)&&!BrowserDetect.isWindowPhone,BrowserDetect.isAndroid=a.indexOf("Android")>-1&&!BrowserDetect.isWindowPhone,BrowserDetect.isBlackberry=a.indexOf("Blackberry")>-1,createjs.BrowserDetect=BrowserDetect}(),this.createjs=this.createjs||{},function(){"use strict";function EventDispatcher(){this._listeners=null,this._captureListeners=null}var a=EventDispatcher.prototype;EventDispatcher.initialize=function(b){b.addEventListener=a.addEventListener,b.on=a.on,b.removeEventListener=b.off=a.removeEventListener,b.removeAllEventListeners=a.removeAllEventListeners,b.hasEventListener=a.hasEventListener,b.dispatchEvent=a.dispatchEvent,b._dispatchEvent=a._dispatchEvent,b.willTrigger=a.willTrigger},a.addEventListener=function(a,b,c){var d;d=c?this._captureListeners=this._captureListeners||{}:this._listeners=this._listeners||{};var e=d[a];return e&&this.removeEventListener(a,b,c),e=d[a],e?e.push(b):d[a]=[b],b},a.on=function(a,b,c,d,e,f){return b.handleEvent&&(c=c||b,b=b.handleEvent),c=c||this,this.addEventListener(a,function(a){b.call(c,a,e),d&&a.remove()},f)},a.removeEventListener=function(a,b,c){var d=c?this._captureListeners:this._listeners;if(d){var e=d[a];if(e)for(var f=0,g=e.length;g>f;f++)if(e[f]==b){1==g?delete d[a]:e.splice(f,1);break}}},a.off=a.removeEventListener,a.removeAllEventListeners=function(a){a?(this._listeners&&delete this._listeners[a],this._captureListeners&&delete this._captureListeners[a]):this._listeners=this._captureListeners=null},a.dispatchEvent=function(a,b,c){if("string"==typeof a){var d=this._listeners;if(!(b||d&&d[a]))return!0;a=new createjs.Event(a,b,c)}else a.target&&a.clone&&(a=a.clone());try{a.target=this}catch(e){}if(a.bubbles&&this.parent){for(var f=this,g=[f];f.parent;)g.push(f=f.parent);var h,i=g.length;for(h=i-1;h>=0&&!a.propagationStopped;h--)g[h]._dispatchEvent(a,1+(0==h));for(h=1;i>h&&!a.propagationStopped;h++)g[h]._dispatchEvent(a,3)}else this._dispatchEvent(a,2);return!a.defaultPrevented},a.hasEventListener=function(a){var b=this._listeners,c=this._captureListeners;return!!(b&&b[a]||c&&c[a])},a.willTrigger=function(a){for(var b=this;b;){if(b.hasEventListener(a))return!0;b=b.parent}return!1},a.toString=function(){return"[EventDispatcher]"},a._dispatchEvent=function(a,b){var c,d,e=2>=b?this._captureListeners:this._listeners;if(a&&e&&(d=e[a.type])&&(c=d.length)){try{a.currentTarget=this}catch(f){}try{a.eventPhase=0|b}catch(f){}a.removed=!1,d=d.slice();for(var g=0;c>g&&!a.immediatePropagationStopped;g++){var h=d[g];h.handleEvent?h.handleEvent(a):h(a),a.removed&&(this.off(a.type,h,1==b),a.removed=!1)}}2===b&&this._dispatchEvent(a,2.1)},createjs.EventDispatcher=EventDispatcher}(),this.createjs=this.createjs||{},function(){"use strict";function Event(a,b,c){this.type=a,this.target=null,this.currentTarget=null,this.eventPhase=0,this.bubbles=!!b,this.cancelable=!!c,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.immediatePropagationStopped=!1,this.removed=!1}var a=Event.prototype;a.preventDefault=function(){this.defaultPrevented=this.cancelable&&!0},a.stopPropagation=function(){this.propagationStopped=!0},a.stopImmediatePropagation=function(){this.immediatePropagationStopped=this.propagationStopped=!0},a.remove=function(){this.removed=!0},a.clone=function(){return new Event(this.type,this.bubbles,this.cancelable)},a.set=function(a){for(var b in a)this[b]=a[b];return this},a.toString=function(){return"[Event (type="+this.type+")]"},createjs.Event=Event}(),this.createjs=this.createjs||{},function(){"use strict";function ErrorEvent(a,b,c){this.Event_constructor("error"),this.title=a,this.message=b,this.data=c}var a=createjs.extend(ErrorEvent,createjs.Event);a.clone=function(){return new createjs.ErrorEvent(this.title,this.message,this.data)},createjs.ErrorEvent=createjs.promote(ErrorEvent,"Event")}(),this.createjs=this.createjs||{},function(){"use strict";function ProgressEvent(a,b){this.Event_constructor("progress"),this.loaded=a,this.total=null==b?1:b,this.progress=0==b?0:this.loaded/this.total}var a=createjs.extend(ProgressEvent,createjs.Event);a.clone=function(){return new createjs.ProgressEvent(this.loaded,this.total)},createjs.ProgressEvent=createjs.promote(ProgressEvent,"Event")}(window),this.createjs=this.createjs||{},function(){"use strict";function LoadItem(){this.src=null,this.type=null,this.id=null,this.maintainOrder=!1,this.callback=null,this.data=null,this.method=createjs.Methods.GET,this.values=null,this.headers=null,this.withCredentials=!1,this.mimeType=null,this.crossOrigin=null,this.loadTimeout=b.LOAD_TIMEOUT_DEFAULT}var a=LoadItem.prototype={},b=LoadItem;b.LOAD_TIMEOUT_DEFAULT=8e3,b.create=function(a){if("string"==typeof a){var c=new LoadItem;return c.src=a,c}if(a instanceof b)return a;if(a instanceof Object&&a.src)return null==a.loadTimeout&&(a.loadTimeout=b.LOAD_TIMEOUT_DEFAULT),a;throw new Error("Type not recognized.")},a.set=function(a){for(var b in a)this[b]=a[b];return this},createjs.LoadItem=b}(),this.createjs=this.createjs||{},function(){var a={};a.POST="POST",a.GET="GET",createjs.Methods=a}(),this.createjs=this.createjs||{},function(){var a={};a.BINARY="binary",a.CSS="css",a.FONT="font",a.FONTCSS="fontcss",a.IMAGE="image",a.JAVASCRIPT="javascript",a.JSON="json",a.JSONP="jsonp",a.MANIFEST="manifest",a.SOUND="sound",a.VIDEO="video",a.SPRITESHEET="spritesheet",a.SVG="svg",a.TEXT="text",a.XML="xml",createjs.Types=a}(),function(){var a={};a.a=function(){return a.el("a")},a.svg=function(){return a.el("svg")},a.object=function(){return a.el("object")},a.image=function(){return a.el("image")},a.img=function(){return a.el("img")},a.style=function(){return a.el("style")},a.link=function(){return a.el("link")},a.script=function(){return a.el("script")},a.audio=function(){return a.el("audio")},a.video=function(){return a.el("video")},a.text=function(a){return document.createTextNode(a)},a.el=function(a){return document.createElement(a)},createjs.Elements=a}(),function(){var a={container:null};a.appendToHead=function(b){a.getHead().appendChild(b)},a.appendToBody=function(b){if(null==a.container){a.container=document.createElement("div"),a.container.id="preloadjs-container";var c=a.container.style;c.visibility="hidden",c.position="absolute",c.width=a.container.style.height="10px",c.overflow="hidden",c.transform=c.msTransform=c.webkitTransform=c.oTransform="translate(-10px, -10px)",a.getBody().appendChild(a.container)}a.container.appendChild(b)},a.getHead=function(){return document.head||document.getElementsByTagName("head")[0]},a.getBody=function(){return document.body||document.getElementsByTagName("body")[0]},a.removeChild=function(a){a.parent&&a.parent.removeChild(a)},a.isImageTag=function(a){return a instanceof HTMLImageElement},a.isAudioTag=function(a){return window.HTMLAudioElement?a instanceof HTMLAudioElement:!1},a.isVideoTag=function(a){return window.HTMLVideoElement?a instanceof HTMLVideoElement:!1},createjs.DomUtils=a}(),function(){var a={};a.isBinary=function(a){switch(a){case createjs.Types.IMAGE:case createjs.Types.BINARY:return!0;default:return!1}},a.isText=function(a){switch(a){case createjs.Types.TEXT:case createjs.Types.JSON:case createjs.Types.MANIFEST:case createjs.Types.XML:case createjs.Types.CSS:case createjs.Types.SVG:case createjs.Types.JAVASCRIPT:case createjs.Types.SPRITESHEET:return!0;default:return!1}},a.getTypeByExtension=function(a){if(null==a)return createjs.Types.TEXT;switch(a.toLowerCase()){case"jpeg":case"jpg":case"gif":case"png":case"webp":case"bmp":return createjs.Types.IMAGE;case"ogg":case"mp3":case"webm":return createjs.Types.SOUND;case"mp4":case"webm":case"ts":return createjs.Types.VIDEO;case"json":return createjs.Types.JSON;case"xml":return createjs.Types.XML;case"css":return createjs.Types.CSS;case"js":return createjs.Types.JAVASCRIPT;case"svg":return createjs.Types.SVG;default:return createjs.Types.TEXT}},createjs.RequestUtils=a}(),function(){var a={};a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[.\/]*?\//i,a.EXTENSION_PATT=/\/?[^\/]+\.(\w{1,5})$/i,a.parseURI=function(b){var c={absolute:!1,relative:!1,protocol:null,hostname:null,port:null,pathname:null,search:null,hash:null,host:null};if(null==b)return c;var d=createjs.Elements.a();d.href=b;for(var e in c)e in d&&(c[e]=d[e]);var f=b.indexOf("?");f>-1&&(b=b.substr(0,f));var g;return a.ABSOLUTE_PATT.test(b)?c.absolute=!0:a.RELATIVE_PATT.test(b)&&(c.relative=!0),(g=b.match(a.EXTENSION_PATT))&&(c.extension=g[1].toLowerCase()),c},a.formatQueryString=function(a,b){if(null==a)throw new Error("You must specify data.");var c=[];for(var d in a)c.push(d+"="+escape(a[d]));return b&&(c=c.concat(b)),c.join("&")},a.buildURI=function(a,b){if(null==b)return a;var c=[],d=a.indexOf("?");if(-1!=d){var e=a.slice(d+1);c=c.concat(e.split("&"))}return-1!=d?a.slice(0,d)+"?"+this.formatQueryString(b,c):a+"?"+this.formatQueryString(b,c)},a.isCrossDomain=function(a){var b=createjs.Elements.a();b.href=a.src;var c=createjs.Elements.a();c.href=location.href;var d=""!=b.hostname&&(b.port!=c.port||b.protocol!=c.protocol||b.hostname!=c.hostname);return d},a.isLocal=function(a){var b=createjs.Elements.a();return b.href=a.src,""==b.hostname&&"file:"==b.protocol},createjs.URLUtils=a}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractLoader(a,b,c){this.EventDispatcher_constructor(),this.loaded=!1,this.canceled=!1,this.progress=0,this.type=c,this.resultFormatter=null,this._item=a?createjs.LoadItem.create(a):null,this._preferXHR=b,this._result=null,this._rawResult=null,this._loadedItems=null,this._tagSrcAttribute=null,this._tag=null}var a=createjs.extend(AbstractLoader,createjs.EventDispatcher),b=AbstractLoader;try{Object.defineProperties(b,{POST:{get:createjs.deprecate(function(){return createjs.Methods.POST},"AbstractLoader.POST")},GET:{get:createjs.deprecate(function(){return createjs.Methods.GET},"AbstractLoader.GET")},BINARY:{get:createjs.deprecate(function(){return createjs.Types.BINARY},"AbstractLoader.BINARY")},CSS:{get:createjs.deprecate(function(){return createjs.Types.CSS},"AbstractLoader.CSS")},FONT:{get:createjs.deprecate(function(){return createjs.Types.FONT},"AbstractLoader.FONT")},FONTCSS:{get:createjs.deprecate(function(){return createjs.Types.FONTCSS},"AbstractLoader.FONTCSS")},IMAGE:{get:createjs.deprecate(function(){return createjs.Types.IMAGE},"AbstractLoader.IMAGE")},JAVASCRIPT:{get:createjs.deprecate(function(){return createjs.Types.JAVASCRIPT},"AbstractLoader.JAVASCRIPT")},JSON:{get:createjs.deprecate(function(){return createjs.Types.JSON},"AbstractLoader.JSON")},JSONP:{get:createjs.deprecate(function(){return createjs.Types.JSONP},"AbstractLoader.JSONP")},MANIFEST:{get:createjs.deprecate(function(){return createjs.Types.MANIFEST},"AbstractLoader.MANIFEST")},SOUND:{get:createjs.deprecate(function(){return createjs.Types.SOUND},"AbstractLoader.SOUND")},VIDEO:{get:createjs.deprecate(function(){return createjs.Types.VIDEO},"AbstractLoader.VIDEO")},SPRITESHEET:{get:createjs.deprecate(function(){return createjs.Types.SPRITESHEET},"AbstractLoader.SPRITESHEET")},SVG:{get:createjs.deprecate(function(){return createjs.Types.SVG},"AbstractLoader.SVG")},TEXT:{get:createjs.deprecate(function(){return createjs.Types.TEXT},"AbstractLoader.TEXT")},XML:{get:createjs.deprecate(function(){return createjs.Types.XML},"AbstractLoader.XML")}})}catch(c){}a.getItem=function(){return this._item},a.getResult=function(a){return a?this._rawResult:this._result},a.getTag=function(){return this._tag},a.setTag=function(a){this._tag=a},a.load=function(){this._createRequest(),this._request.on("complete",this,this),this._request.on("progress",this,this),this._request.on("loadStart",this,this),this._request.on("abort",this,this),this._request.on("timeout",this,this),this._request.on("error",this,this);var a=new createjs.Event("initialize");a.loader=this._request,this.dispatchEvent(a),this._request.load()},a.cancel=function(){this.canceled=!0,this.destroy()},a.destroy=function(){this._request&&(this._request.removeAllEventListeners(),this._request.destroy()),this._request=null,this._item=null,this._rawResult=null,this._result=null,this._loadItems=null,this.removeAllEventListeners()},a.getLoadedItems=function(){return this._loadedItems},a._createRequest=function(){this._request=this._preferXHR?new createjs.XHRRequest(this._item):new createjs.TagRequest(this._item,this._tag||this._createTag(),this._tagSrcAttribute)},a._createTag=function(){return null},a._sendLoadStart=function(){this._isCanceled()||this.dispatchEvent("loadstart")},a._sendProgress=function(a){if(!this._isCanceled()){var b=null;"number"==typeof a?(this.progress=a,b=new createjs.ProgressEvent(this.progress)):(b=a,this.progress=a.loaded/a.total,b.progress=this.progress,(isNaN(this.progress)||1/0==this.progress)&&(this.progress=0)),this.hasEventListener("progress")&&this.dispatchEvent(b)}},a._sendComplete=function(){if(!this._isCanceled()){this.loaded=!0;var a=new createjs.Event("complete");a.rawResult=this._rawResult,null!=this._result&&(a.result=this._result),this.dispatchEvent(a)}},a._sendError=function(a){!this._isCanceled()&&this.hasEventListener("error")&&(null==a&&(a=new createjs.ErrorEvent("PRELOAD_ERROR_EMPTY")),this.dispatchEvent(a))},a._isCanceled=function(){return null==window.createjs||this.canceled?!0:!1},a.resultFormatter=null,a.handleEvent=function(a){switch(a.type){case"complete":this._rawResult=a.target._response;var b=this.resultFormatter&&this.resultFormatter(this);b instanceof Function?b.call(this,createjs.proxy(this._resultFormatSuccess,this),createjs.proxy(this._resultFormatFailed,this)):(this._result=b||this._rawResult,this._sendComplete());break;case"progress":this._sendProgress(a);break;case"error":this._sendError(a);break;case"loadstart":this._sendLoadStart();break;case"abort":case"timeout":this._isCanceled()||this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_"+a.type.toUpperCase()+"_ERROR"))}},a._resultFormatSuccess=function(a){this._result=a,this._sendComplete()},a._resultFormatFailed=function(a){this._sendError(a)},a.toString=function(){return"[PreloadJS AbstractLoader]"},createjs.AbstractLoader=createjs.promote(AbstractLoader,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function AbstractMediaLoader(a,b,c){this.AbstractLoader_constructor(a,b,c),this.resultFormatter=this._formatResult,this._tagSrcAttribute="src",this.on("initialize",this._updateXHR,this)}var a=createjs.extend(AbstractMediaLoader,createjs.AbstractLoader);a.load=function(){this._tag||(this._tag=this._createTag(this._item.src)),this._tag.preload="auto",this._tag.load(),this.AbstractLoader_load()},a._createTag=function(){},a._createRequest=function(){this._request=this._preferXHR?new createjs.XHRRequest(this._item):new createjs.MediaTagRequest(this._item,this._tag||this._createTag(),this._tagSrcAttribute)},a._updateXHR=function(a){a.loader.setResponseType&&a.loader.setResponseType("blob")},a._formatResult=function(a){if(this._tag.removeEventListener&&this._tag.removeEventListener("canplaythrough",this._loadedHandler),this._tag.onstalled=null,this._preferXHR){var b=window.URL||window.webkitURL,c=a.getResult(!0);a.getTag().src=b.createObjectURL(c)}return a.getTag()},createjs.AbstractMediaLoader=createjs.promote(AbstractMediaLoader,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";var AbstractRequest=function(a){this._item=a},a=createjs.extend(AbstractRequest,createjs.EventDispatcher);a.load=function(){},a.destroy=function(){},a.cancel=function(){},createjs.AbstractRequest=createjs.promote(AbstractRequest,"EventDispatcher")}(),this.createjs=this.createjs||{},function(){"use strict";function TagRequest(a,b,c){this.AbstractRequest_constructor(a),this._tag=b,this._tagSrcAttribute=c,this._loadedHandler=createjs.proxy(this._handleTagComplete,this),this._addedToDOM=!1}var a=createjs.extend(TagRequest,createjs.AbstractRequest);a.load=function(){this._tag.onload=createjs.proxy(this._handleTagComplete,this),this._tag.onreadystatechange=createjs.proxy(this._handleReadyStateChange,this),this._tag.onerror=createjs.proxy(this._handleError,this);var a=new createjs.Event("initialize");a.loader=this._tag,this.dispatchEvent(a),this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout),this._tag[this._tagSrcAttribute]=this._item.src,null==this._tag.parentNode&&(createjs.DomUtils.appendToBody(this._tag),this._addedToDOM=!0)},a.destroy=function(){this._clean(),this._tag=null,this.AbstractRequest_destroy()},a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this._tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleTagComplete()},a._handleError=function(){this._clean(),this.dispatchEvent("error")},a._handleTagComplete=function(){this._rawResult=this._tag,this._result=this.resultFormatter&&this.resultFormatter(this)||this._rawResult,this._clean(),this.dispatchEvent("complete")},a._handleTimeout=function(){this._clean(),this.dispatchEvent(new createjs.Event("timeout"))},a._clean=function(){this._tag.onload=null,this._tag.onreadystatechange=null,this._tag.onerror=null,this._addedToDOM&&null!=this._tag.parentNode&&this._tag.parentNode.removeChild(this._tag),clearTimeout(this._loadTimeout)},a._handleStalled=function(){},createjs.TagRequest=createjs.promote(TagRequest,"AbstractRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function MediaTagRequest(a,b,c){this.AbstractRequest_constructor(a),this._tag=b,this._tagSrcAttribute=c,this._loadedHandler=createjs.proxy(this._handleTagComplete,this)}var a=createjs.extend(MediaTagRequest,createjs.TagRequest);a.load=function(){var a=createjs.proxy(this._handleStalled,this);this._stalledCallback=a;var b=createjs.proxy(this._handleProgress,this);this._handleProgress=b,this._tag.addEventListener("stalled",a),this._tag.addEventListener("progress",b),this._tag.addEventListener&&this._tag.addEventListener("canplaythrough",this._loadedHandler,!1),this.TagRequest_load()},a._handleReadyStateChange=function(){clearTimeout(this._loadTimeout);var a=this._tag;("loaded"==a.readyState||"complete"==a.readyState)&&this._handleTagComplete()},a._handleStalled=function(){},a._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.ProgressEvent(a.loaded,a.total);this.dispatchEvent(b)}},a._clean=function(){this._tag.removeEventListener&&this._tag.removeEventListener("canplaythrough",this._loadedHandler),this._tag.removeEventListener("stalled",this._stalledCallback),this._tag.removeEventListener("progress",this._progressCallback),this.TagRequest__clean()},createjs.MediaTagRequest=createjs.promote(MediaTagRequest,"TagRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function XHRRequest(a){this.AbstractRequest_constructor(a),this._request=null,this._loadTimeout=null,this._xhrLevel=1,this._response=null,this._rawResponse=null,this._canceled=!1,this._handleLoadStartProxy=createjs.proxy(this._handleLoadStart,this),this._handleProgressProxy=createjs.proxy(this._handleProgress,this),this._handleAbortProxy=createjs.proxy(this._handleAbort,this),this._handleErrorProxy=createjs.proxy(this._handleError,this),this._handleTimeoutProxy=createjs.proxy(this._handleTimeout,this),this._handleLoadProxy=createjs.proxy(this._handleLoad,this),this._handleReadyStateChangeProxy=createjs.proxy(this._handleReadyStateChange,this),!this._createXHR(a)}var a=createjs.extend(XHRRequest,createjs.AbstractRequest);XHRRequest.ACTIVEX_VERSIONS=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.5.0","Msxml2.XMLHTTP.4.0","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP","Microsoft.XMLHTTP"],a.getResult=function(a){return a&&this._rawResponse?this._rawResponse:this._response},a.cancel=function(){this.canceled=!0,this._clean(),this._request.abort()},a.load=function(){if(null==this._request)return void this._handleError();null!=this._request.addEventListener?(this._request.addEventListener("loadstart",this._handleLoadStartProxy,!1),this._request.addEventListener("progress",this._handleProgressProxy,!1),this._request.addEventListener("abort",this._handleAbortProxy,!1),this._request.addEventListener("error",this._handleErrorProxy,!1),this._request.addEventListener("timeout",this._handleTimeoutProxy,!1),this._request.addEventListener("load",this._handleLoadProxy,!1),this._request.addEventListener("readystatechange",this._handleReadyStateChangeProxy,!1)):(this._request.onloadstart=this._handleLoadStartProxy,this._request.onprogress=this._handleProgressProxy,this._request.onabort=this._handleAbortProxy,this._request.onerror=this._handleErrorProxy,this._request.ontimeout=this._handleTimeoutProxy,this._request.onload=this._handleLoadProxy,this._request.onreadystatechange=this._handleReadyStateChangeProxy),1==this._xhrLevel&&(this._loadTimeout=setTimeout(createjs.proxy(this._handleTimeout,this),this._item.loadTimeout));try{this._item.values?this._request.send(createjs.URLUtils.formatQueryString(this._item.values)):this._request.send()}catch(a){this.dispatchEvent(new createjs.ErrorEvent("XHR_SEND",null,a))}},a.setResponseType=function(a){"blob"===a&&(a=window.URL?"blob":"arraybuffer",this._responseType=a),this._request.responseType=a},a.getAllResponseHeaders=function(){return this._request.getAllResponseHeaders instanceof Function?this._request.getAllResponseHeaders():null},a.getResponseHeader=function(a){return this._request.getResponseHeader instanceof Function?this._request.getResponseHeader(a):null},a._handleProgress=function(a){if(a&&!(a.loaded>0&&0==a.total)){var b=new createjs.ProgressEvent(a.loaded,a.total);this.dispatchEvent(b)}},a._handleLoadStart=function(){clearTimeout(this._loadTimeout),this.dispatchEvent("loadstart")},a._handleAbort=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent("XHR_ABORTED",null,a))},a._handleError=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent(a.message))},a._handleReadyStateChange=function(){4==this._request.readyState&&this._handleLoad()},a._handleLoad=function(){if(!this.loaded){this.loaded=!0;var a=this._checkError();if(a)return void this._handleError(a);if(this._response=this._getResponse(),"arraybuffer"===this._responseType)try{this._response=new Blob([this._response])}catch(b){if(window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,"TypeError"===b.name&&window.BlobBuilder){var c=new BlobBuilder;c.append(this._response),this._response=c.getBlob()}}this._clean(),this.dispatchEvent(new createjs.Event("complete"))}},a._handleTimeout=function(a){this._clean(),this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_TIMEOUT",null,a))},a._checkError=function(){var a=parseInt(this._request.status);return a>=400&&599>=a?new Error(a):0==a&&/^https?:/.test(location.protocol)?new Error(0):null},a._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(a){}return null},a._createXHR=function(a){var b=createjs.URLUtils.isCrossDomain(a),c={},d=null;if(window.XMLHttpRequest)d=new XMLHttpRequest,b&&void 0===d.withCredentials&&window.XDomainRequest&&(d=new XDomainRequest);else{for(var e=0,f=s.ACTIVEX_VERSIONS.length;f>e;e++){var g=s.ACTIVEX_VERSIONS[e];try{d=new ActiveXObject(g);break}catch(h){}}if(null==d)return!1}null==a.mimeType&&createjs.RequestUtils.isText(a.type)&&(a.mimeType="text/plain; charset=utf-8"),a.mimeType&&d.overrideMimeType&&d.overrideMimeType(a.mimeType),this._xhrLevel="string"==typeof d.responseType?2:1;var i=null;if(i=a.method==createjs.Methods.GET?createjs.URLUtils.buildURI(a.src,a.values):a.src,d.open(a.method||createjs.Methods.GET,i,!0),b&&d instanceof XMLHttpRequest&&1==this._xhrLevel&&(c.Origin=location.origin),a.values&&a.method==createjs.Methods.POST&&(c["Content-Type"]="application/x-www-form-urlencoded"),b||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest"),a.headers)for(var j in a.headers)c[j]=a.headers[j];for(j in c)d.setRequestHeader(j,c[j]);return d instanceof XMLHttpRequest&&void 0!==a.withCredentials&&(d.withCredentials=a.withCredentials),this._request=d,!0},a._clean=function(){clearTimeout(this._loadTimeout),null!=this._request.removeEventListener?(this._request.removeEventListener("loadstart",this._handleLoadStartProxy),this._request.removeEventListener("progress",this._handleProgressProxy),this._request.removeEventListener("abort",this._handleAbortProxy),this._request.removeEventListener("error",this._handleErrorProxy),this._request.removeEventListener("timeout",this._handleTimeoutProxy),this._request.removeEventListener("load",this._handleLoadProxy),this._request.removeEventListener("readystatechange",this._handleReadyStateChangeProxy)):(this._request.onloadstart=null,this._request.onprogress=null,this._request.onabort=null,this._request.onerror=null,this._request.ontimeout=null,this._request.onload=null,this._request.onreadystatechange=null)},a.toString=function(){return"[PreloadJS XHRRequest]"},createjs.XHRRequest=createjs.promote(XHRRequest,"AbstractRequest")}(),this.createjs=this.createjs||{},function(){"use strict";function SoundLoader(a,b){this.AbstractMediaLoader_constructor(a,b,createjs.Types.SOUND),createjs.DomUtils.isAudioTag(a)?this._tag=a:createjs.DomUtils.isAudioTag(a.src)?this._tag=a:createjs.DomUtils.isAudioTag(a.tag)&&(this._tag=createjs.DomUtils.isAudioTag(a)?a:a.src),null!=this._tag&&(this._preferXHR=!1)}var a=createjs.extend(SoundLoader,createjs.AbstractMediaLoader),b=SoundLoader;b.canLoadItem=function(a){return a.type==createjs.Types.SOUND},a._createTag=function(a){var b=createjs.Elements.audio();return b.autoplay=!1,b.preload="none",b.src=a,b},createjs.SoundLoader=createjs.promote(SoundLoader,"AbstractMediaLoader")}(),this.createjs=this.createjs||{},function(){"use strict";var PlayPropsConfig=function(){this.interrupt=null,this.delay=null,this.offset=null,this.loop=null,this.volume=null,this.pan=null,this.startTime=null,this.duration=null},a=PlayPropsConfig.prototype={},b=PlayPropsConfig;b.create=function(a){if("string"==typeof a)return console&&(console.warn||console.log)("Deprecated behaviour. Sound.play takes a configuration object instead of individual arguments. See docs for info."),(new createjs.PlayPropsConfig).set({interrupt:a});if(null==a||a instanceof b||a instanceof Object)return(new createjs.PlayPropsConfig).set(a);if(null==a)throw new Error("PlayProps configuration not recognized.")},a.set=function(a){if(null!=a)for(var b in a)this[b]=a[b];return this},a.toString=function(){return"[PlayPropsConfig]"},createjs.PlayPropsConfig=b}(),this.createjs=this.createjs||{},function(){"use strict";function Sound(){throw"Sound cannot be instantiated"}function a(a,b){this.init(a,b)}var b=Sound;b.INTERRUPT_ANY="any",b.INTERRUPT_EARLY="early",b.INTERRUPT_LATE="late",b.INTERRUPT_NONE="none",b.PLAY_INITED="playInited",b.PLAY_SUCCEEDED="playSucceeded",b.PLAY_INTERRUPTED="playInterrupted",b.PLAY_FINISHED="playFinished",b.PLAY_FAILED="playFailed",b.SUPPORTED_EXTENSIONS=["mp3","ogg","opus","mpeg","wav","m4a","mp4","aiff","wma","mid"],b.EXTENSION_MAP={m4a:"mp4"},b.FILE_PATTERN=/^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([\/.]*?(?:[^?]+)?\/)?((?:[^\/?]+)\.(\w+))(?:\?(\S+)?)?$/,b.defaultInterruptBehavior=b.INTERRUPT_NONE,b.alternateExtensions=[],b.activePlugin=null,b._masterVolume=1,b._getMasterVolume=function(){return this._masterVolume},b.getVolume=createjs.deprecate(b._getMasterVolume,"Sound.getVolume"),b._setMasterVolume=function(a){if(null!=Number(a)&&(a=Math.max(0,Math.min(1,a)),b._masterVolume=a,!this.activePlugin||!this.activePlugin.setVolume||!this.activePlugin.setVolume(a)))for(var c=this._instances,d=0,e=c.length;e>d;d++)c[d].setMasterVolume(a)},b.setVolume=createjs.deprecate(b._setMasterVolume,"Sound.setVolume"),b._masterMute=!1,b._getMute=function(){return this._masterMute},b.getMute=createjs.deprecate(b._getMute,"Sound.getMute"),b._setMute=function(a){if(null!=a&&(this._masterMute=a,!this.activePlugin||!this.activePlugin.setMute||!this.activePlugin.setMute(a)))for(var b=this._instances,c=0,d=b.length;d>c;c++)b[c].setMasterMute(a)},b.setMute=createjs.deprecate(b._setMute,"Sound.setMute"),b._getCapabilities=function(){return null==b.activePlugin?null:b.activePlugin._capabilities},b.getCapabilities=createjs.deprecate(b._getCapabilities,"Sound.getCapabilities"),Object.defineProperties(b,{volume:{get:b._getMasterVolume,set:b._setMasterVolume},muted:{get:b._getMute,set:b._setMute},capabilities:{get:b._getCapabilities}}),b._pluginsRegistered=!1,b._lastID=0,b._instances=[],b._idHash={},b._preloadHash={},b._defaultPlayPropsHash={},b.addEventListener=null,b.removeEventListener=null,b.removeAllEventListeners=null,b.dispatchEvent=null,b.hasEventListener=null,b._listeners=null,createjs.EventDispatcher.initialize(b),b.getPreloadHandlers=function(){return{callback:createjs.proxy(b.initLoad,b),types:["sound"],extensions:b.SUPPORTED_EXTENSIONS}},b._handleLoadComplete=function(a){var c=a.target.getItem().src;if(b._preloadHash[c])for(var d=0,e=b._preloadHash[c].length;e>d;d++){var f=b._preloadHash[c][d];if(b._preloadHash[c][d]=!0,b.hasEventListener("fileload")){var a=new createjs.Event("fileload");a.src=f.src,a.id=f.id,a.data=f.data,a.sprite=f.sprite,b.dispatchEvent(a)}}},b._handleLoadError=function(a){var c=a.target.getItem().src;if(b._preloadHash[c])for(var d=0,e=b._preloadHash[c].length;e>d;d++){var f=b._preloadHash[c][d];if(b._preloadHash[c][d]=!1,b.hasEventListener("fileerror")){var a=new createjs.Event("fileerror");a.src=f.src,a.id=f.id,a.data=f.data,a.sprite=f.sprite,b.dispatchEvent(a)}}},b._registerPlugin=function(a){return a.isSupported()?(b.activePlugin=new a,!0):!1},b.registerPlugins=function(a){b._pluginsRegistered=!0;for(var c=0,d=a.length;d>c;c++)if(b._registerPlugin(a[c]))return!0;return!1},b.initializeDefaultPlugins=function(){return null!=b.activePlugin?!0:b._pluginsRegistered?!1:b.registerPlugins([createjs.WebAudioPlugin,createjs.HTMLAudioPlugin])?!0:!1},b.isReady=function(){return null!=b.activePlugin},b.initLoad=function(a){return"video"==a.type?!0:b._registerSound(a)},b._registerSound=function(c){if(!b.initializeDefaultPlugins())return!1;var d;if(c.src instanceof Object?(d=b._parseSrc(c.src),d.src=c.path+d.src):d=b._parsePath(c.src),null==d)return!1; +c.src=d.src,c.type="sound";var e=c.data,f=null;if(null!=e&&(isNaN(e.channels)?isNaN(e)||(f=parseInt(e)):f=parseInt(e.channels),e.audioSprite))for(var g,h=e.audioSprite.length;h--;)g=e.audioSprite[h],b._idHash[g.id]={src:c.src,startTime:parseInt(g.startTime),duration:parseInt(g.duration)},g.defaultPlayProps&&(b._defaultPlayPropsHash[g.id]=createjs.PlayPropsConfig.create(g.defaultPlayProps));null!=c.id&&(b._idHash[c.id]={src:c.src});var i=b.activePlugin.register(c);return a.create(c.src,f),null!=e&&isNaN(e)?c.data.channels=f||a.maxPerChannel():c.data=f||a.maxPerChannel(),i.type&&(c.type=i.type),c.defaultPlayProps&&(b._defaultPlayPropsHash[c.src]=createjs.PlayPropsConfig.create(c.defaultPlayProps)),i},b.registerSound=function(a,c,d,e,f){var g={src:a,id:c,data:d,defaultPlayProps:f};a instanceof Object&&a.src&&(e=c,g=a),g=createjs.LoadItem.create(g),g.path=e,null==e||g.src instanceof Object||(g.src=e+g.src);var h=b._registerSound(g);if(!h)return!1;if(b._preloadHash[g.src]||(b._preloadHash[g.src]=[]),b._preloadHash[g.src].push(g),1==b._preloadHash[g.src].length)h.on("complete",this._handleLoadComplete,this),h.on("error",this._handleLoadError,this),b.activePlugin.preload(h);else if(1==b._preloadHash[g.src][0])return!0;return g},b.registerSounds=function(a,b){var c=[];a.path&&(b?b+=a.path:b=a.path,a=a.manifest);for(var d=0,e=a.length;e>d;d++)c[d]=createjs.Sound.registerSound(a[d].src,a[d].id,a[d].data,b,a[d].defaultPlayProps);return c},b.removeSound=function(c,d){if(null==b.activePlugin)return!1;c instanceof Object&&c.src&&(c=c.src);var e;if(c instanceof Object?e=b._parseSrc(c):(c=b._getSrcById(c).src,e=b._parsePath(c)),null==e)return!1;c=e.src,null!=d&&(c=d+c);for(var f in b._idHash)b._idHash[f].src==c&&delete b._idHash[f];return a.removeSrc(c),delete b._preloadHash[c],b.activePlugin.removeSound(c),!0},b.removeSounds=function(a,b){var c=[];a.path&&(b?b+=a.path:b=a.path,a=a.manifest);for(var d=0,e=a.length;e>d;d++)c[d]=createjs.Sound.removeSound(a[d].src,b);return c},b.removeAllSounds=function(){b._idHash={},b._preloadHash={},a.removeAll(),b.activePlugin&&b.activePlugin.removeAllSounds()},b.loadComplete=function(a){if(!b.isReady())return!1;var c=b._parsePath(a);return a=c?b._getSrcById(c.src).src:b._getSrcById(a).src,void 0==b._preloadHash[a]?!1:1==b._preloadHash[a][0]},b._parsePath=function(a){"string"!=typeof a&&(a=a.toString());var c=a.match(b.FILE_PATTERN);if(null==c)return!1;for(var d=c[4],e=c[5],f=b.capabilities,g=0;!f[e];)if(e=b.alternateExtensions[g++],g>b.alternateExtensions.length)return null;a=a.replace("."+c[5],"."+e);var h={name:d,src:a,extension:e};return h},b._parseSrc=function(a){var c={name:void 0,src:void 0,extension:void 0},d=b.capabilities;for(var e in a)if(a.hasOwnProperty(e)&&d[e]){c.src=a[e],c.extension=e;break}if(!c.src)return!1;var f=c.src.lastIndexOf("/");return c.name=-1!=f?c.src.slice(f+1):c.src,c},b.play=function(a,c){var d=createjs.PlayPropsConfig.create(c),e=b.createInstance(a,d.startTime,d.duration),f=b._playInstance(e,d);return f||e._playFailed(),e},b.createInstance=function(c,d,e){if(!b.initializeDefaultPlugins())return new createjs.DefaultSoundInstance(c,d,e);var f=b._defaultPlayPropsHash[c];c=b._getSrcById(c);var g=b._parsePath(c.src),h=null;return null!=g&&null!=g.src?(a.create(g.src),null==d&&(d=c.startTime),h=b.activePlugin.create(g.src,d,e||c.duration),f=f||b._defaultPlayPropsHash[g.src],f&&h.applyPlayProps(f)):h=new createjs.DefaultSoundInstance(c,d,e),h.uniqueId=b._lastID++,h},b.stop=function(){for(var a=this._instances,b=a.length;b--;)a[b].stop()},b.setDefaultPlayProps=function(a,c){a=b._getSrcById(a),b._defaultPlayPropsHash[b._parsePath(a.src).src]=createjs.PlayPropsConfig.create(c)},b.getDefaultPlayProps=function(a){return a=b._getSrcById(a),b._defaultPlayPropsHash[b._parsePath(a.src).src]},b._playInstance=function(a,c){var d=b._defaultPlayPropsHash[a.src]||{};if(null==c.interrupt&&(c.interrupt=d.interrupt||b.defaultInterruptBehavior),null==c.delay&&(c.delay=d.delay||0),null==c.offset&&(c.offset=a.position),null==c.loop&&(c.loop=a.loop),null==c.volume&&(c.volume=a.volume),null==c.pan&&(c.pan=a.pan),0==c.delay){var e=b._beginPlaying(a,c);if(!e)return!1}else{var f=setTimeout(function(){b._beginPlaying(a,c)},c.delay);a.delayTimeoutId=f}return this._instances.push(a),!0},b._beginPlaying=function(b,c){if(!a.add(b,c.interrupt))return!1;var d=b._beginPlaying(c);if(!d){var e=createjs.indexOf(this._instances,b);return e>-1&&this._instances.splice(e,1),!1}return!0},b._getSrcById=function(a){return b._idHash[a]||{src:a}},b._playFinished=function(b){a.remove(b);var c=createjs.indexOf(this._instances,b);c>-1&&this._instances.splice(c,1)},createjs.Sound=Sound,a.channels={},a.create=function(b,c){var d=a.get(b);return null==d?(a.channels[b]=new a(b,c),!0):!1},a.removeSrc=function(b){var c=a.get(b);return null==c?!1:(c._removeAll(),delete a.channels[b],!0)},a.removeAll=function(){for(var b in a.channels)a.channels[b]._removeAll();a.channels={}},a.add=function(b,c){var d=a.get(b.src);return null==d?!1:d._add(b,c)},a.remove=function(b){var c=a.get(b.src);return null==c?!1:(c._remove(b),!0)},a.maxPerChannel=function(){return c.maxDefault},a.get=function(b){return a.channels[b]};var c=a.prototype;c.constructor=a,c.src=null,c.max=null,c.maxDefault=100,c.length=0,c.init=function(a,b){this.src=a,this.max=b||this.maxDefault,-1==this.max&&(this.max=this.maxDefault),this._instances=[]},c._get=function(a){return this._instances[a]},c._add=function(a,b){return this._getSlot(b,a)?(this._instances.push(a),this.length++,!0):!1},c._remove=function(a){var b=createjs.indexOf(this._instances,a);return-1==b?!1:(this._instances.splice(b,1),this.length--,!0)},c._removeAll=function(){for(var a=this.length-1;a>=0;a--)this._instances[a].stop()},c._getSlot=function(a){var b,c;if(a!=Sound.INTERRUPT_NONE&&(c=this._get(0),null==c))return!0;for(var d=0,e=this.max;e>d;d++){if(b=this._get(d),null==b)return!0;if(b.playState==Sound.PLAY_FINISHED||b.playState==Sound.PLAY_INTERRUPTED||b.playState==Sound.PLAY_FAILED){c=b;break}a!=Sound.INTERRUPT_NONE&&(a==Sound.INTERRUPT_EARLY&&b.positionc.position)&&(c=b)}return null!=c?(c._interrupt(),this._remove(c),!0):!1},c.toString=function(){return"[Sound SoundChannel]"}}(),this.createjs=this.createjs||{},function(){"use strict";var AbstractSoundInstance=function(a,b,c,d){this.EventDispatcher_constructor(),this.src=a,this.uniqueId=-1,this.playState=null,this.delayTimeoutId=null,this._volume=1,Object.defineProperty(this,"volume",{get:this._getVolume,set:this._setVolume}),this.getVolume=createjs.deprecate(this._getVolume,"AbstractSoundInstance.getVolume"),this.setVolume=createjs.deprecate(this._setVolume,"AbstractSoundInstance.setVolume"),this._pan=0,Object.defineProperty(this,"pan",{get:this._getPan,set:this._setPan}),this.getPan=createjs.deprecate(this._getPan,"AbstractSoundInstance.getPan"),this.setPan=createjs.deprecate(this._setPan,"AbstractSoundInstance.setPan"),this._startTime=Math.max(0,b||0),Object.defineProperty(this,"startTime",{get:this._getStartTime,set:this._setStartTime}),this.getStartTime=createjs.deprecate(this._getStartTime,"AbstractSoundInstance.getStartTime"),this.setStartTime=createjs.deprecate(this._setStartTime,"AbstractSoundInstance.setStartTime"),this._duration=Math.max(0,c||0),Object.defineProperty(this,"duration",{get:this._getDuration,set:this._setDuration}),this.getDuration=createjs.deprecate(this._getDuration,"AbstractSoundInstance.getDuration"),this.setDuration=createjs.deprecate(this._setDuration,"AbstractSoundInstance.setDuration"),this._playbackResource=null,Object.defineProperty(this,"playbackResource",{get:this._getPlaybackResource,set:this._setPlaybackResource}),d!==!1&&d!==!0&&this._setPlaybackResource(d),this.getPlaybackResource=createjs.deprecate(this._getPlaybackResource,"AbstractSoundInstance.getPlaybackResource"),this.setPlaybackResource=createjs.deprecate(this._setPlaybackResource,"AbstractSoundInstance.setPlaybackResource"),this._position=0,Object.defineProperty(this,"position",{get:this._getPosition,set:this._setPosition}),this.getPosition=createjs.deprecate(this._getPosition,"AbstractSoundInstance.getPosition"),this.setPosition=createjs.deprecate(this._setPosition,"AbstractSoundInstance.setPosition"),this._loop=0,Object.defineProperty(this,"loop",{get:this._getLoop,set:this._setLoop}),this.getLoop=createjs.deprecate(this._getLoop,"AbstractSoundInstance.getLoop"),this.setLoop=createjs.deprecate(this._setLoop,"AbstractSoundInstance.setLoop"),this._muted=!1,Object.defineProperty(this,"muted",{get:this._getMuted,set:this._setMuted}),this.getMuted=createjs.deprecate(this._getMuted,"AbstractSoundInstance.getMuted"),this.setMuted=createjs.deprecate(this._setMuted,"AbstractSoundInstance.setMuted"),this._paused=!1,Object.defineProperty(this,"paused",{get:this._getPaused,set:this._setPaused}),this.getPaused=createjs.deprecate(this._getPaused,"AbstractSoundInstance.getPaused"),this.setPaused=createjs.deprecate(this._setPaused,"AbstractSoundInstance.setPaused")},a=createjs.extend(AbstractSoundInstance,createjs.EventDispatcher);a.play=function(a){var b=createjs.PlayPropsConfig.create(a);return this.playState==createjs.Sound.PLAY_SUCCEEDED?(this.applyPlayProps(b),void(this._paused&&this._setPaused(!1))):(this._cleanUp(),createjs.Sound._playInstance(this,b),this)},a.stop=function(){return this._position=0,this._paused=!1,this._handleStop(),this._cleanUp(),this.playState=createjs.Sound.PLAY_FINISHED,this},a.destroy=function(){this._cleanUp(),this.src=null,this.playbackResource=null,this.removeAllEventListeners()},a.applyPlayProps=function(a){return null!=a.offset&&this._setPosition(a.offset),null!=a.loop&&this._setLoop(a.loop),null!=a.volume&&this._setVolume(a.volume),null!=a.pan&&this._setPan(a.pan),null!=a.startTime&&(this._setStartTime(a.startTime),this._setDuration(a.duration)),this},a.toString=function(){return"[AbstractSoundInstance]"},a._getPaused=function(){return this._paused},a._setPaused=function(a){return a!==!0&&a!==!1||this._paused==a||1==a&&this.playState!=createjs.Sound.PLAY_SUCCEEDED?void 0:(this._paused=a,a?this._pause():this._resume(),clearTimeout(this.delayTimeoutId),this)},a._setVolume=function(a){return a==this._volume?this:(this._volume=Math.max(0,Math.min(1,a)),this._muted||this._updateVolume(),this)},a._getVolume=function(){return this._volume},a._setMuted=function(a){return a===!0||a===!1?(this._muted=a,this._updateVolume(),this):void 0},a._getMuted=function(){return this._muted},a._setPan=function(a){return a==this._pan?this:(this._pan=Math.max(-1,Math.min(1,a)),this._updatePan(),this)},a._getPan=function(){return this._pan},a._getPosition=function(){return this._paused||this.playState!=createjs.Sound.PLAY_SUCCEEDED||(this._position=this._calculateCurrentPosition()),this._position},a._setPosition=function(a){return this._position=Math.max(0,a),this.playState==createjs.Sound.PLAY_SUCCEEDED&&this._updatePosition(),this},a._getStartTime=function(){return this._startTime},a._setStartTime=function(a){return a==this._startTime?this:(this._startTime=Math.max(0,a||0),this._updateStartTime(),this)},a._getDuration=function(){return this._duration},a._setDuration=function(a){return a==this._duration?this:(this._duration=Math.max(0,a||0),this._updateDuration(),this)},a._setPlaybackResource=function(a){return this._playbackResource=a,0==this._duration&&this._playbackResource&&this._setDurationFromSource(),this},a._getPlaybackResource=function(){return this._playbackResource},a._getLoop=function(){return this._loop},a._setLoop=function(a){null!=this._playbackResource&&(0!=this._loop&&0==a?this._removeLooping(a):0==this._loop&&0!=a&&this._addLooping(a)),this._loop=a},a._sendEvent=function(a){var b=new createjs.Event(a);this.dispatchEvent(b)},a._cleanUp=function(){clearTimeout(this.delayTimeoutId),this._handleCleanUp(),this._paused=!1,createjs.Sound._playFinished(this)},a._interrupt=function(){this._cleanUp(),this.playState=createjs.Sound.PLAY_INTERRUPTED,this._sendEvent("interrupted")},a._beginPlaying=function(a){return this._setPosition(a.offset),this._setLoop(a.loop),this._setVolume(a.volume),this._setPan(a.pan),null!=a.startTime&&(this._setStartTime(a.startTime),this._setDuration(a.duration)),null!=this._playbackResource&&this._positionc;c++){var e=this._soundInstances[b][c];e.playbackResource=this._audioSources[b],this._soundInstances[b]=null}},a._handlePreloadError=function(){},a._updateVolume=function(){},createjs.AbstractPlugin=AbstractPlugin}(),this.createjs=this.createjs||{},function(){"use strict";function a(a){this.AbstractLoader_constructor(a,!0,createjs.Types.SOUND)}var b=createjs.extend(a,createjs.AbstractLoader);a.context=null,b.toString=function(){return"[WebAudioLoader]"},b._createRequest=function(){this._request=new createjs.XHRRequest(this._item,!1),this._request.setResponseType("arraybuffer")},b._sendComplete=function(){a.context.decodeAudioData(this._rawResult,createjs.proxy(this._handleAudioDecoded,this),createjs.proxy(this._sendError,this))},b._handleAudioDecoded=function(a){this._result=a,this.AbstractLoader__sendComplete()},createjs.WebAudioLoader=createjs.promote(a,"AbstractLoader")}(),this.createjs=this.createjs||{},function(){"use strict";function WebAudioSoundInstance(a,c,d,e){this.AbstractSoundInstance_constructor(a,c,d,e),this.gainNode=b.context.createGain(),this.panNode=b.context.createPanner(),this.panNode.panningModel=b._panningModel,this.panNode.connect(this.gainNode),this._updatePan(),this.sourceNode=null,this._soundCompleteTimeout=null,this._sourceNodeNext=null,this._playbackStartTime=0,this._endedHandler=createjs.proxy(this._handleSoundComplete,this)}var a=createjs.extend(WebAudioSoundInstance,createjs.AbstractSoundInstance),b=WebAudioSoundInstance;b.context=null,b._scratchBuffer=null,b.destinationNode=null,b._panningModel="equalpower",a.destroy=function(){this.AbstractSoundInstance_destroy(),this.panNode.disconnect(0),this.panNode=null,this.gainNode.disconnect(0),this.gainNode=null},a.toString=function(){return"[WebAudioSoundInstance]"},a._updatePan=function(){this.panNode.setPosition(this._pan,0,-.5)},a._removeLooping=function(){this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext)},a._addLooping=function(){this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0))},a._setDurationFromSource=function(){this._duration=1e3*this.playbackResource.duration},a._handleCleanUp=function(){this.sourceNode&&this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext)),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(0),clearTimeout(this._soundCompleteTimeout),this._playbackStartTime=0},a._cleanUpAudioNode=function(a){if(a){if(a.stop(0),a.disconnect(0),createjs.BrowserDetect.isIOS)try{a.buffer=b._scratchBuffer}catch(c){}a=null}return a},a._handleSoundReady=function(){this.gainNode.connect(b.destinationNode);var a=.001*this._duration,c=Math.min(.001*Math.max(0,this._position),a);this.sourceNode=this._createAndPlayAudioNode(b.context.currentTime-a,c),this._playbackStartTime=this.sourceNode.startTime-c,this._soundCompleteTimeout=setTimeout(this._endedHandler,1e3*(a-c)),0!=this._loop&&(this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0))},a._createAndPlayAudioNode=function(a,c){var d=b.context.createBufferSource();d.buffer=this.playbackResource,d.connect(this.panNode);var e=.001*this._duration;return d.startTime=a+e,d.start(d.startTime,c+.001*this._startTime,e-c),d},a._pause=function(){this._position=1e3*(b.context.currentTime-this._playbackStartTime),this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext),0!=this.gainNode.numberOfOutputs&&this.gainNode.disconnect(0),clearTimeout(this._soundCompleteTimeout)},a._resume=function(){this._handleSoundReady()},a._updateVolume=function(){var a=this._muted?0:this._volume;a!=this.gainNode.gain.value&&(this.gainNode.gain.value=a)},a._calculateCurrentPosition=function(){return 1e3*(b.context.currentTime-this._playbackStartTime)},a._updatePosition=function(){this.sourceNode=this._cleanUpAudioNode(this.sourceNode),this._sourceNodeNext=this._cleanUpAudioNode(this._sourceNodeNext),clearTimeout(this._soundCompleteTimeout),this._paused||this._handleSoundReady()},a._handleLoop=function(){this._cleanUpAudioNode(this.sourceNode),this.sourceNode=this._sourceNodeNext,this._playbackStartTime=this.sourceNode.startTime,this._sourceNodeNext=this._createAndPlayAudioNode(this._playbackStartTime,0),this._soundCompleteTimeout=setTimeout(this._endedHandler,this._duration)},a._updateDuration=function(){this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._pause(),this._resume())},createjs.WebAudioSoundInstance=createjs.promote(WebAudioSoundInstance,"AbstractSoundInstance")}(),this.createjs=this.createjs||{},function(){"use strict";function WebAudioPlugin(){this.AbstractPlugin_constructor(),this._panningModel=b._panningModel,this.context=b.context,this.dynamicsCompressorNode=this.context.createDynamicsCompressor(),this.dynamicsCompressorNode.connect(this.context.destination),this.gainNode=this.context.createGain(),this.gainNode.connect(this.dynamicsCompressorNode),createjs.WebAudioSoundInstance.destinationNode=this.gainNode,this._capabilities=b._capabilities,this._loaderClass=createjs.WebAudioLoader,this._soundInstanceClass=createjs.WebAudioSoundInstance,this._addPropsToClasses()}var a=createjs.extend(WebAudioPlugin,createjs.AbstractPlugin),b=WebAudioPlugin;b._capabilities=null,b._panningModel="equalpower",b.context=null,b._scratchBuffer=null,b._unlocked=!1,b.DEFAULT_SAMPLE_RATE=44100,b.isSupported=function(){var a=createjs.BrowserDetect.isIOS||createjs.BrowserDetect.isAndroid||createjs.BrowserDetect.isBlackberry;return"file:"!=location.protocol||a||this._isFileXHRSupported()?(b._generateCapabilities(),null==b.context?!1:!0):!1},b.playEmptySound=function(){if(null!=b.context){var a=b.context.createBufferSource();a.buffer=b._scratchBuffer,a.connect(b.context.destination),a.start(0,0,0)}},b._isFileXHRSupported=function(){var a=!0,b=new XMLHttpRequest;try{b.open("GET","WebAudioPluginTest.fail",!1)}catch(c){return a=!1}b.onerror=function(){a=!1},b.onload=function(){a=404==this.status||200==this.status||0==this.status&&""!=this.response};try{b.send()}catch(c){a=!1}return a},b._generateCapabilities=function(){if(null==b._capabilities){var a=document.createElement("audio");if(null==a.canPlayType)return null;if(null==b.context&&(b.context=b._createAudioContext(),null==b.context))return null;null==b._scratchBuffer&&(b._scratchBuffer=b.context.createBuffer(1,1,22050)),b._compatibilitySetUp(),"ontouchstart"in window&&"running"!=b.context.state&&(b._unlock(),document.addEventListener("mousedown",b._unlock,!0),document.addEventListener("touchstart",b._unlock,!0),document.addEventListener("touchend",b._unlock,!0)),b._capabilities={panning:!0,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}b.context.destination.numberOfChannels<2&&(b._capabilities.panning=!1)}},b._createAudioContext=function(){var a=window.AudioContext||window.webkitAudioContext;if(null==a)return null;var c=new a;if(/(iPhone|iPad)/i.test(navigator.userAgent)&&c.sampleRate!==b.DEFAULT_SAMPLE_RATE){var d=c.createBuffer(1,1,b.DEFAULT_SAMPLE_RATE),e=c.createBufferSource();e.buffer=d,e.connect(c.destination),e.start(0),e.disconnect(),c.close(),c=new a}return c},b._compatibilitySetUp=function(){if(b._panningModel="equalpower",!b.context.createGain){b.context.createGain=b.context.createGainNode;var a=b.context.createBufferSource();a.__proto__.start=a.__proto__.noteGrainOn,a.__proto__.stop=a.__proto__.noteOff,b._panningModel=0}},b._unlock=function(){b._unlocked||(b.playEmptySound(),"running"==b.context.state&&(document.removeEventListener("mousedown",b._unlock,!0),document.removeEventListener("touchend",b._unlock,!0),document.removeEventListener("touchstart",b._unlock,!0),b._unlocked=!0))},a.toString=function(){return"[WebAudioPlugin]"},a._addPropsToClasses=function(){var a=this._soundInstanceClass;a.context=this.context,a._scratchBuffer=b._scratchBuffer,a.destinationNode=this.gainNode,a._panningModel=this._panningModel,this._loaderClass.context=this.context},a._updateVolume=function(){var a=createjs.Sound._masterMute?0:this._volume;a!=this.gainNode.gain.value&&(this.gainNode.gain.value=a)},createjs.WebAudioPlugin=createjs.promote(WebAudioPlugin,"AbstractPlugin")}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioTagPool(){throw"HTMLAudioTagPool cannot be instantiated"}function a(){this._tags=[]}var b=HTMLAudioTagPool;b._tags={},b._tagPool=new a,b._tagUsed={},b.get=function(a){var c=b._tags[a];return null==c?(c=b._tags[a]=b._tagPool.get(),c.src=a):b._tagUsed[a]?(c=b._tagPool.get(),c.src=a):b._tagUsed[a]=!0,c},b.set=function(a,c){c==b._tags[a]?b._tagUsed[a]=!1:b._tagPool.set(c)},b.remove=function(a){var c=b._tags[a];return null==c?!1:(b._tagPool.set(c),delete b._tags[a],delete b._tagUsed[a],!0)},b.getDuration=function(a){var c=b._tags[a];return null!=c&&c.duration?1e3*c.duration:0},createjs.HTMLAudioTagPool=HTMLAudioTagPool;var c=a.prototype;c.constructor=a,c.get=function(){var a;return a=0==this._tags.length?this._createTag():this._tags.pop(),null==a.parentNode&&document.body.appendChild(a),a},c.set=function(a){var b=createjs.indexOf(this._tags,a);-1==b&&(this._tags.src=null,this._tags.push(a))},c.toString=function(){return"[TagPool]"},c._createTag=function(){var a=document.createElement("audio");return a.autoplay=!1,a.preload="none",a}}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioSoundInstance(a,b,c,d){this.AbstractSoundInstance_constructor(a,b,c,d),this._audioSpriteStopTime=null,this._delayTimeoutId=null,this._endedHandler=createjs.proxy(this._handleSoundComplete,this),this._readyHandler=createjs.proxy(this._handleTagReady,this),this._stalledHandler=createjs.proxy(this._playFailed,this),this._audioSpriteEndHandler=createjs.proxy(this._handleAudioSpriteLoop,this),this._loopHandler=createjs.proxy(this._handleSoundComplete,this),c?this._audioSpriteStopTime=.001*(b+c):this._duration=createjs.HTMLAudioTagPool.getDuration(this.src)}var a=createjs.extend(HTMLAudioSoundInstance,createjs.AbstractSoundInstance);a.setMasterVolume=function(){this._updateVolume()},a.setMasterMute=function(){this._updateVolume()},a.toString=function(){return"[HTMLAudioSoundInstance]"},a._removeLooping=function(){null!=this._playbackResource&&(this._playbackResource.loop=!1,this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._addLooping=function(){null==this._playbackResource||this._audioSpriteStopTime||(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.loop=!0)},a._handleCleanUp=function(){var a=this._playbackResource;if(null!=a){a.pause(),a.loop=!1,a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),a.removeEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1);try{a.currentTime=this._startTime}catch(b){}createjs.HTMLAudioTagPool.set(this.src,a),this._playbackResource=null}},a._beginPlaying=function(a){return this._playbackResource=createjs.HTMLAudioTagPool.get(this.src),this.AbstractSoundInstance__beginPlaying(a)},a._handleSoundReady=function(){if(4!==this._playbackResource.readyState){var a=this._playbackResource;return a.addEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),a.addEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),a.preload="auto",void a.load()}this._updateVolume(),this._playbackResource.currentTime=.001*(this._startTime+this._position),this._audioSpriteStopTime?this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1):(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),0!=this._loop&&(this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.loop=!0)),this._playbackResource.play()},a._handleTagReady=function(){this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY,this._readyHandler,!1),this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED,this._stalledHandler,!1),this._handleSoundReady()},a._pause=function(){this._playbackResource.pause()},a._resume=function(){this._playbackResource.play()},a._updateVolume=function(){if(null!=this._playbackResource){var a=this._muted||createjs.Sound._masterMute?0:this._volume*createjs.Sound._masterVolume;a!=this._playbackResource.volume&&(this._playbackResource.volume=a)}},a._calculateCurrentPosition=function(){return 1e3*this._playbackResource.currentTime-this._startTime},a._updatePosition=function(){this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._handleSetPositionSeek,!1);try{this._playbackResource.currentTime=.001*(this._position+this._startTime)}catch(a){this._handleSetPositionSeek(null)}},a._handleSetPositionSeek=function(){null!=this._playbackResource&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._handleSetPositionSeek,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._handleAudioSpriteLoop=function(){this._playbackResource.currentTime<=this._audioSpriteStopTime||(this._playbackResource.pause(),0==this._loop?this._handleSoundComplete(null):(this._position=0,this._loop--,this._playbackResource.currentTime=.001*this._startTime,this._paused||this._playbackResource.play(),this._sendEvent("loop")))},a._handleLoop=function(){0==this._loop&&(this._playbackResource.loop=!1,this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED,this._loopHandler,!1))},a._updateStartTime=function(){this._audioSpriteStopTime=.001*(this._startTime+this._duration),this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1))},a._updateDuration=function(){this._audioSpriteStopTime=.001*(this._startTime+this._duration),this.playState==createjs.Sound.PLAY_SUCCEEDED&&(this._playbackResource.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED,this._endedHandler,!1),this._playbackResource.addEventListener(createjs.HTMLAudioPlugin._TIME_UPDATE,this._audioSpriteEndHandler,!1))},a._setDurationFromSource=function(){this._duration=createjs.HTMLAudioTagPool.getDuration(this.src),this._playbackResource=null},createjs.HTMLAudioSoundInstance=createjs.promote(HTMLAudioSoundInstance,"AbstractSoundInstance")}(),this.createjs=this.createjs||{},function(){"use strict";function HTMLAudioPlugin(){this.AbstractPlugin_constructor(),this._capabilities=b._capabilities,this._loaderClass=createjs.SoundLoader,this._soundInstanceClass=createjs.HTMLAudioSoundInstance}var a=createjs.extend(HTMLAudioPlugin,createjs.AbstractPlugin),b=HTMLAudioPlugin;b.MAX_INSTANCES=30,b._AUDIO_READY="canplaythrough",b._AUDIO_ENDED="ended",b._AUDIO_SEEKED="seeked",b._AUDIO_STALLED="stalled",b._TIME_UPDATE="timeupdate",b._capabilities=null,b.isSupported=function(){return b._generateCapabilities(),null!=b._capabilities},b._generateCapabilities=function(){if(null==b._capabilities){var a=document.createElement("audio");if(null==a.canPlayType)return null;b._capabilities={panning:!1,volume:!0,tracks:-1};for(var c=createjs.Sound.SUPPORTED_EXTENSIONS,d=createjs.Sound.EXTENSION_MAP,e=0,f=c.length;f>e;e++){var g=c[e],h=d[g]||g;b._capabilities[g]="no"!=a.canPlayType("audio/"+g)&&""!=a.canPlayType("audio/"+g)||"no"!=a.canPlayType("audio/"+h)&&""!=a.canPlayType("audio/"+h)}}},a.register=function(a){var b=createjs.HTMLAudioTagPool.get(a.src),c=this.AbstractPlugin_register(a);return c.setTag(b),c},a.removeSound=function(a){this.AbstractPlugin_removeSound(a),createjs.HTMLAudioTagPool.remove(a)},a.create=function(a,b,c){var d=this.AbstractPlugin_create(a,b,c);return d.playbackResource=null,d},a.toString=function(){return"[HTMLAudioPlugin]"},a.setVolume=a.getVolume=a.setMute=null,createjs.HTMLAudioPlugin=createjs.promote(HTMLAudioPlugin,"AbstractPlugin") +}(); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 00000000..0ae873a7 --- /dev/null +++ b/package.json @@ -0,0 +1,42 @@ +{ + "name": "soundjs", + "npmName": "soundjs", + "version": "1.0.2", + "description": "A JavaScript library that provides a simple API, and powerful features to make working with audio a breeze. Easily ties in audio file loading to PreloadJS.", + "main": "lib/soundjs.js", + "jsdelivr": "lib/soundjs.min.js", + "directories": { + "doc": "docs", + "example": "examples", + "lib": "lib", + "test": "tests" + }, + "npmFileMap": [ + { + "basePath": "lib", + "files": [ + "**/*" + ] + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/CreateJS/SoundJS.git" + }, + "keywords": [ + "createjs", + "soundjs", + "gskinner", + "javascript", + "audio", + "webaudio", + "html5", + "flash" + ], + "author": "gskinner.com, inc.", + "license": "MIT", + "bugs": { + "url": "https://github.com/CreateJS/SoundJS/issues" + }, + "homepage": "https://createjs.com/soundjs/" +} diff --git a/src/createjs/events/Event.js b/src/createjs/events/Event.js index 0760ed39..f010e269 100644 --- a/src/createjs/events/Event.js +++ b/src/createjs/events/Event.js @@ -28,7 +28,7 @@ /** * A collection of Classes that are shared across all the CreateJS libraries. The classes are included in the minified - * files of each library and are available on the createsjs namespace directly. + * files of each library and are available on the createjs namespace directly. * *

    Example

    * @@ -53,8 +53,8 @@ this.createjs = this.createjs||{}; * rely on an event object's state outside of the call stack it was received in. * @class Event * @param {String} type The event type. - * @param {Boolean} bubbles Indicates whether the event will bubble through the display list. - * @param {Boolean} cancelable Indicates whether the default behaviour of this event can be cancelled. + * @param {Boolean} [bubbles=false] Indicates whether the event will bubble through the display list. + * @param {Boolean} [cancelable=false] Indicates whether the default behaviour of this event can be cancelled. * @constructor **/ function Event(type, bubbles, cancelable) { @@ -171,22 +171,9 @@ this.createjs = this.createjs||{}; } var p = Event.prototype; - /** - * REMOVED. Removed in favor of using `MySuperClass_constructor`. - * See {{#crossLink "Utility Methods/extend"}}{{/crossLink}} and {{#crossLink "Utility Methods/promote"}}{{/crossLink}} - * for details. - * - * There is an inheritance tutorial distributed with EaselJS in /tutorials/Inheritance. - * - * @method initialize - * @protected - * @deprecated - */ - // p.initialize = function() {}; // searchable for devs wondering where it is. - // public methods: /** - * Sets {{#crossLink "Event/defaultPrevented"}}{{/crossLink}} to true if the event is cancelable. + * Sets {{#crossLink "Event/defaultPrevented:property"}}{{/crossLink}} to true if the event is cancelable. * Mirrors the DOM level 2 event standard. In general, cancelable events that have `preventDefault()` called will * cancel the default behaviour associated with the event. * @method preventDefault @@ -196,7 +183,7 @@ this.createjs = this.createjs||{}; }; /** - * Sets {{#crossLink "Event/propagationStopped"}}{{/crossLink}} to true. + * Sets {{#crossLink "Event/propagationStopped:property"}}{{/crossLink}} to true. * Mirrors the DOM event standard. * @method stopPropagation **/ @@ -205,8 +192,8 @@ this.createjs = this.createjs||{}; }; /** - * Sets {{#crossLink "Event/propagationStopped"}}{{/crossLink}} and - * {{#crossLink "Event/immediatePropagationStopped"}}{{/crossLink}} to true. + * Sets {{#crossLink "Event/propagationStopped:property"}}{{/crossLink}} and + * {{#crossLink "Event/immediatePropagationStopped:property"}}{{/crossLink}} to true. * Mirrors the DOM event standard. * @method stopImmediatePropagation **/ diff --git a/src/createjs/events/EventDispatcher.js b/src/createjs/events/EventDispatcher.js index 04830462..4526fa66 100644 --- a/src/createjs/events/EventDispatcher.js +++ b/src/createjs/events/EventDispatcher.js @@ -112,20 +112,6 @@ this.createjs = this.createjs||{}; } var p = EventDispatcher.prototype; - /** - * REMOVED. Removed in favor of using `MySuperClass_constructor`. - * See {{#crossLink "Utility Methods/extend"}}{{/crossLink}} and {{#crossLink "Utility Methods/promote"}}{{/crossLink}} - * for details. - * - * There is an inheritance tutorial distributed with EaselJS in /tutorials/Inheritance. - * - * @method initialize - * @protected - * @deprecated - */ - // p.initialize = function() {}; // searchable for devs wondering where it is. - - // static public methods: /** * Static initializer to mix EventDispatcher methods into a target object or prototype. @@ -393,17 +379,15 @@ this.createjs = this.createjs||{}; // private methods: /** * @method _dispatchEvent - * @param {Object | String | Event} eventObj + * @param {Object | Event} eventObj * @param {Object} eventPhase * @protected **/ p._dispatchEvent = function(eventObj, eventPhase) { - var l, listeners = (eventPhase==1) ? this._captureListeners : this._listeners; - if (eventObj && listeners) { - var arr = listeners[eventObj.type]; - if (!arr||!(l=arr.length)) { return; } + var l, arr, listeners = (eventPhase <= 2) ? this._captureListeners : this._listeners; + if (eventObj && listeners && (arr = listeners[eventObj.type]) && (l=arr.length)) { try { eventObj.currentTarget = this; } catch (e) {} - try { eventObj.eventPhase = eventPhase; } catch (e) {} + try { eventObj.eventPhase = eventPhase|0; } catch (e) {} eventObj.removed = false; arr = arr.slice(); // to avoid issues with items being removed or added during the dispatch @@ -417,6 +401,7 @@ this.createjs = this.createjs||{}; } } } + if (eventPhase === 2) { this._dispatchEvent(eventObj, 2.1); } }; diff --git a/src/createjs/utils/deprecate.js b/src/createjs/utils/deprecate.js new file mode 100644 index 00000000..6b16d04e --- /dev/null +++ b/src/createjs/utils/deprecate.js @@ -0,0 +1,70 @@ +/* +* extend +* Visit http://createjs.com/ for documentation, updates and examples. +* +* Copyright (c) 2010 gskinner.com, inc. +* +* Permission is hereby granted, free of charge, to any person +* obtaining a copy of this software and associated documentation +* files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, +* copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following +* conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +*/ + +/** + * @module CreateJS + */ + +// namespace: +this.createjs = this.createjs||{}; + +/** + * @class Utility Methods + */ + +/** + * Wraps deprecated methods so they still be used, but throw warnings to developers. + * + * obj.deprecatedMethod = createjs.deprecate("Old Method Name", obj._fallbackMethod); + * + * The recommended approach for deprecated properties is: + * + * try { + * Obj ect.defineProperties(object, { + * readyOnlyProp: { get: createjs.deprecate("readOnlyProp", function() { return this.alternateProp; }) }, + * readWriteProp: { + * get: createjs.deprecate("readOnlyProp", function() { return this.alternateProp; }), + * set: createjs.deprecate("readOnlyProp", function(val) { this.alternateProp = val; }) + * }); + * } catch (e) {} + * + * @method deprecate + * @param {Function} [fallbackMethod=null] A method to call when the deprecated method is used. See the example for how + * @param {String} [name=null] The name of the method or property to display in the console warning. + * to deprecate properties. + * @return {Function} If a fallbackMethod is supplied, returns a closure that will call the fallback method after + * logging the warning in the console. + */ +createjs.deprecate = function(fallbackMethod, name) { + "use strict"; + return function() { + var msg = "Deprecated property or method '"+name+"'. See docs for info."; + console && (console.warn ? console.warn(msg) : console.log(msg)); + return fallbackMethod && fallbackMethod.apply(this, arguments); + } +}; \ No newline at end of file diff --git a/src/preloadjs/data/LoadItem.js b/src/preloadjs/data/LoadItem.js index 8d7e9e01..9c4b2289 100644 --- a/src/preloadjs/data/LoadItem.js +++ b/src/preloadjs/data/LoadItem.js @@ -104,14 +104,14 @@ this.createjs = this.createjs || {}; this.data = null; /** - * The request method used for HTTP calls. Both {{#crossLink "AbstractLoader/GET:property"}}{{/crossLink}} or - * {{#crossLink "AbstractLoader/POST:property"}}{{/crossLink}} request types are supported, and are defined as + * The request method used for HTTP calls. Both {{#crossLink "Methods/GET:property"}}{{/crossLink}} or + * {{#crossLink "Methods/POST:property"}}{{/crossLink}} request types are supported, and are defined as * constants on {{#crossLink "AbstractLoader"}}{{/crossLink}}. * @property method * @type {String} - * @default get + * @default GET */ - this.method = createjs.LoadItem.GET; + this.method = createjs.Methods.GET; /** * An object hash of name/value pairs to send to the server. diff --git a/src/preloadjs/data/Methods.js b/src/preloadjs/data/Methods.js new file mode 100644 index 00000000..92fe4da0 --- /dev/null +++ b/src/preloadjs/data/Methods.js @@ -0,0 +1,69 @@ +/* + * Methods + * Visit http://createjs.com/ for documentation, updates and examples. + * + * + * Copyright (c) 2012 gskinner.com, inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @module PreloadJS + */ + +// namespace: +this.createjs = this.createjs || {}; + +(function() { + + "use strict"; + + /** + * Defines the method types for XHR requests. Currently, PreloadJS only supports "POST" and "GET", however + * any HTML method can be used with PreloadJS utilities. + * + * @class Methods + * @static + */ + var s = {}; + + /** + * Defines a POST request, use for a method value when loading data. + * @property POST + * @type {string} + * @default post + * @static + */ + s.POST = "POST"; + + /** + * Defines a GET request, use for a method value when loading data. + * @property GET + * @type {string} + * @default get + * @static + */ + s.GET = "GET"; + + createjs.Methods = s; +}()); diff --git a/src/preloadjs/data/Types.js b/src/preloadjs/data/Types.js new file mode 100644 index 00000000..93b739ce --- /dev/null +++ b/src/preloadjs/data/Types.js @@ -0,0 +1,229 @@ +/* + * Types + * Visit http://createjs.com/ for documentation, updates and examples. + * + * + * Copyright (c) 2012 gskinner.com, inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @module PreloadJS + */ + +// namespace: +this.createjs = this.createjs || {}; + +(function() { + + "use strict"; + + /** + * Defines the load types that PreloadJS supports by default. This is typically used when passing a type override to + * a {{#crossLink "LoadQueue"}}{{/crossLink}}. + * + *

    Example

    + * + * queue.loadFile({src:"https://somecdn/wfossn3", type:createjs.Types.IMAGE}); + * + * You can also use the string value: + * + * queue.loadFile({src:"https://somecdn/wfossn3", type:"image"}); + * + * @class Types + * @static + */ + + var s = {}; + + /** + * The preload type for generic binary types. Note that images are loaded as binary files when using XHR. + * @property BINARY + * @type {String} + * @default binary + * @static + * @since 0.6.0 + */ + s.BINARY = "binary"; + + /** + * The preload type for css files. CSS files are loaded using a <link> when loaded with XHR, or a + * <style> tag when loaded with tags. + * @property CSS + * @type {String} + * @default css + * @static + * @since 0.6.0 + */ + s.CSS = "css"; + + /** + * The preload type for font files. + * @property FONT + * @type {String} + * @default font + * @static + * @since 0.9.0 + */ + s.FONT = "font"; + + /** + * The preload type for fonts specified with CSS (such as Google fonts) + * @property FONTCSS + * @type {String} + * @default fontcss + * @static + * @since 0.9.0 + */ + s.FONTCSS = "fontcss"; + + /** + * The preload type for image files, usually png, gif, or jpg/jpeg. Images are loaded into an <image> tag. + * @property IMAGE + * @type {String} + * @default image + * @static + * @since 0.6.0 + */ + s.IMAGE = "image"; + + /** + * The preload type for javascript files, usually with the "js" file extension. JavaScript files are loaded into a + * <script> tag. + * + * Since version 0.4.1+, due to how tag-loaded scripts work, all JavaScript files are automatically injected into + * the body of the document to maintain parity between XHR and tag-loaded scripts. In version 0.4.0 and earlier, + * only tag-loaded scripts are injected. + * @property JAVASCRIPT + * @type {String} + * @default javascript + * @static + * @since 0.6.0 + */ + s.JAVASCRIPT = "javascript"; + + /** + * The preload type for json files, usually with the "json" file extension. JSON data is loaded and parsed into a + * JavaScript object. Note that if a `callback` is present on the load item, the file will be loaded with JSONP, + * no matter what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} property is set to, and the JSON + * must contain a matching wrapper function. + * @property JSON + * @type {String} + * @default json + * @static + * @since 0.6.0 + */ + s.JSON = "json"; + + /** + * The preload type for jsonp files, usually with the "json" file extension. JSON data is loaded and parsed into a + * JavaScript object. You are required to pass a callback parameter that matches the function wrapper in the JSON. + * Note that JSONP will always be used if there is a callback present, no matter what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} + * property is set to. + * @property JSONP + * @type {String} + * @default jsonp + * @static + * @since 0.6.0 + */ + s.JSONP = "jsonp"; + + /** + * The preload type for json-based manifest files, usually with the "json" file extension. The JSON data is loaded + * and parsed into a JavaScript object. PreloadJS will then look for a "manifest" property in the JSON, which is an + * Array of files to load, following the same format as the {{#crossLink "LoadQueue/loadManifest"}}{{/crossLink}} + * method. If a "callback" is specified on the manifest object, then it will be loaded using JSONP instead, + * regardless of what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} property is set to. + * @property MANIFEST + * @type {String} + * @default manifest + * @static + * @since 0.6.0 + */ + s.MANIFEST = "manifest"; + + /** + * The preload type for sound files, usually mp3, ogg, or wav. When loading via tags, audio is loaded into an + * <audio> tag. + * @property SOUND + * @type {String} + * @default sound + * @static + * @since 0.6.0 + */ + s.SOUND = "sound"; + + /** + * The preload type for video files, usually mp4, ts, or ogg. When loading via tags, video is loaded into an + * <video> tag. + * @property VIDEO + * @type {String} + * @default video + * @static + * @since 0.6.0 + */ + s.VIDEO = "video"; + + /** + * The preload type for SpriteSheet files. SpriteSheet files are JSON files that contain string image paths. + * @property SPRITESHEET + * @type {String} + * @default spritesheet + * @static + * @since 0.6.0 + */ + s.SPRITESHEET = "spritesheet"; + + /** + * The preload type for SVG files. + * @property SVG + * @type {String} + * @default svg + * @static + * @since 0.6.0 + */ + s.SVG = "svg"; + + /** + * The preload type for text files, which is also the default file type if the type can not be determined. Text is + * loaded as raw text. + * @property TEXT + * @type {String} + * @default text + * @static + * @since 0.6.0 + */ + s.TEXT = "text"; + + /** + * The preload type for xml files. XML is loaded into an XML document. + * @property XML + * @type {String} + * @default xml + * @static + * @since 0.6.0 + */ + s.XML = "xml"; + + createjs.Types = s; +}()); diff --git a/src/preloadjs/loaders/AbstractLoader.js b/src/preloadjs/loaders/AbstractLoader.js index 8d43d19f..a49adbc6 100644 --- a/src/preloadjs/loaders/AbstractLoader.js +++ b/src/preloadjs/loaders/AbstractLoader.js @@ -194,176 +194,29 @@ this.createjs = this.createjs || {}; var p = createjs.extend(AbstractLoader, createjs.EventDispatcher); var s = AbstractLoader; - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - - /** - * Defines a POST request, use for a method value when loading data. - * @property POST - * @type {string} - * @default post - * @static - */ - s.POST = "POST"; - - /** - * Defines a GET request, use for a method value when loading data. - * @property GET - * @type {string} - * @default get - * @static - */ - s.GET = "GET"; - - /** - * The preload type for generic binary types. Note that images are loaded as binary files when using XHR. - * @property BINARY - * @type {String} - * @default binary - * @static - * @since 0.6.0 - */ - s.BINARY = "binary"; - - /** - * The preload type for css files. CSS files are loaded using a <link> when loaded with XHR, or a - * <style> tag when loaded with tags. - * @property CSS - * @type {String} - * @default css - * @static - * @since 0.6.0 - */ - s.CSS = "css"; - - /** - * The preload type for image files, usually png, gif, or jpg/jpeg. Images are loaded into an <image> tag. - * @property IMAGE - * @type {String} - * @default image - * @static - * @since 0.6.0 - */ - s.IMAGE = "image"; - - /** - * The preload type for javascript files, usually with the "js" file extension. JavaScript files are loaded into a - * <script> tag. - * - * Since version 0.4.1+, due to how tag-loaded scripts work, all JavaScript files are automatically injected into - * the body of the document to maintain parity between XHR and tag-loaded scripts. In version 0.4.0 and earlier, - * only tag-loaded scripts are injected. - * @property JAVASCRIPT - * @type {String} - * @default javascript - * @static - * @since 0.6.0 - */ - s.JAVASCRIPT = "javascript"; - - /** - * The preload type for json files, usually with the "json" file extension. JSON data is loaded and parsed into a - * JavaScript object. Note that if a `callback` is present on the load item, the file will be loaded with JSONP, - * no matter what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} property is set to, and the JSON - * must contain a matching wrapper function. - * @property JSON - * @type {String} - * @default json - * @static - * @since 0.6.0 - */ - s.JSON = "json"; - - /** - * The preload type for jsonp files, usually with the "json" file extension. JSON data is loaded and parsed into a - * JavaScript object. You are required to pass a callback parameter that matches the function wrapper in the JSON. - * Note that JSONP will always be used if there is a callback present, no matter what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} - * property is set to. - * @property JSONP - * @type {String} - * @default jsonp - * @static - * @since 0.6.0 - */ - s.JSONP = "jsonp"; - - /** - * The preload type for json-based manifest files, usually with the "json" file extension. The JSON data is loaded - * and parsed into a JavaScript object. PreloadJS will then look for a "manifest" property in the JSON, which is an - * Array of files to load, following the same format as the {{#crossLink "LoadQueue/loadManifest"}}{{/crossLink}} - * method. If a "callback" is specified on the manifest object, then it will be loaded using JSONP instead, - * regardless of what the {{#crossLink "LoadQueue/preferXHR:property"}}{{/crossLink}} property is set to. - * @property MANIFEST - * @type {String} - * @default manifest - * @static - * @since 0.6.0 - */ - s.MANIFEST = "manifest"; - - /** - * The preload type for sound files, usually mp3, ogg, or wav. When loading via tags, audio is loaded into an - * <audio> tag. - * @property SOUND - * @type {String} - * @default sound - * @static - * @since 0.6.0 - */ - s.SOUND = "sound"; - - /** - * The preload type for video files, usually mp4, ts, or ogg. When loading via tags, video is loaded into an - * <video> tag. - * @property VIDEO - * @type {String} - * @default video - * @static - * @since 0.6.0 - */ - s.VIDEO = "video"; - - /** - * The preload type for SpriteSheet files. SpriteSheet files are JSON files that contain string image paths. - * @property SPRITESHEET - * @type {String} - * @default spritesheet - * @static - * @since 0.6.0 - */ - s.SPRITESHEET = "spritesheet"; - - /** - * The preload type for SVG files. - * @property SVG - * @type {String} - * @default svg - * @static - * @since 0.6.0 - */ - s.SVG = "svg"; - - /** - * The preload type for text files, which is also the default file type if the type can not be determined. Text is - * loaded as raw text. - * @property TEXT - * @type {String} - * @default text - * @static - * @since 0.6.0 - */ - s.TEXT = "text"; - - /** - * The preload type for xml files. XML is loaded into an XML document. - * @property XML - * @type {String} - * @default xml - * @static - * @since 0.6.0 - */ - s.XML = "xml"; + // Remove these @deprecated properties after 1.0 + try { + Object.defineProperties(s, { + POST: { get: createjs.deprecate(function() { return createjs.Methods.POST; }, "AbstractLoader.POST") }, + GET: { get: createjs.deprecate(function() { return createjs.Methods.GET; }, "AbstractLoader.GET") }, + + BINARY: { get: createjs.deprecate(function() { return createjs.Types.BINARY; }, "AbstractLoader.BINARY") }, + CSS: { get: createjs.deprecate(function() { return createjs.Types.CSS; }, "AbstractLoader.CSS") }, + FONT: { get: createjs.deprecate(function() { return createjs.Types.FONT; }, "AbstractLoader.FONT") }, + FONTCSS: { get: createjs.deprecate(function() { return createjs.Types.FONTCSS; }, "AbstractLoader.FONTCSS") }, + IMAGE: { get: createjs.deprecate(function() { return createjs.Types.IMAGE; }, "AbstractLoader.IMAGE") }, + JAVASCRIPT: { get: createjs.deprecate(function() { return createjs.Types.JAVASCRIPT; }, "AbstractLoader.JAVASCRIPT") }, + JSON: { get: createjs.deprecate(function() { return createjs.Types.JSON; }, "AbstractLoader.JSON") }, + JSONP: { get: createjs.deprecate(function() { return createjs.Types.JSONP; }, "AbstractLoader.JSONP") }, + MANIFEST: { get: createjs.deprecate(function() { return createjs.Types.MANIFEST; }, "AbstractLoader.MANIFEST") }, + SOUND: { get: createjs.deprecate(function() { return createjs.Types.SOUND; }, "AbstractLoader.SOUND") }, + VIDEO: { get: createjs.deprecate(function() { return createjs.Types.VIDEO; }, "AbstractLoader.VIDEO") }, + SPRITESHEET: { get: createjs.deprecate(function() { return createjs.Types.SPRITESHEET; }, "AbstractLoader.SPRITESHEET") }, + SVG: { get: createjs.deprecate(function() { return createjs.Types.SVG; }, "AbstractLoader.SVG") }, + TEXT: { get: createjs.deprecate(function() { return createjs.Types.TEXT; }, "AbstractLoader.TEXT") }, + XML: { get: createjs.deprecate(function() { return createjs.Types.XML; }, "AbstractLoader.XML") } + }); + } catch (e) {} // Events /** @@ -402,7 +255,7 @@ this.createjs = this.createjs || {}; * This enables loaders to maintain internal queues, and surface file load errors. * @event fileerror * @param {Object} target The object that dispatched the event. - * @param {String} type The even type ("fileerror") + * @param {String} type The event type ("fileerror") * @param {LoadItem|object} The item that encountered the error * @since 0.6.0 */ @@ -655,10 +508,7 @@ this.createjs = this.createjs || {}; * @protected */ p._isCanceled = function () { - if (window.createjs == null || this.canceled) { - return true; - } - return false; + return this.canceled; }; /** @@ -685,11 +535,13 @@ this.createjs = this.createjs || {}; case "complete": this._rawResult = event.target._response; var result = this.resultFormatter && this.resultFormatter(this); + // The resultFormatter is asynchronous if (result instanceof Function) { result.call(this, createjs.proxy(this._resultFormatSuccess, this), createjs.proxy(this._resultFormatFailed, this) ); + // The result formatter is synchronous } else { this._result = result || this._rawResult; this._sendComplete(); @@ -736,16 +588,6 @@ this.createjs = this.createjs || {}; this._sendError(event); }; - /** - * @method buildPath - * @protected - * @deprecated Use the {{#crossLink "RequestUtils"}}{{/crossLink}} method {{#crossLink "RequestUtils/buildPath"}}{{/crossLink}} - * instead. - */ - p.buildPath = function (src, data) { - return createjs.RequestUtils.buildPath(src, data); - }; - /** * @method toString * @return {String} a string representation of the instance. diff --git a/src/preloadjs/loaders/SoundLoader.js b/src/preloadjs/loaders/SoundLoader.js index a3be7414..ddf98bce 100644 --- a/src/preloadjs/loaders/SoundLoader.js +++ b/src/preloadjs/loaders/SoundLoader.js @@ -50,15 +50,15 @@ this.createjs = this.createjs || {}; * @constructor */ function SoundLoader(loadItem, preferXHR) { - this.AbstractMediaLoader_constructor(loadItem, preferXHR, createjs.AbstractLoader.SOUND); + this.AbstractMediaLoader_constructor(loadItem, preferXHR, createjs.Types.SOUND); // protected properties - if (createjs.RequestUtils.isAudioTag(loadItem)) { + if (createjs.DomUtils.isAudioTag(loadItem)) { this._tag = loadItem; - } else if (createjs.RequestUtils.isAudioTag(loadItem.src)) { + } else if (createjs.DomUtils.isAudioTag(loadItem.src)) { this._tag = loadItem; - } else if (createjs.RequestUtils.isAudioTag(loadItem.tag)) { - this._tag = createjs.RequestUtils.isAudioTag(loadItem) ? loadItem : loadItem.src; + } else if (createjs.DomUtils.isAudioTag(loadItem.tag)) { + this._tag = createjs.DomUtils.isAudioTag(loadItem) ? loadItem : loadItem.src; } if (this._tag != null) { @@ -72,19 +72,19 @@ this.createjs = this.createjs || {}; // static methods /** * Determines if the loader can load a specific item. This loader can only load items that are of type - * {{#crossLink "AbstractLoader/SOUND:property"}}{{/crossLink}}. + * {{#crossLink "Types/SOUND:property"}}{{/crossLink}}. * @method canLoadItem * @param {LoadItem|Object} item The LoadItem that a LoadQueue is trying to load. * @returns {Boolean} Whether the loader can load the item. * @static */ s.canLoadItem = function (item) { - return item.type == createjs.AbstractLoader.SOUND; + return item.type == createjs.Types.SOUND; }; // protected methods p._createTag = function (src) { - var tag = document.createElement("audio"); + var tag = createjs.Elements.audio(); tag.autoplay = false; tag.preload = "none"; diff --git a/src/preloadjs/net/TagRequest.js b/src/preloadjs/net/TagRequest.js index 921c35c7..dbdbed68 100644 --- a/src/preloadjs/net/TagRequest.js +++ b/src/preloadjs/net/TagRequest.js @@ -81,13 +81,6 @@ this.createjs = this.createjs || {}; */ this._addedToDOM = false; - /** - * Determines what the tags initial style.visibility was, so we can set it correctly after a load. - * - * @type {null} - * @private - */ - this._startTagVisibility = null; }; var p = createjs.extend(TagRequest, createjs.AbstractRequest); @@ -103,15 +96,13 @@ this.createjs = this.createjs || {}; this.dispatchEvent(evt); - this._hideTag(); - this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), this._item.loadTimeout); this._tag[this._tagSrcAttribute] = this._item.src; // wdg:: Append the tag AFTER setting the src, or SVG loading on iOS will fail. if (this._tag.parentNode == null) { - window.document.body.appendChild(this._tag); + createjs.DomUtils.appendToBody(this._tag); this._addedToDOM = true; } }; @@ -161,7 +152,6 @@ this.createjs = this.createjs || {}; this._result = this.resultFormatter && this.resultFormatter(this) || this._rawResult; this._clean(); - this._showTag(); this.dispatchEvent("complete"); }; @@ -192,15 +182,6 @@ this.createjs = this.createjs || {}; clearTimeout(this._loadTimeout); }; - p._hideTag = function() { - this._startTagVisibility = this._tag.style.visibility; - this._tag.style.visibility = "hidden"; - }; - - p._showTag = function() { - this._tag.style.visibility = this._startTagVisibility; - }; - /** * Handle a stalled audio event. The main place this happens is with HTMLAudio in Chrome when playing back audio * that is already in a load, but not complete. diff --git a/src/preloadjs/net/XHRRequest.js b/src/preloadjs/net/XHRRequest.js index a5cfee67..01df75d4 100644 --- a/src/preloadjs/net/XHRRequest.js +++ b/src/preloadjs/net/XHRRequest.js @@ -207,10 +207,10 @@ this.createjs = this.createjs || {}; // Sometimes we get back 404s immediately, particularly when there is a cross origin request. // note this does not catch in Chrome try { - if (!this._item.values || this._item.method == createjs.AbstractLoader.GET) { + if (!this._item.values) { this._request.send(); - } else if (this._item.method == createjs.AbstractLoader.POST) { - this._request.send(createjs.RequestUtils.formatQueryString(this._item.values)); + } else { + this._request.send(createjs.URLUtils.formatQueryString(this._item.values)); } } catch (error) { this.dispatchEvent(new createjs.ErrorEvent("XHR_SEND", null, error)); @@ -328,6 +328,9 @@ this.createjs = this.createjs || {}; /** * The XHR request has completed. This is called by the XHR request directly, or by a readyStateChange that has * request.readyState == 4. Only the first call to this method will be processed. + * + * Note that This method uses {{#crossLink "_checkError"}}{{/crossLink}} to determine if the server has returned an + * error code. * @method _handleLoad * @param {Object} event The XHR load event. * @private @@ -374,30 +377,36 @@ this.createjs = this.createjs || {}; */ p._handleTimeout = function (event) { this._clean(); - this.dispatchEvent(new createjs.ErrorEvent("PRELOAD_TIMEOUT", null, event)); }; // Protected /** - * Determine if there is an error in the current load. This checks the status of the request for problem codes. Note - * that this does not check for an actual response. Currently, it only checks for 404 or 0 error code. + * Determine if there is an error in the current load. + * Currently this checks the status of the request for problem codes, and not actual response content: + *
      + *
    • Status codes between 400 and 599 (HTTP error range)
    • + *
    • A status of 0, but *only when the application is running on a server*. If the application is running + * on `file:`, then it may incorrectly treat an error on local (or embedded applications) as a successful + * load.
    • + *
    * @method _checkError - * @return {int} If the request status returns an error code. + * @return {Error} An error with the status code in the `message` argument. * @private */ p._checkError = function () { - //LM: Probably need additional handlers here, maybe 501 var status = parseInt(this._request.status); - - switch (status) { - case 404: // Not Found - case 0: // Not Loaded - return new Error(status); + if (status >= 400 && status <= 599) { + return new Error(status); + } else if (status == 0) { + if ((/^https?:/).test(location.protocol)) { return new Error(0); } + return null; // Likely an embedded app. + } else { + return null; } - return null; }; + /** * Validate the response. Different browsers have different approaches, some of which throw errors when accessed * in other browsers. If there is no response, the _response property will remain null. @@ -447,7 +456,7 @@ this.createjs = this.createjs || {}; */ p._createXHR = function (item) { // Check for cross-domain loads. We can't fully support them, but we can try. - var crossdomain = createjs.RequestUtils.isCrossDomain(item); + var crossdomain = createjs.URLUtils.isCrossDomain(item); var headers = {}; // Create the request. Fallback to whatever support we have. @@ -486,21 +495,21 @@ this.createjs = this.createjs || {}; this._xhrLevel = (typeof req.responseType === "string") ? 2 : 1; var src = null; - if (item.method == createjs.AbstractLoader.GET) { - src = createjs.RequestUtils.buildPath(item.src, item.values); + if (item.method == createjs.Methods.GET) { + src = createjs.URLUtils.buildURI(item.src, item.values); } else { src = item.src; } // Open the request. Set cross-domain flags if it is supported (XHR level 1 only) - req.open(item.method || createjs.AbstractLoader.GET, src, true); + req.open(item.method || createjs.Methods.GET, src, true); if (crossdomain && req instanceof XMLHttpRequest && this._xhrLevel == 1) { headers["Origin"] = location.origin; } // To send data we need to set the Content-type header) - if (item.values && item.method == createjs.AbstractLoader.POST) { + if (item.values && item.method == createjs.Methods.POST) { headers["Content-Type"] = "application/x-www-form-urlencoded"; } diff --git a/src/preloadjs/utils/DomUtils.js b/src/preloadjs/utils/DomUtils.js new file mode 100644 index 00000000..9ddff92d --- /dev/null +++ b/src/preloadjs/utils/DomUtils.js @@ -0,0 +1,120 @@ +/* + * DomUtils + * Visit http://createjs.com/ for documentation, updates and examples. + * + * + * Copyright (c) 2012 gskinner.com, inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @module PreloadJS + */ + +(function () { + + /** + * A few utilities for interacting with the dom. + * @class DomUtils + */ + var s = { + container: null + }; + + s.appendToHead = function (el) { + s.getHead().appendChild(el); + } + + s.appendToBody = function (el) { + if (s.container == null) { + s.container = document.createElement("div"); + s.container.id = "preloadjs-container"; + var style = s.container.style; + style.visibility = "hidden"; + style.position = "absolute"; + style.width = s.container.style.height = "10px"; + style.overflow = "hidden"; + style.transform = style.msTransform = style.webkitTransform = style.oTransform = "translate(-10px, -10px)"; //LM: Not working + s.getBody().appendChild(s.container); + } + s.container.appendChild(el); + } + + s.getHead = function () { + return document.head || document.getElementsByTagName("head")[0]; + } + + s.getBody = function () { + return document.body || document.getElementsByTagName("body")[0]; + } + + s.removeChild = function(el) { + if (el.parent) { + el.parent.removeChild(el); + } + } + + /** + * Check if item is a valid HTMLImageElement + * @method isImageTag + * @param {Object} item + * @returns {Boolean} + * @static + */ + s.isImageTag = function(item) { + return item instanceof HTMLImageElement; + }; + + /** + * Check if item is a valid HTMLAudioElement + * @method isAudioTag + * @param {Object} item + * @returns {Boolean} + * @static + */ + s.isAudioTag = function(item) { + if (window.HTMLAudioElement) { + return item instanceof HTMLAudioElement; + } else { + return false; + } + }; + + /** + * Check if item is a valid HTMLVideoElement + * @method isVideoTag + * @param {Object} item + * @returns {Boolean} + * @static + */ + s.isVideoTag = function(item) { + if (window.HTMLVideoElement) { + return item instanceof HTMLVideoElement; + } else { + return false; + } + }; + + createjs.DomUtils = s; + +}()); diff --git a/src/preloadjs/utils/Elements.js b/src/preloadjs/utils/Elements.js new file mode 100644 index 00000000..04877dda --- /dev/null +++ b/src/preloadjs/utils/Elements.js @@ -0,0 +1,94 @@ +/* + * Elements + * + * Visit http://createjs.com/ for documentation, updates and examples. + * + * + * Copyright (c) 2012 gskinner.com, inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @module PreloadJS + */ + +(function () { + + /** + * Convenience methods for creating various elements used by PrelaodJS. + * + * @class DomUtils + */ + var s = {}; + + s.a = function() { + return s.el("a"); + } + + s.svg = function() { + return s.el("svg"); + } + + s.object = function() { + return s.el("object"); + } + + s.image = function() { + return s.el("image"); + } + + s.img = function() { + return s.el("img"); + } + + s.style = function() { + return s.el("style"); + } + + s.link = function() { + return s.el("link"); + } + + s.script = function() { + return s.el("script"); + } + + s.audio = function() { + return s.el("audio"); + } + + s.video = function() { + return s.el("video"); + } + + s.text = function(value) { + return document.createTextNode(value); + } + + s.el = function(name) { + return document.createElement(name); + } + + createjs.Elements = s; + +}()); diff --git a/src/preloadjs/utils/RequestUtils.js b/src/preloadjs/utils/RequestUtils.js index 13b1c630..69200c25 100644 --- a/src/preloadjs/utils/RequestUtils.js +++ b/src/preloadjs/utils/RequestUtils.js @@ -39,156 +39,6 @@ */ var s = {}; - /** - * The Regular Expression used to test file URLS for an absolute path. - * @property ABSOLUTE_PATH - * @type {RegExp} - * @static - */ - s.ABSOLUTE_PATT = /^(?:\w+:)?\/{2}/i; - - /** - * The Regular Expression used to test file URLS for a relative path. - * @property RELATIVE_PATH - * @type {RegExp} - * @static - */ - s.RELATIVE_PATT = (/^[./]*?\//i); - - /** - * The Regular Expression used to test file URLS for an extension. Note that URIs must already have the query string - * removed. - * @property EXTENSION_PATT - * @type {RegExp} - * @static - */ - s.EXTENSION_PATT = /\/?[^/]+\.(\w{1,5})$/i; - - /** - * Parse a file path to determine the information we need to work with it. Currently, PreloadJS needs to know: - *
      - *
    • If the path is absolute. Absolute paths start with a protocol (such as `http://`, `file://`, or - * `//networkPath`)
    • - *
    • If the path is relative. Relative paths start with `../` or `/path` (or similar)
    • - *
    • The file extension. This is determined by the filename with an extension. Query strings are dropped, and - * the file path is expected to follow the format `name.ext`.
    • - *
    - * @method parseURI - * @param {String} path - * @returns {Object} An Object with an `absolute` and `relative` Boolean values, as well as an optional 'extension` - * property, which is the lowercase extension. - * @static - */ - s.parseURI = function (path) { - var info = {absolute: false, relative: false}; - if (path == null) { return info; } - - // Drop the query string - var queryIndex = path.indexOf("?"); - if (queryIndex > -1) { - path = path.substr(0, queryIndex); - } - - // Absolute - var match; - if (s.ABSOLUTE_PATT.test(path)) { - info.absolute = true; - - // Relative - } else if (s.RELATIVE_PATT.test(path)) { - info.relative = true; - } - - // Extension - if (match = path.match(s.EXTENSION_PATT)) { - info.extension = match[1].toLowerCase(); - } - return info; - }; - - /** - * Formats an object into a query string for either a POST or GET request. - * @method formatQueryString - * @param {Object} data The data to convert to a query string. - * @param {Array} [query] Existing name/value pairs to append on to this query. - * @static - */ - s.formatQueryString = function (data, query) { - if (data == null) { - throw new Error('You must specify data.'); - } - var params = []; - for (var n in data) { - params.push(n + '=' + escape(data[n])); - } - if (query) { - params = params.concat(query); - } - return params.join('&'); - }; - - /** - * A utility method that builds a file path using a source and a data object, and formats it into a new path. - * @method buildPath - * @param {String} src The source path to add values to. - * @param {Object} [data] Object used to append values to this request as a query string. Existing parameters on the - * path will be preserved. - * @returns {string} A formatted string that contains the path and the supplied parameters. - * @static - */ - s.buildPath = function (src, data) { - if (data == null) { - return src; - } - - var query = []; - var idx = src.indexOf('?'); - - if (idx != -1) { - var q = src.slice(idx + 1); - query = query.concat(q.split('&')); - } - - if (idx != -1) { - return src.slice(0, idx) + '?' + this.formatQueryString(data, query); - } else { - return src + '?' + this.formatQueryString(data, query); - } - }; - - /** - * @method isCrossDomain - * @param {LoadItem|Object} item A load item with a `src` property. - * @return {Boolean} If the load item is loading from a different domain than the current location. - * @static - */ - s.isCrossDomain = function (item) { - var target = document.createElement("a"); - target.href = item.src; - - var host = document.createElement("a"); - host.href = location.href; - - var crossdomain = (target.hostname != "") && - (target.port != host.port || - target.protocol != host.protocol || - target.hostname != host.hostname); - return crossdomain; - }; - - /** - * @method isLocal - * @param {LoadItem|Object} item A load item with a `src` property - * @return {Boolean} If the load item is loading from the "file:" protocol. Assume that the host must be local as - * well. - * @static - */ - s.isLocal = function (item) { - var target = document.createElement("a"); - target.href = item.src; - return target.hostname == "" && target.protocol == "file:"; - }; - /** * Determine if a specific type should be loaded as a binary file. Currently, only images and items marked * specifically as "binary" are loaded as binary. Note that audio is not a binary type, as we can not play @@ -202,55 +52,14 @@ */ s.isBinary = function (type) { switch (type) { - case createjs.AbstractLoader.IMAGE: - case createjs.AbstractLoader.BINARY: + case createjs.Types.IMAGE: + case createjs.Types.BINARY: return true; default: return false; } }; - /** - * Check if item is a valid HTMLImageElement - * @method isImageTag - * @param {Object} item - * @returns {Boolean} - * @static - */ - s.isImageTag = function(item) { - return item instanceof HTMLImageElement; - }; - - /** - * Check if item is a valid HTMLAudioElement - * @method isAudioTag - * @param {Object} item - * @returns {Boolean} - * @static - */ - s.isAudioTag = function(item) { - if (window.HTMLAudioElement) { - return item instanceof HTMLAudioElement; - } else { - return false; - } - }; - - /** - * Check if item is a valid HTMLVideoElement - * @method isVideoTag - * @param {Object} item - * @returns {Boolean} - * @static - */ - s.isVideoTag = function(item) { - if (window.HTMLVideoElement) { - return item instanceof HTMLVideoElement; - } else { - return false; - } - }; - /** * Determine if a specific type is a text-based asset, and should be loaded as UTF-8. * @method isText @@ -260,14 +69,14 @@ */ s.isText = function (type) { switch (type) { - case createjs.AbstractLoader.TEXT: - case createjs.AbstractLoader.JSON: - case createjs.AbstractLoader.MANIFEST: - case createjs.AbstractLoader.XML: - case createjs.AbstractLoader.CSS: - case createjs.AbstractLoader.SVG: - case createjs.AbstractLoader.JAVASCRIPT: - case createjs.AbstractLoader.SPRITESHEET: + case createjs.Types.TEXT: + case createjs.Types.JSON: + case createjs.Types.MANIFEST: + case createjs.Types.XML: + case createjs.Types.CSS: + case createjs.Types.SVG: + case createjs.Types.JAVASCRIPT: + case createjs.Types.SPRITESHEET: return true; default: return false; @@ -279,13 +88,13 @@ * if it is an unusual extension. * @method getTypeByExtension * @param {String} extension The file extension to use to determine the load type. - * @return {String} The determined load type (for example, AbstractLoader.IMAGE). Will return `null` if + * @return {String} The determined load type (for example, `createjs.Types.IMAGE`). Will return `null` if * the type can not be determined by the extension. * @static */ s.getTypeByExtension = function (extension) { if (extension == null) { - return createjs.AbstractLoader.TEXT; + return createjs.Types.TEXT; } switch (extension.toLowerCase()) { @@ -295,27 +104,27 @@ case "png": case "webp": case "bmp": - return createjs.AbstractLoader.IMAGE; + return createjs.Types.IMAGE; case "ogg": case "mp3": case "webm": - return createjs.AbstractLoader.SOUND; + return createjs.Types.SOUND; case "mp4": case "webm": case "ts": - return createjs.AbstractLoader.VIDEO; + return createjs.Types.VIDEO; case "json": - return createjs.AbstractLoader.JSON; + return createjs.Types.JSON; case "xml": - return createjs.AbstractLoader.XML; + return createjs.Types.XML; case "css": - return createjs.AbstractLoader.CSS; + return createjs.Types.CSS; case "js": - return createjs.AbstractLoader.JAVASCRIPT; + return createjs.Types.JAVASCRIPT; case 'svg': - return createjs.AbstractLoader.SVG; + return createjs.Types.SVG; default: - return createjs.AbstractLoader.TEXT; + return createjs.Types.TEXT; } }; diff --git a/src/preloadjs/utils/URLUtils.js b/src/preloadjs/utils/URLUtils.js new file mode 100644 index 00000000..9aba8b40 --- /dev/null +++ b/src/preloadjs/utils/URLUtils.js @@ -0,0 +1,219 @@ +/* + * URLUtils + * Visit http://createjs.com/ for documentation, updates and examples. + * + * + * Copyright (c) 2012 gskinner.com, inc. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * @module PreloadJS + */ + +(function () { + + /** + * Utilities that assist with parsing load items, and determining file types, etc. + * @class URLUtils + */ + var s = {}; + + /** + * The Regular Expression used to test file URLS for an absolute path. + * @property ABSOLUTE_PATH + * @type {RegExp} + * @static + */ + s.ABSOLUTE_PATT = /^(?:\w+:)?\/{2}/i; + + /** + * The Regular Expression used to test file URLS for a relative path. + * @property RELATIVE_PATH + * @type {RegExp} + * @static + */ + s.RELATIVE_PATT = (/^[./]*?\//i); + + /** + * The Regular Expression used to test file URLS for an extension. Note that URIs must already have the query string + * removed. + * @property EXTENSION_PATT + * @type {RegExp} + * @static + */ + s.EXTENSION_PATT = /\/?[^/]+\.(\w{1,5})$/i; + + /** + * Parse a file path to determine the information we need to work with it. Currently, PreloadJS needs to know: + *
      + *
    • If the path is absolute. Absolute paths start with a protocol (such as `http://`, `file://`, or + * `//networkPath`)
    • + *
    • If the path is relative. Relative paths start with `../` or `/path` (or similar)
    • + *
    • The file extension. This is determined by the filename with an extension. Query strings are dropped, and + * the file path is expected to follow the format `name.ext`.
    • + *
    + * + * @method parseURI + * @param {String} path + * @returns {Object} An Object with an `absolute` and `relative` Boolean values, + * the pieces of the path (protocol, hostname, port, pathname, search, hash, host) + * as well as an optional 'extension` property, which is the lowercase extension. + * + * @static + */ + s.parseURI = function (path) { + var info = { + absolute: false, + relative: false, + protocol: null, + hostname: null, + port: null, + pathname: null, + search: null, + hash: null, + host: null + }; + + if (path == null) { return info; } + + // Inject the path parts. + var parser = createjs.Elements.a(); + parser.href = path; + + for (var n in info) { + if (n in parser) { + info[n] = parser[n]; + } + } + + // Drop the query string + var queryIndex = path.indexOf("?"); + if (queryIndex > -1) { + path = path.substr(0, queryIndex); + } + + // Absolute + var match; + if (s.ABSOLUTE_PATT.test(path)) { + info.absolute = true; + + // Relative + } else if (s.RELATIVE_PATT.test(path)) { + info.relative = true; + } + + // Extension + if (match = path.match(s.EXTENSION_PATT)) { + info.extension = match[1].toLowerCase(); + } + + return info; + }; + + /** + * Formats an object into a query string for either a POST or GET request. + * @method formatQueryString + * @param {Object} data The data to convert to a query string. + * @param {Array} [query] Existing name/value pairs to append on to this query. + * @static + */ + s.formatQueryString = function (data, query) { + if (data == null) { + throw new Error("You must specify data."); + } + var params = []; + for (var n in data) { + params.push(n + "=" + escape(data[n])); + } + if (query) { + params = params.concat(query); + } + return params.join("&"); + }; + + /** + * A utility method that builds a file path using a source and a data object, and formats it into a new path. + * @method buildURI + * @param {String} src The source path to add values to. + * @param {Object} [data] Object used to append values to this request as a query string. Existing parameters on the + * path will be preserved. + * @returns {string} A formatted string that contains the path and the supplied parameters. + * @static + */ + s.buildURI = function (src, data) { + if (data == null) { + return src; + } + + var query = []; + var idx = src.indexOf("?"); + + if (idx != -1) { + var q = src.slice(idx + 1); + query = query.concat(q.split("&")); + } + + if (idx != -1) { + return src.slice(0, idx) + "?" + this.formatQueryString(data, query); + } else { + return src + "?" + this.formatQueryString(data, query); + } + }; + + /** + * @method isCrossDomain + * @param {LoadItem|Object} item A load item with a `src` property. + * @return {Boolean} If the load item is loading from a different domain than the current location. + * @static + */ + s.isCrossDomain = function (item) { + var target = createjs.Elements.a(); + target.href = item.src; + + var host = createjs.Elements.a(); + host.href = location.href; + + var crossdomain = (target.hostname != "") && + (target.port != host.port || + target.protocol != host.protocol || + target.hostname != host.hostname); + return crossdomain; + }; + + /** + * @method isLocal + * @param {LoadItem|Object} item A load item with a `src` property + * @return {Boolean} If the load item is loading from the "file:" protocol. Assume that the host must be local as + * well. + * @static + */ + s.isLocal = function (item) { + var target = createjs.Elements.a(); + target.href = item.src; + return target.hostname == "" && target.protocol == "file:"; + }; + + createjs.URLUtils = s; + +}()); diff --git a/src/soundjs/AbstractPlugin.js b/src/soundjs/AbstractPlugin.js index a01aadda..4fae3f5c 100644 --- a/src/soundjs/AbstractPlugin.js +++ b/src/soundjs/AbstractPlugin.js @@ -105,20 +105,6 @@ this.createjs = this.createjs || {}; }; var p = AbstractPlugin.prototype; - /** - * REMOVED. Removed in favor of using `MySuperClass_constructor`. - * See {{#crossLink "Utility Methods/extend"}}{{/crossLink}} and {{#crossLink "Utility Methods/promote"}}{{/crossLink}} - * for details. - * - * There is an inheritance tutorial distributed with EaselJS in /tutorials/Inheritance. - * - * @method initialize - * @protected - * @deprecated - */ - // p.initialize = function() {}; // searchable for devs wondering where it is. - - // Static Properties: // NOTE THESE PROPERTIES NEED TO BE ADDED TO EACH PLUGIN /** @@ -126,7 +112,7 @@ this.createjs = this.createjs || {}; * @property _capabilities * @type {Object} * @default null - * @protected + * @private * @static */ AbstractPlugin._capabilities = null; @@ -237,7 +223,15 @@ this.createjs = this.createjs || {}; this.preload(this.register(src)); } var si = new this._soundInstanceClass(src, startTime, duration, this._audioSources[src]); - this._soundInstances[src].push(si); + if(this._soundInstances[src]){ + this._soundInstances[src].push(si); + } + + // Plugins that don't have a setVolume should implement a setMasterVolume/setMasterMute + // So we have to check that here. + si.setMasterVolume && si.setMasterVolume(createjs.Sound.volume); + si.setMasterMute && si.setMasterMute(createjs.Sound.muted); + return si; }; @@ -268,7 +262,7 @@ this.createjs = this.createjs || {}; * Mute all sounds via the plugin. * @method setMute * @param {Boolean} value If all sound should be muted or not. Note that plugin-level muting just looks up - * the mute value of Sound {{#crossLink "Sound/getMute"}}{{/crossLink}}, so this property is not used here. + * the mute value of Sound {{#crossLink "Sound/muted:property"}}{{/crossLink}}, so this property is not used here. * @return {Boolean} If the mute call succeeds. */ p.setMute = function (value) { @@ -286,26 +280,33 @@ this.createjs = this.createjs || {}; /** * Handles internal preload completion. * @method _handlePreloadComplete + * @param event * @protected */ p._handlePreloadComplete = function (event) { - var src = event.target.getItem().src; - this._audioSources[src] = event.result; - for (var i = 0, l = this._soundInstances[src].length; i < l; i++) { - var item = this._soundInstances[src][i]; - item.setPlaybackResource(this._audioSources[src]); - // ToDo consider adding play call here if playstate == playfailed + var src = event.target.getItem().src, + result = event.result, + instances = this._soundInstances[src]; + this._audioSources[src] = result; + + if (instances != null && instances.length > 0) { + for (var i=0, l=instances.length; imyInstance.volume * createjs.Sound.getVolume(); + * myInstance.volume * createjs.Sound._getVolume(); * * @property volume * @type {Number} @@ -133,24 +133,27 @@ this.createjs = this.createjs || {}; */ this._volume = 1; Object.defineProperty(this, "volume", { - get: this.getVolume, - set: this.setVolume + get: this._getVolume, + set: this._setVolume }); + this.getVolume = createjs.deprecate(this._getVolume, "AbstractSoundInstance.getVolume"); + this.setVolume = createjs.deprecate(this._setVolume, "AbstractSoundInstance.setVolume"); /** * The pan of the sound, between -1 (left) and 1 (right). Note that pan is not supported by HTML Audio. * - *
    Note in WebAudioPlugin this only gives us the "x" value of what is actually 3D audio. - * + * Note in WebAudioPlugin this only gives us the "x" value of what is actually 3D audio * @property pan * @type {Number} * @default 0 */ this._pan = 0; Object.defineProperty(this, "pan", { - get: this.getPan, - set: this.setPan + get: this._getPan, + set: this._setPan }); + this.getPan = createjs.deprecate(this._getPan, "AbstractSoundInstance.getPan"); + this.setPan = createjs.deprecate(this._setPan, "AbstractSoundInstance.setPan"); /** * Audio sprite property used to determine the starting offset. @@ -161,9 +164,11 @@ this.createjs = this.createjs || {}; */ this._startTime = Math.max(0, startTime || 0); Object.defineProperty(this, "startTime", { - get: this.getStartTime, - set: this.setStartTime + get: this._getStartTime, + set: this._setStartTime }); + this.getStartTime = createjs.deprecate(this._getStartTime, "AbstractSoundInstance.getStartTime"); + this.setStartTime = createjs.deprecate(this._setStartTime, "AbstractSoundInstance.setStartTime"); /** * Sets or gets the length of the audio clip, value is in milliseconds. @@ -175,9 +180,11 @@ this.createjs = this.createjs || {}; */ this._duration = Math.max(0, duration || 0); Object.defineProperty(this, "duration", { - get: this.getDuration, - set: this.setDuration + get: this._getDuration, + set: this._setDuration }); + this.getDuration = createjs.deprecate(this._getDuration, "AbstractSoundInstance.getDuration"); + this.setDuration = createjs.deprecate(this._setDuration, "AbstractSoundInstance.setDuration"); /** * Object that holds plugin specific resource need for audio playback. @@ -190,10 +197,12 @@ this.createjs = this.createjs || {}; */ this._playbackResource = null; Object.defineProperty(this, "playbackResource", { - get: this.getPlaybackResource, - set: this.setPlaybackResource + get: this._getPlaybackResource, + set: this._setPlaybackResource }); - if(playbackResource !== false && playbackResource !== true) { this.setPlaybackResource(playbackResource); } + if(playbackResource !== false && playbackResource !== true) { this._setPlaybackResource(playbackResource); } + this.getPlaybackResource = createjs.deprecate(this._getPlaybackResource, "AbstractSoundInstance.getPlaybackResource"); + this.setPlaybackResource = createjs.deprecate(this._setPlaybackResource, "AbstractSoundInstance.setPlaybackResource"); /** * The position of the playhead in milliseconds. This can be set while a sound is playing, paused, or stopped. @@ -205,9 +214,11 @@ this.createjs = this.createjs || {}; */ this._position = 0; Object.defineProperty(this, "position", { - get: this.getPosition, - set: this.setPosition + get: this._getPosition, + set: this._setPosition }); + this.getPosition = createjs.deprecate(this._getPosition, "AbstractSoundInstance.getPosition"); + this.setPosition = createjs.deprecate(this._setPosition, "AbstractSoundInstance.setPosition"); /** * The number of play loops remaining. Negative values will loop infinitely. @@ -220,9 +231,11 @@ this.createjs = this.createjs || {}; */ this._loop = 0; Object.defineProperty(this, "loop", { - get: this.getLoop, - set: this.setLoop + get: this._getLoop, + set: this._setLoop }); + this.getLoop = createjs.deprecate(this._getLoop, "AbstractSoundInstance.getLoop"); + this.setLoop = createjs.deprecate(this._setLoop, "AbstractSoundInstance.setLoop"); /** * Mutes or unmutes the current audio instance. @@ -234,9 +247,11 @@ this.createjs = this.createjs || {}; */ this._muted = false; Object.defineProperty(this, "muted", { - get: this.getMuted, - set: this.setMuted + get: this._getMuted, + set: this._setMuted }); + this.getMuted = createjs.deprecate(this._getMuted, "AbstractSoundInstance.getMuted"); + this.setMuted = createjs.deprecate(this._setMuted, "AbstractSoundInstance.setMuted"); /** * Pauses or resumes the current audio instance. @@ -246,9 +261,11 @@ this.createjs = this.createjs || {}; */ this._paused = false; Object.defineProperty(this, "paused", { - get: this.getPaused, - set: this.setPaused + get: this._getPaused, + set: this._setPaused }); + this.getPaused = createjs.deprecate(this._getPaused, "AbstractSoundInstance.getPaused"); + this.setPaused = createjs.deprecate(this._setPaused, "AbstractSoundInstance.setPaused"); // Events @@ -299,10 +316,6 @@ this.createjs = this.createjs || {}; var p = createjs.extend(AbstractSoundInstance, createjs.EventDispatcher); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Public Methods: /** * Play an instance. This method is intended to be called on SoundInstances that already exist (created @@ -319,34 +332,15 @@ this.createjs = this.createjs || {}; * The parameters for this method are deprecated in favor of a single parameter that is an Object or {{#crossLink "PlayPropsConfig"}}{{/crossLink}}. * * @method play - * @param {String | Object} [interrupt="none"|options] This parameter will be renamed playProps in the next release.
    - * This parameter can be an instance of {{#crossLink "PlayPropsConfig"}}{{/crossLink}} or an Object that contains any or all optional properties by name, - * including: interrupt, delay, offset, loop, volume, pan, startTime, and duration (see the above code sample). - *
    OR
    - * Deprecated How to interrupt any currently playing instances of audio with the same source, - * if the maximum number of instances of the sound are already playing. Values are defined as INTERRUPT_TYPE - * constants on the Sound class, with the default defined by {{#crossLink "Sound/defaultInterruptBehavior:property"}}{{/crossLink}}. - * @param {Number} [delay=0] Deprecated The amount of time to delay the start of audio playback, in milliseconds. - * @param {Number} [offset=0] Deprecated The offset from the start of the audio to begin playback, in milliseconds. - * @param {Number} [loop=0] Deprecated How many times the audio loops when it reaches the end of playback. The default is 0 (no - * loops), and -1 can be used for infinite playback. - * @param {Number} [volume=1] Deprecated The volume of the sound, between 0 and 1. Note that the master volume is applied - * against the individual volume. - * @param {Number} [pan=0] Deprecated The left-right pan of the sound (if supported), between -1 (left) and 1 (right). - * Note that pan is not supported for HTML Audio. + * @param {Object | PlayPropsConfig} props A PlayPropsConfig instance, or an object that contains the parameters to + * play a sound. See the {{#crossLink "PlayPropsConfig"}}{{/crossLink}} for more info. * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. */ - p.play = function (interrupt, delay, offset, loop, volume, pan) { - var playProps; - if (interrupt instanceof Object || interrupt instanceof createjs.PlayPropsConfig) { - playProps = createjs.PlayPropsConfig.create(interrupt); - } else { - playProps = createjs.PlayPropsConfig.create({interrupt:interrupt, delay:delay, offset:offset, loop:loop, volume:volume, pan:pan}); - } - + p.play = function (props) { + var playProps = createjs.PlayPropsConfig.create(props); if (this.playState == createjs.Sound.PLAY_SUCCEEDED) { this.applyPlayProps(playProps); - if (this._paused) { this.setPaused(false); } + if (this._paused) { this._setPaused(false); } return; } this._cleanUp(); @@ -397,13 +391,13 @@ this.createjs = this.createjs || {}; * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. */ p.applyPlayProps = function(playProps) { - if (playProps.offset != null) { this.setPosition(playProps.offset) } - if (playProps.loop != null) { this.setLoop(playProps.loop); } - if (playProps.volume != null) { this.setVolume(playProps.volume); } - if (playProps.pan != null) { this.setPan(playProps.pan); } + if (playProps.offset != null) { this._setPosition(playProps.offset) } + if (playProps.loop != null) { this._setLoop(playProps.loop); } + if (playProps.volume != null) { this._setVolume(playProps.volume); } + if (playProps.pan != null) { this._setPan(playProps.pan); } if (playProps.startTime != null) { - this.setStartTime(playProps.startTime); - this.setDuration(playProps.duration); + this._setStartTime(playProps.startTime); + this._setDuration(playProps.duration); } return this; }; @@ -414,27 +408,25 @@ this.createjs = this.createjs || {}; // get/set methods that allow support for IE8 /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/paused:property"}}{{/crossLink}} directly as a property, - * - * @deprecated - * @method getPaused - * @returns {boolean} If the instance is currently paused + * Please use {{#crossLink "AbstractSoundInstance/paused:property"}}{{/crossLink}} directly as a property. + * @method _getPaused + * @protected + * @return {boolean} If the instance is currently paused * @since 0.6.0 */ - p.getPaused = function() { + p._getPaused = function() { return this._paused; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/paused:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPaused + * Please use {{#crossLink "AbstractSoundInstance/paused:property"}}{{/crossLink}} directly as a property + * @method _setPaused + * @protected * @param {boolean} value * @since 0.6.0 * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. */ - p.setPaused = function (value) { + p._setPaused = function (value) { if ((value !== true && value !== false) || this._paused == value) {return;} if (value == true && this.playState != createjs.Sound.PLAY_SUCCEEDED) {return;} this._paused = value; @@ -448,14 +440,13 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setVolume + * Please use {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} directly as a property + * @method _setVolume + * @protected * @param {Number} value The volume to set, between 0 and 1. * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. */ - p.setVolume = function (value) { + p._setVolume = function (value) { if (value == this._volume) { return this; } this._volume = Math.max(0, Math.min(1, value)); if (!this._muted) { @@ -465,26 +456,24 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getVolume + * Please use {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} directly as a property + * @method _getVolume + * @protected * @return {Number} The current volume of the sound instance. */ - p.getVolume = function () { + p._getVolume = function () { return this._volume; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/muted:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setMuted + * Please use {{#crossLink "AbstractSoundInstance/muted:property"}}{{/crossLink}} directly as a property + * @method _setMuted + * @protected * @param {Boolean} value If the sound should be muted. * @return {AbstractSoundInstance} A reference to itself, intended for chaining calls. * @since 0.6.0 */ - p.setMuted = function (value) { + p._setMuted = function (value) { if (value !== true && value !== false) {return;} this._muted = value; this._updateVolume(); @@ -492,26 +481,24 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/muted:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getMuted + * Please use {{#crossLink "AbstractSoundInstance/muted:property"}}{{/crossLink}} directly as a property + * @method _getMuted + * @protected * @return {Boolean} If the sound is muted. * @since 0.6.0 */ - p.getMuted = function () { + p._getMuted = function () { return this._muted; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/pan:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPan + * Please use {{#crossLink "AbstractSoundInstance/pan:property"}}{{/crossLink}} directly as a property + * @method _setPan + * @protected * @param {Number} value The pan value, between -1 (left) and 1 (right). * @return {AbstractSoundInstance} Returns reference to itself for chaining calls */ - p.setPan = function (value) { + p._setPan = function (value) { if(value == this._pan) { return this; } this._pan = Math.max(-1, Math.min(1, value)); this._updatePan(); @@ -519,24 +506,22 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/pan:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getPan + * Please use {{#crossLink "AbstractSoundInstance/pan:property"}}{{/crossLink}} directly as a property + * @method _getPan + * @protected * @return {Number} The value of the pan, between -1 (left) and 1 (right). */ - p.getPan = function () { + p._getPan = function () { return this._pan; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/position:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getPosition + * Please use {{#crossLink "AbstractSoundInstance/position:property"}}{{/crossLink}} directly as a property + * @method _getPosition + * @protected * @return {Number} The position of the playhead in the sound, in milliseconds. */ - p.getPosition = function () { + p._getPosition = function () { if (!this._paused && this.playState == createjs.Sound.PLAY_SUCCEEDED) { this._position = this._calculateCurrentPosition(); } @@ -544,14 +529,13 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/position:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPosition + * Please use {{#crossLink "AbstractSoundInstance/position:property"}}{{/crossLink}} directly as a property + * @method _setPosition + * @protected * @param {Number} value The position to place the playhead, in milliseconds. * @return {AbstractSoundInstance} Returns reference to itself for chaining calls */ - p.setPosition = function (value) { + p._setPosition = function (value) { this._position = Math.max(0, value); if (this.playState == createjs.Sound.PLAY_SUCCEEDED) { this._updatePosition(); @@ -560,25 +544,23 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/startTime:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getStartTime + * Please use {{#crossLink "AbstractSoundInstance/startTime:property"}}{{/crossLink}} directly as a property + * @method _getStartTime + * @protected * @return {Number} The startTime of the sound instance in milliseconds. */ - p.getStartTime = function () { + p._getStartTime = function () { return this._startTime; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/startTime:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setStartTime + * Please use {{#crossLink "AbstractSoundInstance/startTime:property"}}{{/crossLink}} directly as a property + * @method _setStartTime + * @protected * @param {number} value The new startTime time in milli seconds. * @return {AbstractSoundInstance} Returns reference to itself for chaining calls */ - p.setStartTime = function (value) { + p._setStartTime = function (value) { if (value == this._startTime) { return this; } this._startTime = Math.max(0, value || 0); this._updateStartTime(); @@ -586,26 +568,24 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/duration:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getDuration + * Please use {{#crossLink "AbstractSoundInstance/duration:property"}}{{/crossLink}} directly as a property + * @method _getDuration + * @protected * @return {Number} The duration of the sound instance in milliseconds. */ - p.getDuration = function () { + p._getDuration = function () { return this._duration; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/duration:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setDuration + * Please use {{#crossLink "AbstractSoundInstance/duration:property"}}{{/crossLink}} directly as a property + * @method _setDuration + * @protected * @param {number} value The new duration time in milli seconds. * @return {AbstractSoundInstance} Returns reference to itself for chaining calls * @since 0.6.0 */ - p.setDuration = function (value) { + p._setDuration = function (value) { if (value == this._duration) { return this; } this._duration = Math.max(0, value || 0); this._updateDuration(); @@ -613,54 +593,50 @@ this.createjs = this.createjs || {}; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/playbackResource:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPlayback + * Please use {{#crossLink "AbstractSoundInstance/playbackResource:property"}}{{/crossLink}} directly as a property + * @method _setPlaybackResource + * @protected * @param {Object} value The new playback resource. * @return {AbstractSoundInstance} Returns reference to itself for chaining calls * @since 0.6.0 **/ - p.setPlaybackResource = function (value) { + p._setPlaybackResource = function (value) { this._playbackResource = value; - if (this._duration == 0) { this._setDurationFromSource(); } + if (this._duration == 0 && this._playbackResource) { this._setDurationFromSource(); } return this; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/playbackResource:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method setPlayback + * Please use {{#crossLink "AbstractSoundInstance/playbackResource:property"}}{{/crossLink}} directly as a property + * @method _getPlaybackResource + * @protected * @param {Object} value The new playback resource. * @return {Object} playback resource used for playing audio * @since 0.6.0 **/ - p.getPlaybackResource = function () { + p._getPlaybackResource = function () { return this._playbackResource; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/loop:property"}}{{/crossLink}} directly as a property - * - * @deprecated - * @method getLoop + * Please use {{#crossLink "AbstractSoundInstance/loop:property"}}{{/crossLink}} directly as a property + * @method _getLoop + * @protected * @return {number} * @since 0.6.0 **/ - p.getLoop = function () { + p._getLoop = function () { return this._loop; }; /** - * DEPRECATED, please use {{#crossLink "AbstractSoundInstance/loop:property"}}{{/crossLink}} directly as a property, - * - * @deprecated - * @method setLoop + * Please use {{#crossLink "AbstractSoundInstance/loop:property"}}{{/crossLink}} directly as a property + * @method _setLoop + * @protected * @param {number} value The number of times to loop after play. * @since 0.6.0 */ - p.setLoop = function (value) { + p._setLoop = function (value) { if(this._playbackResource != null) { // remove looping if (this._loop != 0 && value == 0) { @@ -721,13 +697,13 @@ this.createjs = this.createjs || {}; */ // OJR FlashAudioSoundInstance overwrites p._beginPlaying = function (playProps) { - this.setPosition(playProps.offset); - this.setLoop(playProps.loop); - this.setVolume(playProps.volume); - this.setPan(playProps.pan); + this._setPosition(playProps.offset); + this._setLoop(playProps.loop); + this._setVolume(playProps.volume); + this._setPan(playProps.pan); if (playProps.startTime != null) { - this.setStartTime(playProps.startTime); - this.setDuration(playProps.duration); + this._setStartTime(playProps.startTime); + this._setDuration(playProps.duration); } if (this._playbackResource != null && this._position < this._duration) { diff --git a/src/soundjs/Sound.js b/src/soundjs/Sound.js index 9e106b68..211f94be 100644 --- a/src/soundjs/Sound.js +++ b/src/soundjs/Sound.js @@ -384,7 +384,7 @@ this.createjs = this.createjs || {}; * @property FILE_PATTERN * @type {RegExp} * @static - * @protected + * @private */ s.FILE_PATTERN = /^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/; @@ -442,36 +442,76 @@ this.createjs = this.createjs || {}; // class getter / setter properties + /** * Set the master volume of Sound. The master volume is multiplied against each sound's individual volume. For * example, if master volume is 0.5 and a sound's volume is 0.5, the resulting volume is 0.25. To set individual - * sound volume, use AbstractSoundInstance {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} instead. + * sound volume, use AbstractSoundInstance {{#crossLink "AbstractSoundInstance/volume:property"}}{{/crossLink}} + * instead. * *

    Example

    * * createjs.Sound.volume = 0.5; * - * * @property volume * @type {Number} * @default 1 + * @static * @since 0.6.1 */ + + /** + * The internal volume level. Use {{#crossLink "Sound/volume:property"}}{{/crossLink}} to adjust the master volume. + * @property _masterVolume + * @type {number} + * @default 1 + * @private + */ s._masterVolume = 1; - Object.defineProperty(s, "volume", { - get: function () {return this._masterVolume;}, - set: function (value) { - if (Number(value) == null) {return false;} - value = Math.max(0, Math.min(1, value)); - s._masterVolume = value; - if (!this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(value)) { - var instances = this._instances; - for (var i = 0, l = instances.length; i < l; i++) { - instances[i].setMasterVolume(value); - } - } + + /** + * Use the {{#crossLink "Sound/volume:property"}}{{/crossLink}} property instead. + * @method _getMasterVolume + * @private + * @static + * @return {Number} + **/ + s._getMasterVolume = function() { + return this._masterVolume; + }; + + /** + * Use the {{#crossLink "Sound/volume:property"}}{{/crossLink}} property instead. + * @method getMasterVolume + * @deprecated + */ + // Sound.getMasterVolume is @deprecated. Remove for 1.1+ + s.getVolume = createjs.deprecate(s._getMasterVolume, "Sound.getVolume"); + /** + * Use the {{#crossLink "Sound/volume:property"}}{{/crossLink}} property instead. + * @method _setMasterVolume + * @static + * @private + **/ + s._setMasterVolume = function(value) { + if (Number(value) == null) { return; } + value = Math.max(0, Math.min(1, value)); + s._masterVolume = value; + if (!this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(value)) { + var instances = this._instances; + for (var i = 0, l = instances.length; i < l; i++) { + instances[i].setMasterVolume(value); } - }); + } + }; + + /** + * Use the {{#crossLink "Sound/volume:property"}}{{/crossLink}} property instead. + * @method setVolume + * @deprecated + */ + // Sound.setVolume is @deprecated. Remove for 1.1+ + s.setVolume = createjs.deprecate(s._setMasterVolume, "Sound.setVolume"); /** * Mute/Unmute all audio. Note that muted audio still plays at 0 volume. This global mute value is maintained @@ -486,25 +526,55 @@ this.createjs = this.createjs || {}; * @property muted * @type {Boolean} * @default false + * @static * @since 0.6.1 */ s._masterMute = false; - // OJR references to the methods were not working, so the code had to be duplicated here - Object.defineProperty(s, "muted", { - get: function () {return this._masterMute;}, - set: function (value) { - if (value == null) {return false;} - - this._masterMute = value; - if (!this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(value)) { - var instances = this._instances; - for (var i = 0, l = instances.length; i < l; i++) { - instances[i].setMasterMute(value); - } - } - return true; + + /** + * Use the {{#crossLink "Sound/muted:property"}}{{/crossLink}} property instead. + * @method _getMute + * @returns {Boolean} + * @static + * @private + */ + s._getMute = function () { + return this._masterMute; + }; + + /** + * Use the {{#crossLink "Sound/muted:property"}}{{/crossLink}} property instead. + * @method getMute + * @deprecated + */ + // Sound.getMute is @deprecated. Remove for 1.1+ + s.getMute = createjs.deprecate(s._getMute, "Sound.getMute"); + + /** + * Use the {{#crossLink "Sound/muted:property"}}{{/crossLink}} property instead. + * @method _setMute + * @param {Boolean} value The muted value + * @static + * @private + */ + s._setMute = function (value) { + if (value == null) { return; } + this._masterMute = value; + if (!this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(value)) { + var instances = this._instances; + for (var i = 0, l = instances.length; i < l; i++) { + instances[i].setMasterMute(value); } - }); + } + }; + + /** + * Use the {{#crossLink "Sound/muted:property"}}{{/crossLink}} property instead. + * @method setMute + * @deprecated + */ + // Sound.setMute is @deprecated. Remove for 1.1+ + s.setMute = createjs.deprecate(s._setMute, "Sound.setMute"); /** * Get the active plugins capabilities, which help determine if a plugin can be used in the current environment, @@ -540,25 +610,42 @@ this.createjs = this.createjs || {}; * @readOnly * @since 0.6.1 */ - Object.defineProperty(s, "capabilities", { - get: function () { - if (s.activePlugin == null) {return null;} - return s.activePlugin._capabilities; - }, - set: function (value) { return false;} + + /** + * Use the {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} property instead. + * @returns {null} + * @private + */ + s._getCapabilities = function() { + if (s.activePlugin == null) { return null; } + return s.activePlugin._capabilities; + }; + + /** + * Use the {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} property instead. + * @method getCapabilities + * @deprecated + */ + // Sound.getCapabilities is @deprecated. Remove for 1.1+ + s.getCapabilities = createjs.deprecate(s._getCapabilities, "Sound.getCapabilities"); + + Object.defineProperties(s, { + volume: { get: s._getMasterVolume, set: s._setMasterVolume }, + muted: { get: s._getMute, set: s._setMute }, + capabilities: { get: s._getCapabilities } }); // Class Private properties /** - * Determines if the plugins have been registered. If false, the first call to play() will instantiate the default + * Determines if the plugins have been registered. If false, the first call to {{#crossLink "play"}}{{/crossLink}} will instantiate the default * plugins ({{#crossLink "WebAudioPlugin"}}{{/crossLink}}, followed by {{#crossLink "HTMLAudioPlugin"}}{{/crossLink}}). * If plugins have been registered, but none are applicable, then sound playback will fail. * @property _pluginsRegistered * @type {Boolean} * @default false * @static - * @protected + * @private */ s._pluginsRegistered = false; @@ -567,19 +654,19 @@ this.createjs = this.createjs || {}; * @property _lastID * @type {Number} * @static - * @protected + * @private */ s._lastID = 0; /** * An array containing all currently playing instances. This allows Sound to control the volume, mute, and playback of - * all instances when using static APIs like {{#crossLink "Sound/stop"}}{{/crossLink}} and {{#crossLink "Sound/setVolume"}}{{/crossLink}}. + * all instances when using static APIs like {{#crossLink "Sound/stop"}}{{/crossLink}} and {{#crossLink "Sound/volume:property"}}{{/crossLink}}. * When an instance has finished playback, it gets removed via the {{#crossLink "Sound/finishedPlaying"}}{{/crossLink}} * method. If the user replays an instance, it gets added back in via the {{#crossLink "Sound/_beginPlaying"}}{{/crossLink}} * method. * @property _instances * @type {Array} - * @protected + * @private * @static */ s._instances = []; @@ -588,7 +675,7 @@ this.createjs = this.createjs || {}; * An object hash storing objects with sound sources, startTime, and duration via there corresponding ID. * @property _idHash * @type {Object} - * @protected + * @private * @static */ s._idHash = {}; @@ -599,7 +686,7 @@ this.createjs = this.createjs || {}; * and data. * @property _preloadHash * @type {Object} - * @protected + * @private * @static */ s._preloadHash = {}; @@ -609,7 +696,7 @@ this.createjs = this.createjs || {}; * {{#crossLink "Sound/registerSound"}}{{/crossLink}} and {{#crossLink "Sound/registerSounds"}}{{/crossLink}}. * @property _defaultPlayPropsHash * @type {Object} - * @protected + * @private * @static * @since 0.6.1 */ @@ -666,7 +753,7 @@ this.createjs = this.createjs || {}; *
  • types: A list of file types that are supported by Sound (currently supports "sound").
  • *
  • extensions: A list of file extensions that are supported by Sound (see {{#crossLink "Sound/SUPPORTED_EXTENSIONS:property"}}{{/crossLink}}).
  • * @static - * @protected + * @private */ s.getPreloadHandlers = function () { return { @@ -680,7 +767,7 @@ this.createjs = this.createjs || {}; * Used to dispatch fileload events from internal loading. * @method _handleLoadComplete * @param event A loader event. - * @protected + * @private * @static * @since 0.6.0 */ @@ -707,7 +794,7 @@ this.createjs = this.createjs || {}; /** * Used to dispatch error events from internal preloading. * @param event - * @protected + * @private * @since 0.6.0 * @static */ @@ -812,44 +899,17 @@ this.createjs = this.createjs || {}; return (s.activePlugin != null); }; - /** - * Deprecated, please use {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} instead. - * - * @method getCapabilities - * @return {Object} An object containing the capabilities of the active plugin. - * @static - * @deprecated - */ - s.getCapabilities = function () { - if (s.activePlugin == null) {return null;} - return s.activePlugin._capabilities; - }; - - /** - * Deprecated, please use {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} instead. - * - * @method getCapability - * @param {String} key The capability to retrieve - * @return {Number|Boolean} The value of the capability. - * @static - * @see getCapabilities - * @deprecated - */ - s.getCapability = function (key) { - if (s.activePlugin == null) {return null;} - return s.activePlugin._capabilities[key]; - }; - /** * Process manifest items from PreloadJS. This method is intended * for usage by a plugin, and not for direct interaction. * @method initLoad * @param {Object} src The object to load. * @return {Object|AbstractLoader} An instance of AbstractLoader. - * @protected + * @private * @static */ s.initLoad = function (loadItem) { + if (loadItem.type == "video") { return true; } // Don't handle video. PreloadJS's plugin model is really aggressive. return s._registerSound(loadItem); }; @@ -972,8 +1032,8 @@ this.createjs = this.createjs || {}; s._preloadHash[loadItem.src].push(loadItem); if (s._preloadHash[loadItem.src].length == 1) { // OJR note this will disallow reloading a sound if loading fails or the source changes - loader.on("complete", createjs.proxy(this._handleLoadComplete, this)); - loader.on("error", createjs.proxy(this._handleLoadError, this)); + loader.on("complete", this._handleLoadComplete, this); + loader.on("error", this._handleLoadError, this); s.activePlugin.preload(loader); } else { if (s._preloadHash[loadItem.src][0] == true) {return true;} @@ -1181,7 +1241,7 @@ this.createjs = this.createjs || {}; * @param {String} value The path to an audio source. * @return {Object} A formatted object that can be registered with the {{#crossLink "Sound/activePlugin:property"}}{{/crossLink}} * and returned to a preloader like PreloadJS. - * @protected + * @private * @static */ s._parsePath = function (value) { @@ -1211,7 +1271,7 @@ this.createjs = this.createjs || {}; * @param {Object} value The paths to an audio source, indexed by extension type. * @return {Object} A formatted object that can be registered with the {{#crossLink "Sound/activePlugin:property"}}{{/crossLink}} * and returned to a preloader like PreloadJS. - * @protected + * @private * @static */ s._parseSrc = function (value) { @@ -1241,11 +1301,12 @@ this.createjs = this.createjs || {}; Static API. --------------- */ /** - * Play a sound and get a {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} to control. If the sound fails to play, a - * AbstractSoundInstance will still be returned, and have a playState of {{#crossLink "Sound/PLAY_FAILED:property"}}{{/crossLink}}. - * Note that even on sounds with failed playback, you may still be able to call AbstractSoundInstance {{#crossLink "AbstractSoundInstance/play"}}{{/crossLink}}, - * since the failure could be due to lack of available channels. If the src does not have a supported extension or - * if there is no available plugin, a default AbstractSoundInstance will be returned which will not play any audio, but will not generate errors. + * Play a sound and get a {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} to control. If the sound fails to + * play, an AbstractSoundInstance will still be returned, and have a playState of {{#crossLink "Sound/PLAY_FAILED:property"}}{{/crossLink}}. + * Note that even on sounds with failed playback, you may still be able to call the {{#crossLink "AbstractSoundInstance/play"}}{{/crossLink}}, + * method, since the failure could be due to lack of available channels. If the src does not have a supported + * extension or if there is no available plugin, a default AbstractSoundInstance will still be returned, which will + * not play any audio, but will not generate errors. * *

    Example

    * @@ -1257,40 +1318,19 @@ this.createjs = this.createjs || {}; * var myInstance = createjs.Sound.play("myID", {interrupt: createjs.Sound.INTERRUPT_ANY, loop:-1}); * } * - * NOTE to create an audio sprite that has not already been registered, both startTime and duration need to be set. + * NOTE: To create an audio sprite that has not already been registered, both startTime and duration need to be set. * This is only when creating a new audio sprite, not when playing using the id of an already registered audio sprite. * - * Parameters Deprecated
    - * The parameters for this method are deprecated in favor of a single parameter that is an Object or {{#crossLink "PlayPropsConfig"}}{{/crossLink}}. - * * @method play * @param {String} src The src or ID of the audio. - * @param {String | Object} [interrupt="none"|options] This parameter will be renamed playProps in the next release.
    - * This parameter can be an instance of {{#crossLink "PlayPropsConfig"}}{{/crossLink}} or an Object that contains any or all optional properties by name, - * including: interrupt, delay, offset, loop, volume, pan, startTime, and duration (see the above code sample). - *
    OR
    - * Deprecated How to interrupt any currently playing instances of audio with the same source, - * if the maximum number of instances of the sound are already playing. Values are defined as INTERRUPT_TYPE - * constants on the Sound class, with the default defined by {{#crossLink "Sound/defaultInterruptBehavior:property"}}{{/crossLink}}. - * @param {Number} [delay=0] Deprecated The amount of time to delay the start of audio playback, in milliseconds. - * @param {Number} [offset=0] Deprecated The offset from the start of the audio to begin playback, in milliseconds. - * @param {Number} [loop=0] Deprecated How many times the audio loops when it reaches the end of playback. The default is 0 (no - * loops), and -1 can be used for infinite playback. - * @param {Number} [volume=1] Deprecated The volume of the sound, between 0 and 1. Note that the master volume is applied - * against the individual volume. - * @param {Number} [pan=0] Deprecated The left-right pan of the sound (if supported), between -1 (left) and 1 (right). - * @param {Number} [startTime=null] Deprecated To create an audio sprite (with duration), the initial offset to start playback and loop from, in milliseconds. - * @param {Number} [duration=null] Deprecated To create an audio sprite (with startTime), the amount of time to play the clip for, in milliseconds. - * @return {AbstractSoundInstance} A {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} that can be controlled after it is created. + * @param {Object | PlayPropsConfig} props A PlayPropsConfig instance, or an object that contains the parameters to + * play a sound. See the {{#crossLink "PlayPropsConfig"}}{{/crossLink}} for more info. + * @return {AbstractSoundInstance} A {{#crossLink "AbstractSoundInstance"}}{{/crossLink}} that can be controlled + * after it is created. * @static */ - s.play = function (src, interrupt, delay, offset, loop, volume, pan, startTime, duration) { - var playProps; - if (interrupt instanceof Object || interrupt instanceof createjs.PlayPropsConfig) { - playProps = createjs.PlayPropsConfig.create(interrupt); - } else { - playProps = createjs.PlayPropsConfig.create({interrupt:interrupt, delay:delay, offset:offset, loop:loop, volume:volume, pan:pan, startTime:startTime, duration:duration}); - } + s.play = function (src, props) { + var playProps = createjs.PlayPropsConfig.create(props); var instance = s.createInstance(src, playProps.startTime, playProps.duration); var ok = s._playInstance(instance, playProps); if (!ok) {instance._playFailed();} @@ -1326,7 +1366,7 @@ this.createjs = this.createjs || {}; * @static */ s.createInstance = function (src, startTime, duration) { - if (!s.initializeDefaultPlugins()) {return new createjs.DefaultSoundInstance(src, startTime, duration);} + if (!s.initializeDefaultPlugins()) { return new createjs.DefaultSoundInstance(src, startTime, duration); } var defaultPlayProps = s._defaultPlayPropsHash[src]; // for audio sprites, which create and store defaults by id src = s._getSrcById(src); @@ -1336,11 +1376,11 @@ this.createjs = this.createjs || {}; var instance = null; if (details != null && details.src != null) { SoundChannel.create(details.src); - if (startTime == null) {startTime = src.startTime;} + if (startTime == null) { startTime = src.startTime; } instance = s.activePlugin.create(details.src, startTime, duration || src.duration); defaultPlayProps = defaultPlayProps || s._defaultPlayPropsHash[details.src]; - if(defaultPlayProps) { + if (defaultPlayProps) { instance.applyPlayProps(defaultPlayProps); } } else { @@ -1370,74 +1410,6 @@ this.createjs = this.createjs || {}; } }; - /** - * Deprecated, please use {{#crossLink "Sound/volume:property"}}{{/crossLink}} instead. - * - * @method setVolume - * @param {Number} value The master volume value. The acceptable range is 0-1. - * @static - * @deprecated - */ - s.setVolume = function (value) { - if (Number(value) == null) {return false;} - value = Math.max(0, Math.min(1, value)); - s._masterVolume = value; - if (!this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(value)) { - var instances = this._instances; - for (var i = 0, l = instances.length; i < l; i++) { - instances[i].setMasterVolume(value); - } - } - }; - - /** - * Deprecated, please use {{#crossLink "Sound/volume:property"}}{{/crossLink}} instead. - * - * @method getVolume - * @return {Number} The master volume, in a range of 0-1. - * @static - * @deprecated - */ - s.getVolume = function () { - return this._masterVolume; - }; - - /** - * Deprecated, please use {{#crossLink "Sound/muted:property"}}{{/crossLink}} instead. - * - * @method setMute - * @param {Boolean} value Whether the audio should be muted or not. - * @return {Boolean} If the mute was set. - * @static - * @since 0.4.0 - * @deprecated - */ - s.setMute = function (value) { - if (value == null) {return false;} - - this._masterMute = value; - if (!this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(value)) { - var instances = this._instances; - for (var i = 0, l = instances.length; i < l; i++) { - instances[i].setMasterMute(value); - } - } - return true; - }; - - /** - * Deprecated, please use {{#crossLink "Sound/muted:property"}}{{/crossLink}} instead. - * - * @method getMute - * @return {Boolean} The mute value of Sound. - * @static - * @since 0.4.0 - * @deprecated - */ - s.getMute = function () { - return this._masterMute; - }; - /** * Set the default playback properties for all new SoundInstances of the passed in src or ID. * See {{#crossLink "PlayPropsConfig"}}{{/crossLink}} for available properties. @@ -1478,14 +1450,14 @@ this.createjs = this.createjs || {}; * @param {PlayPropsConfig} playProps A PlayPropsConfig object. * @return {Boolean} If the sound can start playing. Sounds that fail immediately will return false. Sounds that * have a delay will return true, but may still fail to play. - * @protected + * @private * @static */ s._playInstance = function (instance, playProps) { var defaultPlayProps = s._defaultPlayPropsHash[instance.src] || {}; if (playProps.interrupt == null) {playProps.interrupt = defaultPlayProps.interrupt || s.defaultInterruptBehavior}; if (playProps.delay == null) {playProps.delay = defaultPlayProps.delay || 0;} - if (playProps.offset == null) {playProps.offset = instance.getPosition();} + if (playProps.offset == null) {playProps.offset = instance.position;} if (playProps.loop == null) {playProps.loop = instance.loop;} if (playProps.volume == null) {playProps.volume = instance.volume;} if (playProps.pan == null) {playProps.pan = instance.pan;} @@ -1514,7 +1486,7 @@ this.createjs = this.createjs || {}; * @param {PlayPropsConfig} playProps A PlayPropsConfig object. * @return {Boolean} If the sound can start playing. If there are no available channels, or the instance fails to * start, this will return false. - * @protected + * @private * @static */ s._beginPlaying = function (instance, playProps) { @@ -1536,7 +1508,7 @@ this.createjs = this.createjs || {}; * @method _getSrcById * @param {String} value The ID the sound was registered with. * @return {String} The source of the sound if it has been registered with this ID or the value that was passed in. - * @protected + * @private * @static */ s._getSrcById = function (value) { @@ -1549,7 +1521,7 @@ this.createjs = this.createjs || {}; * instances themselves. * @method _playFinished * @param {AbstractSoundInstance} instance The instance that finished playback. - * @protected + * @private * @static */ s._playFinished = function (instance) { @@ -1680,20 +1652,6 @@ this.createjs = this.createjs || {}; var p = SoundChannel.prototype; p.constructor = SoundChannel; - /** - * REMOVED. Removed in favor of using `MySuperClass_constructor`. - * See {{#crossLink "Utility Methods/extend"}}{{/crossLink}} and {{#crossLink "Utility Methods/promote"}}{{/crossLink}} - * for details. - * - * There is an inheritance tutorial distributed with EaselJS in /tutorials/Inheritance. - * - * @method initialize - * @protected - * @deprecated - */ - // p.initialize = function() {}; // searchable for devs wondering where it is. - - /** * The source of the channel. * #property src @@ -1827,8 +1785,8 @@ this.createjs = this.createjs || {}; } // Audio is a better candidate than the current target, according to playhead - if ((interrupt == Sound.INTERRUPT_EARLY && target.getPosition() < replacement.getPosition()) || - (interrupt == Sound.INTERRUPT_LATE && target.getPosition() > replacement.getPosition())) { + if ((interrupt == Sound.INTERRUPT_EARLY && target.position < replacement.position) || + (interrupt == Sound.INTERRUPT_LATE && target.position > replacement.position)) { replacement = target; } } diff --git a/src/soundjs/cordovaaudio/CordovaAudioLoader.js b/src/soundjs/cordovaaudio/CordovaAudioLoader.js index 2f03a75f..d7a632a2 100644 --- a/src/soundjs/cordovaaudio/CordovaAudioLoader.js +++ b/src/soundjs/cordovaaudio/CordovaAudioLoader.js @@ -49,7 +49,7 @@ this.createjs = this.createjs || {}; * @protected */ function Loader(loadItem) { - this.AbstractLoader_constructor(loadItem, true, createjs.AbstractLoader.SOUND); + this.AbstractLoader_constructor(loadItem, true, createjs.Types.SOUND); /** * A Media object used to determine if src exists and to get duration diff --git a/src/soundjs/cordovaaudio/CordovaAudioPlugin.js b/src/soundjs/cordovaaudio/CordovaAudioPlugin.js index be6cbc0d..d9b3f8c0 100644 --- a/src/soundjs/cordovaaudio/CordovaAudioPlugin.js +++ b/src/soundjs/cordovaaudio/CordovaAudioPlugin.js @@ -89,11 +89,11 @@ this.createjs = this.createjs || {}; /** * The capabilities of the plugin. This is generated via the {{#crossLink "CordovaAudioPlugin/_generateCapabilities"}}{{/crossLink}} - * method. Please see the Sound {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} method for an overview of all + * method. Please see the Sound {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} method for an overview of all * of the available properties. * @property _capabilities * @type {Object} - * @protected + * @private * @static */ s._capabilities = null; @@ -113,11 +113,11 @@ this.createjs = this.createjs || {}; }; /** - * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} + * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} * method for an overview of plugin capabilities. * @method _generateCapabilities * @static - * @protected + * @private */ s._generateCapabilities = function () { if (s._capabilities != null || !(window.cordova || window.PhoneGap || window.phonegap) || !window.Media) {return;} diff --git a/src/soundjs/data/PlayPropsConfig.js b/src/soundjs/data/PlayPropsConfig.js index 237e7fb7..a55ef25e 100644 --- a/src/soundjs/data/PlayPropsConfig.js +++ b/src/soundjs/data/PlayPropsConfig.js @@ -58,9 +58,10 @@ this.createjs = this.createjs || {}; * *

    Example

    * - * var ppc = new createjs.PlayPropsConfig().set({interrupt: createjs.Sound.INTERRUPT_ANY, loop: -1, volume: 0.5}) - * createjs.Sound.play("mySound", ppc); - * mySoundInstance.play(ppc); + * var props = new createjs.PlayPropsConfig().set({interrupt: createjs.Sound.INTERRUPT_ANY, loop: -1, volume: 0.5}) + * createjs.Sound.play("mySound", props); + * // OR + * mySoundInstance.play(props); * * @class PlayPropsConfig * @constructor @@ -152,12 +153,14 @@ this.createjs = this.createjs || {}; * @static */ s.create = function (value) { - if (value instanceof s || value instanceof Object) { - var ppc = new createjs.PlayPropsConfig(); - ppc.set(value); - return ppc; - } else { - throw new Error("Type not recognized."); + if (typeof(value) === "string") { + // Handle the old API gracefully. + console && (console.warn || console.log)("Deprecated behaviour. Sound.play takes a configuration object instead of individual arguments. See docs for info."); + return new createjs.PlayPropsConfig().set({interrupt:value}); + } else if (value == null || value instanceof s || value instanceof Object) { + return new createjs.PlayPropsConfig().set(value); + } else if (value == null) { + throw new Error("PlayProps configuration not recognized."); } }; @@ -174,7 +177,9 @@ this.createjs = this.createjs || {}; * @return {PlayPropsConfig} Returns the instance the method is called on (useful for chaining calls.) */ p.set = function(props) { - for (var n in props) { this[n] = props[n]; } + if (props != null) { + for (var n in props) { this[n] = props[n]; } + } return this; }; diff --git a/src/soundjs/flashaudio/FlashAudioLoader.js b/src/soundjs/flashaudio/FlashAudioLoader.js index 0b096df9..b2c1a4c3 100644 --- a/src/soundjs/flashaudio/FlashAudioLoader.js +++ b/src/soundjs/flashaudio/FlashAudioLoader.js @@ -48,7 +48,7 @@ this.createjs = this.createjs || {}; * @protected */ function Loader(loadItem) { - this.AbstractLoader_constructor(loadItem, false, createjs.AbstractLoader.SOUND); + this.AbstractLoader_constructor(loadItem, false, createjs.Types.SOUND); // Public properties @@ -63,17 +63,13 @@ this.createjs = this.createjs || {}; } var p = createjs.extend(Loader, createjs.AbstractLoader); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static Properties var s = Loader; /** * A reference to the Flash instance that gets created. * @property flash * @type {Object | Embed} - * @protected + * @private */ s._flash = null; @@ -81,7 +77,7 @@ this.createjs = this.createjs || {}; * A list of loader instances that tried to load before _flash was set * @property _preloadInstances * @type {Array} - * @protected + * @private */ s._preloadInstances = []; diff --git a/src/soundjs/flashaudio/FlashAudioPlugin.js b/src/soundjs/flashaudio/FlashAudioPlugin.js index 85582f3b..77aca3a6 100644 --- a/src/soundjs/flashaudio/FlashAudioPlugin.js +++ b/src/soundjs/flashaudio/FlashAudioPlugin.js @@ -176,10 +176,6 @@ this.createjs = this.createjs || {}; var p = createjs.extend(FlashAudioPlugin, createjs.AbstractPlugin); var s = FlashAudioPlugin; - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static properties /** * Event constant for the "registerFlashID" event for cleaner code. @@ -187,7 +183,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default registerflashid * @static - * @protected + * @private */ s._REG_FLASHID = "registerflashid"; @@ -197,17 +193,17 @@ this.createjs = this.createjs || {}; * @type {String} * @default unregisterflashid * @static - * @protected + * @private */ s._UNREG_FLASHID = "unregisterflashid"; /** * The capabilities of the plugin. This is generated via the {{#crossLink "WebAudioPlugin/_generateCapabilities"}}{{/crossLink}} - * method. Please see the Sound {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} method for a list of available + * method. Please see the Sound {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} method for a list of available * capabilities. * @property _capabilities * @type {Object} - * @protected + * @private * @static */ s._capabilities = null; @@ -240,11 +236,11 @@ this.createjs = this.createjs || {}; }; /** - * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} + * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} * method for an overview of plugin capabilities. * @method _generateCapabilities * @static - * @protected + * @private */ s._generateCapabilities = function () { if (s._capabilities != null) {return;} diff --git a/src/soundjs/flashaudio/FlashAudioSoundInstance.js b/src/soundjs/flashaudio/FlashAudioSoundInstance.js index 074793ae..13bbcfb6 100644 --- a/src/soundjs/flashaudio/FlashAudioSoundInstance.js +++ b/src/soundjs/flashaudio/FlashAudioSoundInstance.js @@ -68,10 +68,6 @@ this.createjs = this.createjs || {}; }; var p = createjs.extend(FlashAudioSoundInstance, createjs.AbstractSoundInstance); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static Propeties var s = FlashAudioSoundInstance; /** @@ -149,13 +145,13 @@ this.createjs = this.createjs || {}; p._beginPlaying = function (playProps) { if (s._flash == null) { return false; } - this.setPosition(playProps.offset); - this.setLoop(playProps.loop); - this.setVolume(playProps.volume); - this.setPan(playProps.pan); + this.position = playProps.offset; + this.loop = playProps.loop; + this.volume = playProps.volume; + this.pan = playProps.pan; if (playProps.startTime != null) { - this.setStartTime(playProps.startTime); - this.setDuration(playProps.duration); + this.startTime = playProps.startTime; + this.duration = playProps.duration; } this._paused = false; diff --git a/src/soundjs/htmlaudio/HTMLAudioPlugin.js b/src/soundjs/htmlaudio/HTMLAudioPlugin.js index 14b70d01..7dab17be 100644 --- a/src/soundjs/htmlaudio/HTMLAudioPlugin.js +++ b/src/soundjs/htmlaudio/HTMLAudioPlugin.js @@ -93,18 +93,6 @@ this.createjs = this.createjs || {}; // Public Properties - /** - * This is no longer needed as we are now using object pooling for tags. - * - * NOTE this property only exists as a limitation of HTML audio. - * @property defaultNumChannels - * @type {Number} - * @default 2 - * @since 0.4.0 - * @deprecated - */ - this.defaultNumChannels = 2; - this._capabilities = s._capabilities; this._loaderClass = createjs.SoundLoader; @@ -114,10 +102,6 @@ this.createjs = this.createjs || {}; var p = createjs.extend(HTMLAudioPlugin, createjs.AbstractPlugin); var s = HTMLAudioPlugin; - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static Properties /** * The maximum number of instances that can be loaded or played. This is a browser limitation, primarily limited to IE9. @@ -136,7 +120,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default canplaythrough * @static - * @protected + * @private */ s._AUDIO_READY = "canplaythrough"; @@ -146,7 +130,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default ended * @static - * @protected + * @private */ s._AUDIO_ENDED = "ended"; @@ -156,7 +140,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default seeked * @static - * @protected + * @private */ s._AUDIO_SEEKED = "seeked"; @@ -166,7 +150,7 @@ this.createjs = this.createjs || {}; * @type {String} * @default stalled * @static - * @protected + * @private */ s._AUDIO_STALLED = "stalled"; @@ -177,17 +161,17 @@ this.createjs = this.createjs || {}; * @type {String} * @default timeupdate * @static - * @protected + * @private */ s._TIME_UPDATE = "timeupdate"; /** * The capabilities of the plugin. This is generated via the {{#crossLink "HTMLAudioPlugin/_generateCapabilities"}}{{/crossLink}} - * method. Please see the Sound {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} method for an overview of all + * method. Please see the Sound {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} method for an overview of all * of the available properties. * @property _capabilities * @type {Object} - * @protected + * @private * @static */ s._capabilities = null; @@ -207,11 +191,11 @@ this.createjs = this.createjs || {}; }; /** - * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} + * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} * method for an overview of plugin capabilities. * @method _generateCapabilities * @static - * @protected + * @private */ s._generateCapabilities = function () { if (s._capabilities != null) {return;} @@ -251,7 +235,7 @@ this.createjs = this.createjs || {}; p.create = function (src, startTime, duration) { var si = this.AbstractPlugin_create(src, startTime, duration); - si.setPlaybackResource(null); + si.playbackResource = null; return si; }; diff --git a/src/soundjs/htmlaudio/HTMLAudioSoundInstance.js b/src/soundjs/htmlaudio/HTMLAudioSoundInstance.js index 1e0d582d..79d669a0 100644 --- a/src/soundjs/htmlaudio/HTMLAudioSoundInstance.js +++ b/src/soundjs/htmlaudio/HTMLAudioSoundInstance.js @@ -72,10 +72,6 @@ this.createjs = this.createjs || {}; } var p = createjs.extend(HTMLAudioSoundInstance, createjs.AbstractSoundInstance); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Public Methods /** * Called by {{#crossLink "Sound"}}{{/crossLink}} when plugin does not handle master volume. diff --git a/src/soundjs/htmlaudio/HTMLAudioTagPool.js b/src/soundjs/htmlaudio/HTMLAudioTagPool.js index fed8442e..fdf63dfa 100644 --- a/src/soundjs/htmlaudio/HTMLAudioTagPool.js +++ b/src/soundjs/htmlaudio/HTMLAudioTagPool.js @@ -55,7 +55,7 @@ this.createjs = this.createjs || {}; * @property _tags * @type {{}} * @static - * @protected + * @private */ s._tags = {}; @@ -64,7 +64,7 @@ this.createjs = this.createjs || {}; * @property _tagPool * @type {TagPool} * @static - * @protected + * @private */ s._tagPool = new TagPool(); @@ -72,7 +72,7 @@ this.createjs = this.createjs || {}; * A hash lookup of if a base audio tag is available, indexed by the audio source * @property _tagsUsed * @type {{}} - * @protected + * @private * @static */ s._tagUsed = {}; diff --git a/src/soundjs/webaudio/WebAudioLoader.js b/src/soundjs/webaudio/WebAudioLoader.js index a0ca2602..df80eaa7 100644 --- a/src/soundjs/webaudio/WebAudioLoader.js +++ b/src/soundjs/webaudio/WebAudioLoader.js @@ -47,15 +47,11 @@ this.createjs = this.createjs || {}; * @protected */ function Loader(loadItem) { - this.AbstractLoader_constructor(loadItem, true, createjs.AbstractLoader.SOUND); + this.AbstractLoader_constructor(loadItem, true, createjs.Types.SOUND); }; var p = createjs.extend(Loader, createjs.AbstractLoader); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - /** * web audio context required for decoding audio * @property context diff --git a/src/soundjs/webaudio/WebAudioPlugin.js b/src/soundjs/webaudio/WebAudioPlugin.js index cce8c667..4c65ff4d 100644 --- a/src/soundjs/webaudio/WebAudioPlugin.js +++ b/src/soundjs/webaudio/WebAudioPlugin.js @@ -126,10 +126,6 @@ this.createjs = this.createjs || {}; } var p = createjs.extend(WebAudioPlugin, createjs.AbstractPlugin); - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - // Static Properties var s = WebAudioPlugin; /** @@ -138,7 +134,7 @@ this.createjs = this.createjs || {}; * @property _capabilities * @type {Object} * @default null - * @protected + * @private * @static */ s._capabilities = null; @@ -147,7 +143,7 @@ this.createjs = this.createjs || {}; * Value to set panning model to equal power for WebAudioSoundInstance. Can be "equalpower" or 0 depending on browser implementation. * @property _panningModel * @type {Number / String} - * @protected + * @private * @static */ s._panningModel = "equalpower"; @@ -174,7 +170,7 @@ this.createjs = this.createjs || {}; * * @property _scratchBuffer * @type {AudioBuffer} - * @protected + * @private * @static */ s._scratchBuffer = null; @@ -189,6 +185,14 @@ this.createjs = this.createjs || {}; */ s._unlocked = false; + /** + * The default sample rate used when checking for iOS compatibility. See {{#crossLink "WebAudioPlugin/_createAudioContext"}}{{/crossLink}}. + * @property DEFAULT_SAMPLE_REATE + * @type {number} + * @default 44100 + * @static + */ + s.DEFAULT_SAMPLE_RATE = 44100; // Static Public Methods /** @@ -238,40 +242,51 @@ this.createjs = this.createjs || {}; * @method _isFileXHRSupported * @return {Boolean} If XHR is supported. * @since 0.4.2 - * @protected + * @private * @static */ s._isFileXHRSupported = function() { - // it's much easier to detect when something goes wrong, so let's start optimistically - var supported = true; - - var xhr = new XMLHttpRequest(); - try { - xhr.open("GET", "WebAudioPluginTest.fail", false); // loading non-existant file triggers 404 only if it could load (synchronous call) - } catch (error) { - // catch errors in cases where the onerror is passed by - supported = false; - return supported; - } - xhr.onerror = function() { supported = false; }; // cause irrelevant - // with security turned off, we can get empty success results, which is actually a failed read (status code 0?) - xhr.onload = function() { supported = this.status == 404 || (this.status == 200 || (this.status == 0 && this.response != "")); }; - try { - xhr.send(); - } catch (error) { - // catch errors in cases where the onerror is passed by - supported = false; - } + + // CHANGE - Dan Zen 3/27/21 + // The commented code was giving error locally finding test file + // XHR is supported as far as I can tell in all browsers now + // The line below will turn it off for local files as that is what the commented test seemed to do + // but not sure if this is needed + // maybe we can just set supported to true as that seems to work for sound - did not test, though + + var supported = document.location.host; + + // // it's much easier to detect when something goes wrong, so let's start optimistically + // var supported = true; + + // var xhr = new XMLHttpRequest(); + // xhr.onerror = function() { supported = false; }; // cause irrelevant + // // with security turned off, we can get empty success results, which is actually a failed read (status code 0?) + // xhr.onload = function() { supported = this.status == 404 || (this.status == 200 || (this.status == 0 && this.response != "")); }; + + // try { + // xhr.open("GET", "WebAudioPluginTest.fail", false); // loading non-existant file triggers 404 only if it could load (synchronous call) + // } catch (error) { + // // catch errors in cases where the onerror is passed by + // supported = false; + // return supported; + // } + // try { + // xhr.send(); + // } catch (error) { + // // catch errors in cases where the onerror is passed by + // supported = true; + // } return supported; }; /** - * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/getCapabilities"}}{{/crossLink}} + * Determine the capabilities of the plugin. Used internally. Please see the Sound API {{#crossLink "Sound/capabilities:property"}}{{/crossLink}} * method for an overview of plugin capabilities. * @method _generateCapabilities * @static - * @protected + * @private */ s._generateCapabilities = function () { if (s._capabilities != null) {return;} @@ -280,13 +295,8 @@ this.createjs = this.createjs || {}; if (t.canPlayType == null) {return null;} if (s.context == null) { - if (window.AudioContext) { - s.context = new AudioContext(); - } else if (window.webkitAudioContext) { - s.context = new webkitAudioContext(); - } else { - return null; - } + s.context = s._createAudioContext(); + if (s.context == null) { return null; } } if (s._scratchBuffer == null) { s._scratchBuffer = s.context.createBuffer(1, 1, 22050); @@ -298,10 +308,10 @@ this.createjs = this.createjs || {}; if ("ontouchstart" in window && s.context.state != "running") { s._unlock(); // When played inside of a touch event, this will enable audio on iOS immediately. document.addEventListener("mousedown", s._unlock, true); + document.addEventListener("touchstart", s._unlock, true); document.addEventListener("touchend", s._unlock, true); } - s._capabilities = { panning:true, volume:true, @@ -324,6 +334,44 @@ this.createjs = this.createjs || {}; } }; + /** + * Create an audio context for the sound. + * + * This method handles both vendor prefixes (specifically webkit support), as well as a case on iOS where + * audio played with a different sample rate may play garbled when first started. The default sample rate is + * 44,100, however it can be changed using the {{#crossLink "WebAudioPlugin/DEFAULT_SAMPLE_RATE:property"}}{{/crossLink}}. + * @method _createAudioContext + * @return {AudioContext | webkitAudioContext} + * @private + * @static + * @since 1.0.0 + */ + s._createAudioContext = function() { + // Slightly modified version of https://github.com/Jam3/ios-safe-audio-context + // Resolves issues with first-run contexts playing garbled on iOS. + var AudioCtor = (window.AudioContext || window.webkitAudioContext); + if (AudioCtor == null) { return null; } + var context = new AudioCtor(); + console.warn("The AudioContext is ready"); // Dan Zen 3/27/21 + + // Check if hack is necessary. Only occurs in iOS6+ devices + // and only when you first boot the iPhone, or play a audio/video + // with a different sample rate + if (/(iPhone|iPad)/i.test(navigator.userAgent) + && context.sampleRate !== s.DEFAULT_SAMPLE_RATE) { + var buffer = context.createBuffer(1, 1, s.DEFAULT_SAMPLE_RATE), + dummy = context.createBufferSource(); + dummy.buffer = buffer; + dummy.connect(context.destination); + dummy.start(0); + dummy.disconnect(); + context.close() // dispose old context + + context = new AudioCtor(); + } + return context; + } + /** * Set up compatibility if only deprecated web audio calls are supported. * See http://www.w3.org/TR/webaudio/#DeprecationNotes @@ -332,7 +380,7 @@ this.createjs = this.createjs || {}; * * @method _compatibilitySetUp * @static - * @protected + * @private * @since 0.4.2 */ s._compatibilitySetUp = function() { @@ -370,6 +418,7 @@ this.createjs = this.createjs || {}; if (s.context.state == "running") { document.removeEventListener("mousedown", s._unlock, true); document.removeEventListener("touchend", s._unlock, true); + document.removeEventListener("touchstart", s._unlock, true); s._unlocked = true; } }; diff --git a/src/soundjs/webaudio/WebAudioSoundInstance.js b/src/soundjs/webaudio/WebAudioSoundInstance.js index 888564b2..29d30b5d 100644 --- a/src/soundjs/webaudio/WebAudioSoundInstance.js +++ b/src/soundjs/webaudio/WebAudioSoundInstance.js @@ -130,10 +130,6 @@ this.createjs = this.createjs || {}; var p = createjs.extend(WebAudioSoundInstance, createjs.AbstractSoundInstance); var s = WebAudioSoundInstance; - // TODO: deprecated - // p.initialize = function() {}; // searchable for devs wondering where it is. REMOVED. See docs for details. - - /** * Note this is only intended for use by advanced users. *
    Audio context used to create nodes. This is and needs to be the same context used by {{#crossLink "WebAudioPlugin"}}{{/crossLink}}. @@ -220,7 +216,7 @@ this.createjs = this.createjs || {}; clearTimeout(this._soundCompleteTimeout); - this._playbackStartTime = 0; // This is used by getPosition + this._playbackStartTime = 0; // This is used by _getPosition }; /** @@ -237,7 +233,9 @@ this.createjs = this.createjs || {}; audioNode.disconnect(0); // necessary to prevent leak on iOS Safari 7-9. will throw in almost all other // browser implementations. - try { audioNode.buffer = s._scratchBuffer; } catch(e) {} + if ( createjs.BrowserDetect.isIOS ) { + try { audioNode.buffer = s._scratchBuffer; } catch(e) {} + } audioNode = null; } return audioNode; @@ -246,9 +244,8 @@ this.createjs = this.createjs || {}; p._handleSoundReady = function (event) { this.gainNode.connect(s.destinationNode); // this line can cause a memory leak. Nodes need to be disconnected from the audioDestination or any sequence that leads to it. - var dur = this._duration * 0.001; - var pos = this._position * 0.001; - if (pos > dur) {pos = dur;} + var dur = this._duration * 0.001, + pos = Math.min(Math.max(0, this._position) * 0.001, dur); this.sourceNode = this._createAndPlayAudioNode((s.context.currentTime - dur), pos); this._playbackStartTime = this.sourceNode.startTime - pos; diff --git a/tests/Gruntfile.js b/tests/Gruntfile.js index 7a634fca..321455c2 100644 --- a/tests/Gruntfile.js +++ b/tests/Gruntfile.js @@ -6,7 +6,7 @@ module.exports = function (grunt) { jasmine: { run: { src: [ - '../lib/soundjs-NEXT.combined.js' + '../lib/soundjs-NEXT.js' ], options: { diff --git a/tutorials/Basics and Best Practices/sample.html b/tutorials/Basics and Best Practices/sample.html index 35893eb1..a2e3408f 100644 --- a/tutorials/Basics and Best Practices/sample.html +++ b/tutorials/Basics and Best Practices/sample.html @@ -4,7 +4,7 @@ - + + + - + +