diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..4d2a55e7c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs +# Docs: http://editorconfig.org + +# For Atom: https://atom.io/packages/editorconfig +# For Sublime: https://github.com/sindresorhus/editorconfig-sublime +# For WebStorm: Natively supported + +root = true + +[*] +indent_style = tab +indent_size = 2 +trim_trailing_whitespace = true +insert_final_newline = true +end_of_line = lf +charset = utf-8 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..f0bae429e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,38 @@ +# Force all line endings to be \n +* text eol=lf + +############################################################ +# git can corrupt binary files if they're not set to binary. +############################################################ + +# Image files +*.png binary +*.jpg binary +*.jpeg binary +*.gif binary +*.webp binary +*.ico binary + +# Movie and audio files +*.mov binary +*.mp4 binary +*.mp3 binary +*.flv binary +*.ogg binary + +# Compression formats +*.gz binary +*.bz2 binary +*.7z binary +*.zip binary + +# Web fonts +*.ttf binary +*.eot binary +*.woff binary +*.otf binary + +# Other +*.fla binary +*.swf binary +*.pdf binary diff --git a/.gitignore b/.gitignore index 9dba5d8f9..6d852fa26 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,27 @@ -.DS_Store -build/output/ -build/tmp/ -tests/_SpecRunner.html -tests/.grunt/ -docs/**/ -*TMP* +# Packages node_modules/ + +# JetBrains .idea/ + +# Sublime Text *.sublime-project *.sublime-workspace -config.local.json -*[\<\>\:\"\/\\\|\?\*]* -npm-debug.log -build/.sass-cache -main.css +# Atom +.atom/ + +# VSCode +.vscode/ + +# OS +.DS_Store +Thumbs.db + +# Generated +docs/ +tests/coverage/ +tests/debug/ + +# Other +*.log diff --git a/.npmignore b/.npmignore new file mode 100644 index 000000000..ef94d1ab4 --- /dev/null +++ b/.npmignore @@ -0,0 +1,29 @@ +# JetBrains +.idea/ + +# Sublime Text +*.sublime-project +*.sublime-workspace + +# Atom +.atom/ + +# VSCode +.vscode/ + +# OS +.DS_Store +Thumbs.db + +# Other +*.log + +# Project +assets/ +docs/ +examples/ +extras/ +tests/ +tutorials/ +.editorconfig +CONTRIBUTING.md diff --git a/VERSIONS.txt b/CHANGELOG.md similarity index 98% rename from VERSIONS.txt rename to CHANGELOG.md index d35fbf751..ea64f239b 100644 --- a/VERSIONS.txt +++ b/CHANGELOG.md @@ -1,505 +1,513 @@ -Version NEXT [Not Released] -**************************************************************************************************** - - -Version 0.8.2 [November 26, 2015] -**************************************************************************************************** -CRITICAL (may break existing content): -- MovieClip has been added to the minified EaselJS source. The movieclip minified script has been removed. - -***** -OTHER: -- fixed compositeOperation value in DisplayProps.setValues (thanks @fumio) -- documentation updates -- upgraded tutorials to the latest EaselJS version, including content updates -- fixed the SpriteSheetBuilder to support both SpriteSheet framerate and speed (instead of frequency) -- fixed ignoreScale support in Graphic StrokeStyle command -- bower updates: Removed bower.json from excludes -- updated ScaleBitmap extra to the new extend/promote approach -- changed SpriteSheet Array checks from instanceof to Array.isArray() -- added StrokeDash support to SVGExporter -- fixed issue with SVGExporter when the first lineTo has a zero-value for x or y -- added image error handling to SpriteSheet -- Grunt updates: Added shortcut "next" task - - -Version 0.8.1 [May 21, 2015] -**************************************************************************************************** -CRITICAL (may break existing content): -- Graphics.command now returns null after empty fill / stroke calls. -- dispatchEvent now returns false instead of true to indicate an event had preventDefault called (DOM level 2 compatibility) -- cursor is now inherited properly (cursors on children override parents) - -***** -OTHER: -- added Graphics.StrokeDash and Graphics.setStrokeDash() -- Graphics no longer appends redundant StrokeStyle commands -- fixed an issue with preventDefault not working with drawstart and tickstart events -- added bubbles and cancelable params to EventDispatcher.dispatchEvent() -- reintroduced Sprite.initialize() for now, to support FlashCC spritesheet export -- fixed an issue with stroke dash not being reset properly on Graphics.clear() -- bitmap fills no longer throw RTEs when targeting an unloaded image -- Sprite constructor now accepts 0 as frameOrAnimation param -- added MouseEvent.relatedTarget -- improved handling of Bitmap load errors -- fixed Rectangle.pad -- fixed issues with buttons playing on reset -- added totalframes property and getDuration method to MovieClip - - -Version 0.8.0 [December 12, 2014] -**************************************************************************************************** -CRITICAL (may break existing content): -- modified behaviour of SpriteSheetBuilder.addFrame setupFunction, setupParams & setupScope params -- removed the deprecated mousemove & mouseup events on MouseEvent -- removed Graphics.inject() in favour of Graphics.append() -- Sprite now properly displays the first frame of animations after calling gotoAndPlay() (thanks MannyC) -- Moved Ticker into the "createjs" package since it will be included with TweenJS in future releases. -- re-architected the class and inheritance model - - initialize methods removed, use MySuperClass_constructor instead - - helper methods: extend & promote (see the "Utility Methods" docs) - - property definitions are now instance level, and in the constructor (performance gains) - - the .constructor is now set correctly on all classes (thanks kaesve) -- renamed initialize on geom classes to "setValues()" -- removed secondary properties (visible, alpha, compositeOperation, shadow) and related functionality from Matrix2D - - added DisplayProps to hold these properties + a matrix instance -- Matrix2D was updated to be internally consistent with regards to matrix orientation - - Matrix2D transform methods (ex. translate, rotate) now behave as append instead of prepend operations -- renamed ColorMatrix.copyMatrix() to .copy() to reflect geom classes - -***** -DEPRECATED (will be removed in a future version): -- Container.getNumChildren() in favour of Container.numChildren -- DisplayObject.getStage() in favour of DisplayObject.stage -- Graphics.getInstructions() in favour of Graphics.instructions -- MovieClip.getLabels() in favour of MovieClip.labels -- MovieClip.getCurrentLabel() in favour of MovieClip.currentLabel -- SpriteSheet.getAnimations() in favour of SpriteSheet.animations -- Ticker.getInterval() in favour of Ticker.interval -- Ticker.getFPS() in favour of Ticker.framerate -- Ticker.getPaused() / setPaused() in favour of Ticker.paused - -*********** -PERFORMANCE: -- added performance tests to extras -- significant performance improvements: - - vector graphics (especially in Graphics instances with large numbers of instructions) - - filters (thanks pfirpfel & quasimondo) (~2-4x faster) - - overall display list performance (~2x faster) - - display object property access (~2x faster) - - tick event propagation (~3x faster) - -***** -OTHER: -- replaced a number of get/set methods with getter / setters. See the DEPRECATED section above for a list. -- added setupFunction, setupData, labelFunction to SpriteSheetBuilder.addMovieClip -- added SpriteStage & SpriteContainer for WebGL rendering -- changes to how BitmapText works to support WebGL -- added WebGL examples -- added .visible to Matrix2D for use by DOMElement -- updates to how DisplayObject.snapToPixel & Stage.snapToPixelEnabled interact -- major improvements to Stage.nextStage to better handle layered canvases -- ButtonHelper now sets mouseChildren to false, and reverts to default cursor when disabled -- fixed issue introduced in 0.7.1 where getObjectsUnderPoint ignore elements without mouse listeners -- doc updates -- fixed example formatting in docs -- simplified handling of custom data passed into Stage.update() -- display object tick events will now include delta, time, paused, and runTime properties if a Ticker tick event object is passed as the first param to Stage.update() -- added Stage.tick() -- added Event.set() -- added MovieClip.framerate and support for time based movieclips -- Added Bower support, including grunt task for automatically updating bower.json -- fixed an issue with Ticker.reset() -- Ticker.getTime()/getEventTime() now return -1 if the Ticker has not been initialized -- preventDefault support added to the tickstart and drawstart events -- added Stage.drawRect to support selective rendering -- major rewrite of Graphics to use specific command objects -- added Graphics.getInstructions() -- added Text.getMetrics() -- fix for Text.getMeasuredWidth() when no font or an invalid font is specified -- fix for spritesheets that included 0 width/height frames -- the CreateJS CDN now supports https / SSL -- improved how Sprite handles sequencing between animations with different speed values -- added "change" event to Sprite -- added "added" and "removed" events to DisplayObject -- added the extras folder, with: SVGExport, Context2DLog, and PerformanceTests -- added Graphics.store() / unstore() -- examples now all use the combined lib -- SpriteSheet.getNumFrames() now returns 0 instead of null if images are not loaded. -- added some initial unit tests for the library -- added helper methods to Rectangle: union, intersects, extend, intersection, pad, isEmpty, & contains. -- updated clone() method for all classes -- added Matrix2D.equals() method -- added DisplayObject.transformMatrix -- mouse interactions and getObjectsUnderPoint now respect masks -- added a mode param to getObjectsUnderPoint() to respect mouseEnabled/mouseChildren and event listeners -- added Stage.preventSelection to block accidental selection of document elements -- added `pt` param to DisplayObject.localToGlobal, globalToLocal, and localToLocal methods -- BlurFilter provides higher quality results (thanks quasimondo) -- added MouseEvent.isTouch -- added support for margin and spacing in sprite sheet data (thanks renatopp) - - -Version 0.7.1 [December 12, 2013] -**************************************************************************************************** -- fixed issue with mouseChildren not working with nested Containers -- fixed issue where first call to Ticker.addEventListener() did not return the listener -- added DisplayObject.tickEnabled & Container.tickChildren -- fixed an issue related to modal dialogs and pointer position for mouse down -- fixed an issue when calling gotoAndStop(animation) in the animationend event stack for the same animation -- ColorMatrix no longer extends Array -- fixed ColorMatrix.toArray(), .concat(), and .clone() -- changed dblclick to use a canvas listener instead of global listener -- added MouseEvent.localX/Y -- fixed touch/multitouch in IE11 -- fixed issue with -1 mouse pointers (thanks cubica) -- fixed issue with AlphaMapFilter (thanks Dave) -- added willTrigger() to EventDispatcher -- modified mouse event flow so items with no listeners are not checked for a hitTest. - - avoids unnecessary cross-domain issues introduced in EaselJS 0.7.0, when loaded images don't have any mouse listeners on them. -- getObjectsUnderPoint() and getObjectUnderPoint() now account for hitAreas - - -Version 0.7.0 [September 25, 2013] -**************************************************************************************************** -CRITICAL (may break existing content): -- removed all onEvent handlers (ex. onClick, onTick, onAnimationEnd, etc) -- removed Ticker.addListener and .removeListener -- most mouse events now bubble -- BitmapAnimation renamed to Sprite -- MouseEvent now inherits from new Event class -- sprite sheet data's animation .frequency property removed in favour of .speed -- removed "target" from MouseEvent's param list -- returning false from an event handler no longer causes dispatchEvent to return false, see Event.preventDefault -- Added "use strict"; to everything. -- renamed BoxBlurFilter to BlurFilter - -***** -DEPRECATED (will be removed in a future version): -- MouseEvent mousemove/mouseup events, see DisplayObject pressmove/pressup -- SpriteSheetUtils.flip() -- SpriteSheetUtils.mergeAlpha() - -***** -OTHER: -- implemented createjs Utils -- implemented "use strict" mode -- BitmapAnimation renamed to Sprite -- renamed the "frequency" property in sprite sheet data to "speed" and changed functionality: - * support for non-integer values - * inverted outcome vs frequency. Ex. a "speed" value of 2 doubles playback speed, 0.5 halves it -- added Sprite.framerate and SpriteSheet.framerate -- added frameOrAnimation param to Sprite constructor -- deprecated Sprite.offset (no longer functional) -- added Ticker.timingMode and deprecated Ticker.useRAF - * added Ticker.TIMEOUT, Ticker.RAF, Ticker.RAF_SYNCHED timing mode constants -- added Ticker.getMeasuredTickTime() -- Ticker now does not automatically init until a listener is added to it -- added Ticker.reset() -- added Stage.nextStage to relay interaction events -- added Graphics.inject() -- added Text.getMeasuredHeight() -- fixes and improvements to Touch support -- fixed setChildIndex when adding to an index lower than the item exists at already. -- added Graphics.Command -- merged lots of doc updates (thanks @peteshand) -- lots of doc, example, & tutorial updates -- included MouseEvent.nativeEvent for mouseover/out events -- added rollover / rollout events to DisplayObject -- prevented mouseover/out and rollover/out events from triggering if the mouse is not over the canvas - * ex. within a scrolling div or DOM element layered over top -- added pressmove / pressup events to DisplayObject -- added Matrix2D.transformPoint() method -- fixed an issue when adding the same listener to an event twice -- added Event class, used by all events -- MouseEvent inherits from new Event class -- added .on and .off methods to EventDispatcher -- fixed an issue with extending EventDispatcher -- DisplayObject, SpriteSheet, and SpriteSheetBuilder now inherit from EventDispatcher -- fixed an issue with the tick event's time value being epoch time instead of Timer time -- added Ticker.getEventTime() -- added Ticker.maxDelta -- the initialize methods for Point, Rectangle, and Matrix2D are now public -- added .copy() to Point, Rectangle, and Matrix2D -- fixed an issue that could occur when reinitializing Matrix2D -- added MovieClip.frameBounds -- fixed errors when the lib was loaded in a browser with no canvas support (ex. IE8) -- added support for .next on single frame spritesheet animations -- added the BitmapText class -- improved DOMElement redraw handling to avoid flicker and layout costs -- added Stage mouseleave and mouseenter events -- added tickstart, tickend, drawstart, and drawend events to Stage -- added getBounds() functionality for all display objects -- added MovieClip.getLabels() & getCurrentLabel() -- Filter.getBounds() now returns null as its default value -- bounds for cache() are now automatically adjusted for filters -- improved BlurFilter performance and results (thanks to Mario Klingemann) -- objects added to a MovieClip via addChild will now display over objects managed by the MovieClip -- Fixed clone on AlphaMapFilter -- Updated the build process to use NodeJS & Grunt.js. Please refer to the README in the build folder. - - -Version 0.6.1 [May 14, 2013] -**************************************************************************************************** -- Updated demos: - * propagate the tick event to the stage. This is a best practice. - * Added AlphaMaskFilter demo. - * Added a "Graphics Winding" demo - * Added Safari note to the Cache demo -- Updated documentation: - * Added lots more examples. - * Matrix2D.rotate - * Matrix2D.tx named incorrectly - * Stage.stagemousedown event (stagemouseup was doc'd twice) - * DisplayObject.dblclick (case incorrect) - * Fixed example in Stage documentation (incorrect) - * Fixed example in Text documentation (missing quote) - * Fixed updateContext method name in docs (was incorrectly set to "setupContext") - * Added sample code to MovieClip documentation, and a MovieClip example. - * Added optional parameters to MovieClip constructor - * Updated description of DisplayObject.mouseEnabled - * Fixed setPaused/getPaused descriptions in Ticker, and added some better descriptions, a few examples, and updated - documentation throughout. - * Updated SpriteSheetUtils/extractFrame documentation to mention Bitmap/sourceRect and security concerns - * Updated Bitmap/cache methods to clarify caching usage for Bitmaps - * Updated optional parameter for DisplayObject/cache - * Added initial example in EaselJS to show interaction -- Modified EventDispatcher to avoid unnecessary instanceof and apply -- Replaced the width=0 hack (for clearing canvases) with a setTransform/clearRect in DisplayObject, - Container, and SpriteSheetUtils. -- Updated clearRect usages to use +1 on width and height to prevent crashes on Android (thanks mikelito) -- Fixed Matrix2D.scale method to properly apply scale when rotated (thanks fumio) -- Fixed bug with mouse and touch events in iOS's UIWebView (thanks cubica) - - -Version 0.6.0 [Feb 12, 2013] -**************************************************************************************************** -- added new event model with EventDispatcher class -- added DisplayObject.cursor property -- added Container.getChildByName() method -- added ButtonHelper class -- fixed error with AlphaMaskFilter -- hitArea position now ignores the regX/Y of the target instance -- added Log class to provide verbose errors while debugging -- simplified & updated MovieClipPlugin to work with revised TweenJS plugin model -- added DisplayObject.set() shortcut method -- added MovieClip.autoReset property -- added Graphics.isEmpty() method -- improved support for empty masks -- added SpriteSheetBuilder.progress -- added SpriteSheetBuilder.timeSlice -- removed the callback param on SpriteSheetBuilder.buildAsync, replaced with .onComplete -- added SpriteSheetBuilder.onComplete and .onProgress -- fixes for various MovieClip bugs -- SpriteSheetBuilder now works correctly when adding more than one MovieClip -- fixed an issue with SpriteSheetBuilder defining frames that exceeded the image bounds -- added SpriteSheet.getFrameBounds() -- added BitmapAnimation.getBounds() -- added closePath support to Graphics.decodePath() -- changed how animationEnd events are fired, to support calling stop() in the handler -- animationEnd events now include a "next" value with the name of the next animation -- event types for MouseEvents now follow DOM standards (mousedown, click, dblclick etc) -- improved hitArea handling -- added version.js -- added MovieClip.currentFrame -- documentation updates -- new and improved build process, tools & documentation format -- added Stage.enableDOMEvents() method -- added default Stage.handleEvent() for integration with Ticker and new event model -- deprecated Stage.snapToPixel API -- added Graphics.ignoreScale API -- added a matrix parameter to Graphics.beginBitmapFill - - -Version 0.5.0 [Aug 24, 2012] -**************************************************************************************************** -- moved all classes into a configurable createjs namespace -- added support for multitouch -- complete rewrite of drawing model to use a hybrid approach (save/restore & matrix) -- added DisplayObject.mask -- added Graphics.drawAsPath(ctx) -- added Text.getMeasuredHeight() -- added DisplayObject.updateContext(ctx) -- added DisplayObject.getMatrix(matrix) -- added DisplayObject.hitArea -- fixed issue with Text not displaying if .text is 0 or false -- fix for setChildIndex -- fix for addChildAt with multiple params -- added SpriteSheetBuilder -- added MovieClip.actionsEnabled -- updates to Ticker to improve support for requestAnimationFrame -- better support for negative corner values on .drawRoundRectComplex -- added stage.mouseMoveOutside & mouseEvent.rawX/Y -- added "createjs.createCanvas()" to support for alternative canvases (ex. exCanvas) -- added "scale" parameter to cache() and cleaned up the implementation -- fix for DOMElement with Opera -- various bug fixes and doc updates -- changed setTransform to return the instance for use in chaining -- started adding tutorials to address common questions and make it easier to get started -- stage.mouseX/Y now defaults to 0 instead of null -- text.textBaseline now defaults to "top" instead of null (resolved to "alphabetic") -- text.textAlign now defaults to "left" instead of null -- text.color now defaults to "#000" instead of null -- parameters passed to Stage.update are now passed on to onTick handlers - - for example, Ticker elapsedTime and paused params -- correctly resolves mouse positions for CSS scaled canvases & canvases with borders/padding -- added AlphaMapFilter & AlphaMaskFilter -- added Touch.disable(stage) - - -Version 0.4.2 [Apr 18, 2012] -**************************************************************************************************** -- hot fix for issues with Ticker that caused reduced frame rates. -- NO API CHANGES - - -Version 0.4.1 [Apr 14, 2012] -**************************************************************************************************** -- DisplayObject.tick has been renamed to onTick -- fixed a problem with preloading sprite sheet images when using tile based sheets -- worked around a bug in Safari with addFlippedFrames -- added setChildIndex(), swapChildrenAt(), and swapChildren() to Container -- made frequency param on enableMouseOver optional -- worked around a Chrome 17 bug that would prevent text w/o maxwidth from rendering -- additional fixes for video as a Bitmap source -- rewrite of Ticker to simplify implementation and solve issues with useRAF in Safari -- animations in BitmapAnimation now default to looping -- added BitmapAnimation.play/stop() -- added Bitmap.sourceRect -- Ticker now supports an object with a tick method, or a function as a listener -- renamed DisplayObject.tick to .onTick -- added MovieClip class -- added onComplete to SpriteSheet -- added ColorMatrix class -- added Graphics.decodePath for compressed vector paths -- support for passing a canvas string id to the Stage constructor -- various bug fixes and doc updates -- updateCache now clears the cacheCanvas correctly - - -Version 0.4 [Nov 30, 2011] -**************************************************************************************************** -- completely rewrote BitmapSequence (now BitmapAnimation) & SpriteSheet including data format - - BitmapSequence was renamed BitmapAnimation - - SpriteSheet now handles calculating frame rects - - support for multi-image sprite sheets - - support for variable frame sizes - - support for frame reuse (non-linear frame order) - - support for frame registration points - - SpriteSheet supports URIs as sources (and will handle preloading) -- rewrote SpriteSheetUtils to support SpriteSheet changes - - renamed .flip() to .addFlippedFrames() and changed functionality significantly - - removed .frameDataToString() -- fixed support for video sources in Bitmap -- added support for null canvas for Stage -- added DOMElement, an experimental display object for including DOM elements in the display list -- separated tick and draw into separate phases to fix possible race conditions -- added Matrix2D.isIdentity() -- support for double click events (thanks to rbarazi) -- added MouseEvent.nativeEvent and MouseEvent.target properties -- fixes to Ticker, added second "paused" param when it calls tick -- added experimental support for requestAnimationFrame to Ticker -- fixed a problem with caching Container instances -- fixed an issue with .parent not being assigned on children of cloned Containers -- added filter support via DisplayObject.filters and Filter objects - - added sample filters: ColorFilter, ColorMatrixFilter, and BoxBlurFilter -- added DisplayObject.setTransform() -- added DisplayObject.onDoubleClick handler (thanks to rbarazi) -- added DisplayObject.cacheID and DisplayObject.getCacheDataURL() -- performance optimization for DisplayObject drawing (6910e6849856bd0740f8) -- added support for touch input (single point) via the Touch class -- added support for passing an image URI to the Bitmap constructor -- fixes to Shadow -- optimizations -- documentation updates - - -Version 0.3.2 [Mar 2, 2011] -**************************************************************************************************** -- added stage.mouseInBounds -- added DisplayObject.onMouseOver and onMouseOut callbacks -- added stage.enableMouseOver(freq) -- improved support for calculating mouseX/Y in divs with relative positioning -- fixed Graphics.clone() -- fixed an issue with shadows not being reset properly -- migrated to use YUIDocs instead of JSDocs -- fixed an issue that prevented BitmapSequence instances with frameData from working with gotoAndPlay(frameNumber) - - -Version 0.3.1 [Feb 13, 2011] -**************************************************************************************************** -- fixed issues with hitTest and mouse event callbacks on Container instances. -- added recursive clone option to Container and Shape -- fix for snapToPixel -- added cache, updateCache, and HelloWorld demos -- extensive code cleanup, including improved support for jsdoc - - -Version 0.3 [Feb 8, 2011] -**************************************************************************************************** -- renamed Tick to Ticker -- adding a listener to Ticker twice will now move it to the end of the listener list -- added Ticker.getMeasuredFPS() -- added Ticker.setFPS() -- renamed Stage.tick to Stage.update and made Stage.tick point to Stage.update -- made the pauseable param "true" by default on Ticker.addListener() -- added Stage.toDataURL(backgroundColor, mimeType) -- renamed Rectangle.w/h to width/height -- improvements to commenting and documentation -- formalized inheritance model to make code more readable -- changed color to null instead of 0 in Shadow.IDENTITY -- fixed an error with simple sprite sheets that weren't set to loop -- implemented "tiny" instructions for Graphics. (ex. myGraphics.f("#0FF").c(x,y,r) ) -- fixed problems with Graphics.clone() -- fixed bug with passing instructions to a Graphics object constructor -- complete rewrite of the render engine to be cleaner and more flexible -- added .decompose() method to Matrix2D -- added .skew() method to Matrix2D -- added .skewX/Y on DisplayObject -- added SpriteSheetUtils.extractFrame(spriteSheet,frame) method -- added basic multi-line support for Text -- added DisplayObject.suppressCrossDomainErrors property -- complete rewrite of the hit testing system to be cleaner and run 5-10x faster -- improved the interaction model: - - added .onPress, .onClick callbacks on DisplayObject - - removed .mouseChildren from Container - - made .mouseEnabled true by default - - added .onMouseDown, .onMouseUp, and .onMouseMove callbacks on Stage - - added MouseEvent -- Stage.getObjectsUnderPoint() has been moved to Container -- added Container.contains(child) method -- added DisplayObject.compositeOperation -- added appendProperties() and prependProperties methods to Matrix2D -- added DisplayObject.hitTest() method -- added stage.snapToPixelEnabled and displayObject.snapToPixel -- added DisplayObject.updateCache() -- renamed minified file from easeljs.js to easel.js -- Re-factored directory layout - - -Version 0.2.1 [Jan 12, 2011] -**************************************************************************************************** -- optimized Graphics: reduced overhead by 80-90% -- added drawPolyStar method to Graphics -- fixed bug with using canvas as an image source for Bitmap -- made mouseChildren true by default for stage -- fixed major bug with Ticker.getTime() - - -Version 0.2 [Jan 6, 2011] -**************************************************************************************************** -Focus on vector graphics and text. -- repackaged all class files to "easeljs" instead of "com.gskinner" -- added Graphics API, and revised Shape to use a Graphics instance -- added Text class -- added Point class and updated CoordTransform to use it -- added Rectangle class -- fixed minor issue with Ticker -- added initial implementation of Stage.mouseX/Y (likely to change) -- added new examples, updated others to work with revised APIs -- minor tweaks, fixes to code and documentation -- added support for multiple params on Container.addChild, addChildAt, removeChild & removeChildAt - -Version 0.1 [Dec 17, 2010] -**************************************************************************************************** -Initial release. +Version NEXT [Not Released] +**************************************************************************************************** +CRITICAL (may break existing content): +- Codebase ported to ES6 and transpiled to ES5 with Babel. Multiple build formats are provided (global, CommonJS, ES6). + +***** +OTHER: +- Build process converted from Grunt to Gulp +- Build process and shared files (Event, EventDispatcher, Ticker) moved to external repository which is a devDependency of this one. +- WebGL is no longer a plugin, it has been fully integrated. WebGL will be leveraged by BitmapCache if support is found. + + +Version 0.8.2 [November 26, 2015] +**************************************************************************************************** +CRITICAL (may break existing content): +- MovieClip has been added to the minified EaselJS source. The movieclip minified script has been removed. + +***** +OTHER: +- fixed compositeOperation value in DisplayProps.setValues (thanks @fumio) +- documentation updates +- upgraded tutorials to the latest EaselJS version, including content updates +- fixed the SpriteSheetBuilder to support both SpriteSheet framerate and speed (instead of frequency) +- fixed ignoreScale support in Graphic StrokeStyle command +- bower updates: Removed bower.json from excludes +- updated ScaleBitmap extra to the new extend/promote approach +- changed SpriteSheet Array checks from instanceof to Array.isArray() +- added StrokeDash support to SVGExporter +- fixed issue with SVGExporter when the first lineTo has a zero-value for x or y +- added image error handling to SpriteSheet +- Grunt updates: Added shortcut "next" task + + +Version 0.8.1 [May 21, 2015] +**************************************************************************************************** +CRITICAL (may break existing content): +- Graphics.command now returns null after empty fill / stroke calls. +- dispatchEvent now returns false instead of true to indicate an event had preventDefault called (DOM level 2 compatibility) +- cursor is now inherited properly (cursors on children override parents) + +***** +OTHER: +- added Graphics.StrokeDash and Graphics.setStrokeDash() +- Graphics no longer appends redundant StrokeStyle commands +- fixed an issue with preventDefault not working with drawstart and tickstart events +- added bubbles and cancelable params to EventDispatcher.dispatchEvent() +- reintroduced Sprite.initialize() for now, to support FlashCC spritesheet export +- fixed an issue with stroke dash not being reset properly on Graphics.clear() +- bitmap fills no longer throw RTEs when targeting an unloaded image +- Sprite constructor now accepts 0 as frameOrAnimation param +- added MouseEvent.relatedTarget +- improved handling of Bitmap load errors +- fixed Rectangle.pad +- fixed issues with buttons playing on reset +- added totalframes property and getDuration method to MovieClip + + +Version 0.8.0 [December 12, 2014] +**************************************************************************************************** +CRITICAL (may break existing content): +- modified behaviour of SpriteSheetBuilder.addFrame setupFunction, setupParams & setupScope params +- removed the deprecated mousemove & mouseup events on MouseEvent +- removed Graphics.inject() in favour of Graphics.append() +- Sprite now properly displays the first frame of animations after calling gotoAndPlay() (thanks MannyC) +- Moved Ticker into the "createjs" package since it will be included with TweenJS in future releases. +- re-architected the class and inheritance model + - initialize methods removed, use MySuperClass_constructor instead + - helper methods: extend & promote (see the "Utility Methods" docs) + - property definitions are now instance level, and in the constructor (performance gains) + - the .constructor is now set correctly on all classes (thanks kaesve) +- renamed initialize on geom classes to "setValues()" +- removed secondary properties (visible, alpha, compositeOperation, shadow) and related functionality from Matrix2D + - added DisplayProps to hold these properties + a matrix instance +- Matrix2D was updated to be internally consistent with regards to matrix orientation + - Matrix2D transform methods (ex. translate, rotate) now behave as append instead of prepend operations +- renamed ColorMatrix.copyMatrix() to .copy() to reflect geom classes + +***** +DEPRECATED (will be removed in a future version): +- Container.getNumChildren() in favour of Container.numChildren +- DisplayObject.getStage() in favour of DisplayObject.stage +- Graphics.getInstructions() in favour of Graphics.instructions +- MovieClip.getLabels() in favour of MovieClip.labels +- MovieClip.getCurrentLabel() in favour of MovieClip.currentLabel +- SpriteSheet.getAnimations() in favour of SpriteSheet.animations +- Ticker.getInterval() in favour of Ticker.interval +- Ticker.getFPS() in favour of Ticker.framerate +- Ticker.getPaused() / setPaused() in favour of Ticker.paused + +*********** +PERFORMANCE: +- added performance tests to extras +- significant performance improvements: + - vector graphics (especially in Graphics instances with large numbers of instructions) + - filters (thanks pfirpfel & quasimondo) (~2-4x faster) + - overall display list performance (~2x faster) + - display object property access (~2x faster) + - tick event propagation (~3x faster) + +***** +OTHER: +- replaced a number of get/set methods with getter / setters. See the DEPRECATED section above for a list. +- added setupFunction, setupData, labelFunction to SpriteSheetBuilder.addMovieClip +- added SpriteStage & SpriteContainer for WebGL rendering +- changes to how BitmapText works to support WebGL +- added WebGL examples +- added .visible to Matrix2D for use by DOMElement +- updates to how DisplayObject.snapToPixel & Stage.snapToPixelEnabled interact +- major improvements to Stage.nextStage to better handle layered canvases +- ButtonHelper now sets mouseChildren to false, and reverts to default cursor when disabled +- fixed issue introduced in 0.7.1 where getObjectsUnderPoint ignore elements without mouse listeners +- doc updates +- fixed example formatting in docs +- simplified handling of custom data passed into Stage.update() +- display object tick events will now include delta, time, paused, and runTime properties if a Ticker tick event object is passed as the first param to Stage.update() +- added Stage.tick() +- added Event.set() +- added MovieClip.framerate and support for time based movieclips +- Added Bower support, including grunt task for automatically updating bower.json +- fixed an issue with Ticker.reset() +- Ticker.getTime()/getEventTime() now return -1 if the Ticker has not been initialized +- preventDefault support added to the tickstart and drawstart events +- added Stage.drawRect to support selective rendering +- major rewrite of Graphics to use specific command objects +- added Graphics.getInstructions() +- added Text.getMetrics() +- fix for Text.getMeasuredWidth() when no font or an invalid font is specified +- fix for spritesheets that included 0 width/height frames +- the CreateJS CDN now supports https / SSL +- improved how Sprite handles sequencing between animations with different speed values +- added "change" event to Sprite +- added "added" and "removed" events to DisplayObject +- added the extras folder, with: SVGExport, Context2DLog, and PerformanceTests +- added Graphics.store() / unstore() +- examples now all use the combined lib +- SpriteSheet.getNumFrames() now returns 0 instead of null if images are not loaded. +- added some initial unit tests for the library +- added helper methods to Rectangle: union, intersects, extend, intersection, pad, isEmpty, & contains. +- updated clone() method for all classes +- added Matrix2D.equals() method +- added DisplayObject.transformMatrix +- mouse interactions and getObjectsUnderPoint now respect masks +- added a mode param to getObjectsUnderPoint() to respect mouseEnabled/mouseChildren and event listeners +- added Stage.preventSelection to block accidental selection of document elements +- added `pt` param to DisplayObject.localToGlobal, globalToLocal, and localToLocal methods +- BlurFilter provides higher quality results (thanks quasimondo) +- added MouseEvent.isTouch +- added support for margin and spacing in sprite sheet data (thanks renatopp) + + +Version 0.7.1 [December 12, 2013] +**************************************************************************************************** +- fixed issue with mouseChildren not working with nested Containers +- fixed issue where first call to Ticker.addEventListener() did not return the listener +- added DisplayObject.tickEnabled & Container.tickChildren +- fixed an issue related to modal dialogs and pointer position for mouse down +- fixed an issue when calling gotoAndStop(animation) in the animationend event stack for the same animation +- ColorMatrix no longer extends Array +- fixed ColorMatrix.toArray(), .concat(), and .clone() +- changed dblclick to use a canvas listener instead of global listener +- added MouseEvent.localX/Y +- fixed touch/multitouch in IE11 +- fixed issue with -1 mouse pointers (thanks cubica) +- fixed issue with AlphaMapFilter (thanks Dave) +- added willTrigger() to EventDispatcher +- modified mouse event flow so items with no listeners are not checked for a hitTest. + - avoids unnecessary cross-domain issues introduced in EaselJS 0.7.0, when loaded images don't have any mouse listeners on them. +- getObjectsUnderPoint() and getObjectUnderPoint() now account for hitAreas + + +Version 0.7.0 [September 25, 2013] +**************************************************************************************************** +CRITICAL (may break existing content): +- removed all onEvent handlers (ex. onClick, onTick, onAnimationEnd, etc) +- removed Ticker.addListener and .removeListener +- most mouse events now bubble +- BitmapAnimation renamed to Sprite +- MouseEvent now inherits from new Event class +- sprite sheet data's animation .frequency property removed in favour of .speed +- removed "target" from MouseEvent's param list +- returning false from an event handler no longer causes dispatchEvent to return false, see Event.preventDefault +- Added "use strict"; to everything. +- renamed BoxBlurFilter to BlurFilter + +***** +DEPRECATED (will be removed in a future version): +- MouseEvent mousemove/mouseup events, see DisplayObject pressmove/pressup +- SpriteSheetUtils.flip() +- SpriteSheetUtils.mergeAlpha() + +***** +OTHER: +- implemented createjs Utils +- implemented "use strict" mode +- BitmapAnimation renamed to Sprite +- renamed the "frequency" property in sprite sheet data to "speed" and changed functionality: + * support for non-integer values + * inverted outcome vs frequency. Ex. a "speed" value of 2 doubles playback speed, 0.5 halves it +- added Sprite.framerate and SpriteSheet.framerate +- added frameOrAnimation param to Sprite constructor +- deprecated Sprite.offset (no longer functional) +- added Ticker.timingMode and deprecated Ticker.useRAF + * added Ticker.TIMEOUT, Ticker.RAF, Ticker.RAF_SYNCHED timing mode constants +- added Ticker.getMeasuredTickTime() +- Ticker now does not automatically init until a listener is added to it +- added Ticker.reset() +- added Stage.nextStage to relay interaction events +- added Graphics.inject() +- added Text.getMeasuredHeight() +- fixes and improvements to Touch support +- fixed setChildIndex when adding to an index lower than the item exists at already. +- added Graphics.Command +- merged lots of doc updates (thanks @peteshand) +- lots of doc, example, & tutorial updates +- included MouseEvent.nativeEvent for mouseover/out events +- added rollover / rollout events to DisplayObject +- prevented mouseover/out and rollover/out events from triggering if the mouse is not over the canvas + * ex. within a scrolling div or DOM element layered over top +- added pressmove / pressup events to DisplayObject +- added Matrix2D.transformPoint() method +- fixed an issue when adding the same listener to an event twice +- added Event class, used by all events +- MouseEvent inherits from new Event class +- added .on and .off methods to EventDispatcher +- fixed an issue with extending EventDispatcher +- DisplayObject, SpriteSheet, and SpriteSheetBuilder now inherit from EventDispatcher +- fixed an issue with the tick event's time value being epoch time instead of Timer time +- added Ticker.getEventTime() +- added Ticker.maxDelta +- the initialize methods for Point, Rectangle, and Matrix2D are now public +- added .copy() to Point, Rectangle, and Matrix2D +- fixed an issue that could occur when reinitializing Matrix2D +- added MovieClip.frameBounds +- fixed errors when the lib was loaded in a browser with no canvas support (ex. IE8) +- added support for .next on single frame spritesheet animations +- added the BitmapText class +- improved DOMElement redraw handling to avoid flicker and layout costs +- added Stage mouseleave and mouseenter events +- added tickstart, tickend, drawstart, and drawend events to Stage +- added getBounds() functionality for all display objects +- added MovieClip.getLabels() & getCurrentLabel() +- Filter.getBounds() now returns null as its default value +- bounds for cache() are now automatically adjusted for filters +- improved BlurFilter performance and results (thanks to Mario Klingemann) +- objects added to a MovieClip via addChild will now display over objects managed by the MovieClip +- Fixed clone on AlphaMapFilter +- Updated the build process to use NodeJS & Grunt.js. Please refer to the README in the build folder. + + +Version 0.6.1 [May 14, 2013] +**************************************************************************************************** +- Updated demos: + * propagate the tick event to the stage. This is a best practice. + * Added AlphaMaskFilter demo. + * Added a "Graphics Winding" demo + * Added Safari note to the Cache demo +- Updated documentation: + * Added lots more examples. + * Matrix2D.rotate + * Matrix2D.tx named incorrectly + * Stage.stagemousedown event (stagemouseup was doc'd twice) + * DisplayObject.dblclick (case incorrect) + * Fixed example in Stage documentation (incorrect) + * Fixed example in Text documentation (missing quote) + * Fixed updateContext method name in docs (was incorrectly set to "setupContext") + * Added sample code to MovieClip documentation, and a MovieClip example. + * Added optional parameters to MovieClip constructor + * Updated description of DisplayObject.mouseEnabled + * Fixed setPaused/getPaused descriptions in Ticker, and added some better descriptions, a few examples, and updated + documentation throughout. + * Updated SpriteSheetUtils/extractFrame documentation to mention Bitmap/sourceRect and security concerns + * Updated Bitmap/cache methods to clarify caching usage for Bitmaps + * Updated optional parameter for DisplayObject/cache + * Added initial example in EaselJS to show interaction +- Modified EventDispatcher to avoid unnecessary instanceof and apply +- Replaced the width=0 hack (for clearing canvases) with a setTransform/clearRect in DisplayObject, + Container, and SpriteSheetUtils. +- Updated clearRect usages to use +1 on width and height to prevent crashes on Android (thanks mikelito) +- Fixed Matrix2D.scale method to properly apply scale when rotated (thanks fumio) +- Fixed bug with mouse and touch events in iOS's UIWebView (thanks cubica) + + +Version 0.6.0 [Feb 12, 2013] +**************************************************************************************************** +- added new event model with EventDispatcher class +- added DisplayObject.cursor property +- added Container.getChildByName() method +- added ButtonHelper class +- fixed error with AlphaMaskFilter +- hitArea position now ignores the regX/Y of the target instance +- added Log class to provide verbose errors while debugging +- simplified & updated MovieClipPlugin to work with revised TweenJS plugin model +- added DisplayObject.set() shortcut method +- added MovieClip.autoReset property +- added Graphics.isEmpty() method +- improved support for empty masks +- added SpriteSheetBuilder.progress +- added SpriteSheetBuilder.timeSlice +- removed the callback param on SpriteSheetBuilder.buildAsync, replaced with .onComplete +- added SpriteSheetBuilder.onComplete and .onProgress +- fixes for various MovieClip bugs +- SpriteSheetBuilder now works correctly when adding more than one MovieClip +- fixed an issue with SpriteSheetBuilder defining frames that exceeded the image bounds +- added SpriteSheet.getFrameBounds() +- added BitmapAnimation.getBounds() +- added closePath support to Graphics.decodePath() +- changed how animationEnd events are fired, to support calling stop() in the handler +- animationEnd events now include a "next" value with the name of the next animation +- event types for MouseEvents now follow DOM standards (mousedown, click, dblclick etc) +- improved hitArea handling +- added version.js +- added MovieClip.currentFrame +- documentation updates +- new and improved build process, tools & documentation format +- added Stage.enableDOMEvents() method +- added default Stage.handleEvent() for integration with Ticker and new event model +- deprecated Stage.snapToPixel API +- added Graphics.ignoreScale API +- added a matrix parameter to Graphics.beginBitmapFill + + +Version 0.5.0 [Aug 24, 2012] +**************************************************************************************************** +- moved all classes into a configurable createjs namespace +- added support for multitouch +- complete rewrite of drawing model to use a hybrid approach (save/restore & matrix) +- added DisplayObject.mask +- added Graphics.drawAsPath(ctx) +- added Text.getMeasuredHeight() +- added DisplayObject.updateContext(ctx) +- added DisplayObject.getMatrix(matrix) +- added DisplayObject.hitArea +- fixed issue with Text not displaying if .text is 0 or false +- fix for setChildIndex +- fix for addChildAt with multiple params +- added SpriteSheetBuilder +- added MovieClip.actionsEnabled +- updates to Ticker to improve support for requestAnimationFrame +- better support for negative corner values on .drawRoundRectComplex +- added stage.mouseMoveOutside & mouseEvent.rawX/Y +- added "createjs.createCanvas()" to support for alternative canvases (ex. exCanvas) +- added "scale" parameter to cache() and cleaned up the implementation +- fix for DOMElement with Opera +- various bug fixes and doc updates +- changed setTransform to return the instance for use in chaining +- started adding tutorials to address common questions and make it easier to get started +- stage.mouseX/Y now defaults to 0 instead of null +- text.textBaseline now defaults to "top" instead of null (resolved to "alphabetic") +- text.textAlign now defaults to "left" instead of null +- text.color now defaults to "#000" instead of null +- parameters passed to Stage.update are now passed on to onTick handlers + - for example, Ticker elapsedTime and paused params +- correctly resolves mouse positions for CSS scaled canvases & canvases with borders/padding +- added AlphaMapFilter & AlphaMaskFilter +- added Touch.disable(stage) + + +Version 0.4.2 [Apr 18, 2012] +**************************************************************************************************** +- hot fix for issues with Ticker that caused reduced frame rates. +- NO API CHANGES + + +Version 0.4.1 [Apr 14, 2012] +**************************************************************************************************** +- DisplayObject.tick has been renamed to onTick +- fixed a problem with preloading sprite sheet images when using tile based sheets +- worked around a bug in Safari with addFlippedFrames +- added setChildIndex(), swapChildrenAt(), and swapChildren() to Container +- made frequency param on enableMouseOver optional +- worked around a Chrome 17 bug that would prevent text w/o maxwidth from rendering +- additional fixes for video as a Bitmap source +- rewrite of Ticker to simplify implementation and solve issues with useRAF in Safari +- animations in BitmapAnimation now default to looping +- added BitmapAnimation.play/stop() +- added Bitmap.sourceRect +- Ticker now supports an object with a tick method, or a function as a listener +- renamed DisplayObject.tick to .onTick +- added MovieClip class +- added onComplete to SpriteSheet +- added ColorMatrix class +- added Graphics.decodePath for compressed vector paths +- support for passing a canvas string id to the Stage constructor +- various bug fixes and doc updates +- updateCache now clears the cacheCanvas correctly + + +Version 0.4 [Nov 30, 2011] +**************************************************************************************************** +- completely rewrote BitmapSequence (now BitmapAnimation) & SpriteSheet including data format + - BitmapSequence was renamed BitmapAnimation + - SpriteSheet now handles calculating frame rects + - support for multi-image sprite sheets + - support for variable frame sizes + - support for frame reuse (non-linear frame order) + - support for frame registration points + - SpriteSheet supports URIs as sources (and will handle preloading) +- rewrote SpriteSheetUtils to support SpriteSheet changes + - renamed .flip() to .addFlippedFrames() and changed functionality significantly + - removed .frameDataToString() +- fixed support for video sources in Bitmap +- added support for null canvas for Stage +- added DOMElement, an experimental display object for including DOM elements in the display list +- separated tick and draw into separate phases to fix possible race conditions +- added Matrix2D.isIdentity() +- support for double click events (thanks to rbarazi) +- added MouseEvent.nativeEvent and MouseEvent.target properties +- fixes to Ticker, added second "paused" param when it calls tick +- added experimental support for requestAnimationFrame to Ticker +- fixed a problem with caching Container instances +- fixed an issue with .parent not being assigned on children of cloned Containers +- added filter support via DisplayObject.filters and Filter objects + - added sample filters: ColorFilter, ColorMatrixFilter, and BoxBlurFilter +- added DisplayObject.setTransform() +- added DisplayObject.onDoubleClick handler (thanks to rbarazi) +- added DisplayObject.cacheID and DisplayObject.getCacheDataURL() +- performance optimization for DisplayObject drawing (6910e6849856bd0740f8) +- added support for touch input (single point) via the Touch class +- added support for passing an image URI to the Bitmap constructor +- fixes to Shadow +- optimizations +- documentation updates + + +Version 0.3.2 [Mar 2, 2011] +**************************************************************************************************** +- added stage.mouseInBounds +- added DisplayObject.onMouseOver and onMouseOut callbacks +- added stage.enableMouseOver(freq) +- improved support for calculating mouseX/Y in divs with relative positioning +- fixed Graphics.clone() +- fixed an issue with shadows not being reset properly +- migrated to use YUIDocs instead of JSDocs +- fixed an issue that prevented BitmapSequence instances with frameData from working with gotoAndPlay(frameNumber) + + +Version 0.3.1 [Feb 13, 2011] +**************************************************************************************************** +- fixed issues with hitTest and mouse event callbacks on Container instances. +- added recursive clone option to Container and Shape +- fix for snapToPixel +- added cache, updateCache, and HelloWorld demos +- extensive code cleanup, including improved support for jsdoc + + +Version 0.3 [Feb 8, 2011] +**************************************************************************************************** +- renamed Tick to Ticker +- adding a listener to Ticker twice will now move it to the end of the listener list +- added Ticker.getMeasuredFPS() +- added Ticker.setFPS() +- renamed Stage.tick to Stage.update and made Stage.tick point to Stage.update +- made the pauseable param "true" by default on Ticker.addListener() +- added Stage.toDataURL(backgroundColor, mimeType) +- renamed Rectangle.w/h to width/height +- improvements to commenting and documentation +- formalized inheritance model to make code more readable +- changed color to null instead of 0 in Shadow.IDENTITY +- fixed an error with simple sprite sheets that weren't set to loop +- implemented "tiny" instructions for Graphics. (ex. myGraphics.f("#0FF").c(x,y,r) ) +- fixed problems with Graphics.clone() +- fixed bug with passing instructions to a Graphics object constructor +- complete rewrite of the render engine to be cleaner and more flexible +- added .decompose() method to Matrix2D +- added .skew() method to Matrix2D +- added .skewX/Y on DisplayObject +- added SpriteSheetUtils.extractFrame(spriteSheet,frame) method +- added basic multi-line support for Text +- added DisplayObject.suppressCrossDomainErrors property +- complete rewrite of the hit testing system to be cleaner and run 5-10x faster +- improved the interaction model: + - added .onPress, .onClick callbacks on DisplayObject + - removed .mouseChildren from Container + - made .mouseEnabled true by default + - added .onMouseDown, .onMouseUp, and .onMouseMove callbacks on Stage + - added MouseEvent +- Stage.getObjectsUnderPoint() has been moved to Container +- added Container.contains(child) method +- added DisplayObject.compositeOperation +- added appendProperties() and prependProperties methods to Matrix2D +- added DisplayObject.hitTest() method +- added stage.snapToPixelEnabled and displayObject.snapToPixel +- added DisplayObject.updateCache() +- renamed minified file from easeljs.js to easel.js +- Re-factored directory layout + + +Version 0.2.1 [Jan 12, 2011] +**************************************************************************************************** +- optimized Graphics: reduced overhead by 80-90% +- added drawPolyStar method to Graphics +- fixed bug with using canvas as an image source for Bitmap +- made mouseChildren true by default for stage +- fixed major bug with Ticker.getTime() + + +Version 0.2 [Jan 6, 2011] +**************************************************************************************************** +Focus on vector graphics and text. +- repackaged all class files to "easeljs" instead of "com.gskinner" +- added Graphics API, and revised Shape to use a Graphics instance +- added Text class +- added Point class and updated CoordTransform to use it +- added Rectangle class +- fixed minor issue with Ticker +- added initial implementation of Stage.mouseX/Y (likely to change) +- added new examples, updated others to work with revised APIs +- minor tweaks, fixes to code and documentation +- added support for multiple params on Container.addChild, addChildAt, removeChild & removeChildAt + +Version 0.1 [Dec 17, 2010] +**************************************************************************************************** +Initial release. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..67936d047 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,21 @@ +# Contributing + +We welcome pull requests on fixes, documentation updates, and even features. Ideally changes are discrete, documented inline with current standards, and don't contain superficial changes like tab formatting an entire file (hard to accept a PR that has 1000 changes). Don't commit updates to the `dist/` folder, as those will be done by the maintainers at our discretion. + +### Pull Requests + +Our continuous integration processes will lint and test all pull requests. To save time, please lint and test your changes locally, prior to committing. + +Please reference any issues that your PR addresses. + +### Local Development + +``` +# clone repo +git clone https://github.com:createjs/easeljs.git +cd path/to/easeljs +# install dependencies +npm install +``` + +Documentation for compiling and testing the source can be found in the [build repository README](https://github.com/createjs/build/blob/master/README.md). diff --git a/LICENSE.txt b/LICENSE.md similarity index 100% rename from LICENSE.txt rename to LICENSE.md diff --git a/README.md b/README.md index f8a45503f..b990b3fc1 100644 --- a/README.md +++ b/README.md @@ -1,139 +1,80 @@ -# EaselJS +### 2.0 BETA -EaselJS is a library for building high-performance interactive 2D content in HTML5. It provides a feature-rich display -list to allow you to manipulate and animate graphics. It also provides a robust interactive model for mouse and touch +**This branch is in beta. Reporting issues is appreciated, please mention that it is for 2.0 in the issue body.** + +The `StageGL` class went under a heavy rewrite in 1.1 which has not been ported to ES2015 syntax. We have excluded it from this branch for the time being. It will be added back when the class is finalized. + +Canvas-based image comparison unit tests are known to be failing, please don't report issues for this. + +

+ + easeljs + +

+ +EaselJS is a library for building high-performance interactive 2D content in HTML5. It provides a feature-rich display +list to allow you to manipulate and animate graphics. It also provides a robust interactive model for mouse and touch interactions. -It is excellent for building games, generative art, ads, data visualization, and other highly graphical experiences. It -works well alone, or with the rest of the [CreateJS](http://createjs.com/) suite: [SoundJS](http://createjs.com/soundjs), -[PreloadJS](http://createjs.com/preloadjs), and [TweenJS](http://createjs.com/tweenjs). +It is excellent for building games, generative art, ads, data visualization, and other highly graphical experiences. It +works well alone, or with the rest of the [CreateJS](https://createjs.com/) suite: [SoundJS](https://github.com/createjs/soundjs), +[PreloadJS](https://github.com/createjs/preloadjs), and [TweenJS](https://github.com/createjs/tweenjs). It has no external dependencies, and should be compatible with virtually any framework you enjoy using. +## Installation + +#### NPM + +`npm install @createjs/easeljs --save` + +#### CDN + +`` + ## Simple Example ```javascript -//Draw a square on screen. -var stage = new createjs.Stage('myCanvas'); -var shape = new createjs.Shape(); -shape.graphics.beginFill('red').drawRect(0, 0, 120, 120); +// Draw a square on screen. +import { Stage, Shape } from "@createjs/easeljs"; +let stage = new Stage("myCanvas"); +let shape = new Shape(); +shape.graphics.beginFill("red").drawRect(0, 0, 120, 120); stage.addChild(shape); stage.update(); ``` ## Sprite Animation Example ```javascript -var ss = new createjs.SpriteSheet({ - frames: { - width: 32, - height: 64, - numFrames: 19 - }, - animations: {run: [0, 25], jump: [26, 63, "run"]}, - images: ["./assets/runningGrant.png"] +import { Sprite, SpriteSheet, Ticker } from "@createjs/easeljs"; +let ss = new SpriteSheet({ + frames: { + width: 32, + height: 64, + numFrames: 19 + }, + animations: {run: [0, 25], jump: [26, 63, "run"]}, + images: ["./assets/runningGrant.png"] }); - -var sprite = new createjs.Sprite(ss, "run"); + +let sprite = new Sprite(ss, "run"); sprite.scaleY = sprite.scaleX = 0.4; stage.addChild(sprite); - -sprite.on("click", function() { sprite.gotoAndPlay("jump"); }); - -createjs.Ticker.on("tick", stage); + +sprite.on("click", evt => sprite.gotoAndPlay("jump")); + +Ticker.on("tick", stage); ``` ## Support and Resources -* Find examples and more information at the [EaselJS web site](http://easeljs.com/). -* Read the [documentation](http://createjs.com/docs/easeljs). -* Discuss, share projects, and interact with other users on [reddit](http://www.reddit.com/r/createjs/). -* Ask technical questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/easeljs). -* File verified bugs or formal feature requests using Issues on [GitHub](https://github.com/createjs/EaselJS/issues). -* There is a [Google Group](http://groups.google.com/group/createjs-discussion) for discussions and support. -* Have a look at the included [examples](https://github.com/CreateJS/EaselJS/tree/master/examples) and -[API documentation](http://createjs.com/docs/easeljs/) for more in-depth information. +- Find examples and more information at the [EaselJS web site](http://createjs.com/easeljs). +- Read the [documentation](http://createjs.com/easeljs/docs). +- Discuss, share projects, and interact with other users on [reddit](http://www.reddit.com/r/createjs/). +- Ask technical questions on [Stack Overflow](http://stackoverflow.com/questions/tagged/easeljs). +- File verified bugs or formal feature requests using Issues on [GitHub](https://github.com/createjs/easeljs/issues). +- There is a [Google Group](http://groups.google.com/group/createjs-discussion) for discussions and support. +- Have a look at the included [examples](https://github.com/createjs/easeljs/tree/master/examples) for more in-depth instructions. It was built by [gskinner.com](http://www.gskinner.com), and is released for free under the MIT license, which means you -can use it for almost any purpose (including commercial projects). We appreciate credit where possible, but it is not a +can use it for almost any purpose (including commercial projects). We appreciate credit where possible, but it is not a requirement. - - -## Classes - -The API is inspired in part by Flash's display list, and should be easy to pick up for both JS and AS3 developers. Check -out the [docs](http://createjs.com/docs/easeljs/) for more information. - -**DisplayObject** -Abstract base class for all display elements in EaselJS. Exposes all of the display properties (ex. x, y, rotation, -scaleX, scaleY, skewX, skewY, alpha, shadow, etc) that are common to all display objects. - -**Stage** -The root level display container for display elements. Each time tick() is called on Stage, it will update and render -the display list to its associated canvas. - -**Container** -A nestable display container, which lets you aggregate display objects and manipulate them as a group. - -**Bitmap** -Draws an image, video or canvas to the canvas according to its display properties. - -**Sprite** -Displays single frames or animations from sprite sheets, and provides APIs for managing playback and sequencing. - -**Shape** -Renders a Graphics object within the context of the display list. - -**Graphics** -Provides an easy to use API for drawing vector data. Can be used with Shape, or completely stand alone. - -**Text** -Renders a single line of text to the stage. - -**BitmapText** -Renders text using a SpriteSheet of letter. - -**DOMElement** -An experimental display object that allows you to manage an HTML element as a part of the display list. - -**Filter** -The base filter class that other filters (ex. BlurFilter, ColorMatrixFilter, etc) extend. - - -There are also a few helper classes included: - -**Shadow** -Defines all of the properties needed to display a shadow on a display object. - -**Ticker** -Provides a pausable centralized tick manager for ticking Stage instances or other time based code. - -**UID** -Very simple class that provides global, incremental unique numeric IDs. - -**SpriteSheet** -Encapsulates all the data associated with a sprite sheet to be used with Sprite. - -**SpriteSheetUtils** -Contains utility methods for extending existing sprite sheets with flipped frames and extracting individual frames. - -**SpriteSheetBuilder** -Build a bitmap SpriteSheet from vector graphics at run time. Get the filesize savings of vector, with the performance -of a SpriteSheet. - -**Matrix2D** -Represents a 3x3 affine transformation matrix. Used internally for calculating concatenated transformations. - -**Rectangle** -Represents a rectangle as defined by the points (x, y) and (x+width, y+height). - -**Point** -Represents a point on a 2 dimensional x / y coordinate system. - -A WebGL implementation currently exists, but is limited. - -**SpriteContainer** -A container that accepts a SpriteSheet, and uses a WebGL stage (SpriteStage) for WebGL-accelerated content. - -**SpriteStage** -A Stage class that uses a WebGL context. Currently, can only have children that are SpriteContainers. - -A new WebGL implementation is in the works, which removes these limitations. diff --git a/README_SECURITY_ERROR.txt b/README_SECURITY_ERROR.txt deleted file mode 100644 index 3d20ae4aa..000000000 --- a/README_SECURITY_ERROR.txt +++ /dev/null @@ -1,16 +0,0 @@ -When working with loaded images and canvas on your local file system, some browsers -will throw security errors. This may occur when using SpriteSheetUtils or getObjectsUnderPoint, -and lead to a number of other repeating errors. - -To avoid this, test on a web server (a local web server should work fine), or test with a browser -that doesn't throw these errors (Safari seems to work). - -If you have python installed on your system you can enable a simple web server that's fine for -local testing by navigating to the directory where your project resides typing the following -at your command line: - -python -m SimpleHTTPServer - -Your project is now available at: - -http://localhost:8000/ \ No newline at end of file diff --git a/_assets/README.md b/_assets/README.md deleted file mode 100644 index bea1b3942..000000000 --- a/_assets/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# _shared folder - -Contains assets that are shared by examples, tutorials, and tests to prevent duplication, and simplify referencing. \ No newline at end of file diff --git a/_assets/art/loading.gif b/_assets/art/loading.gif deleted file mode 100644 index c02e626a9..000000000 Binary files a/_assets/art/loading.gif and /dev/null differ diff --git a/_assets/art/logo_createjs.svg b/_assets/art/logo_createjs.svg deleted file mode 100644 index 6c7340017..000000000 --- a/_assets/art/logo_createjs.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/_assets/css/examples.css b/_assets/css/examples.css deleted file mode 100755 index 1d3bdfe4b..000000000 --- a/_assets/css/examples.css +++ /dev/null @@ -1,68 +0,0 @@ -body { - width: 960px; -} - -header { - margin-bottom: 1rem; -} - -h1 { - font-weight: 200; - margin-bottom: 1rem; -} - -h1:before { - content:"EASELJS "; - font-weight: bold; -} - -header p { - margin: 0; - padding: 1em; - background: rgba(250, 252, 255, 0.7); -} - -.content, canvas { - background: white; -} - -.content { - width: 960px; - height: 400px; - overflow: hidden; -} - -.loading { - position: relative; -} - -.loading:after { - content: url("../art/loading.gif"); - position: absolute; - left: 50%; - top: 50%; - margin: -13px 0 0 -51px; - opacity: 0.8; -} - -#error { - display:none; - width: 960px; - text-align: left; - padding: 10px; -} - -#mobile { - display:none; - width: 960px; - text-align: left; - padding: 10px; -} - -body.embedded header { - display: none; -} - -body.embedded { - margin: 0; -} diff --git a/_assets/css/shared.css b/_assets/css/shared.css deleted file mode 100644 index 479e119f4..000000000 --- a/_assets/css/shared.css +++ /dev/null @@ -1,95 +0,0 @@ -body { - margin: 3em auto; - padding: 0; - background-color: #eaebee; - font-family: Arial, Verdana, sans-serif; - font-size: 14px; - font-weight: normal; - color: #333; - line-height: 1.4em; -} - -a:link, a:visited { - color: #39f; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - -h1, h2 { - color: #FFF; - font-size: 1.6em; - margin-bottom: 0; - padding: 1.5em; - padding-bottom: 1.2em; - background: #374252; - text-transform: uppercase; -} - -h1::after { - display: block; - content: ""; - background: url('../art/logo_createjs.svg') no-repeat; - height:1.5em; - width: 6em; - margin-top: -0.3em; - float: right; -} - -h1 em { - font-weight: 200; - font-style: normal; -} - -h2 { - font-size: 1.3em; - padding: 1em; - padding-bottom: 0.8em; -} - -h3 { - background: #e0e1e5; - color: #374252; - font-size: 1.25em; - padding: 0.5em; - margin-top: 1.25em; - margin-bottom: -0.5em; - position: relative; -} - -code { - color: black; - background-color: rgba(255, 230, 0, 0.33); - padding: 1px 3px; - font-family: Courier New, Courier, serif; - font-weight: bold; -} - -/** - * For modern browsers - * 1. The space content is one way to avoid an Opera bug when the - * contenteditable attribute is included anywhere else in the document. - * Otherwise it causes space to appear at the top and bottom of elements - * that are clearfixed. - * 2. The use of `table` rather than `block` is only necessary if using - * `:before` to contain the top-margins of child elements. - */ -.cf:before, -.cf:after { - content: " "; /* 1 */ - display: table; /* 2 */ -} - -.cf:after { - clear: both; -} - -/** - * For IE 6/7 only - * Include this rule to trigger hasLayout and contain floats. - */ -.cf { - *zoom: 1; -} \ No newline at end of file diff --git a/_assets/js/Slider.js b/_assets/js/Slider.js deleted file mode 100644 index 2f98267ff..000000000 --- a/_assets/js/Slider.js +++ /dev/null @@ -1,94 +0,0 @@ -/* -* Slider -* 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. -*/ - -(function() { - - /** - * Simple slider control for EaselJS examples. - **/ - function Slider(min, max, width, height) { - this.Shape_constructor(); - - // public properties: - this.min = this.value = min||0; - this.max = max||100; - - this.width = width||100; - this.height = height||20; - - this.values = {}; - - this.trackColor = "#EEE"; - this.thumbColor = "#666"; - - this.cursor = "pointer"; - this.on("mousedown", this._handleInput, this); - this.on("pressmove", this._handleInput, this); - } - var p = createjs.extend(Slider, createjs.Shape); - - -// public methods: - p.isVisible = function() { return true; }; - - p.draw = function(ctx, ignoreCache) { - if (this._checkChange()) { - var x = (this.width-this.height) * Math.max(0,Math.min(1,(this.value-this.min) / (this.max-this.min))); - this.graphics.clear() - .beginFill(this.trackColor).drawRect(0,0,this.width,this.height) - .beginFill(this.thumbColor).drawRect(x,0,this.height, this.height); - } - this.Shape_draw(ctx, true); - }; - - -// private methods: - p._checkChange = function() { - var a = this, b = a.values; - if (a.value !== b.value || a.min !== b.min || a.max !== b.max || a.width !== b.width || a.height !== b.height) { - b.min = a.min; - b.max = a.max; - b.value = a.value; - b.width = a.width; - b.height = a.height; - return true; - } - return false; - }; - - p._handleInput = function(evt) { - var val = (evt.localX-this.height/2)/(this.width-this.height)*(this.max-this.min)+this.min; - val = Math.max(this.min, Math.min(this.max, val)); - if (val == this.value) { return; } - this.value = val; - this.dispatchEvent("change"); - }; - - - window.Slider = createjs.promote(Slider, "Shape"); -}()); \ No newline at end of file diff --git a/_assets/js/examples.js b/_assets/js/examples.js deleted file mode 100644 index fd0618871..000000000 --- a/_assets/js/examples.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Very minimal shared code for examples. - */ - -(function() { - if (document.body) { setupEmbed(); } - else { document.addEventListener("DOMContentLoaded", setupEmbed); } - - function setupEmbed() { - if (window.top != window) { - document.body.className += " embedded"; - } - } - - var o = window.examples = {}; - o.showDistractor = function(id) { - var div = id ? document.getElementById(id) : document.querySelector("div canvas").parentNode; - div.className += " loading"; - }; - - o.hideDistractor = function() { - var div = document.querySelector(".loading"); - div.className = div.className.replace(/\bloading\b/); - }; -})(); \ No newline at end of file diff --git a/_assets/libs/preloadjs-NEXT.min.js b/_assets/libs/preloadjs-NEXT.min.js deleted file mode 100644 index 2d16bf3ff..000000000 --- a/_assets/libs/preloadjs-NEXT.min.js +++ /dev/null @@ -1,13 +0,0 @@ -/*! -* @license PreloadJS -* 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. -*/ -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 diff --git a/_assets/libs/soundjs-NEXT.min.js b/_assets/libs/soundjs-NEXT.min.js deleted file mode 100644 index bbfc84245..000000000 --- a/_assets/libs/soundjs-NEXT.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="NEXT",a.buildDate="Wed, 25 Nov 2015 19:26:51 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/_assets/libs/tweenjs-NEXT.min.js b/_assets/libs/tweenjs-NEXT.min.js deleted file mode 100644 index c49f9d096..000000000 --- a/_assets/libs/tweenjs-NEXT.min.js +++ /dev/null @@ -1,12 +0,0 @@ -/*! -* @license TweenJS -* 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. -*/ -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 diff --git a/_assets/art/daisy.png b/assets/art/daisy.png similarity index 100% rename from _assets/art/daisy.png rename to assets/art/daisy.png diff --git a/_assets/art/flowers.jpg b/assets/art/flowers.jpg similarity index 100% rename from _assets/art/flowers.jpg rename to assets/art/flowers.jpg diff --git a/_assets/art/ground.png b/assets/art/ground.png similarity index 100% rename from _assets/art/ground.png rename to assets/art/ground.png diff --git a/_assets/art/hill1.png b/assets/art/hill1.png similarity index 100% rename from _assets/art/hill1.png rename to assets/art/hill1.png diff --git a/_assets/art/hill2.png b/assets/art/hill2.png similarity index 100% rename from _assets/art/hill2.png rename to assets/art/hill2.png diff --git a/assets/art/robojs/robojs.png b/assets/art/robojs/robojs.png new file mode 100644 index 000000000..9d96eb587 Binary files /dev/null and b/assets/art/robojs/robojs.png differ diff --git a/assets/art/robojs/robojs1.png b/assets/art/robojs/robojs1.png new file mode 100644 index 000000000..56304a692 Binary files /dev/null and b/assets/art/robojs/robojs1.png differ diff --git a/assets/art/robojs/robojs10.png b/assets/art/robojs/robojs10.png new file mode 100644 index 000000000..efaf5df96 Binary files /dev/null and b/assets/art/robojs/robojs10.png differ diff --git a/assets/art/robojs/robojs2.png b/assets/art/robojs/robojs2.png new file mode 100644 index 000000000..a5f46e0dc Binary files /dev/null and b/assets/art/robojs/robojs2.png differ diff --git a/assets/art/robojs/robojs3.png b/assets/art/robojs/robojs3.png new file mode 100644 index 000000000..cf5b9bfed Binary files /dev/null and b/assets/art/robojs/robojs3.png differ diff --git a/assets/art/robojs/robojs4.png b/assets/art/robojs/robojs4.png new file mode 100644 index 000000000..e007240ab Binary files /dev/null and b/assets/art/robojs/robojs4.png differ diff --git a/assets/art/robojs/robojs5.png b/assets/art/robojs/robojs5.png new file mode 100644 index 000000000..4cd72030b Binary files /dev/null and b/assets/art/robojs/robojs5.png differ diff --git a/assets/art/robojs/robojs6.png b/assets/art/robojs/robojs6.png new file mode 100644 index 000000000..ca9941649 Binary files /dev/null and b/assets/art/robojs/robojs6.png differ diff --git a/assets/art/robojs/robojs7.png b/assets/art/robojs/robojs7.png new file mode 100644 index 000000000..6f51a3e6c Binary files /dev/null and b/assets/art/robojs/robojs7.png differ diff --git a/assets/art/robojs/robojs8.png b/assets/art/robojs/robojs8.png new file mode 100644 index 000000000..b92055f50 Binary files /dev/null and b/assets/art/robojs/robojs8.png differ diff --git a/assets/art/robojs/robojs9.png b/assets/art/robojs/robojs9.png new file mode 100644 index 000000000..4c2b741a0 Binary files /dev/null and b/assets/art/robojs/robojs9.png differ diff --git a/_assets/art/robot.png b/assets/art/robot.png similarity index 100% rename from _assets/art/robot.png rename to assets/art/robot.png diff --git a/_assets/art/sky.png b/assets/art/sky.png similarity index 100% rename from _assets/art/sky.png rename to assets/art/sky.png diff --git a/_assets/art/spritesheet_button.png b/assets/art/spritesheet_button.png similarity index 100% rename from _assets/art/spritesheet_button.png rename to assets/art/spritesheet_button.png diff --git a/_assets/art/spritesheet_font.png b/assets/art/spritesheet_font.png similarity index 100% rename from _assets/art/spritesheet_font.png rename to assets/art/spritesheet_font.png diff --git a/_assets/art/spritesheet_grant.png b/assets/art/spritesheet_grant.png similarity index 100% rename from _assets/art/spritesheet_grant.png rename to assets/art/spritesheet_grant.png diff --git a/_assets/art/spritesheet_icons.png b/assets/art/spritesheet_icons.png similarity index 100% rename from _assets/art/spritesheet_icons.png rename to assets/art/spritesheet_icons.png diff --git a/_assets/art/spritesheet_sparkle.png b/assets/art/spritesheet_sparkle.png similarity index 100% rename from _assets/art/spritesheet_sparkle.png rename to assets/art/spritesheet_sparkle.png diff --git a/_assets/art/tmw_desert_spacing.png b/assets/art/tmw_desert_spacing.png similarity index 100% rename from _assets/art/tmw_desert_spacing.png rename to assets/art/tmw_desert_spacing.png diff --git a/_assets/audio/bionic.mp3 b/assets/audio/bionic.mp3 similarity index 100% rename from _assets/audio/bionic.mp3 rename to assets/audio/bionic.mp3 diff --git a/assets/github-header.png b/assets/github-header.png new file mode 100644 index 000000000..5d4563964 Binary files /dev/null and b/assets/github-header.png differ diff --git a/assets/icon.png b/assets/icon.png new file mode 100644 index 000000000..297ab7325 Binary files /dev/null and b/assets/icon.png differ diff --git a/assets/js/Slider.js b/assets/js/Slider.js new file mode 100644 index 000000000..0b042708a --- /dev/null +++ b/assets/js/Slider.js @@ -0,0 +1,79 @@ +/** + * @license Slider + * 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 3A 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. + */ + +if (window.createjs === undefined || window.createjs.Shape === undefined) { + console.warn("The Slider asset only works with the global createjs module"); +} +class Slider extends Shape { + constructor (min = 0, max = 100, width = 100, height = 20) { + this.min = min; + this.max = max; + this.width = width; + this.height = height; + this.values = {}; + this.trackColor = "#EEE"; + this.thumbColor = "#666"; + this.cursor = "pointer"; + this.on("mousedown", this._handleInput, this); + this.on("pressmove", this._handleInput, this); + } + isVisible () { return true; } + draw (ctx, ignoreCache) { + if (this._checkChange()) { + const x = (this.width-this.height) * Math.max(0,Math.min(1,(this.value-this.min) / (this.max-this.min))); + this.graphics.clear() + .beginFill(this.trackColor).drawRect(0,0,this.width,this.height) + .beginFill(this.thumbColor).drawRect(x,0,this.height, this.height); + } + super.draw(ctx, true); + } + _checkChange () { + const a = this, b = a.values; + if (a.value !== b.value || a.min !== b.min || a.max !== b.max || a.width !== b.width || a.height !== b.height) { + b.min = a.min; + b.max = a.max; + b.value = a.value; + b.width = a.width; + b.height = a.height; + return true; + } + return false; + } + _handleInput (evt) { + const val = Math.max( + this.min, Math.min( + this.max, + (evt.localX-this.height/2)/(this.width-this.height)*(this.max-this.min)+this.min + ) + ); + if (val === this.value) { return; } + this.value = val; + this.dispatchEvent("change"); + } +} +export default Slider; diff --git a/_assets/art/VectorButton.js b/assets/js/VectorButton.js similarity index 100% rename from _assets/art/VectorButton.js rename to assets/js/VectorButton.js diff --git a/assets/js/dat.gui.min.js b/assets/js/dat.gui.min.js new file mode 100644 index 000000000..8ea141a96 --- /dev/null +++ b/assets/js/dat.gui.min.js @@ -0,0 +1,95 @@ +/** + * dat-gui JavaScript Controller Library + * http://code.google.com/p/dat-gui + * + * Copyright 2011 Data Arts Team, Google Creative Lab + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ +var dat=dat||{};dat.gui=dat.gui||{};dat.utils=dat.utils||{};dat.controllers=dat.controllers||{};dat.dom=dat.dom||{};dat.color=dat.color||{};dat.utils.css=function(){return{load:function(f,a){a=a||document;var d=a.createElement("link");d.type="text/css";d.rel="stylesheet";d.href=f;a.getElementsByTagName("head")[0].appendChild(d)},inject:function(f,a){a=a||document;var d=document.createElement("style");d.type="text/css";d.innerHTML=f;a.getElementsByTagName("head")[0].appendChild(d)}}}(); +dat.utils.common=function(){var f=Array.prototype.forEach,a=Array.prototype.slice;return{BREAK:{},extend:function(d){this.each(a.call(arguments,1),function(a){for(var c in a)this.isUndefined(a[c])||(d[c]=a[c])},this);return d},defaults:function(d){this.each(a.call(arguments,1),function(a){for(var c in a)this.isUndefined(d[c])&&(d[c]=a[c])},this);return d},compose:function(){var d=a.call(arguments);return function(){for(var e=a.call(arguments),c=d.length-1;0<=c;c--)e=[d[c].apply(this,e)];return e[0]}}, +each:function(a,e,c){if(a)if(f&&a.forEach&&a.forEach===f)a.forEach(e,c);else if(a.length===a.length+0)for(var b=0,p=a.length;bthis.__max&&(a=this.__max);void 0!==this.__step&&0!=a%this.__step&&(a=Math.round(a/this.__step)*this.__step);return e.superclass.prototype.setValue.call(this,a)},min:function(a){this.__min=a;return this},max:function(a){this.__max=a;return this},step:function(a){this.__impliedStep=this.__step=a;this.__precision=d(a);return this}});return e}(dat.controllers.Controller,dat.utils.common); +dat.controllers.NumberControllerBox=function(f,a,d){var e=function(c,b,f){function q(){var a=parseFloat(n.__input.value);d.isNaN(a)||n.setValue(a)}function l(a){var b=u-a.clientY;n.setValue(n.getValue()+b*n.__impliedStep);u=a.clientY}function r(){a.unbind(window,"mousemove",l);a.unbind(window,"mouseup",r)}this.__truncationSuspended=!1;e.superclass.call(this,c,b,f);var n=this,u;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"change",q);a.bind(this.__input, +"blur",function(){q();n.__onFinishChange&&n.__onFinishChange.call(n,n.getValue())});a.bind(this.__input,"mousedown",function(b){a.bind(window,"mousemove",l);a.bind(window,"mouseup",r);u=b.clientY});a.bind(this.__input,"keydown",function(a){13===a.keyCode&&(n.__truncationSuspended=!0,this.blur(),n.__truncationSuspended=!1)});this.updateDisplay();this.domElement.appendChild(this.__input)};e.superclass=f;d.extend(e.prototype,f.prototype,{updateDisplay:function(){var a=this.__input,b;if(this.__truncationSuspended)b= +this.getValue();else{b=this.getValue();var d=Math.pow(10,this.__precision);b=Math.round(b*d)/d}a.value=b;return e.superclass.prototype.updateDisplay.call(this)}});return e}(dat.controllers.NumberController,dat.dom.dom,dat.utils.common); +dat.controllers.NumberControllerSlider=function(f,a,d,e,c){function b(a,b,c,e,d){return e+(a-b)/(c-b)*(d-e)}var p=function(c,e,d,f,u){function A(c){c.preventDefault();var e=a.getOffset(k.__background),d=a.getWidth(k.__background);k.setValue(b(c.clientX,e.left,e.left+d,k.__min,k.__max));return!1}function g(){a.unbind(window,"mousemove",A);a.unbind(window,"mouseup",g);k.__onFinishChange&&k.__onFinishChange.call(k,k.getValue())}p.superclass.call(this,c,e,{min:d,max:f,step:u});var k=this;this.__background= +document.createElement("div");this.__foreground=document.createElement("div");a.bind(this.__background,"mousedown",function(b){a.bind(window,"mousemove",A);a.bind(window,"mouseup",g);A(b)});a.addClass(this.__background,"slider");a.addClass(this.__foreground,"slider-fg");this.updateDisplay();this.__background.appendChild(this.__foreground);this.domElement.appendChild(this.__background)};p.superclass=f;p.useDefaultStyles=function(){d.inject(c)};e.extend(p.prototype,f.prototype,{updateDisplay:function(){var a= +(this.getValue()-this.__min)/(this.__max-this.__min);this.__foreground.style.width=100*a+"%";return p.superclass.prototype.updateDisplay.call(this)}});return p}(dat.controllers.NumberController,dat.dom.dom,dat.utils.css,dat.utils.common,"/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"); +dat.controllers.FunctionController=function(f,a,d){var e=function(c,b,d){e.superclass.call(this,c,b);var f=this;this.__button=document.createElement("div");this.__button.innerHTML=void 0===d?"Fire":d;a.bind(this.__button,"click",function(a){a.preventDefault();f.fire();return!1});a.addClass(this.__button,"button");this.domElement.appendChild(this.__button)};e.superclass=f;d.extend(e.prototype,f.prototype,{fire:function(){this.__onChange&&this.__onChange.call(this);this.getValue().call(this.object); +this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}});return e}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); +dat.controllers.BooleanController=function(f,a,d){var e=function(c,b){e.superclass.call(this,c,b);var d=this;this.__prev=this.getValue();this.__checkbox=document.createElement("input");this.__checkbox.setAttribute("type","checkbox");a.bind(this.__checkbox,"change",function(){d.setValue(!d.__prev)},!1);this.domElement.appendChild(this.__checkbox);this.updateDisplay()};e.superclass=f;d.extend(e.prototype,f.prototype,{setValue:function(a){a=e.superclass.prototype.setValue.call(this,a);this.__onFinishChange&& +this.__onFinishChange.call(this,this.getValue());this.__prev=this.getValue();return a},updateDisplay:function(){!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0):this.__checkbox.checked=!1;return e.superclass.prototype.updateDisplay.call(this)}});return e}(dat.controllers.Controller,dat.dom.dom,dat.utils.common); +dat.color.toString=function(f){return function(a){if(1==a.a||f.isUndefined(a.a)){for(a=a.hex.toString(16);6>a.length;)a="0"+a;return"#"+a}return"rgba("+Math.round(a.r)+","+Math.round(a.g)+","+Math.round(a.b)+","+a.a+")"}}(dat.utils.common); +dat.color.interpret=function(f,a){var d,e,c=[{litmus:a.isString,conversions:{THREE_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null===a?!1:{space:"HEX",hex:parseInt("0x"+a[1].toString()+a[1].toString()+a[2].toString()+a[2].toString()+a[3].toString()+a[3].toString())}},write:f},SIX_CHAR_HEX:{read:function(a){a=a.match(/^#([A-F0-9]{6})$/i);return null===a?!1:{space:"HEX",hex:parseInt("0x"+a[1].toString())}},write:f},CSS_RGB:{read:function(a){a=a.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); +return null===a?!1:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3])}},write:f},CSS_RGBA:{read:function(a){a=a.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);return null===a?!1:{space:"RGB",r:parseFloat(a[1]),g:parseFloat(a[2]),b:parseFloat(a[3]),a:parseFloat(a[4])}},write:f}}},{litmus:a.isNumber,conversions:{HEX:{read:function(a){return{space:"HEX",hex:a,conversionName:"HEX"}},write:function(a){return a.hex}}}},{litmus:a.isArray,conversions:{RGB_ARRAY:{read:function(a){return 3!= +a.length?!1:{space:"RGB",r:a[0],g:a[1],b:a[2]}},write:function(a){return[a.r,a.g,a.b]}},RGBA_ARRAY:{read:function(a){return 4!=a.length?!1:{space:"RGB",r:a[0],g:a[1],b:a[2],a:a[3]}},write:function(a){return[a.r,a.g,a.b,a.a]}}}},{litmus:a.isObject,conversions:{RGBA_OBJ:{read:function(b){return a.isNumber(b.r)&&a.isNumber(b.g)&&a.isNumber(b.b)&&a.isNumber(b.a)?{space:"RGB",r:b.r,g:b.g,b:b.b,a:b.a}:!1},write:function(a){return{r:a.r,g:a.g,b:a.b,a:a.a}}},RGB_OBJ:{read:function(b){return a.isNumber(b.r)&& +a.isNumber(b.g)&&a.isNumber(b.b)?{space:"RGB",r:b.r,g:b.g,b:b.b}:!1},write:function(a){return{r:a.r,g:a.g,b:a.b}}},HSVA_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)&&a.isNumber(b.a)?{space:"HSV",h:b.h,s:b.s,v:b.v,a:b.a}:!1},write:function(a){return{h:a.h,s:a.s,v:a.v,a:a.a}}},HSV_OBJ:{read:function(b){return a.isNumber(b.h)&&a.isNumber(b.s)&&a.isNumber(b.v)?{space:"HSV",h:b.h,s:b.s,v:b.v}:!1},write:function(a){return{h:a.h,s:a.s,v:a.v}}}}}];return function(){e=!1; +var b=1\n\n Here\'s the new load parameter for your GUI\'s constructor:\n\n \n\n
\n\n Automatically save\n values to localStorage on exit.\n\n
The values saved to localStorage will\n override those passed to dat.GUI\'s constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n \n
\n \n
\n\n', +".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row,
  • */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n", +dat.controllers.factory=function(f,a,d,e,c,b,p){return function(q,l,r,n){var u=q[l];if(p.isArray(r)||p.isObject(r))return new f(q,l,r);if(p.isNumber(u))return p.isNumber(r)&&p.isNumber(n)?new d(q,l,r,n):new a(q,l,{min:r,max:n});if(p.isString(u))return new e(q,l);if(p.isFunction(u))return new c(q,l,"");if(p.isBoolean(u))return new b(q,l)}}(dat.controllers.OptionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.StringController=function(f,a,d){var e= +function(c,b){function d(){f.setValue(f.__input.value)}e.superclass.call(this,c,b);var f=this;this.__input=document.createElement("input");this.__input.setAttribute("type","text");a.bind(this.__input,"keyup",d);a.bind(this.__input,"change",d);a.bind(this.__input,"blur",function(){f.__onFinishChange&&f.__onFinishChange.call(f,f.getValue())});a.bind(this.__input,"keydown",function(a){13===a.keyCode&&this.blur()});this.updateDisplay();this.domElement.appendChild(this.__input)};e.superclass=f;d.extend(e.prototype, +f.prototype,{updateDisplay:function(){a.isActive(this.__input)||(this.__input.value=this.getValue());return e.superclass.prototype.updateDisplay.call(this)}});return e}(dat.controllers.Controller,dat.dom.dom,dat.utils.common),dat.controllers.FunctionController,dat.controllers.BooleanController,dat.utils.common),dat.controllers.Controller,dat.controllers.BooleanController,dat.controllers.FunctionController,dat.controllers.NumberControllerBox,dat.controllers.NumberControllerSlider,dat.controllers.OptionController, +dat.controllers.ColorController=function(f,a,d,e,c){function b(a,b,d,e){a.style.background="";c.each(l,function(c){a.style.cssText+="background: "+c+"linear-gradient("+b+", "+d+" 0%, "+e+" 100%); "})}function p(a){a.style.background="";a.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);";a.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"; +a.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);";a.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}var q=function(f,n){function u(b){v(b);a.bind(window,"mousemove",v);a.bind(window, +"mouseup",l)}function l(){a.unbind(window,"mousemove",v);a.unbind(window,"mouseup",l)}function g(){var a=e(this.value);!1!==a?(t.__color.__state=a,t.setValue(t.__color.toOriginal())):this.value=t.__color.toString()}function k(){a.unbind(window,"mousemove",w);a.unbind(window,"mouseup",k)}function v(b){b.preventDefault();var c=a.getWidth(t.__saturation_field),d=a.getOffset(t.__saturation_field),e=(b.clientX-d.left+document.body.scrollLeft)/c;b=1-(b.clientY-d.top+document.body.scrollTop)/c;1 +b&&(b=0);1e&&(e=0);t.__color.v=b;t.__color.s=e;t.setValue(t.__color.toOriginal());return!1}function w(b){b.preventDefault();var c=a.getHeight(t.__hue_field),d=a.getOffset(t.__hue_field);b=1-(b.clientY-d.top+document.body.scrollTop)/c;1b&&(b=0);t.__color.h=360*b;t.setValue(t.__color.toOriginal());return!1}q.superclass.call(this,f,n);this.__color=new d(this.getValue());this.__temp=new d(0);var t=this;this.domElement=document.createElement("div");a.makeSelectable(this.domElement,!1); +this.__selector=document.createElement("div");this.__selector.className="selector";this.__saturation_field=document.createElement("div");this.__saturation_field.className="saturation-field";this.__field_knob=document.createElement("div");this.__field_knob.className="field-knob";this.__field_knob_border="2px solid ";this.__hue_knob=document.createElement("div");this.__hue_knob.className="hue-knob";this.__hue_field=document.createElement("div");this.__hue_field.className="hue-field";this.__input=document.createElement("input"); +this.__input.type="text";this.__input_textShadow="0 1px 1px ";a.bind(this.__input,"keydown",function(a){13===a.keyCode&&g.call(this)});a.bind(this.__input,"blur",g);a.bind(this.__selector,"mousedown",function(b){a.addClass(this,"drag").bind(window,"mouseup",function(b){a.removeClass(t.__selector,"drag")})});var y=document.createElement("div");c.extend(this.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"});c.extend(this.__field_knob.style, +{position:"absolute",width:"12px",height:"12px",border:this.__field_knob_border+(.5>this.__color.v?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1});c.extend(this.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1});c.extend(this.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"});c.extend(y.style,{width:"100%",height:"100%", +background:"none"});b(y,"top","rgba(0,0,0,0)","#000");c.extend(this.__hue_field.style,{width:"15px",height:"100px",display:"inline-block",border:"1px solid #555",cursor:"ns-resize"});p(this.__hue_field);c.extend(this.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:this.__input_textShadow+"rgba(0,0,0,0.7)"});a.bind(this.__saturation_field,"mousedown",u);a.bind(this.__field_knob,"mousedown",u);a.bind(this.__hue_field,"mousedown",function(b){w(b);a.bind(window, +"mousemove",w);a.bind(window,"mouseup",k)});this.__saturation_field.appendChild(y);this.__selector.appendChild(this.__field_knob);this.__selector.appendChild(this.__saturation_field);this.__selector.appendChild(this.__hue_field);this.__hue_field.appendChild(this.__hue_knob);this.domElement.appendChild(this.__input);this.domElement.appendChild(this.__selector);this.updateDisplay()};q.superclass=f;c.extend(q.prototype,f.prototype,{updateDisplay:function(){var a=e(this.getValue());if(!1!==a){var f=!1; +c.each(d.COMPONENTS,function(b){if(!c.isUndefined(a[b])&&!c.isUndefined(this.__color.__state[b])&&a[b]!==this.__color.__state[b])return f=!0,{}},this);f&&c.extend(this.__color.__state,a)}c.extend(this.__temp.__state,this.__color.__state);this.__temp.a=1;var l=.5>this.__color.v||.5a&&(a+=1);return{h:360*a,s:c/b,v:b/255}},rgb_to_hex:function(a,d,e){a=this.hex_with_component(0,2,a);a=this.hex_with_component(a,1,d);return a=this.hex_with_component(a,0,e)},component_from_hex:function(a,d){return a>>8*d&255},hex_with_component:function(a,d,e){return e<<(f=8*d)|a&~(255<= 0 && + arr.length % 1 === 0 + ); + } + + function _arrayEach(arr, iterator) { + var index = -1, + length = arr.length; + + while (++index < length) { + iterator(arr[index], index, arr); + } + } + + function _map(arr, iterator) { + var index = -1, + length = arr.length, + result = Array(length); + + while (++index < length) { + result[index] = iterator(arr[index], index, arr); + } + return result; + } + + function _range(count) { + return _map(Array(count), function (v, i) { return i; }); + } + + function _reduce(arr, iterator, memo) { + _arrayEach(arr, function (x, i, a) { + memo = iterator(memo, x, i, a); + }); + return memo; + } + + function _forEachOf(object, iterator) { + _arrayEach(_keys(object), function (key) { + iterator(object[key], key); + }); + } + + function _indexOf(arr, item) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] === item) return i; + } + return -1; + } + + var _keys = Object.keys || function (obj) { + var keys = []; + for (var k in obj) { + if (obj.hasOwnProperty(k)) { + keys.push(k); + } + } + return keys; + }; + + function _keyIterator(coll) { + var i = -1; + var len; + var keys; + if (_isArrayLike(coll)) { + len = coll.length; + return function next() { + i++; + return i < len ? i : null; + }; + } else { + keys = _keys(coll); + len = keys.length; + return function next() { + i++; + return i < len ? keys[i] : null; + }; + } + } + + // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html) + // This accumulates the arguments passed into an array, after a given index. + // From underscore.js (https://github.com/jashkenas/underscore/pull/2140). + function _restParam(func, startIndex) { + startIndex = startIndex == null ? func.length - 1 : +startIndex; + return function() { + var length = Math.max(arguments.length - startIndex, 0); + var rest = Array(length); + for (var index = 0; index < length; index++) { + rest[index] = arguments[index + startIndex]; + } + switch (startIndex) { + case 0: return func.call(this, rest); + case 1: return func.call(this, arguments[0], rest); + } + // Currently unused but handle cases outside of the switch statement: + // var args = Array(startIndex + 1); + // for (index = 0; index < startIndex; index++) { + // args[index] = arguments[index]; + // } + // args[startIndex] = rest; + // return func.apply(this, args); + }; + } + + function _withoutIndex(iterator) { + return function (value, index, callback) { + return iterator(value, callback); + }; + } + + //// exported async module functions //// + + //// nextTick implementation with browser-compatible fallback //// + + // capture the global reference to guard against fakeTimer mocks + var _setImmediate = typeof setImmediate === 'function' && setImmediate; + + var _delay = _setImmediate ? function(fn) { + // not a direct alias for IE10 compatibility + _setImmediate(fn); + } : function(fn) { + setTimeout(fn, 0); + }; + + if (typeof process === 'object' && typeof process.nextTick === 'function') { + async.nextTick = process.nextTick; + } else { + async.nextTick = _delay; + } + async.setImmediate = _setImmediate ? _delay : async.nextTick; + + + async.forEach = + async.each = function (arr, iterator, callback) { + return async.eachOf(arr, _withoutIndex(iterator), callback); + }; + + async.forEachSeries = + async.eachSeries = function (arr, iterator, callback) { + return async.eachOfSeries(arr, _withoutIndex(iterator), callback); + }; + + + async.forEachLimit = + async.eachLimit = function (arr, limit, iterator, callback) { + return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback); + }; + + async.forEachOf = + async.eachOf = function (object, iterator, callback) { + callback = _once(callback || noop); + object = object || []; + + var iter = _keyIterator(object); + var key, completed = 0; + + while ((key = iter()) != null) { + completed += 1; + iterator(object[key], key, only_once(done)); + } + + if (completed === 0) callback(null); + + function done(err) { + completed--; + if (err) { + callback(err); + } + // Check key is null in case iterator isn't exhausted + // and done resolved synchronously. + else if (key === null && completed <= 0) { + callback(null); + } + } + }; + + async.forEachOfSeries = + async.eachOfSeries = function (obj, iterator, callback) { + callback = _once(callback || noop); + obj = obj || []; + var nextKey = _keyIterator(obj); + var key = nextKey(); + function iterate() { + var sync = true; + if (key === null) { + return callback(null); + } + iterator(obj[key], key, only_once(function (err) { + if (err) { + callback(err); + } + else { + key = nextKey(); + if (key === null) { + return callback(null); + } else { + if (sync) { + async.setImmediate(iterate); + } else { + iterate(); + } + } + } + })); + sync = false; + } + iterate(); + }; + + + + async.forEachOfLimit = + async.eachOfLimit = function (obj, limit, iterator, callback) { + _eachOfLimit(limit)(obj, iterator, callback); + }; + + function _eachOfLimit(limit) { + + return function (obj, iterator, callback) { + callback = _once(callback || noop); + obj = obj || []; + var nextKey = _keyIterator(obj); + if (limit <= 0) { + return callback(null); + } + var done = false; + var running = 0; + var errored = false; + + (function replenish () { + if (done && running <= 0) { + return callback(null); + } + + while (running < limit && !errored) { + var key = nextKey(); + if (key === null) { + done = true; + if (running <= 0) { + callback(null); + } + return; + } + running += 1; + iterator(obj[key], key, only_once(function (err) { + running -= 1; + if (err) { + callback(err); + errored = true; + } + else { + replenish(); + } + })); + } + })(); + }; + } + + + function doParallel(fn) { + return function (obj, iterator, callback) { + return fn(async.eachOf, obj, iterator, callback); + }; + } + function doParallelLimit(fn) { + return function (obj, limit, iterator, callback) { + return fn(_eachOfLimit(limit), obj, iterator, callback); + }; + } + function doSeries(fn) { + return function (obj, iterator, callback) { + return fn(async.eachOfSeries, obj, iterator, callback); + }; + } + + function _asyncMap(eachfn, arr, iterator, callback) { + callback = _once(callback || noop); + arr = arr || []; + var results = _isArrayLike(arr) ? [] : {}; + eachfn(arr, function (value, index, callback) { + iterator(value, function (err, v) { + results[index] = v; + callback(err); + }); + }, function (err) { + callback(err, results); + }); + } + + async.map = doParallel(_asyncMap); + async.mapSeries = doSeries(_asyncMap); + async.mapLimit = doParallelLimit(_asyncMap); + + // reduce only has a series version, as doing reduce in parallel won't + // work in many situations. + async.inject = + async.foldl = + async.reduce = function (arr, memo, iterator, callback) { + async.eachOfSeries(arr, function (x, i, callback) { + iterator(memo, x, function (err, v) { + memo = v; + callback(err); + }); + }, function (err) { + callback(err, memo); + }); + }; + + async.foldr = + async.reduceRight = function (arr, memo, iterator, callback) { + var reversed = _map(arr, identity).reverse(); + async.reduce(reversed, memo, iterator, callback); + }; + + async.transform = function (arr, memo, iterator, callback) { + if (arguments.length === 3) { + callback = iterator; + iterator = memo; + memo = _isArray(arr) ? [] : {}; + } + + async.eachOf(arr, function(v, k, cb) { + iterator(memo, v, k, cb); + }, function(err) { + callback(err, memo); + }); + }; + + function _filter(eachfn, arr, iterator, callback) { + var results = []; + eachfn(arr, function (x, index, callback) { + iterator(x, function (v) { + if (v) { + results.push({index: index, value: x}); + } + callback(); + }); + }, function () { + callback(_map(results.sort(function (a, b) { + return a.index - b.index; + }), function (x) { + return x.value; + })); + }); + } + + async.select = + async.filter = doParallel(_filter); + + async.selectLimit = + async.filterLimit = doParallelLimit(_filter); + + async.selectSeries = + async.filterSeries = doSeries(_filter); + + function _reject(eachfn, arr, iterator, callback) { + _filter(eachfn, arr, function(value, cb) { + iterator(value, function(v) { + cb(!v); + }); + }, callback); + } + async.reject = doParallel(_reject); + async.rejectLimit = doParallelLimit(_reject); + async.rejectSeries = doSeries(_reject); + + function _createTester(eachfn, check, getResult) { + return function(arr, limit, iterator, cb) { + function done() { + if (cb) cb(getResult(false, void 0)); + } + function iteratee(x, _, callback) { + if (!cb) return callback(); + iterator(x, function (v) { + if (cb && check(v)) { + cb(getResult(true, x)); + cb = iterator = false; + } + callback(); + }); + } + if (arguments.length > 3) { + eachfn(arr, limit, iteratee, done); + } else { + cb = iterator; + iterator = limit; + eachfn(arr, iteratee, done); + } + }; + } + + async.any = + async.some = _createTester(async.eachOf, toBool, identity); + + async.someLimit = _createTester(async.eachOfLimit, toBool, identity); + + async.all = + async.every = _createTester(async.eachOf, notId, notId); + + async.everyLimit = _createTester(async.eachOfLimit, notId, notId); + + function _findGetResult(v, x) { + return x; + } + async.detect = _createTester(async.eachOf, identity, _findGetResult); + async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult); + async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult); + + async.sortBy = function (arr, iterator, callback) { + async.map(arr, function (x, callback) { + iterator(x, function (err, criteria) { + if (err) { + callback(err); + } + else { + callback(null, {value: x, criteria: criteria}); + } + }); + }, function (err, results) { + if (err) { + return callback(err); + } + else { + callback(null, _map(results.sort(comparator), function (x) { + return x.value; + })); + } + + }); + + function comparator(left, right) { + var a = left.criteria, b = right.criteria; + return a < b ? -1 : a > b ? 1 : 0; + } + }; + + async.auto = function (tasks, concurrency, callback) { + if (typeof arguments[1] === 'function') { + // concurrency is optional, shift the args. + callback = concurrency; + concurrency = null; + } + callback = _once(callback || noop); + var keys = _keys(tasks); + var remainingTasks = keys.length; + if (!remainingTasks) { + return callback(null); + } + if (!concurrency) { + concurrency = remainingTasks; + } + + var results = {}; + var runningTasks = 0; + + var hasError = false; + + var listeners = []; + function addListener(fn) { + listeners.unshift(fn); + } + function removeListener(fn) { + var idx = _indexOf(listeners, fn); + if (idx >= 0) listeners.splice(idx, 1); + } + function taskComplete() { + remainingTasks--; + _arrayEach(listeners.slice(0), function (fn) { + fn(); + }); + } + + addListener(function () { + if (!remainingTasks) { + callback(null, results); + } + }); + + _arrayEach(keys, function (k) { + if (hasError) return; + var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]]; + var taskCallback = _restParam(function(err, args) { + runningTasks--; + if (args.length <= 1) { + args = args[0]; + } + if (err) { + var safeResults = {}; + _forEachOf(results, function(val, rkey) { + safeResults[rkey] = val; + }); + safeResults[k] = args; + hasError = true; + + callback(err, safeResults); + } + else { + results[k] = args; + async.setImmediate(taskComplete); + } + }); + var requires = task.slice(0, task.length - 1); + // prevent dead-locks + var len = requires.length; + var dep; + while (len--) { + if (!(dep = tasks[requires[len]])) { + throw new Error('Has nonexistent dependency in ' + requires.join(', ')); + } + if (_isArray(dep) && _indexOf(dep, k) >= 0) { + throw new Error('Has cyclic dependencies'); + } + } + function ready() { + return runningTasks < concurrency && _reduce(requires, function (a, x) { + return (a && results.hasOwnProperty(x)); + }, true) && !results.hasOwnProperty(k); + } + if (ready()) { + runningTasks++; + task[task.length - 1](taskCallback, results); + } + else { + addListener(listener); + } + function listener() { + if (ready()) { + runningTasks++; + removeListener(listener); + task[task.length - 1](taskCallback, results); + } + } + }); + }; + + + + async.retry = function(times, task, callback) { + var DEFAULT_TIMES = 5; + var DEFAULT_INTERVAL = 0; + + var attempts = []; + + var opts = { + times: DEFAULT_TIMES, + interval: DEFAULT_INTERVAL + }; + + function parseTimes(acc, t){ + if(typeof t === 'number'){ + acc.times = parseInt(t, 10) || DEFAULT_TIMES; + } else if(typeof t === 'object'){ + acc.times = parseInt(t.times, 10) || DEFAULT_TIMES; + acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL; + } else { + throw new Error('Unsupported argument type for \'times\': ' + typeof t); + } + } + + var length = arguments.length; + if (length < 1 || length > 3) { + throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)'); + } else if (length <= 2 && typeof times === 'function') { + callback = task; + task = times; + } + if (typeof times !== 'function') { + parseTimes(opts, times); + } + opts.callback = callback; + opts.task = task; + + function wrappedTask(wrappedCallback, wrappedResults) { + function retryAttempt(task, finalAttempt) { + return function(seriesCallback) { + task(function(err, result){ + seriesCallback(!err || finalAttempt, {err: err, result: result}); + }, wrappedResults); + }; + } + + function retryInterval(interval){ + return function(seriesCallback){ + setTimeout(function(){ + seriesCallback(null); + }, interval); + }; + } + + while (opts.times) { + + var finalAttempt = !(opts.times-=1); + attempts.push(retryAttempt(opts.task, finalAttempt)); + if(!finalAttempt && opts.interval > 0){ + attempts.push(retryInterval(opts.interval)); + } + } + + async.series(attempts, function(done, data){ + data = data[data.length - 1]; + (wrappedCallback || opts.callback)(data.err, data.result); + }); + } + + // If a callback is passed, run this as a controll flow + return opts.callback ? wrappedTask() : wrappedTask; + }; + + async.waterfall = function (tasks, callback) { + callback = _once(callback || noop); + if (!_isArray(tasks)) { + var err = new Error('First argument to waterfall must be an array of functions'); + return callback(err); + } + if (!tasks.length) { + return callback(); + } + function wrapIterator(iterator) { + return _restParam(function (err, args) { + if (err) { + callback.apply(null, [err].concat(args)); + } + else { + var next = iterator.next(); + if (next) { + args.push(wrapIterator(next)); + } + else { + args.push(callback); + } + ensureAsync(iterator).apply(null, args); + } + }); + } + wrapIterator(async.iterator(tasks))(); + }; + + function _parallel(eachfn, tasks, callback) { + callback = callback || noop; + var results = _isArrayLike(tasks) ? [] : {}; + + eachfn(tasks, function (task, key, callback) { + task(_restParam(function (err, args) { + if (args.length <= 1) { + args = args[0]; + } + results[key] = args; + callback(err); + })); + }, function (err) { + callback(err, results); + }); + } + + async.parallel = function (tasks, callback) { + _parallel(async.eachOf, tasks, callback); + }; + + async.parallelLimit = function(tasks, limit, callback) { + _parallel(_eachOfLimit(limit), tasks, callback); + }; + + async.series = function(tasks, callback) { + _parallel(async.eachOfSeries, tasks, callback); + }; + + async.iterator = function (tasks) { + function makeCallback(index) { + function fn() { + if (tasks.length) { + tasks[index].apply(null, arguments); + } + return fn.next(); + } + fn.next = function () { + return (index < tasks.length - 1) ? makeCallback(index + 1): null; + }; + return fn; + } + return makeCallback(0); + }; + + async.apply = _restParam(function (fn, args) { + return _restParam(function (callArgs) { + return fn.apply( + null, args.concat(callArgs) + ); + }); + }); + + function _concat(eachfn, arr, fn, callback) { + var result = []; + eachfn(arr, function (x, index, cb) { + fn(x, function (err, y) { + result = result.concat(y || []); + cb(err); + }); + }, function (err) { + callback(err, result); + }); + } + async.concat = doParallel(_concat); + async.concatSeries = doSeries(_concat); + + async.whilst = function (test, iterator, callback) { + callback = callback || noop; + if (test()) { + var next = _restParam(function(err, args) { + if (err) { + callback(err); + } else if (test.apply(this, args)) { + iterator(next); + } else { + callback.apply(null, [null].concat(args)); + } + }); + iterator(next); + } else { + callback(null); + } + }; + + async.doWhilst = function (iterator, test, callback) { + var calls = 0; + return async.whilst(function() { + return ++calls <= 1 || test.apply(this, arguments); + }, iterator, callback); + }; + + async.until = function (test, iterator, callback) { + return async.whilst(function() { + return !test.apply(this, arguments); + }, iterator, callback); + }; + + async.doUntil = function (iterator, test, callback) { + return async.doWhilst(iterator, function() { + return !test.apply(this, arguments); + }, callback); + }; + + async.during = function (test, iterator, callback) { + callback = callback || noop; + + var next = _restParam(function(err, args) { + if (err) { + callback(err); + } else { + args.push(check); + test.apply(this, args); + } + }); + + var check = function(err, truth) { + if (err) { + callback(err); + } else if (truth) { + iterator(next); + } else { + callback(null); + } + }; + + test(check); + }; + + async.doDuring = function (iterator, test, callback) { + var calls = 0; + async.during(function(next) { + if (calls++ < 1) { + next(null, true); + } else { + test.apply(this, arguments); + } + }, iterator, callback); + }; + + function _queue(worker, concurrency, payload) { + if (concurrency == null) { + concurrency = 1; + } + else if(concurrency === 0) { + throw new Error('Concurrency must not be zero'); + } + function _insert(q, data, pos, callback) { + if (callback != null && typeof callback !== "function") { + throw new Error("task callback must be a function"); + } + q.started = true; + if (!_isArray(data)) { + data = [data]; + } + if(data.length === 0 && q.idle()) { + // call drain immediately if there are no tasks + return async.setImmediate(function() { + q.drain(); + }); + } + _arrayEach(data, function(task) { + var item = { + data: task, + callback: callback || noop + }; + + if (pos) { + q.tasks.unshift(item); + } else { + q.tasks.push(item); + } + + if (q.tasks.length === q.concurrency) { + q.saturated(); + } + }); + async.setImmediate(q.process); + } + function _next(q, tasks) { + return function(){ + workers -= 1; + + var removed = false; + var args = arguments; + _arrayEach(tasks, function (task) { + _arrayEach(workersList, function (worker, index) { + if (worker === task && !removed) { + workersList.splice(index, 1); + removed = true; + } + }); + + task.callback.apply(task, args); + }); + if (q.tasks.length + workers === 0) { + q.drain(); + } + q.process(); + }; + } + + var workers = 0; + var workersList = []; + var q = { + tasks: [], + concurrency: concurrency, + payload: payload, + saturated: noop, + empty: noop, + drain: noop, + started: false, + paused: false, + push: function (data, callback) { + _insert(q, data, false, callback); + }, + kill: function () { + q.drain = noop; + q.tasks = []; + }, + unshift: function (data, callback) { + _insert(q, data, true, callback); + }, + process: function () { + while(!q.paused && workers < q.concurrency && q.tasks.length){ + + var tasks = q.payload ? + q.tasks.splice(0, q.payload) : + q.tasks.splice(0, q.tasks.length); + + var data = _map(tasks, function (task) { + return task.data; + }); + + if (q.tasks.length === 0) { + q.empty(); + } + workers += 1; + workersList.push(tasks[0]); + var cb = only_once(_next(q, tasks)); + worker(data, cb); + } + }, + length: function () { + return q.tasks.length; + }, + running: function () { + return workers; + }, + workersList: function () { + return workersList; + }, + idle: function() { + return q.tasks.length + workers === 0; + }, + pause: function () { + q.paused = true; + }, + resume: function () { + if (q.paused === false) { return; } + q.paused = false; + var resumeCount = Math.min(q.concurrency, q.tasks.length); + // Need to call q.process once per concurrent + // worker to preserve full concurrency after pause + for (var w = 1; w <= resumeCount; w++) { + async.setImmediate(q.process); + } + } + }; + return q; + } + + async.queue = function (worker, concurrency) { + var q = _queue(function (items, cb) { + worker(items[0], cb); + }, concurrency, 1); + + return q; + }; + + async.priorityQueue = function (worker, concurrency) { + + function _compareTasks(a, b){ + return a.priority - b.priority; + } + + function _binarySearch(sequence, item, compare) { + var beg = -1, + end = sequence.length - 1; + while (beg < end) { + var mid = beg + ((end - beg + 1) >>> 1); + if (compare(item, sequence[mid]) >= 0) { + beg = mid; + } else { + end = mid - 1; + } + } + return beg; + } + + function _insert(q, data, priority, callback) { + if (callback != null && typeof callback !== "function") { + throw new Error("task callback must be a function"); + } + q.started = true; + if (!_isArray(data)) { + data = [data]; + } + if(data.length === 0) { + // call drain immediately if there are no tasks + return async.setImmediate(function() { + q.drain(); + }); + } + _arrayEach(data, function(task) { + var item = { + data: task, + priority: priority, + callback: typeof callback === 'function' ? callback : noop + }; + + q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item); + + if (q.tasks.length === q.concurrency) { + q.saturated(); + } + async.setImmediate(q.process); + }); + } + + // Start with a normal queue + var q = async.queue(worker, concurrency); + + // Override push to accept second parameter representing priority + q.push = function (data, priority, callback) { + _insert(q, data, priority, callback); + }; + + // Remove unshift function + delete q.unshift; + + return q; + }; + + async.cargo = function (worker, payload) { + return _queue(worker, 1, payload); + }; + + function _console_fn(name) { + return _restParam(function (fn, args) { + fn.apply(null, args.concat([_restParam(function (err, args) { + if (typeof console === 'object') { + if (err) { + if (console.error) { + console.error(err); + } + } + else if (console[name]) { + _arrayEach(args, function (x) { + console[name](x); + }); + } + } + })])); + }); + } + async.log = _console_fn('log'); + async.dir = _console_fn('dir'); + /*async.info = _console_fn('info'); + async.warn = _console_fn('warn'); + async.error = _console_fn('error');*/ + + async.memoize = function (fn, hasher) { + var memo = {}; + var queues = {}; + var has = Object.prototype.hasOwnProperty; + hasher = hasher || identity; + var memoized = _restParam(function memoized(args) { + var callback = args.pop(); + var key = hasher.apply(null, args); + if (has.call(memo, key)) { + async.setImmediate(function () { + callback.apply(null, memo[key]); + }); + } + else if (has.call(queues, key)) { + queues[key].push(callback); + } + else { + queues[key] = [callback]; + fn.apply(null, args.concat([_restParam(function (args) { + memo[key] = args; + var q = queues[key]; + delete queues[key]; + for (var i = 0, l = q.length; i < l; i++) { + q[i].apply(null, args); + } + })])); + } + }); + memoized.memo = memo; + memoized.unmemoized = fn; + return memoized; + }; + + async.unmemoize = function (fn) { + return function () { + return (fn.unmemoized || fn).apply(null, arguments); + }; + }; + + function _times(mapper) { + return function (count, iterator, callback) { + mapper(_range(count), iterator, callback); + }; + } + + async.times = _times(async.map); + async.timesSeries = _times(async.mapSeries); + async.timesLimit = function (count, limit, iterator, callback) { + return async.mapLimit(_range(count), limit, iterator, callback); + }; + + async.seq = function (/* functions... */) { + var fns = arguments; + return _restParam(function (args) { + var that = this; + + var callback = args[args.length - 1]; + if (typeof callback == 'function') { + args.pop(); + } else { + callback = noop; + } + + async.reduce(fns, args, function (newargs, fn, cb) { + fn.apply(that, newargs.concat([_restParam(function (err, nextargs) { + cb(err, nextargs); + })])); + }, + function (err, results) { + callback.apply(that, [err].concat(results)); + }); + }); + }; + + async.compose = function (/* functions... */) { + return async.seq.apply(null, Array.prototype.reverse.call(arguments)); + }; + + + function _applyEach(eachfn) { + return _restParam(function(fns, args) { + var go = _restParam(function(args) { + var that = this; + var callback = args.pop(); + return eachfn(fns, function (fn, _, cb) { + fn.apply(that, args.concat([cb])); + }, + callback); + }); + if (args.length) { + return go.apply(this, args); + } + else { + return go; + } + }); + } + + async.applyEach = _applyEach(async.eachOf); + async.applyEachSeries = _applyEach(async.eachOfSeries); + + + async.forever = function (fn, callback) { + var done = only_once(callback || noop); + var task = ensureAsync(fn); + function next(err) { + if (err) { + return done(err); + } + task(next); + } + next(); + }; + + function ensureAsync(fn) { + return _restParam(function (args) { + var callback = args.pop(); + args.push(function () { + var innerArgs = arguments; + if (sync) { + async.setImmediate(function () { + callback.apply(null, innerArgs); + }); + } else { + callback.apply(null, innerArgs); + } + }); + var sync = true; + fn.apply(this, args); + sync = false; + }); + } + + async.ensureAsync = ensureAsync; + + async.constant = _restParam(function(values) { + var args = [null].concat(values); + return function (callback) { + return callback.apply(this, args); + }; + }); + + async.wrapSync = + async.asyncify = function asyncify(func) { + return _restParam(function (args) { + var callback = args.pop(); + var result; + try { + result = func.apply(this, args); + } catch (e) { + return callback(e); + } + // if result is Promise object + if (_isObject(result) && typeof result.then === "function") { + result.then(function(value) { + callback(null, value); + })["catch"](function(err) { + callback(err.message ? err : new Error(err)); + }); + } else { + callback(null, result); + } + }); + }; + + // Node.js + if (typeof module === 'object' && module.exports) { + module.exports = async; + } + // AMD / RequireJS + else if (typeof define === 'function' && define.amd) { + define([], function () { + return async; + }); + } + // included directly via '; - var realPath = scripts[i].replace("../src/", ""); - tags.push(grunt.template.process(script, {data: {src: source + realPath}})); - } - console.log(tags.join("\n")); - }); - - grunt.registerTask('setDocsBase', "Internal utility task to set a correct base for YUIDocs.", function() { - grunt.file.setBase('../src'); - grunt.config.set('docsFolder', "../build/output/<%= docsName %>/"); - }); - - grunt.registerTask('resetBase', "Internal utility task to reset the base, after setDocsBase", function() { - grunt.file.setBase('../build'); - grunt.config.set('docsFolder', "./output/<%= docsName %>/"); - }); - - /** - * Build the docs using YUIdocs. - */ - grunt.registerTask('docs', [ - "sass", "setDocsBase", "yuidoc", "resetBase", "clean:docs", "compress", "copy:docsZip" - ]); - - /** - * Sets out version to the version in package.json (defaults to NEXT) - */ - grunt.registerTask('setVersion', function () { - grunt.config.set('version', grunt.config.get('pkg').version); - }); - - /** - * Task for exporting a next build. - * - */ - grunt.registerTask('next', function() { - grunt.config("buildArgs", this.args || []); - getBuildArgs(); - grunt.task.run(["coreBuild", "clearBuildArgs"]); - }); - - /** - * Task for exporting only the next lib. - * - */ - grunt.registerTask('nextlib', [ - "sourceBuild" - ]); - - /** Aliased task for WebStorm quick-run */ - grunt.registerTask('_next_easel', ["next"]); - - /** - * Task for exporting a release build (version based on package.json) - * - */ - grunt.registerTask('build', function() { - grunt.config("buildArgs", this.args || []); - getBuildArgs(); - grunt.task.run(["setVersion", "coreBuild", "updatebower", "copy:docsSite", "clearBuildArgs"]); - }); - - grunt.registerTask('clearBuildArgs', function() { - grunt.config("buildArgs", []); - }); - - /** - * Main build task, always runs after next or build. - * - */ - grunt.registerTask('coreBuild', [ - "docs", "sourceBuild" - ]); - - /** - * Main source build task - * - */ - grunt.registerTask('sourceBuild', [ - "updateversion", "combine", "uglify", "clearversion", "copy:src" - ]); - - - /** - * Task for exporting combined view. - * - */ - grunt.registerTask('combine', 'Combine all source into a single, un-minified file.', [ - "concat" - ]); - - /** - * Task for starting a webserver, watching source files and livereloading. - * - */ - grunt.registerTask('serve', 'Start a webserver and watch the source files for changes.', [ - "sourceBuild", - "connect:test", - "watch" - ]); - -}; diff --git a/build/LICENSE b/build/LICENSE deleted file mode 100644 index 3e32a9c49..000000000 --- a/build/LICENSE +++ /dev/null @@ -1,11 +0,0 @@ -/*! -* @license <%= pkg.name %> -* 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. -*/ diff --git a/build/README.md b/build/README.md deleted file mode 100644 index c628ce5f5..000000000 --- a/build/README.md +++ /dev/null @@ -1,71 +0,0 @@ -## EaselJS uses [Grunt](http://gruntjs.com/) to manage the build process. - -## To use - -Note that this requires a familiarity with using the command line. The example commands shown are for use with the OSX Terminal. - -### Install dependencies - -sass (3.3 or greater is required): - - # ruby is required for sass. Check http://sass-lang.com/install for dependencies. - # Install (or update) sass - gem install sass; - -Node (0.10.x or greater is required): - - # check the version via the command line - node -v - -If your Node install is out of date, get the latest from [NodeJS.org](http://nodejs.org/) - -After node is setup, install the other dependencies. You may want to familiarize yourself with the Node Packager Manager (NPM) before proceeding. - - # Install the grunt command line utility globally - sudo npm install grunt-cli -g - - # Change to the build directory, which contains package.json - cd /path/to/libraryName/build/ - - # Install all the dependencies from package.json - npm install - -### Setup - -You can change the default settings to suit your local work environment by overriding them in a "config.local.json" file in the build directory. All paths can either be relative to the build folder, or absolute paths. - -* docs_out_path - Location of the uncompressed generated docs. - -### Building -To export a release build for this library run: - - grunt build - -This command will: - -* Update the version.js file(s) with the current date and version number from config -* Create the {PROJECT_NAME}-{VERSION}.min.js file, and move it to ../lib -* Generate the documentation in the docs_out_path from config -* Create a zip file of the documentation and move it to ../docs - -**NEXT version** - -The same process as above, but uses "NEXT" as the version. This is used to generate minified builds with the latest source between release versions. - - grunt next - -**Combined File** - -The same as the NEXT process, but will not minify the source code. All code formatting and comments are left intact. - - grunt combine - - -### All commands - -* grunt build - Build everything based on the version in package.json -* grunt next - Build everything using the NEXT version. -* grunt combine - Build a NEXT version, but leave comments and formatting intact. -* grunt docs - Build only the docs -* grunt exportScriptTags - Export valid ","script")}}),i("innerhtml","table")||(n.tbody=function(b,c){var e=d.create(q+b+r,c),f=a.DOM._children(e,"tbody")[0];return e.children.length>1&&f&&!p.test(b)&&f.parentNode.removeChild(f),e}),i("innerhtml-div","script")||(n.script=function(a,b){var c=b.createElement("div");return c.innerHTML="-"+a,c.removeChild(c.firstChild),c},n.link=n.style=n.script),i("innerhtml-div","tr")||(a.mix(n,{option:function(a,b){return d.create('",b)},tr:function(a,b){return d.create(""+a+"",b)},td:function(a,b){return d.create(""+a+"",b)},col:function(a,b){return d.create(""+a+"",b)},tbody:"table"}),a.mix(n,{legend:"fieldset",th:n.td,thead:n.tbody,tfoot:n.tbody,caption:n.tbody,colgroup:n.tbody,optgroup:n.option})),d.creators=n,a.mix(a.DOM,{setWidth:function(b,c){a.DOM._setSize(b,"width",c)},setHeight:function(b,c){a.DOM._setSize(b,"height",c)},_setSize:function(a,b,c){c=c>0?c:0;var d=0;a.style[b]=c+"px",d="height"===b?a.offsetHeight:a.offsetWidth,d>c&&(c-=d-c,0>c&&(c=0),a.style[b]=c+"px")}})},"3.10.1",{requires:["dom-core"]}),YUI.add("selector-native",function(a){!function(a){a.namespace("Selector");var b="compareDocumentPosition",c="ownerDocument",d={_types:{esc:{token:"\ue000",re:/\\[:\[\]\(\)#\.\'\>+~"]/gi},attr:{token:"\ue001",re:/(\[[^\]]*\])/g},pseudo:{token:"\ue002",re:/(\([^\)]*\))/g}},useNative:!0,_escapeId:function(a){return a&&(a=a.replace(/([:\[\]\(\)#\.'<>+~"])/g,"\\$1")),a},_compare:"sourceIndex"in a.config.doc.documentElement?function(a,b){var c=a.sourceIndex,d=b.sourceIndex;return c===d?0:c>d?1:-1}:a.config.doc.documentElement[b]?function(a,c){return 4&a[b](c)?-1:1}:function(a,b){var d,e,f;return a&&b&&(d=a[c].createRange(),d.setStart(a,0),e=b[c].createRange(),e.setStart(b,0),f=d.compareBoundaryPoints(1,e)),f},_sort:function(b){return b&&(b=a.Array(b,0,!0),b.sort&&b.sort(d._compare)),b},_deDupe:function(a){var c,d,b=[];for(c=0;d=a[c++];)d._found||(b[b.length]=d,d._found=!0);for(c=0;d=b[c++];)d._found=null,d.removeAttribute("_found");return b},query:function(b,c,e,f){c=c||a.config.doc;var j,k,l,g=[],h=a.Selector.useNative&&a.config.doc.querySelector&&!f,i=[[b,c]],m=h?a.Selector._nativeQuery:a.Selector._bruteQuery;if(b&&m){for(!f&&(!h||c.tagName)&&(i=d._splitQueries(b,c)),l=0;j=i[l++];)k=m(j[0],j[1],e),e||(k=a.Array(k,0,!0)),k&&(g=g.concat(k));i.length>1&&(g=d._sort(d._deDupe(g)))}return e?g[0]||null:g},_replaceSelector:function(b){var e,f,c=a.Selector._parse("esc",b);return b=a.Selector._replace("esc",b),f=a.Selector._parse("pseudo",b),b=d._replace("pseudo",b),e=a.Selector._parse("attr",b),b=a.Selector._replace("attr",b),{esc:c,attrs:e,pseudos:f,selector:b}},_restoreSelector:function(b){var c=b.selector;return c=a.Selector._restore("attr",c,b.attrs),c=a.Selector._restore("pseudo",c,b.pseudos),c=a.Selector._restore("esc",c,b.esc)},_replaceCommas:function(b){var c=a.Selector._replaceSelector(b),b=c.selector;return b&&(b=b.replace(/,/g,"\ue007"),c.selector=b,b=a.Selector._restoreSelector(c)),b},_splitQueries:function(b,c){b.indexOf(",")>-1&&(b=a.Selector._replaceCommas(b));var g,h,i,d=b.split("\ue007"),e=[],f="";if(c)for(1===c.nodeType&&(g=a.Selector._escapeId(a.DOM.getId(c)),g||(g=a.guid(),a.DOM.setId(c,g)),f='[id="'+g+'"] '),h=0,i=d.length;i>h;++h)b=f+d[h],e.push([b,c]);return e},_nativeQuery:function(b,c,d){if(a.UA.webkit&&b.indexOf(":checked")>-1&&a.Selector.pseudos&&a.Selector.pseudos.checked)return a.Selector.query(b,c,d,!0);try{return c["querySelector"+(d?"":"All")](b)}catch(e){return a.Selector.query(b,c,d,!0)}},filter:function(b,c){var e,f,d=[];if(b&&c)for(e=0;f=b[e++];)a.Selector.test(f,c)&&(d[d.length]=f);return d},test:function(b,d,e){var h,i,j,k,l,m,n,o,p,f=!1,g=!1;if(b&&b.tagName)if("function"==typeof d)f=d.call(b,b);else{for(h=d.split(","),!e&&!a.DOM.inDoc(b)&&(i=b.parentNode,i?e=i:(l=b[c].createDocumentFragment(),l.appendChild(b),e=l,g=!0)),e=e||b[c],m=a.Selector._escapeId(a.DOM.getId(b)),m||(m=a.guid(),a.DOM.setId(b,m)),n=0;p=h[n++];){for(p+='[id="'+m+'"]',k=a.Selector.query(p,e),o=0;j=k[o++];)if(j===b){f=!0;break}if(f)break}g&&l.removeChild(b)}return f},ancestor:function(b,c,d){return a.DOM.ancestor(b,function(b){return a.Selector.test(b,c)},d)},_parse:function(b,c){return c.match(a.Selector._types[b].re)},_replace:function(b,c){var d=a.Selector._types[b];return c.replace(d.re,d.token)},_restore:function(b,c,d){if(d){var f,g,e=a.Selector._types[b].token;for(f=0,g=d.length;g>f;++f)c=c.replace(e,d[f])}return c}};a.mix(a.Selector,d,!0)}(a)},"3.10.1",{requires:["dom-base"]}),YUI.add("selector",function(){},"3.10.1",{requires:["selector-native"]}),YUI.add("node-core",function(a){var c=".",d="nodeName",e="nodeType",f="ownerDocument",h="_yuid",j=Array.prototype.slice,k=a.DOM,l=function(b){if(!this.getDOMNode)return new l(b);if("string"==typeof b&&(b=l._fromString(b),!b))return null;var c=9!==b.nodeType?b.uniqueID:b[h];c&&l._instances[c]&&l._instances[c]._node!==b&&(b[h]=null),c=c||a.stamp(b),c||(c=a.guid()),this[h]=c,this._node=b,this._stateProxy=b,this._initPlugins&&this._initPlugins()},m=function(b){var c=null;return b&&(c="string"==typeof b?function(c){return a.Selector.test(c,b)}:function(c){return b(a.one(c))}),c};l.ATTRS={},l.DOM_EVENTS={},l._fromString=function(b){return b&&(b=0===b.indexOf("doc")?a.config.doc:0===b.indexOf("win")?a.config.win:a.Selector.query(b,null,!0)),b||null},l.NAME="node",l.re_aria=/^(?:role$|aria-)/,l.SHOW_TRANSITION="fadeIn",l.HIDE_TRANSITION="fadeOut",l._instances={},l.getDOMNode=function(a){return a?a.nodeType?a:a._node||null:null},l.scrubVal=function(b,c){return b?("object"==typeof b||"function"==typeof b)&&(e in b||k.isWindow(b)?b=a.one(b):(b.item&&!b._nodes||b[0]&&b[0][e])&&(b=a.all(b))):"undefined"==typeof b?b=c:null===b&&(b=null),b},l.addMethod=function(a,b){a&&b&&"function"==typeof b&&(l.prototype[a]=function(){var d,a=j.call(arguments),c=this;return a[0]&&a[0]._node&&(a[0]=a[0]._node),a[1]&&a[1]._node&&(a[1]=a[1]._node),a.unshift(c._node),d=b.apply(c,a),d&&(d=l.scrubVal(d,c)),"undefined"!=typeof d||(d=c),d})},l.importMethod=function(b,c,d){"string"==typeof c?(d=d||c,l.addMethod(d,b[c],b)):a.Array.each(c,function(a){l.importMethod(b,a)})},l.one=function(b){var d,e,c=null;if(b){if("string"==typeof b){if(b=l._fromString(b),!b)return null}else if(b.getDOMNode)return b;(b.nodeType||a.DOM.isWindow(b))&&(e=b.uniqueID&&9!==b.nodeType?b.uniqueID:b._yuid,c=l._instances[e],d=c?c._node:null,(!c||d&&b!==d)&&(c=new l(b),11!=b.nodeType&&(l._instances[c[h]]=c)))}return c},l.DEFAULT_SETTER=function(b,d){var f,e=this._stateProxy;return b.indexOf(c)>-1?(f=b,b=b.split(c),a.Object.setValue(e,b,d)):"undefined"!=typeof e[b]&&(e[b]=d),d},l.DEFAULT_GETTER=function(b){var e,d=this._stateProxy;return b.indexOf&&b.indexOf(c)>-1?e=a.Object.getValue(d,b.split(c)):"undefined"!=typeof d[b]&&(e=d[b]),e},a.mix(l.prototype,{DATA_PREFIX:"data-",toString:function(){var c,e,f,a=this[h]+": not bound to a node",b=this._node;return b&&(c=b.attributes,e=c&&c.id?b.getAttribute("id"):null,f=c&&c.className?b.getAttribute("className"):null,a=b[d],e&&(a+="#"+e),f&&(a+="."+f.replace(" ",".")),a+=" "+this[h]),a},get:function(a){var b;return b=this._getAttr?this._getAttr(a):this._get(a),b?b=l.scrubVal(b,this):null===b&&(b=null),b},_get:function(a){var c,b=l.ATTRS[a];return c=b&&b.getter?b.getter.call(this):l.re_aria.test(a)?this._node.getAttribute(a,2):l.DEFAULT_GETTER.apply(this,arguments)},set:function(a,b){var c=l.ATTRS[a];return this._setAttr?this._setAttr.apply(this,arguments):c&&c.setter?c.setter.call(this,b,a):l.re_aria.test(a)?this._node.setAttribute(a,b):l.DEFAULT_SETTER.apply(this,arguments),this},setAttrs:function(b){return this._setAttrs?this._setAttrs(b):a.Object.each(b,function(a,b){this.set(b,a)},this),this},getAttrs:function(b){var c={};return this._getAttrs?this._getAttrs(b):a.Array.each(b,function(a){c[a]=this.get(a)},this),c},compareTo:function(a){var b=this._node;return a&&a._node&&(a=a._node),b===a},inDoc:function(a){var b=this._node;return a=a?a._node||a:b[f],a.documentElement?k.contains(a.documentElement,b):void 0},getById:function(b){var c=this._node,d=k.byId(b,c[f]);return d=d&&k.contains(c,d)?a.one(d):null},ancestor:function(b,c,d){return 2===arguments.length&&("string"==typeof c||"function"==typeof c)&&(d=c),a.one(k.ancestor(this._node,m(b),c,m(d)))},ancestors:function(b,c,d){return 2===arguments.length&&("string"==typeof c||"function"==typeof c)&&(d=c),a.all(k.ancestors(this._node,m(b),c,m(d)))},previous:function(b,c){return a.one(k.elementByAxis(this._node,"previousSibling",m(b),c))},next:function(b,c){return a.one(k.elementByAxis(this._node,"nextSibling",m(b),c))},siblings:function(b){return a.all(k.siblings(this._node,m(b)))},one:function(b){return a.one(a.Selector.query(b,this._node,!0))},all:function(b){var c;return this._node&&(c=a.all(a.Selector.query(b,this._node)),c._query=b,c._queryRoot=this._node),c||a.all([])},test:function(b){return a.Selector.test(this._node,b)},remove:function(a){var b=this._node;return b&&b.parentNode&&b.parentNode.removeChild(b),a&&this.destroy(),this},replace:function(a){var b=this._node;return"string"==typeof a&&(a=l.create(a)),b.parentNode.replaceChild(l.getDOMNode(a),b),this},replaceChild:function(b,c){return"string"==typeof b&&(b=k.create(b)),a.one(this._node.replaceChild(l.getDOMNode(b),l.getDOMNode(c)))},destroy:function(b){var d,c=a.config.doc.uniqueID?"uniqueID":"_yuid";this.purge(),this.unplug&&this.unplug(),this.clearData(),b&&a.NodeList.each(this.all("*"),function(b){d=l._instances[b[c]],d?d.destroy():a.Event.purgeElement(b)}),this._node=null,this._stateProxy=null,delete l._instances[this._yuid]},invoke:function(a,b,c,d,e,f){var h,g=this._node;return b&&b._node&&(b=b._node),c&&c._node&&(c=c._node),h=g[a](b,c,d,e,f),l.scrubVal(h,this)},swap:a.config.doc.documentElement.swapNode?function(a){this._node.swapNode(l.getDOMNode(a))}:function(a){a=l.getDOMNode(a);var b=this._node,c=a.parentNode,d=a.nextSibling;return d===b?c.insertBefore(b,a):a===b.nextSibling?c.insertBefore(a,b):(b.parentNode.replaceChild(a,b),k.addHTML(c,b,d)),this},hasMethod:function(a){var b=this._node;return!(!(b&&a in b&&"unknown"!=typeof b[a])||"function"!=typeof b[a]&&1!==String(b[a]).indexOf("function"))},isFragment:function(){return 11===this.get("nodeType")},empty:function(){return this.get("childNodes").remove().destroy(!0),this},getDOMNode:function(){return this._node}},!0),a.Node=l,a.one=l.one;var n=function(b){var c=[];b&&("string"==typeof b?(this._query=b,b=a.Selector.query(b)):b.nodeType||k.isWindow(b)?b=[b]:b._node?b=[b._node]:b[0]&&b[0]._node?(a.Array.each(b,function(a){a._node&&c.push(a._node)}),b=c):b=a.Array(b,0,!0)),this._nodes=b||[]};n.NAME="NodeList",n.getDOMNodes=function(a){return a&&a._nodes?a._nodes:a},n.each=function(b,c,d){var e=b._nodes;e&&e.length&&a.Array.each(e,c,d||b)},n.addMethod=function(b,c,d){b&&c&&(n.prototype[b]=function(){var b=[],e=arguments;return a.Array.each(this._nodes,function(f){var i,j,g=f.uniqueID&&9!==f.nodeType?"uniqueID":"_yuid",h=a.Node._instances[f[g]];h||(h=n._getTempNode(f)),i=d||h,j=c.apply(i,e),void 0!==j&&j!==h&&(b[b.length]=j)}),b.length?b:this})},n.importMethod=function(b,c,d){"string"==typeof c?(d=d||c,n.addMethod(c,b[c])):a.Array.each(c,function(a){n.importMethod(b,a)})},n._getTempNode=function(b){var c=n._tempNode;return c||(c=a.Node.create("
    "),n._tempNode=c),c._node=b,c._stateProxy=b,c},a.mix(n.prototype,{_invoke:function(a,b,c){var d=c?[]:this;return this.each(function(e){var f=e[a].apply(e,b);c&&d.push(f)}),d},item:function(b){return a.one((this._nodes||[])[b])},each:function(b,c){var d=this;return a.Array.each(this._nodes,function(e,f){return e=a.one(e),b.call(c||e,e,f,d)}),d},batch:function(b,c){var d=this;return a.Array.each(this._nodes,function(e,f){var g=a.Node._instances[e[h]];return g||(g=n._getTempNode(e)),b.call(c||g,g,f,d)}),d},some:function(b,c){var d=this;return a.Array.some(this._nodes,function(e,f){return e=a.one(e),c=c||e,b.call(c,e,f,d)})},toFrag:function(){return a.one(a.DOM._nl2frag(this._nodes))},indexOf:function(b){return a.Array.indexOf(this._nodes,a.Node.getDOMNode(b))},filter:function(b){return a.all(a.Selector.filter(this._nodes,b))},modulus:function(b,c){c=c||0;var d=[];return n.each(this,function(a,e){e%b===c&&d.push(a)}),a.all(d)},odd:function(){return this.modulus(2,1)},even:function(){return this.modulus(2)},destructor:function(){},refresh:function(){var c=this._nodes,d=this._query,e=this._queryRoot;return d&&(e||c&&c[0]&&c[0].ownerDocument&&(e=c[0].ownerDocument),this._nodes=a.Selector.query(d,e)),this},size:function(){return this._nodes.length},isEmpty:function(){return this._nodes.length<1},toString:function(){var e,a="",b=this[h]+": not bound to any nodes",c=this._nodes;return c&&c[0]&&(e=c[0],a+=e[d],e.id&&(a+="#"+e.id),e.className&&(a+="."+e.className.replace(" ",".")),c.length>1&&(a+="...["+c.length+" items]")),a||b},getDOMNodes:function(){return this._nodes}},!0),n.importMethod(a.Node.prototype,["destroy","empty","remove","set"]),n.prototype.get=function(b){var g,h,c=[],d=this._nodes,e=!1,f=n._getTempNode;return d[0]&&(g=a.Node._instances[d[0]._yuid]||f(d[0]),h=g._get(b),h&&h.nodeType&&(e=!0)),a.Array.each(d,function(d){g=a.Node._instances[d._yuid],g||(g=f(d)),h=g._get(b),e||(h=a.Node.scrubVal(h,g)),c.push(h)}),e?a.all(c):c},a.NodeList=n,a.all=function(a){return new n(a)},a.Node.all=a.all;var o=a.NodeList,p=Array.prototype,q={concat:1,pop:0,push:0,shift:0,slice:1,splice:1,unshift:0};a.Object.each(q,function(b,c){o.prototype[c]=function(){for(var f,g,d=[],e=0;"undefined"!=typeof(f=arguments[e++]);)d.push(f._node||f._nodes||f);return g=p[c].apply(this._nodes,d),g=b?a.all(g):a.Node.scrubVal(g)}}),a.Array.each(["removeChild","hasChildNodes","cloneNode","hasAttribute","scrollIntoView","getElementsByTagName","focus","blur","submit","reset","select","createCaption"],function(b){a.Node.prototype[b]=function(a,c,d){var e=this.invoke(b,a,c,d);return e}}),a.Node.prototype.removeAttribute=function(a){var b=this._node;return b&&b.removeAttribute(a,0),this},a.Node.importMethod(a.DOM,["contains","setAttribute","getAttribute","wrap","unwrap","generateID"]),a.NodeList.importMethod(a.Node.prototype,["getAttribute","setAttribute","removeAttribute","unwrap","wrap","generateID"])},"3.10.1",{requires:["dom-core","selector"]}),YUI.add("node-base",function(a){var c=["hasClass","addClass","removeClass","replaceClass","toggleClass"];a.Node.importMethod(a.DOM,c),a.NodeList.importMethod(a.Node.prototype,c);var d=a.Node,e=a.DOM;d.create=function(b,c){return c&&c._node&&(c=c._node),a.one(e.create(b,c))},a.mix(d.prototype,{create:d.create,insert:function(a,b){return this._insert(a,b),this},_insert:function(a,b){var c=this._node,d=null;return"number"==typeof b?b=this._node.childNodes[b]:b&&b._node&&(b=b._node),a&&"string"!=typeof a&&(a=a._node||a._nodes||a),d=e.addHTML(c,a,b)},prepend:function(a){return this.insert(a,0)},append:function(a){return this.insert(a,null)},appendChild:function(a){return d.scrubVal(this._insert(a))},insertBefore:function(b,c){return a.Node.scrubVal(this._insert(b,c))},appendTo:function(b){return a.one(b).append(this),this},setContent:function(a){return this._insert(a,"replace"),this},getContent:function(){return this.get("innerHTML")}}),a.Node.prototype.setHTML=a.Node.prototype.setContent,a.Node.prototype.getHTML=a.Node.prototype.getContent,a.NodeList.importMethod(a.Node.prototype,["append","insert","appendChild","insertBefore","prepend","setContent","getContent","setHTML","getHTML"]);var d=a.Node,e=a.DOM;d.ATTRS={text:{getter:function(){return e.getText(this._node)},setter:function(a){return e.setText(this._node,a),a}},"for":{getter:function(){return e.getAttribute(this._node,"for")},setter:function(a){return e.setAttribute(this._node,"for",a),a}},options:{getter:function(){return this._node.getElementsByTagName("option")}},children:{getter:function(){var d,e,f,b=this._node,c=b.children;if(!c)for(d=b.childNodes,c=[],e=0,f=d.length;f>e;++e)d[e].tagName&&(c[c.length]=d[e]);return a.all(c)}},value:{getter:function(){return e.getValue(this._node)},setter:function(a){return e.setValue(this._node,a),a}}},a.Node.importMethod(a.DOM,["setAttribute","getAttribute"]);var d=a.Node,f=a.NodeList;d.DOM_EVENTS={abort:1,beforeunload:1,blur:1,change:1,click:1,close:1,command:1,contextmenu:1,dblclick:1,DOMMouseScroll:1,drag:1,dragstart:1,dragenter:1,dragover:1,dragleave:1,dragend:1,drop:1,error:1,focus:1,key:1,keydown:1,keypress:1,keyup:1,load:1,message:1,mousedown:1,mouseenter:1,mouseleave:1,mousemove:1,mousemultiwheel:1,mouseout:1,mouseover:1,mouseup:1,mousewheel:1,orientationchange:1,reset:1,resize:1,select:1,selectstart:1,submit:1,scroll:1,textInput:1,unload:1},a.mix(d.DOM_EVENTS,a.Env.evt.plugins),a.augment(d,a.EventTarget),a.mix(d.prototype,{purge:function(b,c){return a.Event.purgeElement(this._node,b,c),this}}),a.mix(a.NodeList.prototype,{_prepEvtArgs:function(b,c,d){var e=a.Array(arguments,0,!0);return e.length<2?e[2]=this._nodes:e.splice(2,0,this._nodes),e[3]=d||this,e},on:function(){return a.on.apply(a,this._prepEvtArgs.apply(this,arguments))},once:function(){return a.once.apply(a,this._prepEvtArgs.apply(this,arguments))},after:function(){return a.after.apply(a,this._prepEvtArgs.apply(this,arguments))},onceAfter:function(){return a.onceAfter.apply(a,this._prepEvtArgs.apply(this,arguments))}}),f.importMethod(a.Node.prototype,["detach","detachAll"]),a.mix(a.Node.ATTRS,{offsetHeight:{setter:function(b){return a.DOM.setHeight(this._node,b),b},getter:function(){return this._node.offsetHeight}},offsetWidth:{setter:function(b){return a.DOM.setWidth(this._node,b),b},getter:function(){return this._node.offsetWidth}}}),a.mix(a.Node.prototype,{sizeTo:function(b,c){var d;arguments.length<2&&(d=a.one(b),b=d.get("offsetWidth"),c=d.get("offsetHeight")),this.setAttrs({offsetWidth:b,offsetHeight:c})}});var d=a.Node;a.mix(d.prototype,{show:function(a){return a=arguments[arguments.length-1],this.toggleView(!0,a),this},_show:function(){this.setStyle("display","")},_isHidden:function(){return"none"===a.DOM.getStyle(this._node,"display")},toggleView:function(){return this._toggleView.apply(this,arguments),this},_toggleView:function(a,b){return b=arguments[arguments.length-1],"boolean"!=typeof a&&(a=this._isHidden()?1:0),a?this._show():this._hide(),"function"==typeof b&&b.call(this),this},hide:function(a){return a=arguments[arguments.length-1],this.toggleView(!1,a),this},_hide:function(){this.setStyle("display","none")}}),a.NodeList.importMethod(a.Node.prototype,["show","hide","toggleView"]),a.config.doc.documentElement.hasAttribute||(a.Node.prototype.hasAttribute=function(a){return"value"===a&&""!==this.get("value")?!0:!!this._node.attributes[a]&&!!this._node.attributes[a].specified}),a.Node.prototype.focus=function(){try{this._node.focus()}catch(a){}return this},a.Node.ATTRS.type={setter:function(a){if("hidden"===a)try{this._node.type="hidden"}catch(b){this.setStyle("display","none"),this._inputType="hidden"}else try{this._node.type=a}catch(b){}return a},getter:function(){return this._inputType||this._node.type},_bypassProxy:!0},a.config.doc.createElement("form").elements.nodeType&&(a.Node.ATTRS.elements={getter:function(){return this.all("input, textarea, button, select")}}),a.mix(a.Node.prototype,{_initData:function(){"_data"in this||(this._data={})},getData:function(b){this._initData();var c=this._data,d=c;return arguments.length?d=b in c?c[b]:this._getDataAttribute(b):"object"==typeof c&&null!==c&&(d={},a.Object.each(c,function(a,b){d[b]=a}),d=this._getDataAttributes(d)),d},_getDataAttributes:function(a){a=a||{};for(var g,b=0,c=this._node.attributes,d=c.length,e=this.DATA_PREFIX,f=e.length;d>b;)g=c[b].name,0===g.indexOf(e)&&(g=g.substr(f),g in a||(a[g]=this._getDataAttribute(g))),b+=1;return a},_getDataAttribute:function(a){a=this.DATA_PREFIX+a;var b=this._node,c=b.attributes,d=c&&c[a]&&c[a].value;return d},setData:function(a,b){return this._initData(),arguments.length>1?this._data[a]=b:this._data=a,this},clearData:function(a){return"_data"in this&&("undefined"!=typeof a?delete this._data[a]:delete this._data),this}}),a.mix(a.NodeList.prototype,{getData:function(a){var b=arguments.length?[a]:[];return this._invoke("getData",b,!0)},setData:function(a,b){var c=arguments.length>1?[a,b]:[a];return this._invoke("setData",c)},clearData:function(a){return arguments.length?[a]:[],this._invoke("clearData",[a])}})},"3.10.1",{requires:["event-base","node-core","dom-base"]}),function(){var a=YUI.Env;a._ready||(a._ready=function(){a.DOMReady=!0,a.remove(YUI.config.doc,"DOMContentLoaded",a._ready)},a.add(YUI.config.doc,"DOMContentLoaded",a._ready))}(),YUI.add("event-base",function(a){a.publish("domready",{fireOnce:!0,async:!0}),YUI.Env.DOMReady?a.fire("domready"):a.Do.before(function(){a.fire("domready")},YUI.Env,"_ready");var c=a.UA,d={},e={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9,63272:46,63273:36,63275:35},f=function(b){if(!b)return b;try{b&&3==b.nodeType&&(b=b.parentNode)}catch(c){return null}return a.one(b)},g=function(a,b,c){this._event=a,this._currentTarget=b,this._wrapper=c||d,this.init()};a.extend(g,Object,{init:function(){var h,a=this._event,b=this._wrapper.overrides,d=a.pageX,g=a.pageY,i=this._currentTarget;this.altKey=a.altKey,this.ctrlKey=a.ctrlKey,this.metaKey=a.metaKey,this.shiftKey=a.shiftKey,this.type=b&&b.type||a.type,this.clientX=a.clientX,this.clientY=a.clientY,this.pageX=d,this.pageY=g,h=a.keyCode||a.charCode,c.webkit&&h in e&&(h=e[h]),this.keyCode=h,this.charCode=h,this.which=a.which||a.charCode||h,this.button=this.which,this.target=f(a.target),this.currentTarget=f(i),this.relatedTarget=f(a.relatedTarget),("mousewheel"==a.type||"DOMMouseScroll"==a.type)&&(this.wheelDelta=a.detail?-1*a.detail:Math.round(a.wheelDelta/80)||(a.wheelDelta<0?-1:1)),this._touch&&this._touch(a,i,this._wrapper)},stopPropagation:function(){this._event.stopPropagation(),this._wrapper.stopped=1,this.stopped=1},stopImmediatePropagation:function(){var a=this._event;a.stopImmediatePropagation?a.stopImmediatePropagation():this.stopPropagation(),this._wrapper.stopped=2,this.stopped=2},preventDefault:function(a){var b=this._event;b.preventDefault(),b.returnValue=a||!1,this._wrapper.prevented=1,this.prevented=1},halt:function(a){a?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()}}),g.resolve=f,a.DOM2EventFacade=g,a.DOMEventFacade=g,function(){a.Env.evt.dom_wrappers={},a.Env.evt.dom_map={};var b=a.DOM,c=a.Env.evt,d=a.config,e=d.win,f=YUI.Env.add,g=YUI.Env.remove,h=function(){YUI.Env.windowLoaded=!0,a.Event._load(),g(e,"load",h)},i=function(){a.Event._unload()},j="domready",k="~yui|2|compat~",l=function(c){try{return c&&"string"!=typeof c&&a.Lang.isNumber(c.length)&&!c.tagName&&!b.isWindow(c)}catch(d){return!1}},m=a.CustomEvent.prototype._delete,n=function(){var c=m.apply(this,arguments);return this.hasSubs()||a.Event._clean(this),c},o=function(){var d=!1,h=0,m=[],p=c.dom_wrappers,q=null,r=c.dom_map;return{POLL_RETRYS:1e3,POLL_INTERVAL:40,lastError:null,_interval:null,_dri:null,DOMReady:!1,startInterval:function(){o._interval||(o._interval=setInterval(o._poll,o.POLL_INTERVAL))},onAvailable:function(b,c,d,e,f,g){var j,k,i=a.Array(b);for(j=0;j4?c.slice(4):null),m&&i.fire(),n):!1},detach:function(c,d,e){var h,i,j,m,n,q,g=a.Array(arguments,0,!0);if(g[g.length-1]===k&&(h=!0),c&&c.detach)return c.detach();if("string"==typeof e&&(h?e=b.byId(e):(e=a.Selector.query(e),i=e.length,1>i?e=null:1==i&&(e=e[0]))),!e)return!1;if(e.detach)return g.splice(2,1),e.detach.apply(e,g);if(l(e)){for(j=!0,m=0,i=e.length;i>m;++m)g[2]=e[m],j=a.Event.detach.apply(a.Event,g)&&j;return j}return c&&d&&d.call?(n="event:"+a.stamp(e)+c,q=p[n],q?q.detach(d):!1):o.purgeElement(e,!1,c)},getEvent:function(b,c,d){var f=b||e.event;return d?f:new a.DOMEventFacade(f,c,p["event:"+a.stamp(c)+b.type])},generateId:function(a){return b.generateID(a)},_isValidCollection:l,_load:function(){d||(d=!0,a.fire&&a.fire(j),o._poll())},_poll:function(){if(!o.locked){if(a.UA.ie&&!YUI.Env.DOMReady)return o.startInterval(),void 0;o.locked=!0;var c,e,f,g,i,j,k=!d;for(k||(k=h>0),i=[],j=function(b,c){var d,e=c.override;try{c.compat?(d=c.override?e===!0?c.obj:e:b,c.fn.call(d,c.obj)):(d=c.obj||a.one(b),c.fn.apply(d,a.Lang.isArray(e)?e:[]))}catch(f){}},c=0,e=m.length;e>c;++c)f=m[c],f&&!f.checkReady&&(g=f.compat?b.byId(f.id):a.Selector.query(f.id,null,!0),g?(j(g,f),m[c]=null):i.push(f));for(c=0,e=m.length;e>c;++c)f=m[c],f&&f.checkReady&&(g=f.compat?b.byId(f.id):a.Selector.query(f.id,null,!0),g?(d||g.get&&g.get("nextSibling")||g.nextSibling)&&(j(g,f),m[c]=null):i.push(f));h=0===i.length?0:h-1,k?o.startInterval():(clearInterval(o._interval),o._interval=null),o.locked=!1}},purgeElement:function(b,c,d){var g,h,i,j,e=a.Lang.isString(b)?a.Selector.query(b,null,!0):b,f=o.getListeners(e,d);if(c&&e)for(f=f||[],i=a.Selector.query("*",e),h=i.length,g=0;h>g;++g)j=o.getListeners(i[g],d),j&&(f=f.concat(j));if(f)for(g=0,h=f.length;h>g;++g)f[g].detachAll()},_clean:function(b){var c=b.key,d=b.domkey;g(b.el,b.type,b.fn,b.capture),delete p[c],delete a._yuievt.events[c],r[d]&&(delete r[d][c],a.Object.size(r[d])||delete r[d])},getListeners:function(b,d){var e=a.stamp(b,!0),f=r[e],g=[],h=d?"event:"+e+d:null,i=c.plugins;return f?(h?(i[d]&&i[d].eventDef&&(h+="_synth"),f[h]&&g.push(f[h]),h+="native",f[h]&&g.push(f[h])):a.each(f,function(a){g.push(a)}),g.length?g:null):null},_unload:function(b){a.each(p,function(a){"unload"==a.type&&a.fire(b),a.detachAll()}),g(e,"unload",i)},nativeAdd:f,nativeRemove:g}}();a.Event=o,d.injected||YUI.Env.windowLoaded?h():f(e,"load",h),a.UA.ie&&a.on(j,o._poll);try{f(e,"unload",i)}catch(p){}o.Custom=a.CustomEvent,o.Subscriber=a.Subscriber,o.Target=a.EventTarget,o.Handle=a.EventHandle,o.Facade=a.EventFacade,o._poll()}(),a.Env.evt.plugins.available={on:function(b,c,d,e){var f=arguments.length>4?a.Array(arguments,4,!0):null;return a.Event.onAvailable.call(a.Event,d,c,e,f)}},a.Env.evt.plugins.contentready={on:function(b,c,d,e){var f=arguments.length>4?a.Array(arguments,4,!0):null;return a.Event.onContentReady.call(a.Event,d,c,e,f)}}},"3.10.1",{requires:["event-custom-base"]}),YUI.add("event-custom-complex",function(a){var c,d,f,e=a.Object,g={},h=a.CustomEvent.prototype,i=a.EventTarget.prototype,j=function(a,b){var c;for(c in b)d.hasOwnProperty(c)||(a[c]=b[c])};a.EventFacade=function(a,b){a||(a=g),this._event=a,this.details=a.details,this.type=a.type,this._type=a.type,this.target=a.target,this.currentTarget=b,this.relatedTarget=a.relatedTarget},a.mix(a.EventFacade.prototype,{stopPropagation:function(){this._event.stopPropagation(),this.stopped=1},stopImmediatePropagation:function(){this._event.stopImmediatePropagation(),this.stopped=2},preventDefault:function(){this._event.preventDefault(),this.prevented=1},halt:function(a){this._event.halt(a),this.prevented=1,this.stopped=a?2:1}}),h.fireComplex=function(b){var c,d,e,f,g,i,j,k,l,m,n,o,p,q,t,u,v,x,h=!0,r=this,s=r.host||r,w=s._yuievt;if(v=r.stack,v&&r.queuable&&r.type!==v.next.type)return v.queue||(v.queue=[]),v.queue.push([r,b]),!0;if(x=r.hasSubs()||w.hasTargets||r.broadcast,r.target=r.target||s,r.currentTarget=s,r.details=b.concat(),x){if(c=v||{id:r.id,next:r,silent:r.silent,stopped:0,prevented:0,bubbling:null,type:r.type,defaultTargetOnly:r.defaultTargetOnly},j=r.getSubs(),k=j[0],l=j[1],r.stopped=r.type!==c.type?0:c.stopped,r.prevented=r.type!==c.type?0:c.prevented,r.stoppedFn&&(i=new a.EventTarget({fireOnce:!0,context:s}),r.events=i,i.on("stopped",r.stoppedFn)),r._facade=null,d=r._getFacade(b),k&&r._procSubs(k,b,d),r.bubbles&&s.bubble&&!r.stopped&&(u=c.bubbling,c.bubbling=r.type,c.type!==r.type&&(c.stopped=0,c.prevented=0),h=s.bubble(r,b,null,c),r.stopped=Math.max(r.stopped,c.stopped),r.prevented=Math.max(r.prevented,c.prevented),c.bubbling=u),o=r.prevented,o?(p=r.preventedFn,p&&p.apply(s,b)):(q=r.defaultFn,q&&(!r.defaultTargetOnly&&!c.defaultTargetOnly||s===d.target)&&q.apply(s,b)),r.broadcast&&r._broadcast(b),l&&!r.prevented&&r.stopped<2)if(m=c.afterQueue,c.id===r.id||r.type!==w.bubbling){if(r._procSubs(l,b,d),m)for(;t=m.last();)t()}else n=l,c.execDefaultCnt&&(n=a.merge(n),a.each(n,function(a){a.postponed=!0})),m||(c.afterQueue=new a.Queue),c.afterQueue.add(function(){r._procSubs(n,b,d)});if(r.target=null,c.id===r.id){if(f=c.queue)for(;f.length;)e=f.pop(),g=e[0],c.next=g,g._fire(e[1]);r.stack=null}return h=!r.stopped,r.type!==w.bubbling&&(c.stopped=0,c.prevented=0,r.stopped=0,r.prevented=0),r._facade=null,h}return q=r.defaultFn,q&&(d=r._getFacade(b),(!r.defaultTargetOnly||s===d.target)&&q.apply(s,b)),h},h._getFacade=function(b){var c=this.details,d=c&&c[0],e="object"==typeof d,f=this._facade;return f||(f=new a.EventFacade(this,this.currentTarget)),e?(j(f,d),d.type&&(f.type=d.type),b&&(b[0]=f)):b&&b.unshift(f),f.details=this.details,f.target=this.originalTarget||this.target,f.currentTarget=this.currentTarget,f.stopped=0,f.prevented=0,this._facade=f,this._facade},h.stopPropagation=function(){this.stopped=1,this.stack&&(this.stack.stopped=1),this.events&&this.events.fire("stopped",this)},h.stopImmediatePropagation=function(){this.stopped=2,this.stack&&(this.stack.stopped=2),this.events&&this.events.fire("stopped",this)},h.preventDefault=function(){this.preventable&&(this.prevented=1,this.stack&&(this.stack.prevented=1))},h.halt=function(a){a?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()},i.addTarget=function(b){var c=this._yuievt;c.targets||(c.targets={}),c.targets[a.stamp(b)]=b,c.hasTargets=!0 -},i.getTargets=function(){var a=this._yuievt.targets;return a?e.values(a):[]},i.removeTarget=function(b){var c=this._yuievt.targets;c&&(delete c[a.stamp(b,!0)],0===e.size(c)&&(this._yuievt.hasTargets=!1))},i.bubble=function(a,b,c,d){var g,h,i,j,k,n,e=this._yuievt.targets,f=!0,l=a&&a.type,m=c||a&&a.target||this;if(!a||!a.stopped&&e)for(i in e)if(e.hasOwnProperty(i)){if(g=e[i],h=g._yuievt.events[l],g._hasSiblings&&(k=g.getSibling(l,h)),k&&!h&&(h=g.publish(l)),n=g._yuievt.bubbling,g._yuievt.bubbling=l,h){if(k&&(h.sibling=k),h.target=m,h.originalTarget=m,h.currentTarget=g,j=h.broadcast,h.broadcast=!1,h.emitFacade=!0,h.stack=d,f=f&&h.fire.apply(h,b||a.details||[]),h.broadcast=j,h.originalTarget=null,h.stopped)break}else g._yuievt.hasTargets&&g.bubble(a,b,m,d);g._yuievt.bubbling=n}return f},c=new a.EventFacade,d={};for(f in c)d[f]=!0},"3.10.1",{requires:["event-custom-base"]}),YUI.add("event-synthetic",function(a){function c(a,b){this.handle=a,this.emitFacade=b}function d(a,b,c){this.handles=[],this.el=a,this.key=c,this.domkey=b}function e(){this._init.apply(this,arguments)}var f=a.CustomEvent,g=a.Env.evt.dom_map,h=a.Array,i=a.Lang,j=i.isObject,k=i.isString,l=i.isArray,m=a.Selector.query,n=function(){};c.prototype.fire=function(b){var l,c=h(arguments,0,!0),d=this.handle,e=d.evt,f=d.sub,g=f.context,i=f.filter,k=b||{};return this.emitFacade?(b&&b.preventDefault||(k=e._getFacade(),j(b)&&!b.preventDefault?(a.mix(k,b,!0),c[0]=k):c.unshift(k)),k.type=e.type,k.details=c.slice(),i&&(k.container=e.host)):i&&j(b)&&b.currentTarget&&c.shift(),f.context=g||k.currentTarget||e.host,l=e.fire.apply(e,c),f.context=g,l},d.prototype={constructor:d,type:"_synth",fn:n,capture:!1,register:function(a){a.evt.registry=this,this.handles.push(a)},unregister:function(b){var e,c=this.handles,d=g[this.domkey];for(e=c.length-1;e>=0;--e)if(c[e].sub===b){c.splice(e,1);break}c.length||(delete d[this.key],a.Object.size(d)||delete g[this.domkey])},detachAll:function(){for(var a=this.handles,b=a.length;--b>=0;)a[b].detach()}},a.mix(e,{Notifier:c,SynthRegistry:d,getRegistry:function(b,c,e){var f=b._node,h=a.stamp(f),i="event:"+h+c+"_synth",j=g[h];return e&&(j||(j=g[h]={}),j[i]||(j[i]=new d(f,h,i))),j&&j[i]||null},_deleteSub:function(a){if(a&&a.fn){var b=this.eventDef,c=a.filter?"detachDelegate":"detach";this._subscribers=[],f.keepDeprecatedSubs&&(this.subscribers={}),b[c](a.node,a,this.notifier,a.filter),this.registry.unregister(a),delete a.fn,delete a.node,delete a.context}},prototype:{constructor:e,_init:function(){var a=this.publishConfig||(this.publishConfig={});this.emitFacade="emitFacade"in a?a.emitFacade:!0,a.emitFacade=!1},processArgs:n,on:n,detach:n,delegate:n,detachDelegate:n,_on:function(b,c){var j,l,d=[],e=b.slice(),f=this.processArgs(b,c),g=b[2],i=c?"delegate":"on";return j=k(g)?m(g):h(g||a.one(a.config.win)),!j.length&&k(g)?l=a.on("available",function(){a.mix(l,a[i].apply(a,e),!0)},g):(a.Array.each(j,function(e){var h,g=b.slice();e=a.one(e),e&&(c&&(h=g.splice(3,1)[0]),g.splice(0,4,g[1],g[3]),(!this.preventDups||!this.getSubs(e,b,null,!0))&&d.push(this._subscribe(e,i,g,f,h)))},this),1===d.length?d[0]:new a.EventHandle(d))},_subscribe:function(b,d,f,g,h){var i=new a.CustomEvent(this.type,this.publishConfig),j=i.on.apply(i,f),k=new c(j,this.emitFacade),l=e.getRegistry(b,this.type,!0),m=j.sub;return m.node=b,m.filter=h,g&&this.applyArgExtras(g,m),a.mix(i,{eventDef:this,notifier:k,host:b,currentTarget:b,target:b,el:b._node,_delete:e._deleteSub},!0),j.notifier=k,l.register(j),this[d](b,m,k,h),j},applyArgExtras:function(a,b){b._extra=a},_detach:function(b){var e,f,g,i,j,c=b[2],d=k(c)?m(c):h(c);for(b.splice(2,1),f=0,g=d.length;g>f;++f)if(e=a.one(d[f]),e&&(i=this.getSubs(e,b)))for(j=i.length-1;j>=0;--j)i[j].detach()},getSubs:function(a,b,c,d){var h,i,j,k,f=e.getRegistry(a,this.type),g=[];if(f)for(h=f.handles,c||(c=this.subMatch),i=0,j=h.length;j>i;++i)if(k=h[i],c.call(this,k.sub,b)){if(d)return k;g.push(h[i])}return g.length&&g},subMatch:function(a,b){return!b[1]||a.fn===b[1]}}},!0),a.SyntheticEvent=e,a.Event.define=function(b,c,d){var f,g,i;return b&&b.type?(f=b,d=c):c&&(f=a.merge({type:b},c)),f?(d||!a.Node.DOM_EVENTS[f.type])&&(g=function(){e.apply(this,arguments)},a.extend(g,e,f),i=new g,b=i.type,a.Node.DOM_EVENTS[b]=a.Env.evt.plugins[b]={eventDef:i,on:function(){return i._on(h(arguments))},delegate:function(){return i._on(h(arguments),!0)},detach:function(){return i._detach(h(arguments))}}):(k(b)||l(b))&&a.Array.each(h(b),function(b){a.Node.DOM_EVENTS[b]=1}),i}},"3.10.1",{requires:["node-base","event-custom-complex"]}),YUI.add("history-base",function(a){function c(){this._init.apply(this,arguments)}function d(a){return"object"===e.type(a)}var e=a.Lang,f=a.Object,g=YUI.namespace("Env.History"),h=a.Array,i=a.config.doc,j=i.documentMode,k=a.config.win,l={merge:!0},m="change",n="add",o="replace";a.augment(c,a.EventTarget,null,null,{emitFacade:!0,prefix:"history",preventable:!1,queueable:!0}),g._state||(g._state={}),c.NAME="historyBase",c.SRC_ADD=n,c.SRC_REPLACE=o,c.html5=!!(k.history&&k.history.pushState&&k.history.replaceState&&("onpopstate"in k||a.UA.gecko>=2)&&(!a.UA.android||a.UA.android>=2.4)),c.nativeHashChange=("onhashchange"in k||"onhashchange"in i)&&(!j||j>7),a.mix(c.prototype,{_init:function(a){var b;a=this._config=a||{},this.force=!!a.force,b=this._initialState=this._initialState||a.initialState||null,this.publish(m,{broadcast:2,defaultFn:this._defChangeFn}),b&&this.replace(b)},add:function(){var a=h(arguments,0,!0);return a.unshift(n),this._change.apply(this,a)},addValue:function(a,b,c){var d={};return d[a]=b,this._change(n,d,c)},get:function(b){var c=g._state,e=d(c);return b?e&&f.owns(c,b)?c[b]:void 0:e?a.mix({},c,!0):c},replace:function(){var a=h(arguments,0,!0);return a.unshift(o),this._change.apply(this,a)},replaceValue:function(a,b,c){var d={};return d[a]=b,this._change(o,d,c)},_change:function(b,c,e){return e=e?a.merge(l,e):l,e.merge&&d(c)&&d(g._state)&&(c=a.merge(g._state,c)),this._resolveChanges(b,c,e),this},_fireEvents:function(a,b,c){this.fire(m,{_options:c,changed:b.changed,newVal:b.newState,prevVal:b.prevState,removed:b.removed,src:a}),f.each(b.changed,function(b,c){this._fireChangeEvent(a,c,b)},this),f.each(b.removed,function(b,c){this._fireRemoveEvent(a,c,b)},this)},_fireChangeEvent:function(a,b,c){this.fire(b+"Change",{newVal:c.newVal,prevVal:c.prevVal,src:a})},_fireRemoveEvent:function(a,b,c){this.fire(b+"Remove",{prevVal:c,src:a})},_resolveChanges:function(a,b,c){var h,e={},i=g._state,j={};b||(b={}),c||(c={}),d(b)&&d(i)?(f.each(b,function(a,b){var c=i[b];a!==c&&(e[b]={newVal:a,prevVal:c},h=!0)},this),f.each(i,function(a,c){f.owns(b,c)&&null!==b[c]||(delete b[c],j[c]=a,h=!0)},this)):h=b!==i,(h||this.force)&&this._fireEvents(a,{changed:e,newState:b,prevState:i,removed:j},c)},_storeState:function(a,b){g._state=b||{}},_defChangeFn:function(a){this._storeState(a.src,a.newVal,a._options)}},!0),a.HistoryBase=c},"3.10.1",{requires:["event-custom-complex"]}),YUI.add("history-html5",function(a){function c(){c.superclass.constructor.apply(this,arguments)}var d=a.HistoryBase,e=a.Lang,f=a.config.win,g=a.config.useHistoryHTML5,h="popstate",i=d.SRC_REPLACE;a.extend(c,d,{_init:function(b){var d=f.history.state;a.Object.isEmpty(d)&&(d=null),b||(b={}),this._initialState=b.initialState&&"object"===e.type(b.initialState)&&"object"===e.type(d)?a.merge(b.initialState,d):d,a.on("popstate",this._onPopState,f,this),c.superclass._init.apply(this,arguments)},_storeState:function(b,d,e){b!==h&&f.history[b===i?"replaceState":"pushState"](d,e.title||a.config.doc.title||"",e.url||null),c.superclass._storeState.apply(this,arguments)},_onPopState:function(a){this._resolveChanges(h,a._event.state||null)}},{NAME:"historyhtml5",SRC_POPSTATE:h}),a.Node.DOM_EVENTS.popstate||(a.Node.DOM_EVENTS.popstate=1),a.HistoryHTML5=c,(g===!0||g!==!1&&d.html5)&&(a.History=c)},"3.10.1",{optional:["json"],requires:["event-base","history-base","node-base"]}),YUI.add("history-hash",function(a){function c(){c.superclass.constructor.apply(this,arguments)}var j,k,l,d=a.HistoryBase,e=a.Lang,f=a.Array,g=a.Object,h=YUI.namespace("Env.HistoryHash"),i="hash",m=a.config.win,n=a.config.useHistoryHTML5;a.extend(c,d,{_init:function(b){var d=c.parseHash();b=b||{},this._initialState=b.initialState?a.merge(b.initialState,d):d,a.after("hashchange",a.bind(this._afterHashChange,this),m),c.superclass._init.apply(this,arguments)},_change:function(a,b,d){return g.each(b,function(a,c){e.isValue(a)&&(b[c]=a.toString())}),c.superclass._change.call(this,a,b,d)},_storeState:function(a,b){var e=c.decode,f=c.createHash(b);c.superclass._storeState.apply(this,arguments),a!==i&&e(c.getHash())!==e(f)&&c[a===d.SRC_REPLACE?"replaceHash":"setHash"](f)},_afterHashChange:function(a){this._resolveChanges(i,c.parseHash(a.newHash),{})}},{NAME:"historyHash",SRC_HASH:i,hashPrefix:"",_REGEX_HASH:/([^\?#&]+)=([^&]+)/g,createHash:function(a){var b=c.encode,d=[];return g.each(a,function(a,c){e.isValue(a)&&d.push(b(c)+"="+b(a))}),d.join("&")},decode:function(a){return decodeURIComponent(a.replace(/\+/g," "))},encode:function(a){return encodeURIComponent(a).replace(/%20/g,"+")},getHash:a.UA.gecko?function(){var b=a.getLocation(),d=/#(.*)$/.exec(b.href),e=d&&d[1]||"",f=c.hashPrefix;return f&&0===e.indexOf(f)?e.replace(f,""):e}:function(){var b=a.getLocation(),d=b.hash.substring(1),e=c.hashPrefix;return e&&0===d.indexOf(e)?d.replace(e,""):d},getUrl:function(){return location.href},parseHash:function(a){var d,f,g,h,k,b=c.decode,i={},j=c.hashPrefix;for(a=e.isValue(a)?a:c.getHash(),j&&(k=a.indexOf(j),(0===k||1===k&&"#"===a.charAt(0))&&(a=a.replace(j,""))),g=a.match(c._REGEX_HASH)||[],d=0,f=g.length;f>d;++d)h=g[d].split("="),i[b(h[0])]=b(h[1]);return i},replaceHash:function(b){var d=a.getLocation(),e=d.href.replace(/#.*$/,"");"#"===b.charAt(0)&&(b=b.substring(1)),d.replace(e+"#"+(c.hashPrefix||"")+b)},setHash:function(b){var d=a.getLocation();"#"===b.charAt(0)&&(b=b.substring(1)),d.hash=(c.hashPrefix||"")+b}}),j=h._notifiers,j||(j=h._notifiers=[]),a.Event.define("hashchange",{on:function(b,c,d){(b.compareTo(m)||b.compareTo(a.config.doc.body))&&j.push(d)},detach:function(a,b,c){var d=f.indexOf(j,c);-1!==d&&j.splice(d,1)}}),k=c.getHash(),l=c.getUrl(),d.nativeHashChange?h._hashHandle||(h._hashHandle=a.Event.attach("hashchange",function(a){var b=c.getHash(),d=c.getUrl();f.each(j.concat(),function(c){c.fire({_event:a,oldHash:k,oldUrl:l,newHash:b,newUrl:d})}),k=b,l=d},m)):h._hashPoll||(h._hashPoll=a.later(50,null,function(){var b,d,a=c.getHash();k!==a&&(d=c.getUrl(),b={oldHash:k,oldUrl:l,newHash:a,newUrl:d},k=a,l=d,f.each(j.concat(),function(a){a.fire(b)}))},null,!0)),a.HistoryHash=c,n!==!1&&(a.History||n===!0||d.html5&&a.HistoryHTML5)||(a.History=c)},"3.10.1",{requires:["event-synthetic","history-base","yui-later"]}),YUI.add("dom-style",function(a){!function(a){var b="documentElement",c="defaultView",d="ownerDocument",e="style",f="float",g="cssFloat",h="styleFloat",i="transparent",j="getComputedStyle",k="getBoundingClientRect",m=(a.config.win,a.config.doc),n=void 0,o=a.DOM,p="transform",q="transformOrigin",r=["WebkitTransform","MozTransform","OTransform","msTransform"],s=/color$/i,t=/width|height|top|left|right|bottom|margin|padding/i;a.Array.each(r,function(a){a in m[b].style&&(p=a,q=a+"Origin")}),a.mix(o,{DEFAULT_UNIT:"px",CUSTOM_STYLES:{},setStyle:function(a,b,c,d){d=d||a.style;var e=o.CUSTOM_STYLES;if(d){if(null===c||""===c?c="":!isNaN(new Number(c))&&t.test(b)&&(c+=o.DEFAULT_UNIT),b in e){if(e[b].set)return e[b].set(a,c,d),void 0;"string"==typeof e[b]&&(b=e[b])}else""===b&&(b="cssText",c="");d[b]=c}},getStyle:function(a,b,c){c=c||a.style;var d=o.CUSTOM_STYLES,e="";if(c){if(b in d){if(d[b].get)return d[b].get(a,b,c);"string"==typeof d[b]&&(b=d[b])}e=c[b],""===e&&(e=o[j](a,b))}return e},setStyles:function(b,c){var d=b.style;a.each(c,function(a,c){o.setStyle(b,c,a,d)},o)},getComputedStyle:function(a,b){var h,f="",g=a[d];return a[e]&&g[c]&&g[c][j]&&(h=g[c][j](a,null),h&&(f=h[b])),f}}),m[b][e][g]!==n?o.CUSTOM_STYLES[f]=g:m[b][e][h]!==n&&(o.CUSTOM_STYLES[f]=h),a.UA.opera&&(o[j]=function(b,e){var f=b[d][c],g=f[j](b,"")[e];return s.test(e)&&(g=a.Color.toRGB(g)),g}),a.UA.webkit&&(o[j]=function(a,b){var e=a[d][c],f=e[j](a,"")[b];return"rgba(0, 0, 0, 0)"===f&&(f=i),f}),a.DOM._getAttrOffset=function(b,c){var f,g,h,d=a.DOM[j](b,c),e=b.offsetParent;return"auto"===d&&(f=a.DOM.getStyle(b,"position"),"static"===f||"relative"===f?d=0:e&&e[k]&&(g=e[k]()[c],h=b[k]()[c],d="left"===c||"top"===c?h-g:g-b[k]()[c])),d},a.DOM._getOffset=function(a){var b,c=null;return a&&(b=o.getStyle(a,"position"),c=[parseInt(o[j](a,"left"),10),parseInt(o[j](a,"top"),10)],isNaN(c[0])&&(c[0]=parseInt(o.getStyle(a,"left"),10),isNaN(c[0])&&(c[0]="relative"===b?0:a.offsetLeft||0)),isNaN(c[1])&&(c[1]=parseInt(o.getStyle(a,"top"),10),isNaN(c[1])&&(c[1]="relative"===b?0:a.offsetTop||0))),c},o.CUSTOM_STYLES.transform={set:function(a,b,c){c[p]=b},get:function(a){return o[j](a,p)}},o.CUSTOM_STYLES.transformOrigin={set:function(a,b,c){c[q]=b},get:function(a){return o[j](a,q)}}}(a),function(a){var b=parseInt,c=RegExp;a.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(d){return a.Color.re_RGB.test(d)||(d=a.Color.toHex(d)),a.Color.re_hex.exec(d)&&(d="rgb("+[b(c.$1,16),b(c.$2,16),b(c.$3,16)].join(", ")+")"),d},toHex:function(b){if(b=a.Color.KEYWORDS[b]||b,a.Color.re_RGB.exec(b)){b=[Number(c.$1).toString(16),Number(c.$2).toString(16),Number(c.$3).toString(16)];for(var d=0;d=4.2)&&(e[0]+=f,e[1]+=g)):e=o._getOffset(d)),e}:function(b){var f,g,h,i,j,c=null;if(b)if(o.inDoc(b)){for(c=[b.offsetLeft,b.offsetTop],f=b.ownerDocument,g=b,h=a.UA.gecko||a.UA.webkit>519?!0:!1;g=g.offsetParent;)c[0]+=g.offsetLeft,c[1]+=g.offsetTop,h&&(c=o._calcBorders(g,c));if(o.getStyle(b,d)!=e){for(g=b;g=g.parentNode;)i=g.scrollTop,j=g.scrollLeft,a.UA.gecko&&"visible"!==o.getStyle(g,"overflow")&&(c=o._calcBorders(g,c)),(i||j)&&(c[0]-=j,c[1]-=i);c[0]+=o.docScrollX(b,f),c[1]+=o.docScrollY(b,f)}else c[0]+=o.docScrollX(b,f),c[1]+=o.docScrollY(b,f)}else c=o._getOffset(b);return c}}(),getScrollbarWidth:a.cached(function(){var b=a.config.doc,c=b.createElement("div"),d=b.getElementsByTagName("body")[0],e=.1;return d&&(c.style.cssText="position:absolute;visibility:hidden;overflow:scroll;width:20px;",c.appendChild(b.createElement("p")).style.height="1px",d.insertBefore(c,d.firstChild),e=c.offsetWidth-c.clientWidth,d.removeChild(c)),e},null,.1),getX:function(a){return o.getXY(a)[0]},getY:function(a){return o.getXY(a)[1]},setXY:function(a,b,c){var i,j,k,l,e=o.setStyle;a&&b&&(i=o.getStyle(a,d),j=o._getOffset(a),"static"==i&&(i=f,e(a,d,i)),l=o.getXY(a),null!==b[0]&&e(a,g,b[0]-l[0]+j[0]+"px"),null!==b[1]&&e(a,h,b[1]-l[1]+j[1]+"px"),c||(k=o.getXY(a),(k[0]!==b[0]||k[1]!==b[1])&&o.setXY(a,b,!0)))},setX:function(a,b){return o.setXY(a,[b,null])},setY:function(a,b){return o.setXY(a,[null,b])},swapXY:function(a,b){var c=o.getXY(a);o.setXY(a,o.getXY(b)),o.setXY(b,c)},_calcBorders:function(b,c){var d=parseInt(o[n](b,l),10)||0,e=parseInt(o[n](b,k),10)||0;return a.UA.gecko&&p.test(b.tagName)&&(d=0,e=0),c[0]+=e,c[1]+=d,c},_getWinSize:function(d,e){e=e||d?o._getDoc(d):a.config.doc;var f=e.defaultView||e.parentWindow,g=e[c],h=f.innerHeight,i=f.innerWidth,j=e[b];return g&&!a.UA.opera&&("CSS1Compat"!=g&&(j=e.body),h=j.clientHeight,i=j.clientWidth),{height:h,width:i}},_getDocSize:function(d){var e=d?o._getDoc(d):a.config.doc,f=e[b];return"CSS1Compat"!=e[c]&&(f=e.body),{height:f.scrollHeight,width:f.scrollWidth}}})}(a),function(a){var b="top",c="right",d="bottom",e="left",f=function(a,f){var g=Math.max(a[b],f[b]),h=Math.min(a[c],f[c]),i=Math.min(a[d],f[d]),j=Math.max(a[e],f[e]),k={};return k[b]=g,k[c]=h,k[d]=i,k[e]=j,k},g=a.DOM;a.mix(g,{region:function(a){var b=g.getXY(a),c=!1;return a&&b&&(c=g._getRegion(b[1],b[0]+a.offsetWidth,b[1]+a.offsetHeight,b[0])),c},intersect:function(h,i,j){var n,k=j||g.region(h),l={},m=i;if(m.tagName)l=g.region(m);else{if(!a.Lang.isObject(i))return!1;l=i}return n=f(l,k),{top:n[b],right:n[c],bottom:n[d],left:n[e],area:(n[d]-n[b])*(n[c]-n[e]),yoff:n[d]-n[b],xoff:n[c]-n[e],inRegion:g.inRegion(h,i,!1,j)}},inRegion:function(h,i,j,k){var o,l={},m=k||g.region(h),n=i;if(n.tagName)l=g.region(n);else{if(!a.Lang.isObject(i))return!1;l=i}return j?m[e]>=l[e]&&m[c]<=l[c]&&m[b]>=l[b]&&m[d]<=l[d]:(o=f(l,m),o[d]>=o[b]&&o[c]>=o[e]?!0:!1)},inViewportRegion:function(a,b,c){return g.inRegion(a,g.viewportRegion(a),b,c)},_getRegion:function(a,f,g,h){var i={};return i[b]=i[1]=a,i[e]=i[0]=h,i[d]=g,i[c]=f,i.width=i[c]-i[e],i.height=i[d]-i[b],i},viewportRegion:function(b){b=b||a.config.doc.documentElement;var d,e,c=!1;return b&&(d=g.docScrollX(b),e=g.docScrollY(b),c=g._getRegion(e,g.winWidth(b)+d,e+g.winHeight(b),d)),c}})}(a)},"3.10.1",{requires:["dom-base","dom-style"]}),YUI.add("node-screen",function(a){a.each(["winWidth","winHeight","docWidth","docHeight","docScrollX","docScrollY"],function(b){a.Node.ATTRS[b]={getter:function(){var c=Array.prototype.slice.call(arguments);return c.unshift(a.Node.getDOMNode(this)),a.DOM[b].apply(this,c)}}}),a.Node.ATTRS.scrollLeft={getter:function(){var b=a.Node.getDOMNode(this);return"scrollLeft"in b?b.scrollLeft:a.DOM.docScrollX(b)},setter:function(b){var c=a.Node.getDOMNode(this);c&&("scrollLeft"in c?c.scrollLeft=b:(c.document||9===c.nodeType)&&a.DOM._getWin(c).scrollTo(b,a.DOM.docScrollY(c)))}},a.Node.ATTRS.scrollTop={getter:function(){var b=a.Node.getDOMNode(this);return"scrollTop"in b?b.scrollTop:a.DOM.docScrollY(b)},setter:function(b){var c=a.Node.getDOMNode(this);c&&("scrollTop"in c?c.scrollTop=b:(c.document||9===c.nodeType)&&a.DOM._getWin(c).scrollTo(a.DOM.docScrollX(c),b))}},a.Node.importMethod(a.DOM,["getXY","setXY","getX","setX","getY","setY","swapXY"]),a.Node.ATTRS.region={getter:function(){var c,b=this.getDOMNode();return b&&!b.tagName&&9===b.nodeType&&(b=b.documentElement),c=a.DOM.isWindow(b)?a.DOM.viewportRegion(b):a.DOM.region(b)}},a.Node.ATTRS.viewportRegion={getter:function(){return a.DOM.viewportRegion(a.Node.getDOMNode(this))}},a.Node.importMethod(a.DOM,"inViewportRegion"),a.Node.prototype.intersect=function(b,c){var d=a.Node.getDOMNode(this);return a.instanceOf(b,a.Node)&&(b=a.Node.getDOMNode(b)),a.DOM.intersect(d,b,c)},a.Node.prototype.inRegion=function(b,c,d){var e=a.Node.getDOMNode(this);return a.instanceOf(b,a.Node)&&(b=a.Node.getDOMNode(b)),a.DOM.inRegion(e,b,c,d)}},"3.10.1",{requires:["dom-screen","node-base"]}),YUI.add("node-style",function(a){!function(a){a.mix(a.Node.prototype,{setStyle:function(b,c){return a.DOM.setStyle(this._node,b,c),this},setStyles:function(b){return a.DOM.setStyles(this._node,b),this},getStyle:function(b){return a.DOM.getStyle(this._node,b)},getComputedStyle:function(b){return a.DOM.getComputedStyle(this._node,b)}}),a.NodeList.importMethod(a.Node.prototype,["getStyle","getComputedStyle","setStyle","setStyles"])}(a)},"3.10.1",{requires:["dom-style","node-base"]}),YUI.add("classnamemanager",function(a){var c="classNamePrefix",d="classNameDelimiter",e=a.config;e[c]=e[c]||"yui3",e[d]=e[d]||"-",a.ClassNameManager=function(){var b=e[c],f=e[d];return{getClassName:a.cached(function(){var c=a.Array(arguments);return c[c.length-1]!==!0?c.unshift(b):c.pop(),c.join(f)})}}()},"3.10.1",{requires:["yui-base"]}),YUI.add("event-delegate",function(a){function c(b,e,i,k){var n,o,p,q,r,s,t,u,v,l=d(arguments,0,!0),m=f(i)?i:null;if(g(b)){if(u=[],h(b))for(s=0,t=b.length;t>s;++s)l[0]=b[s],u.push(a.delegate.apply(a,l));else{l.unshift(null);for(s in b)b.hasOwnProperty(s)&&(l[0]=s,l[1]=b[s],u.push(a.delegate.apply(a,l)))}return new a.EventHandle(u)}if(n=b.split(/\|/),n.length>1&&(r=n.shift(),l[0]=b=n.shift()),o=a.Node.DOM_EVENTS[b],g(o)&&o.delegate&&(v=o.delegate.apply(o,arguments)),!v){if(!(b&&e&&i&&k))return;p=m?a.Selector.query(m,null,!0):i,!p&&f(i)&&(v=a.on("available",function(){a.mix(v,a.delegate.apply(a,l),!0)},i)),!v&&p&&(l.splice(2,2,p),v=a.Event._attach(l,{facade:!1}),v.sub.filter=k,v.sub._notify=c.notifySub)}return v&&r&&(q=j[r]||(j[r]={}),q=q[b]||(q[b]=[]),q.push(v)),v}var d=a.Array,e=a.Lang,f=e.isString,g=e.isObject,h=e.isArray,i=a.Selector.test,j=a.Env.evt.handles;c.notifySub=function(b,e,f){e=e.slice(),this.args&&e.push.apply(e,this.args);var h,i,j,k,g=c._applyFilter(this.filter,e,f);if(g){for(g=d(g),h=e[0]=new a.DOMEventFacade(e[0],f.el,f),h.container=a.one(f.el),i=0,j=g.length;j>i&&!h.stopped&&(h.currentTarget=a.one(g[i]),k=this.fn.apply(this.context||h.currentTarget,e),k!==!1);++i);return k}},c.compileFilter=a.cached(function(a){return function(b,c){return i(b._node,a,c.currentTarget===c.target?null:c.currentTarget._node)}}),c._disabledRE=/^(?:button|input|select|textarea)$/i,c._applyFilter=function(b,d,e){var g=d[0],h=e.el,j=g.target||g.srcElement,k=[],l=!1;if(3===j.nodeType&&(j=j.parentNode),j.disabled&&c._disabledRE.test(j.nodeName))return k;if(d.unshift(j),f(b))for(;j&&(l=j===h,i(j,b,l?null:h)&&k.push(j),!l);)j=j.parentNode;else{for(d[0]=a.one(j),d[1]=new a.DOMEventFacade(g,h,e);j&&(b.apply(d[0],d)&&k.push(j),j!==h);)j=j.parentNode,d[0]=a.one(j);d[1]=g}return k.length<=1&&(k=k[0]),d.shift(),k},a.delegate=a.Event.delegate=c},"3.10.1",{requires:["node-base"]}),YUI.add("node-event-delegate",function(a){a.Node.prototype.delegate=function(b){var c=a.Array(arguments,0,!0),d=a.Lang.isObject(b)&&!a.Lang.isArray(b)?1:2;return c.splice(d,0,this._node),a.delegate.apply(a,c)}},"3.10.1",{requires:["node-base","event-delegate"]}),YUI.add("array-extras",function(a){var c=a.Array,d=a.Lang,e=Array.prototype;c.lastIndexOf=d._isNative(e.lastIndexOf)?function(a,b,c){return c||0===c?a.lastIndexOf(b,c):a.lastIndexOf(b)}:function(a,b,c){var d=a.length,e=d-1;if((c||0===c)&&(e=Math.min(0>c?d+c:c,d)),e>-1&&d>0)for(;e>-1;--e)if(e in a&&a[e]===b)return e;return-1},c.unique=function(a,b){var f,g,h,i,c=0,d=a.length,e=[];a:for(;d>c;c++){for(i=a[c],f=0,h=e.length;h>f;f++)if(g=e[f],b){if(b.call(a,i,g,c,a))continue a}else if(i===g)continue a;e.push(i)}return e},c.filter=d._isNative(e.filter)?function(a,b,c){return e.filter.call(a,b,c)}:function(a,b,c){for(var g,d=0,e=a.length,f=[];e>d;++d)d in a&&(g=a[d],b.call(c,g,d,a)&&f.push(g));return f},c.reject=function(a,b,d){return c.filter(a,function(a,c,e){return!b.call(d,a,c,e)})},c.every=d._isNative(e.every)?function(a,b,c){return e.every.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!1;return!0},c.map=d._isNative(e.map)?function(a,b,c){return e.map.call(a,b,c)}:function(a,b,c){for(var d=0,f=a.length,g=e.concat.call(a);f>d;++d)d in a&&(g[d]=b.call(c,a[d],d,a));return g},c.reduce=d._isNative(e.reduce)?function(a,b,c,d){return e.reduce.call(a,function(a,b,e,f){return c.call(d,a,b,e,f)},b)}:function(a,b,c,d){for(var e=0,f=a.length,g=b;f>e;++e)e in a&&(g=c.call(d,g,a[e],e,a));return g},c.find=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 a[d];return null},c.grep=function(a,b){return c.filter(a,function(a){return b.test(a)})},c.partition=function(a,b,d){var e={matches:[],rejects:[]};return c.each(a,function(c,f){var g=b.call(d,c,f,a)?e.matches:e.rejects;g.push(c)}),e},c.zip=function(a,b){var d=[];return c.each(a,function(a,c){d.push([a,b[c]])}),d},c.flatten=function(a){var e,f,g,b=[];if(!a)return b;for(e=0,f=a.length;f>e;++e)g=a[e],d.isArray(g)?b.push.apply(b,c.flatten(g)):b.push(g);return b}},"3.10.1",{requires:["yui-base"]}),YUI.add("attribute-core",function(a){function c(a,b,c){this._yuievt=null,this._initAttrHost(a,b,c)}a.State=function(){this.data={}},a.State.prototype={add:function(a,b,c){var d=this.data[a];d||(d=this.data[a]={}),d[b]=c},addAll:function(a,b){var d,c=this.data[a];c||(c=this.data[a]={});for(d in b)b.hasOwnProperty(d)&&(c[d]=b[d])},remove:function(a,b){var c=this.data[a];c&&delete c[b]},removeAll:function(b,c){var d;c?a.each(c,function(a,c){this.remove(b,"string"==typeof c?c:a)},this):(d=this.data,b in d&&delete d[b])},get:function(a,b){var c=this.data[a];return c?c[b]:void 0},getAll:function(a,b){var d,e,c=this.data[a];if(b)e=c;else if(c){e={};for(d in c)c.hasOwnProperty(d)&&(e[d]=c[d])}return e}};var t,d=a.Object,e=a.Lang,f=".",g="getter",h="setter",i="readOnly",j="writeOnce",k="initOnly",l="validator",m="value",n="valueFn",o="lazyAdd",p="added",q="_bypassProxy",r="initValue",s="lazy";c.INVALID_VALUE={},t=c.INVALID_VALUE,c._ATTR_CFG=[h,g,l,m,n,j,i,o,q],c.protectAttrs=function(b){if(b){b=a.merge(b);for(var c in b)b.hasOwnProperty(c)&&(b[c]=a.merge(b[c]))}return b},c.prototype={_initAttrHost:function(b,c,d){this._state=new a.State,this._initAttrs(b,c,d)},addAttr:function(a,b,c){var h,i,j,d=this,e=d._state,f=e.data,g=f[a];return b=b||{},o in b&&(c=b[o]),i=e.get(a,p),c&&!i?(g||(g=f[a]={}),g.lazy=b,g.added=!0):(!i||b.isLazyAdd)&&(j=m in b,j?(h=b.value,b.value=void 0):g&&m in g&&(b.value=g.value),b.added=!0,b.initializing=!0,f[a]=b,j&&d.set(a,h),b.initializing=!1),d},attrAdded:function(a){return!!this._state.get(a,p)},get:function(a){return this._getAttr(a)},_isLazyAttr:function(a){return this._state.get(a,s)},_addLazyAttr:function(a,b){var c=this._state;b=b||c.get(a,s),b&&(c.data[a].lazy=void 0,b.isLazyAdd=!0,this.addAttr(a,b))},set:function(a,b,c){return this._setAttr(a,b,c)},_set:function(a,b,c){return this._setAttr(a,b,c,!0)},_setAttr:function(b,c,e,g){var l,m,n,o,p,q,r,h=!0,i=this._state,j=this._stateProxy;return-1!==b.indexOf(f)&&(n=b,o=b.split(f),b=o.shift()),l=i.data[b]||{},l.lazy&&(l=l.lazy,this._addLazyAttr(b,l)),m=void 0===l.value,j&&b in j&&!l._bypassProxy&&(m=!1),q=l.writeOnce,r=l.initializing,!m&&!g&&(q&&(h=!1),l.readOnly&&(h=!1)),!r&&!g&&q===k&&(h=!1),h&&(m||(p=this.get(b)),o&&(c=d.setValue(a.clone(p),o,c),void 0===c&&(h=!1)),h&&(!this._fireAttrChange||r?this._setAttrVal(b,n,p,c,e,l):this._fireAttrChange(b,n,p,c,e,l))),this},_getAttr:function(a){var e,g,h,i,j,b=a,c=this._tCfgs;return-1!==a.indexOf(f)&&(e=a.split(f),a=e.shift()),c&&c[a]&&(j={},j[a]=c[a],delete c[a],this._addAttrs(j,this._tVals)),i=this._state.data[a]||{},i.lazy&&(i=i.lazy,this._addLazyAttr(a,i)),h=this._getStateVal(a,i),g=i.getter,g&&!g.call&&(g=this[g]),h=g?g.call(this,h,b):h,h=e?d.getValue(h,e):h},_getStateVal:function(a,b){var c=this._stateProxy;return b||(b=this._state.getAll(a)||{}),c&&a in c&&!b._bypassProxy?c[a]:b.value},_setStateVal:function(a,b){var c=this._stateProxy;c&&a in c&&!this._state.get(a,q)?c[a]=b:this._state.add(a,m,b)},_setAttrVal:function(a,b,c,d,f,g){var p,q,h=this,i=!0,j=g||this._state.data[a]||{},k=j.validator,l=j.setter,m=j.initializing,n=this._getStateVal(a,j),o=b||a;return k&&(k.call||(k=this[k]),k&&(q=k.call(h,d,o,f),!q&&m&&(d=j.defaultValue,q=!0))),!k||q?(l&&(l.call||(l=this[l]),l&&(p=l.call(h,d,o,f),p===t?m?d=j.defaultValue:i=!1:void 0!==p&&(d=p))),i&&(b||d!==n||e.isObject(d)?(r in j||(j.initValue=d),h._setStateVal(a,d)):i=!1)):i=!1,i},setAttrs:function(a,b){return this._setAttrs(a,b)},_setAttrs:function(a,b){var c;for(c in a)a.hasOwnProperty(c)&&this.set(c,a[c],b);return this},getAttrs:function(a){return this._getAttrs(a)},_getAttrs:function(a){var c,e,f,b={},g=a===!0;for((!a||g)&&(a=d.keys(this._state.data)),e=0,f=a.length;f>e;e++)c=a[e],g&&this._getStateVal(c)==this._state.get(c,r)||(b[c]=this.get(c));return b},addAttrs:function(a,b,c){return a&&(this._tCfgs=a,this._tVals=b?this._normAttrVals(b):null,this._addAttrs(a,this._tVals,c),this._tCfgs=this._tVals=null),this},_addAttrs:function(a,b,c){var f,g,h,d=this._tCfgs,e=this._tVals;for(f in a)a.hasOwnProperty(f)&&(g=a[f],g.defaultValue=g.value,h=this._getAttrInitVal(f,g,e),void 0!==h&&(g.value=h),d[f]&&(d[f]=void 0),this.addAttr(f,g,c))},_protectAttrs:c.protectAttrs,_normAttrVals:function(a){var b,c,d,e,g,h;if(!a)return null;b={};for(h in a)a.hasOwnProperty(h)&&(-1!==h.indexOf(f)?(d=h.split(f),e=d.shift(),c=c||{},g=c[e]=c[e]||[],g[g.length]={path:d,value:a[h]}):b[h]=a[h]);return{simple:b,complex:c}},_getAttrInitVal:function(a,b,c){var g,j,k,l,m,n,o,p,e=b.value,f=b.valueFn,h=!1,i=b.readOnly;if(!i&&c&&(j=c.simple,j&&j.hasOwnProperty(a)&&(e=j[a],h=!0)),f&&!h&&(f.call||(f=this[f]),f&&(g=f.call(this,a),e=g)),!i&&c&&(k=c.complex,k&&k.hasOwnProperty(a)&&void 0!==e&&null!==e))for(p=k[a],l=0,m=p.length;m>l;++l)n=p[l].path,o=p[l].value,d.setValue(e,n,o);return e},_initAttrs:function(b,c,d){b=b||this.constructor.ATTRS;var e=a.Base,f=a.BaseCore,g=e&&a.instanceOf(this,e),h=!g&&f&&a.instanceOf(this,f);b&&!g&&!h&&this.addAttrs(a.AttributeCore.protectAttrs(b),c,d)}},a.AttributeCore=c},"3.10.1",{requires:["oop"]}),YUI.add("attribute-observable",function(a){function c(){this._ATTR_E_FACADE={},d.call(this,{emitFacade:!0})}var d=a.EventTarget,e="Change",f="broadcast";c._ATTR_CFG=[f],c.prototype={set:function(a,b,c){return this._setAttr(a,b,c)},_set:function(a,b,c){return this._setAttr(a,b,c,!0)},setAttrs:function(a,b){return this._setAttrs(a,b)},_setAttrs:function(a,b){var c;for(c in a)a.hasOwnProperty(c)&&this.set(c,a[c],b);return this},_fireAttrChange:function(b,c,d,f,g,h){var l,m,n,i=this,j=this._getFullType(b+e),k=i._state;h||(h=k.data[b]||{}),h.published||(n=i._publish(j),n.emitFacade=!0,n.defaultTargetOnly=!0,n.defaultFn=i._defAttrChangeFn,m=h.broadcast,void 0!==m&&(n.broadcast=m),h.published=!0),l=g?a.merge(g):i._ATTR_E_FACADE,l.attrName=b,l.subAttrName=c,l.prevVal=d,l.newVal=f,i.fire(j,l)},_defAttrChangeFn:function(a){this._setAttrVal(a.attrName,a.subAttrName,a.prevVal,a.newVal,a.opts)?a.newVal=this.get(a.attrName):a.stopImmediatePropagation()}},a.mix(c,d,!1,null,1),a.AttributeObservable=c,a.AttributeEvents=c},"3.10.1",{requires:["event-custom"]}),YUI.add("attribute-extras",function(a){function c(){}var d="broadcast",e="published",f="initValue",g={readOnly:1,writeOnce:1,getter:1,broadcast:1};c.prototype={modifyAttr:function(a,b){var f,h,c=this;if(c.attrAdded(a)){c._isLazyAttr(a)&&c._addLazyAttr(a),h=c._state;for(f in b)g[f]&&b.hasOwnProperty(f)&&(h.add(a,f,b[f]),f===d&&h.remove(a,e))}},removeAttr:function(a){this._state.removeAll(a)},reset:function(b){var c=this;return b?(c._isLazyAttr(b)&&c._addLazyAttr(b),c.set(b,c._state.get(b,f))):a.each(c._state.data,function(a,b){c.reset(b)}),c},_getAttrCfg:function(b){var c,d=this._state; -return b?c=d.getAll(b)||{}:(c={},a.each(d.data,function(a,b){c[b]=d.getAll(b)})),c}},a.AttributeExtras=c},"3.10.1",{requires:["oop"]}),YUI.add("attribute-base",function(a){function c(){a.AttributeCore.apply(this,arguments),a.AttributeObservable.apply(this,arguments),a.AttributeExtras.apply(this,arguments)}a.mix(c,a.AttributeCore,!1,null,1),a.mix(c,a.AttributeExtras,!1,null,1),a.mix(c,a.AttributeObservable,!0,null,1),c.INVALID_VALUE=a.AttributeCore.INVALID_VALUE,c._ATTR_CFG=a.AttributeCore._ATTR_CFG.concat(a.AttributeObservable._ATTR_CFG),c.protectAttrs=a.AttributeCore.protectAttrs,a.Attribute=c},"3.10.1",{requires:["attribute-core","attribute-observable","attribute-extras"]}),YUI.add("base-core",function(a){function c(a){this._BaseInvoked||(this._BaseInvoked=!0,this._initBase(a))}var d=a.Object,e=a.Lang,f=".",g="initialized",h="destroyed",i="initializer",j="value",k=Object.prototype.constructor,l="deep",m="shallow",n="destructor",o=a.AttributeCore,p=function(a,b,c){var d;for(d in b)c[d]&&(a[d]=b[d]);return a};c._ATTR_CFG=o._ATTR_CFG.concat("cloneDefaultValue"),c._NON_ATTRS_CFG=["plugins"],c.NAME="baseCore",c.ATTRS={initialized:{readOnly:!0,value:!1},destroyed:{readOnly:!0,value:!1}},c.modifyAttrs=function(b,c){"function"!=typeof b&&(c=b,b=this);var d,e,f;if(d=b.ATTRS||(b.ATTRS={}),c){b._CACHED_CLASS_DATA=null;for(f in c)c.hasOwnProperty(f)&&(e=d[f]||(d[f]={}),a.mix(e,c[f],!0))}},c.prototype={_initBase:function(b){a.stamp(this),this._initAttribute(b);var c=a.Plugin&&a.Plugin.Host;this._initPlugins&&c&&c.call(this),this._lazyAddAttrs!==!1&&(this._lazyAddAttrs=!0),this.name=this.constructor.NAME,this.init.apply(this,arguments)},_initAttribute:function(){o.call(this)},init:function(a){return this._baseInit(a),this},_baseInit:function(a){this._initHierarchy(a),this._initPlugins&&this._initPlugins(a),this._set(g,!0)},destroy:function(){return this._baseDestroy(),this},_baseDestroy:function(){this._destroyPlugins&&this._destroyPlugins(),this._destroyHierarchy(),this._set(h,!0)},_getClasses:function(){return this._classes||this._initHierarchyData(),this._classes},_getAttrCfgs:function(){return this._attrs||this._initHierarchyData(),this._attrs},_filterAttrCfgs:function(a,b){var e,f,g,h,i,j,k,c=null,l=this._filteredAttrs,m=a.ATTRS;if(m)for(j in m)if(k=b[j],k&&!l.hasOwnProperty(j)&&(c||(c={}),e=c[j]=p({},k,this._attrCfgHash()),l[j]=!0,f=e.value,f&&"object"==typeof f&&this._cloneDefaultValue(j,e),b._subAttrs&&b._subAttrs.hasOwnProperty(j))){h=b._subAttrs[j];for(i in h)g=h[i],g.path&&d.setValue(e.value,g.path,g.value)}return c},_filterAdHocAttrs:function(a,b){var c,e,d=this._nonAttrs;if(b){c={};for(e in b)!a[e]&&!d[e]&&b.hasOwnProperty(e)&&(c[e]={value:b[e]})}return c},_initHierarchyData:function(){var c,d,e,f,g,i,a=this.constructor,b=a._CACHED_CLASS_DATA,h=!a._ATTR_CFG_HASH,j={},k=[],l=[];if(c=a,!b){for(;c;){if(k[k.length]=c,c.ATTRS&&(l[l.length]=c.ATTRS),h&&(f=c._ATTR_CFG,g=g||{},f))for(d=0,e=f.length;e>d;d+=1)g[f[d]]=!0;if(i=c._NON_ATTRS_CFG)for(d=0,e=i.length;e>d;d++)j[i[d]]=!0;c=c.superclass?c.superclass.constructor:null}h&&(a._ATTR_CFG_HASH=g),b=a._CACHED_CLASS_DATA={classes:k,nonAttrs:j,attrs:this._aggregateAttrs(l)}}this._classes=b.classes,this._attrs=b.attrs,this._nonAttrs=b.nonAttrs},_attrCfgHash:function(){return this.constructor._ATTR_CFG_HASH},_cloneDefaultValue:function(b,c){var d=c.value,f=c.cloneDefaultValue;f===l||f===!0?c.value=a.clone(d):f===m?c.value=a.merge(d):void 0===f&&(k===d.constructor||e.isArray(d))&&(c.value=a.clone(d))},_aggregateAttrs:function(a){var b,c,d,e,g,h,k,i=this._attrCfgHash(),l={};if(a)for(h=a.length-1;h>=0;--h){c=a[h];for(b in c)c.hasOwnProperty(b)&&(e=p({},c[b],i),g=null,-1!==b.indexOf(f)&&(g=b.split(f),b=g.shift()),k=l[b],g&&k&&k.value?(d=l._subAttrs,d||(d=l._subAttrs={}),d[b]||(d[b]={}),d[b][g.join(f)]={value:e.value,path:g}):g||(k?(k.valueFn&&j in e&&(k.valueFn=null),p(k,e,i)):l[b]=e))}return l},_initHierarchy:function(a){var c,d,e,f,g,h,j,b=this._lazyAddAttrs,k=this._getClasses(),l=this._getAttrCfgs(),m=k.length-1;for(this._filteredAttrs={},e=m;e>=0;e--){if(c=k[e],d=c.prototype,j=c._yuibuild&&c._yuibuild.exts,j)for(f=0,g=j.length;g>f;f++)j[f].apply(this,arguments);if(this.addAttrs(this._filterAttrCfgs(c,l),a,b),this._allowAdHocAttrs&&e===m&&this.addAttrs(this._filterAdHocAttrs(l,a),a,b),d.hasOwnProperty(i)&&d.initializer.apply(this,arguments),j)for(f=0;g>f;f++)h=j[f].prototype,h.hasOwnProperty(i)&&h.initializer.apply(this,arguments)}this._filteredAttrs=null},_destroyHierarchy:function(){var a,b,c,d,e,f,g,h,i=this._getClasses();for(c=0,d=i.length;d>c;c++){if(a=i[c],b=a.prototype,g=a._yuibuild&&a._yuibuild.exts,g)for(e=0,f=g.length;f>e;e++)h=g[e].prototype,h.hasOwnProperty(n)&&h.destructor.apply(this,arguments);b.hasOwnProperty(n)&&b.destructor.apply(this,arguments)}},toString:function(){return this.name+"["+a.stamp(this,!0)+"]"}},a.mix(c,o,!1,null,1),c.prototype.constructor=c,a.BaseCore=c},"3.10.1",{requires:["attribute-core"]}),YUI.add("base-observable",function(a){function c(){}var d=a.Lang,e="destroy",f="init",g="bubbleTargets",h="_bubbleTargets",i=a.AttributeObservable,j=a.BaseCore;c._ATTR_CFG=i._ATTR_CFG.concat(),c._NON_ATTRS_CFG=["on","after","bubbleTargets"],c.prototype={_initAttribute:function(){j.prototype._initAttribute.apply(this,arguments),i.call(this),this._eventPrefix=this.constructor.EVENT_PREFIX||this.constructor.NAME,this._yuievt.config.prefix=this._eventPrefix},init:function(a){var b=this._getFullType(f),c=this._publish(b);return c.emitFacade=!0,c.fireOnce=!0,c.defaultTargetOnly=!0,c.defaultFn=this._defInitFn,this._preInitEventCfg(a),this.fire(b,{cfg:a}),this},_preInitEventCfg:function(a){a&&(a.on&&this.on(a.on),a.after&&this.after(a.after));var b,c,e,f=a&&g in a;if(f||h in this)if(e=f?a&&a.bubbleTargets:this._bubbleTargets,d.isArray(e))for(b=0,c=e.length;c>b;b++)this.addTarget(e[b]);else e&&this.addTarget(e)},destroy:function(){return this.publish(e,{fireOnce:!0,defaultTargetOnly:!0,defaultFn:this._defDestroyFn}),this.fire(e),this.detachAll(),this},_defInitFn:function(a){this._baseInit(a.cfg)},_defDestroyFn:function(a){this._baseDestroy(a.cfg)}},a.mix(c,i,!1,null,1),a.BaseObservable=c},"3.10.1",{requires:["attribute-observable"]}),YUI.add("base-base",function(a){function c(){f.apply(this,arguments),g.apply(this,arguments),e.apply(this,arguments)}var d=a.AttributeCore,e=a.AttributeExtras,f=a.BaseCore,g=a.BaseObservable;c._ATTR_CFG=f._ATTR_CFG.concat(g._ATTR_CFG),c._NON_ATTRS_CFG=f._NON_ATTRS_CFG.concat(g._NON_ATTRS_CFG),c.NAME="base",c.ATTRS=d.protectAttrs(f.ATTRS),c.modifyAttrs=f.modifyAttrs,a.mix(c,f,!1,null,1),a.mix(c,e,!1,null,1),a.mix(c,g,!0,null,1),c.prototype.constructor=c,a.Base=c},"3.10.1",{requires:["attribute-base","base-core","base-observable"]}),YUI.add("base-build",function(a){function c(a,b,c){c[a]&&(b[a]=(b[a]||[]).concat(c[a]))}function d(a,b,d){d._ATTR_CFG&&(b._ATTR_CFG_HASH=null,c.apply(null,arguments))}function e(a,b,c){f.modifyAttrs(b,c.ATTRS)}var l,f=a.BaseCore,g=a.Base,h=a.Lang,i="initializer",j="destructor",k=["_PLUG","_UNPLUG"];g._build=function(b,c,d,e,f,h){var p,q,r,s,t,u,k=g._build,l=k._ctor(c,h),m=k._cfg(c,h,d),n=k._mixCust,o=l._yuibuild.dynamic;for(p=0,q=d.length;q>p;p++)r=d[p],s=r.prototype,t=s[i],u=s[j],delete s[i],delete s[j],a.mix(l,r,!0,null,1),n(l,r,m),t&&(s[i]=t),u&&(s[j]=u),l._yuibuild.exts.push(r);return e&&a.mix(l.prototype,e,!0),f&&(a.mix(l,k._clean(f,m),!0),n(l,f,m)),l.prototype.hasImpl=k._impl,o&&(l.NAME=b,l.prototype.constructor=l,l.modifyAttrs=c.modifyAttrs),l},l=g._build,a.mix(l,{_mixCust:function(b,c,d){var e,f,g,i,j,k;if(d&&(e=d.aggregates,f=d.custom,g=d.statics),g&&a.mix(b,c,!0,g),e)for(k=0,j=e.length;j>k;k++)i=e[k],!b.hasOwnProperty(i)&&c.hasOwnProperty(i)&&(b[i]=h.isArray(c[i])?[]:{}),a.aggregate(b,c,!0,[i]);if(f)for(k in f)f.hasOwnProperty(k)&&f[k](k,b,c)},_tmpl:function(b){function c(){c.superclass.constructor.apply(this,arguments)}return a.extend(c,b),c},_impl:function(a){var c,d,e,f,g,h,b=this._getClasses();for(c=0,d=b.length;d>c;c++)if(e=b[c],e._yuibuild)for(f=e._yuibuild.exts,g=f.length,h=0;g>h;h++)if(f[h]===a)return!0;return!1},_ctor:function(a,b){var c=b&&!1===b.dynamic?!1:!0,d=c?l._tmpl(a):a,e=d._yuibuild;return e||(e=d._yuibuild={}),e.id=e.id||null,e.exts=e.exts||[],e.dynamic=c,d},_cfg:function(b,c,d){for(var h,m,n,e=[],f={},g=[],i=c&&c.aggregates,j=c&&c.custom,k=c&&c.statics,l=b;l&&l.prototype;)h=l._buildCfg,h&&(h.aggregates&&(e=e.concat(h.aggregates)),h.custom&&a.mix(f,h.custom,!0),h.statics&&(g=g.concat(h.statics))),l=l.superclass?l.superclass.constructor:null;if(d)for(m=0,n=d.length;n>m;m++)l=d[m],h=l._buildCfg,h&&(h.aggregates&&(e=e.concat(h.aggregates)),h.custom&&a.mix(f,h.custom,!0),h.statics&&(g=g.concat(h.statics)));return i&&(e=e.concat(i)),j&&a.mix(f,c.cfgBuild,!0),k&&(g=g.concat(k)),{aggregates:e,custom:f,statics:g}},_clean:function(b,c){var d,e,f,g=a.merge(b),h=c.aggregates,i=c.custom;for(d in i)g.hasOwnProperty(d)&&delete g[d];for(e=0,f=h.length;f>e;e++)d=h[e],g.hasOwnProperty(d)&&delete g[d];return g}}),g.build=function(a,b,c,d){return l(a,b,c,null,null,d)},g.create=function(a,b,c,d,e){return l(a,b,c,d,e)},g.mix=function(a,b){return a._CACHED_CLASS_DATA&&(a._CACHED_CLASS_DATA=null),l(null,a,b,null,null,{dynamic:!1})},f._buildCfg={aggregates:k.concat(),custom:{ATTRS:e,_ATTR_CFG:d,_NON_ATTRS_CFG:c}},g._buildCfg={aggregates:k.concat(),custom:{ATTRS:e,_ATTR_CFG:d,_NON_ATTRS_CFG:c}}},"3.10.1",{requires:["base-base"]}),YUI.add("history-hash-ie",function(a){if(a.UA.ie&&!a.HistoryBase.nativeHashChange){var c=a.Do,d=YUI.namespace("Env.HistoryHash"),e=a.HistoryHash,f=d._iframe,g=a.config.win;e.getIframeHash=function(){if(!f||!f.contentWindow)return"";var a=e.hashPrefix,b=f.contentWindow.location.hash.substr(1);return a&&0===b.indexOf(a)?b.replace(a,""):b},e._updateIframe=function(a,b){var c=f&&f.contentWindow&&f.contentWindow.document,d=c&&c.location;c&&d&&(b?d.replace("#"===a.charAt(0)?a:"#"+a):(c.open().close(),d.hash=a))},c.before(e._updateIframe,e,"replaceHash",e,!0),f||a.on("domready",function(){var b=e.getHash();f=d._iframe=a.Node.getDOMNode(a.Node.create('