redpacket-core
Version:
一个基于 canvas 的红包雨插件
2 lines • 59.4 kB
JavaScript
/*! For license information please see redpacket.min.js.LICENSE.txt */
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(self,(function(){return function(){var t={485:function(t){function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}var i=function(){var t,i,n=function(t){var e,i,n={};for(e in t)i=t[e],r.hasOwnProperty(e)?r[e].call(this,i):n[e]=i;a(this.prototype,n)},r={Extends:function(t){var e=this.prototype,i=o(t.prototype);a(this,t),a(i,e),i.constructor=this,this.prototype=i,this.superclass=t.prototype},Mixes:function(t){t instanceof Array||(t=[t]);for(var e,i=this.prototype;e=t.shift();)a(i,e.prototype||e)},Statics:function(t){a(this,t)}},o=function(){if(Object.__proto__)return function(t){return{__proto__:t}};var t=function(){};return function(e){return t.prototype=e,new t}}(),a=function(t){for(var n=1,r=arguments.length;n<r;n++){var o,a=arguments[n];for(var s in a){var h=a[s];!h||"object"!==e(h)||void 0===h.value&&"function"!=typeof h.get&&"function"!=typeof h.set?t[s]=h:(o=o||{})[s]=h}o&&i(t,o)}return t};try{t=Object.defineProperty,i=Object.defineProperties,t({},"$",{value:0})}catch(e){"__defineGetter__"in Object&&(t=function(t,e,i){return"value"in i&&(t[e]=i.value),"get"in i&&t.__defineGetter__(e,i.get),"set"in i&&t.__defineSetter__(e,i.set),t},i=function(e,i){for(var n in i)i.hasOwnProperty(n)&&t(e,n,i[n]);return e})}return{create:function(t){var e=(t=t||{}).hasOwnProperty("constructor")?t.constructor:function(){};return n.call(e,t),e},mix:a}}();t.exports=i},930:function(t,e,i){var n=i(459),r=i(322),o=window,a=document,s=a.documentElement,h=0,c={},u={version:"2.0.2",getUid:function(t){var e=++h;if(t){var i=t.charCodeAt(t.length-1);return i>=48&&i<=57&&(t+="_"),t+e}return e},viewToString:function(t){for(var e,i=t;i;)e=e?i.id+"."+e:i.id,i=i.parent;return e},copy:function(t,e,i){return r.copy(t,e,i),c.copy||(c.copy=!0),t},browser:n,event:{POINTER_START:n.POINTER_START,POINTER_MOVE:n.POINTER_MOVE,POINTER_END:n.POINTER_END},align:{TOP_LEFT:"TL",TOP:"T",TOP_RIGHT:"TR",LEFT:"L",CENTER:"C",RIGHT:"R",BOTTOM_LEFT:"BL",BOTTOM:"B",BOTTOM_RIGHT:"BR"},getElementRect:function(t){var e;try{e=t.getBoundingClientRect()}catch(i){e={top:t.offsetTop,left:t.offsetLeft,right:t.offsetLeft+t.offsetWidth,bottom:t.offsetTop+t.offsetHeight}}var i=(o.pageXOffset||s.scrollLeft)-(s.clientLeft||0)||0,n=(o.pageYOffset||s.scrollTop)-(s.clientTop||0)||0,r=o.getComputedStyle?getComputedStyle(t):t.currentStyle,a=parseInt,h=a(r.paddingLeft)+a(r.borderLeftWidth)||0,c=a(r.paddingTop)+a(r.borderTopWidth)||0,u=a(r.paddingRight)+a(r.borderRightWidth)||0,l=a(r.paddingBottom)+a(r.borderBottomWidth)||0,d=e.top||0,f=e.left||0;return{left:f+i+h,top:d+n+c,width:(e.right||0)-u-f-h,height:(e.bottom||0)-l-d-c}},createElement:function(t,e){var i,n,r,o=a.createElement(t);for(i in e)if(n=e[i],"style"===i)for(r in n)o.style[r]=n[r];else o[i]=n;return o},getElement:function(t){return a.getElementById(t)},setElementStyleByView:function(t){var e=t.drawable,i=e.domElement.style,n=t._stateCache||(t._stateCache={}),r=u.browser.jsVendor,o="px",a=!1;if(this.cacheStateIfChanged(t,["visible"],n)&&(i.display=t.visible?"":"none"),this.cacheStateIfChanged(t,["alpha"],n)&&(i.opacity=t.alpha),t.visible&&!(t.alpha<=0)){if(this.cacheStateIfChanged(t,["width"],n)&&(i.width=t.width+o),this.cacheStateIfChanged(t,["height"],n)&&(i.height=t.height+o),this.cacheStateIfChanged(t,["depth"],n)&&(i.zIndex=t.depth+1),t.transform){var s=t.transform;(a=this.cacheStateIfChanged(t,["pivotX","pivotY"],n))&&(i[r+"TransformOrigin"]="0 0"),i[r+"Transform"]="matrix3d("+s.a+", "+s.b+", 0, 0, "+s.c+", "+s.d+", 0, 0, 0, 0, 1, 0, "+s.tx+", "+s.ty+", 0, 1)"}else(a=this.cacheStateIfChanged(t,["pivotX","pivotY"],n))&&(i[r+"TransformOrigin"]=t.pivotX+o+" "+t.pivotY+o),(this.cacheStateIfChanged(t,["x","y","rotation","scaleX","scaleY"],n)||a)&&(i[r+"Transform"]=this.getTransformCSS(t));this.cacheStateIfChanged(t,["background"],n)&&(i.backgroundColor=t.background),i.pointerEvents||(i.pointerEvents="none");var h=e.image;if(h){var c=h.src;c!==n.image&&(n.image=c,i.backgroundImage="url("+c+")");var l=e.rect;if(l){var d=l[0],f=l[1];d!==n.sx&&(n.sx=d,i.backgroundPositionX=-d+o),f!==n.sy&&(n.sy=f,i.backgroundPositionY=-f+o)}}var p=t.mask;if(p){var v=p.drawable.domElement.style.backgroundImage;v!==n.maskImage&&(n.maskImage=v,i[r+"MaskImage"]=v,i[r+"MaskRepeat"]="no-repeat");var m=p.x,_=p.y;m===n.maskX&&_===n.maskY||(n.maskX=m,n.maskY=_,i[r+"MaskPosition"]=m+o+" "+_+o)}}},cacheStateIfChanged:function(t,e,i){var n,r,o,a,s=!1;for(n=0,r=e.length;n<r;n++)(a=t[o=e[n]])!=i[o]&&(i[o]=a,s=!0);return s},getTransformCSS:function(t){var e=this.browser.supportTransform3D,i=e?"3d":"";return"translate"+i+"("+(t.x-t.pivotX)+"px, "+(t.y-t.pivotY)+(e?"px, 0px)":"px)")+"rotate"+i+(e?"(0, 0, 1, ":"(")+t.rotation+"deg)scale"+i+"("+t.scaleX+", "+t.scaleY+(e?", 1)":")")}};t.exports=u},111:function(t,e,i){var n={_listeners:null,on:function(t,e,i){for(var n=this._listeners=this._listeners||{},r=n[t]=n[t]||[],o=0,a=r.length;o<a;o++){if(r[o].listener===e)return}return r.push({listener:e,once:i}),this},off:function(t,e){if(0==arguments.length)return this._listeners=null,this;var i=this._listeners&&this._listeners[t];if(i){if(1==arguments.length)return delete this._listeners[t],this;for(var n=0,r=i.length;n<r;n++){if(i[n].listener===e){i.splice(n,1),0===i.length&&delete this._listeners[t];break}}}return this},fire:function(t,e){var i,n;"string"==typeof t?n=t:(i=t,n=t.type);var o=this._listeners;if(!o)return!1;var a=o[n];if(a){var s=a.slice(0);if((i=i||new r(n,this,e))._stopped)return!1;for(var h=0;h<s.length;h++){var c=s[h];if(c.listener.call(this,i),c.once){var u=a.indexOf(c);u>-1&&a.splice(u,1)}}return 0==a.length&&delete o[n],!0}return!1}},r=i(485).create({constructor:function(t,e,i){this.type=t,this.target=e,this.detail=i,this.timeStamp=+new Date},type:null,target:null,detail:null,timeStamp:0,stopImmediatePropagation:function(){this._stopped=!0}}),o=window.Event;if(o){var a=o.prototype,s=a.stopImmediatePropagation;a.stopImmediatePropagation=function(){s&&s.call(this),this._stopped=!0}}t.exports=n},347:function(t,e,i){var n=i(930),r=i(485),o=i(760),a=i(329),s=i(126),h=i(322),c=function(){for(var t=["x","y","vx","vy","ax","ay","rotation","rotationV","scale","scaleV","alpha","alphaV","life"],e=[],i=0,c=t.length;i<c;i++){var u=t[i];e.push(u),e.push(u+"Var")}var l={x:0,y:0,vx:0,vy:0,ax:0,ay:0,scale:1,scaleV:0,alpha:1,alphaV:0,rotation:0,rotationV:0,life:1},d=[],f=r.create({Extends:a,constructor:function(t){this.id=this.id||t.id||n.getUid("ParticleSystem"),this.emitterX=0,this.emitterY=0,this.gx=0,this.gy=0,this.totalTime=1/0,this.emitNum=10,this.emitNumVar=0,this.emitTime=.2,this.emitTimeVar=0,this.particle={},f.superclass.constructor.call(this,t),this.reset(t)},Statics:{PROPS:e,PROPS_DEFAULT:l,diedParticles:d},reset:function(t){h.copy(this,t),this.particle.system=this,this.totalTime<=0&&(this.totalTime=1/0)},onUpdate:function(t){t*=.001,this._isRun&&(this._totalRunTime+=t,this._currentRunTime+=t,this._currentRunTime>=this._emitTime&&(this._currentRunTime=0,this._emitTime=v(this.emitTime,this.emitTimeVar),this._emit()),this._totalRunTime>=this.totalTime&&this.stop())},_emit:function(){for(var t=v(this.emitNum,this.emitNumVar)>>0,e=0;e<t;e++)this.addChild(p.create(this.particle))},start:function(){this.stop(!0),this._currentRunTime=0,this._totalRunTime=0,this._isRun=!0,this._emitTime=v(this.emitTime,this.emitTimeVar)},stop:function(t){if(this._isRun=!1,t)for(var e=this.children.length-1;e>=0;e--)this.children[e].destroy()}}),p=r.create({Extends:o,constructor:function(t){this.id=this.id||t.id||n.getUid("Particle"),p.superclass.constructor.call(this,t),this.init(t)},onUpdate:function(t){if(t*=.001,this._died)return!1;var e=this.ax+this.system.gx,i=this.ay+this.system.gy;return this.vx+=e*t,this.vy+=i*t,this.x+=this.vx*t,this.y+=this.vy*t,this.rotation+=this.rotationV,this._time>.1&&(this.alpha+=this.alphaV),this.scale+=this.scaleV,this.scaleX=this.scaleY=this.scale,this._time+=t,this._time>=this.life||this.alpha<=0?(this.destroy(),!1):void 0},setImage:function(t,e){this.drawable=this.drawable||new s,e=e||[0,0,t.width,t.height],this.width=e[2],this.height=e[3],this.drawable.rect=e,this.drawable.image=t},destroy:function(){this._died=!0,this.alpha=0,this.removeFromParent(),d.push(this)},init:function(t){this.system=t.system,this._died=!1,this._time=0,this.alpha=1;for(var i=0,n=e.length;i<n;i++){var r=e[i],o=void 0===t[r]?l[r]:t[r];this[r]=v(o,t[r+"Var"])}if(this.x+=this.system.emitterX,this.y+=this.system.emitterY,t.image){var a=t.frame;a&&a[0].length&&(a=a[Math.random()*a.length>>0]),this.setImage(t.image,a),void 0!==t.pivotX&&(this.pivotX=t.pivotX*a[2]),void 0!==t.pivotY&&(this.pivotY=t.pivotY*a[3])}},Statics:{create:function(t){if(d.length>0){var e=d.pop();return e.init(t),e}return new p(t)}}});function v(t,e){return e?t+2*(Math.random()-.5)*e:t}return f}();t.exports=c},739:function(t,e,i){var n=i(485).create({constructor:function(t,e,i,n,r,o){this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=o},set:function(t,e,i,n,r,o){return this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=o,this},copy:function(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this},clone:function(){return(new n).copy(this)},concat:function(t){var e,i,n,r,o,a,s=arguments,h=this.a,c=this.b,u=this.c,l=this.d,d=this.tx,f=this.ty;return s.length>=6?(e=s[0],i=s[1],n=s[2],r=s[3],o=s[4],a=s[5]):(e=t.a,i=t.b,n=t.c,r=t.d,o=t.tx,a=t.ty),this.a=h*e+c*n,this.b=h*i+c*r,this.c=u*e+l*n,this.d=u*i+l*r,this.tx=d*e+f*n+o,this.ty=d*i+f*r+a,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.a,r=this.b,o=this.c,a=this.d,s=this.tx,h=this.ty;return this.a=n*i-r*e,this.b=n*e+r*i,this.c=o*i-a*e,this.d=o*e+a*i,this.tx=s*i-h*e,this.ty=s*e+h*i,this},scale:function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},translate:function(t,e){return this.tx+=t,this.ty+=e,this},identity:function(){return this.a=this.d=1,this.b=this.c=this.tx=this.ty=0,this},invert:function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=this.tx,o=t*n-e*i;return this.a=n/o,this.b=-e/o,this.c=-i/o,this.d=t/o,this.tx=(i*this.ty-n*r)/o,this.ty=-(t*this.ty-e*r)/o,this},transformPoint:function(t,e,i){var n=t.x*this.a+t.y*this.c+this.tx,r=t.x*this.b+t.y*this.d+this.ty;return e&&(n=n+.5>>0,r=r+.5>>0),i?{x:n,y:r}:(t.x=n,t.y=r,t)}});t.exports=n},289:function(t,e,i){var n=i(485).create({load:function(t){var e=this,i=new Image;t.crossOrigin&&(i.crossOrigin="Anonymous"),i.onload=function(){e.onLoad(i)},i.onerror=i.onabort=e.onError.bind(i),i.src=t.src+(t.noCache?(-1==t.src.indexOf("?")?"?":"&")+"t="+ +new Date:"")},onLoad:function(t){return t.onload=t.onerror=t.onabort=null,t},onError:function(t){var e=t.target;return e.onload=e.onerror=e.onabort=null,t}});t.exports=n},855:function(t,e,i){var n=i(485),r=i(111),o=i(289),a=i(797),s=n.create({Mixes:r,constructor:function(t){this._source=[],this.add(t)},maxConnections:2,_source:null,_loaded:0,_connections:0,_currentIndex:-1,add:function(t){var e=this;return t&&(t=t instanceof Array?t:[t],e._source=e._source.concat(t)),e},get:function(t){if(t)for(var e=this._source,i=0;i<e.length;i++){var n=e[i];if(n.id===t||n.src===t)return n}return null},getContent:function(t){var e=this.get(t);return e&&e.content},removeContent:function(t){if(t)for(var e=this._source,i=0;i<e.length;i++){var n=e[i];if(n.id===t||n.src===t)return void e.splice(i,1)}},start:function(){return this._loadNext(),this},_loadNext:function(){var t=this,e=t._source,i=e.length;if(t._loaded>=i)t.fire("complete");else if(t._currentIndex<i-1&&t._connections<t.maxConnections){var n=++t._currentIndex,r=e[n],o=t._getLoader(r);if(o){var a=o.onLoad,s=o.onError;o.onLoad=function(e){o.onLoad=a,o.onError=s;var i=a&&a.call(o,e)||e.target;t._onItemLoad(n,i)},o.onError=function(e){o.onLoad=a,o.onError=s,s&&s.call(o,e),t._onItemError(n,e)},t._connections++}t._loadNext(),o&&o.load(r)}},_getLoader:function(t){var e=t.loader;if(e)return e;switch(t.type||function(t){var e,i,n=/\/?[^/]+\.(\w+)(\?\S+)?$/i;(e=t.match(n))&&(i=e[1].toLowerCase());return i||null}(t.src)){case"png":case"jpg":case"jpeg":case"gif":case"webp":e=new o;break;case"js":case"jsonp":e=new a}return e},_onItemLoad:function(t,e){var i=this,n=i._source[t];n.loaded=!0,n.content=e,i._connections--,i._loaded++,i.fire("load",n),i._loadNext()},_onItemError:function(t,e){var i=this,n=i._source[t];n.error=e,i._connections--,i._loaded++,i.fire("error",n),i._loadNext()},getSize:function(t){for(var e=0,i=this._source,n=0;n<i.length;n++){var r=i[n];e+=(t?r.loaded&&r.size:r.size)||0}return e},getLoaded:function(){return this._loaded},getTotal:function(){return this._source.length}});t.exports=s},797:function(t,e,i){var n=i(485).create({load:function(t){var e=this,i=t.src;if("jsonp"==t.type){var r=t.callbackName||"callback",o=t.callback||"jsonp"+ ++n._count,a=window;a[o]||(a[o]=function(t){delete a[o]}),i+=(-1==i.indexOf("?")?"?":"&")+r+"="+o}t.noCache&&(i+=(-1==i.indexOf("?")?"?":"&")+"t="+ +new Date);var s=document.createElement("script");s.type="text/javascript",s.async=!0,s.onload=e.onLoad.bind(e),s.onerror=e.onError.bind(e),s.src=i,t.id&&(s.id=t.id),document.getElementsByTagName("head")[0].appendChild(s)},onLoad:function(t){var e=t.target;return e.onload=e.onerror=null,e},onError:function(t){var e=t.target;return e.onload=e.onerror=null,t},Statics:{_count:0}});t.exports=n},558:function(t,e,i){var n=i(485),r=i(322),o=i(111),a=n.create({Mixes:o,constructor:function(t){r.copy(this,t,!0),this._onAudioEvent=this._onAudioEvent.bind(this)},src:null,loop:!1,autoPlay:!1,loaded:!1,playing:!1,duration:0,volume:1,muted:!1,_element:null,load:function(){var t;if(!this._element)try{(t=this._element=new Audio).addEventListener("canplaythrough",this._onAudioEvent,!1),t.addEventListener("ended",this._onAudioEvent,!1),t.addEventListener("error",this._onAudioEvent,!1),t.src=this.src,t.volume=this.volume,t.load()}catch(e){(t=this._element={}).play=t.pause=function(){}}return this},_onAudioEvent:function(t){var e=t.type;switch(e){case"canplaythrough":t.target.removeEventListener(e,this._onAudioEvent),this.loaded=!0,this.duration=this._element.duration,this.fire("load"),this.autoPlay&&this._doPlay();break;case"ended":this.playing=!1,this.fire("end"),this.loop&&this._doPlay();break;case"error":this.fire("error")}},_doPlay:function(){this.playing||(this._element.volume=this.muted?0:this.volume,this._element.play(),this.playing=!0)},play:function(){return this.playing&&this.stop(),this._element?this.loaded&&this._doPlay():(this.autoPlay=!0,this.load()),this},pause:function(){return this.playing&&(this._element.pause(),this.playing=!1),this},resume:function(){return this.playing||this._doPlay(),this},stop:function(){return this.playing&&(this._element.pause(),this._element.currentTime=0,this.playing=!1),this},setVolume:function(t){return this.volume!=t&&(this.volume=t,this._element.volume=t),this},setMute:function(t){return this.muted!=t&&(this.muted=t,this._element.volume=t?0:this.volume),this},Statics:{isSupported:null!==window.Audio}});t.exports=a},408:function(t,e,i){var n=i(485),r=i(322),o=i(111),a=function(){var t=null;try{var e=window.AudioContext||window.webkitAudioContext;e&&(t=new e)}catch(e){t=null}return n.create({Mixes:o,constructor:function(t){r.copy(this,t,!0),this._init()},src:null,loop:!1,autoPlay:!1,loaded:!1,playing:!1,duration:0,volume:1,muted:!1,_context:null,_gainNode:null,_buffer:null,_audioNode:null,_startTime:0,_offset:0,_init:function(){this._context=t,this._gainNode=t.createGain?t.createGain():t.createGainNode(),this._gainNode.connect(t.destination),this._onAudioEvent=this._onAudioEvent.bind(this),this._onDecodeComplete=this._onDecodeComplete.bind(this),this._onDecodeError=this._onDecodeError.bind(this)},load:function(){if(!this._buffer){var t=a._bufferCache[this.src];if(t)this._onDecodeComplete(t);else{var e=new XMLHttpRequest;e.src=this.src,e.open("GET",this.src,!0),e.responseType="arraybuffer",e.onload=this._onAudioEvent,e.onprogress=this._onAudioEvent,e.onerror=this._onAudioEvent,e.send()}this._buffer=!0}return this},_onAudioEvent:function(t){switch(t.type){case"load":var e=t.target;e.onload=e.onprogress=e.onerror=null,this._context.decodeAudioData(e.response,this._onDecodeComplete,this._onDecodeError),e=null;break;case"ended":this.playing=!1,this.fire("end"),this.loop&&this._doPlay();break;case"progress":case"error":this.fire(t)}},_onDecodeComplete:function(t){a._bufferCache[this.src]||(a._bufferCache[this.src]=t),this._buffer=t,this.loaded=!0,this.duration=t.duration,this.fire("load"),this.autoPlay&&this._doPlay()},_onDecodeError:function(){this.fire("error")},_doPlay:function(){this._clearAudioNode();var t=this._context.createBufferSource();t.start||(t.start=t.noteOn,t.stop=t.noteOff),t.buffer=this._buffer,t.onended=this._onAudioEvent,this._gainNode.gain.value=this.muted?0:this.volume,t.connect(this._gainNode),t.start(0,this._offset),this._audioNode=t,this._startTime=this._context.currentTime,this.playing=!0},_clearAudioNode:function(){var t=this._audioNode;t&&(t.onended=null,t.disconnect(0),this._audioNode=null)},play:function(){return this.playing&&this.stop(),this.loaded?this._doPlay():this._buffer||(this.autoPlay=!0,this.load()),this},pause:function(){return this.playing&&(this._audioNode.stop(0),this._offset+=this._context.currentTime-this._startTime,this.playing=!1),this},resume:function(){return this.playing||this._doPlay(),this},stop:function(){return this.playing&&(this._audioNode.stop(0),this._audioNode.disconnect(),this._offset=0,this.playing=!1),this},setVolume:function(t){return this.volume!=t&&(this.volume=t,this._gainNode.gain.value=t),this},setMute:function(t){return this.muted!=t&&(this.muted=t,this._gainNode.gain.value=t?0:this.volume),this},Statics:{isSupported:null!==t,enabled:!1,enable:function(){if(!this.enabled&&t){var e=t.createBufferSource();return e.buffer=t.createBuffer(1,1,22050),e.connect(t.destination),e.start?e.start(0,0,0):e.noteOn(0,0,0),this.enabled=!0,!0}return this.enabled},_bufferCache:{},clearBufferCache:function(t){t?this._bufferCache[t]=null:this._bufferCache={}}}})}();t.exports=a},712:function(t,e,i){var n=i(558),r=i(408),o=i(322),a={_audios:{},enableAudio:function(){r.isSupported&&r.enable()},getAudio:function(t,e){void 0===e&&(e=!0),t=this._normalizeSource(t);var i=this._audios[t.src];return i||(e&&r.isSupported?i=new r(t):n.isSupported&&(i=new n(t)),this._audios[t.src]=i),i},removeAudio:function(t){var e="string"==typeof t?t:t.src,i=this._audios[e];i&&(i.stop(),i.off(),i._buffer&&r.clearBufferCache(e),this._audios[e]=null,delete this._audios[e])},_normalizeSource:function(t){var e={};return"string"==typeof t?e={src:t}:o.copy(e,t),e}};t.exports=a},604:function(t,e,i){var n=i(485),r=i(930),o=i(952),a=n.create({Extends:o,constructor:function(t){a.superclass.constructor.call(this,t),this.context=this.canvas.getContext("2d")},renderType:"canvas",context:null,startDraw:function(t){return!!(t.visible&&t.alpha>0)&&(t===this.stage&&this.context.clearRect(0,0,t.width,t.height),t.blendMode!==this.blendMode&&(this.context.globalCompositeOperation=this.blendMode=t.blendMode),this.context.save(),!0)},draw:function(t){var e=this.context,i=t.width,n=t.height,r=t.background;r&&(e.fillStyle=r,e.fillRect(0,0,i,n));var o=t.drawable,a=o&&o.image;if(a){var s=o.rect,h=s[2],c=s[3],u=s[4],l=s[5];if(!h||!c)return;i||n||(i=t.width=h,n=t.height=c),(u||l)&&e.translate(u-.5*h,l-.5*c),e.drawImage(a,s[0],s[1],h,c,0,0,i,n)}},endDraw:function(t){this.context.restore()},transform:function(t){var e=t.drawable;if(e&&e.domElement)r.setElementStyleByView(t);else{var i=this.context,n=t.scaleX,o=t.scaleY;if(t===this.stage){var a=this.canvas.style,s=t._scaleX,h=t._scaleY,c=!1;(!s&&1!=n||s&&s!=n)&&(t._scaleX=n,a.width=n*t.width+"px",c=!0),(!h&&1!=o||h&&h!=o)&&(t._scaleY=o,a.height=o*t.height+"px",c=!0),c&&t.updateViewport()}else{var u=t.x,l=t.y,d=t.pivotX,f=t.pivotY,p=t.rotation%360,v=t.transform,m=t.mask;if(m&&(m._render(this),i.clip()),t.align){var _=t.getAlignPosition();u=_.x,l=_.y}v?i.transform(v.a,v.b,v.c,v.d,v.tx,v.ty):(0==u&&0==l||i.translate(u,l),0!=p&&i.rotate(p*Math.PI/180),1==n&&1==o||i.scale(n,o),0==d&&0==f||i.translate(-d,-f))}t.alpha>0&&(i.globalAlpha*=t.alpha)}},remove:function(t){var e=t.drawable,i=e&&e.domElement;if(i){var n=i.parentNode;n&&n.removeChild(i)}},clear:function(t,e,i,n){this.context.clearRect(t,e,i,n)},resize:function(t,e){var i=this.canvas,n=this.stage,r=i.style;i.width=t,i.height=e,r.width=n.width*n.scaleX+"px",r.height=n.height*n.scaleY+"px"}});t.exports=a},386:function(t,e,i){var n=i(485),r=i(930),o=i(952),a=i(126),s=n.create({Extends:o,constructor:function(t){s.superclass.constructor.call(this,t)},renderType:"dom",startDraw:function(t){var e=t.drawable=t.drawable||new a;return e.domElement=e.domElement||function(t,e){var i=t.tagName||"div",n=e.image,o=t.width||n&&n.width,a=t.height||n&&n.height,s=r.createElement(i),h=s.style;if(t.id&&(s.id=t.id),h.position="absolute",h.left=(t.left||0)+"px",h.top=(t.top||0)+"px",h.width=o+"px",h.height=a+"px","canvas"==i){if(s.width=o,s.height=a,n){var c=s.getContext("2d"),u=e.rect||[0,0,o,a];c.drawImage(n,u[0],u[1],u[2],u[3],t.x||0,t.y||0,t.width||u[2],t.height||u[3])}}else if(h.opacity=null!=t.alpha?t.alpha:1,(t===this.stage||t.clipChildren)&&(h.overflow="hidden"),n&&n.src){h.backgroundImage="url("+n.src+")";var l=t.rectX||0,d=t.rectY||0;h.backgroundPosition=-l+"px "+-d+"px"}return s}(t,e),!0},draw:function(t){var e=t.parent,i=t.drawable.domElement,n=i.parentNode;if(e){var r=e.drawable.domElement;if(r!=n&&r.appendChild(i),!t.width&&!t.height){var o=t.drawable.rect;o&&(o[2]||o[3])&&(t.width=o[2],t.height=o[3])}}else t!==this.stage||n||(i.style.overflow="hidden",this.canvas.appendChild(i))},transform:function(t){if(r.setElementStyleByView(t),t===this.stage){var e=this.canvas.style,i=t._scaleX,n=t._scaleY,o=t.scaleX,a=t.scaleY;(!i&&1!=o||i&&i!=o)&&(t._scaleX=o,e.width=o*t.width+"px"),(!n&&1!=a||n&&n!=a)&&(t._scaleY=a,e.height=a*t.height+"px")}},remove:function(t){var e=t.drawable,i=e&&e.domElement;if(i){var n=i.parentNode;n&&n.removeChild(i)}},hide:function(t){var e=t.drawable&&t.drawable.domElement;e&&(e.style.display="none")},resize:function(t,e){var i=this.canvas.style;i.width=t+"px",i.height=e+"px","absolute"!=i.position&&(i.position="relative")}});t.exports=s},952:function(t,e,i){var n=i(485),r=i(322),o=n.create({constructor:function(t){t=t||{},r.copy(this,t,!0)},renderType:null,canvas:null,stage:null,blendMode:"source-over",startDraw:function(t){},draw:function(t){},endDraw:function(t){},transform:function(){},hide:function(){},remove:function(t){},clear:function(t,e,i,n){},resize:function(t,e){}});t.exports=o},856:function(t,e,i){var n=i(485),r=i(930),o=i(952),a=i(739),s=Math.PI/180,h=n.create({Extends:o,Statics:{MAX_BATCH_NUM:2e3,ATTRIBUTE_NUM:5,isSupport:function(){if(null==this._isSupported){var t=document.createElement("canvas");t.getContext&&(t.getContext("webgl")||t.getContext("experimental-webgl"))?this._isSupported=!0:this._isSupported=!1}return this._isSupported},contextOptions:null},renderType:"webgl",gl:null,_isContextLost:!1,_cacheTexture:{},constructor:function(t){h.superclass.constructor.call(this,t);var e=this,i=h.contextOptions||{};this.gl=this.canvas.getContext("webgl",i)||this.canvas.getContext("experimental-webgl",i),this.maxBatchNum=h.MAX_BATCH_NUM,this.positionStride=4*h.ATTRIBUTE_NUM;var n=this.maxBatchNum*h.ATTRIBUTE_NUM*4,r=6*this.maxBatchNum;this.arrayBuffer=new ArrayBuffer(4*n),this.float32Array=new Float32Array(this.arrayBuffer),this.uint32Array=new Uint32Array(this.arrayBuffer),this.indexs=new Uint16Array(r);for(var o=0,a=0;o<r;o+=6,a+=4)this.indexs[o+0]=a+0,this.indexs[o+1]=a+1,this.indexs[o+2]=a+2,this.indexs[o+3]=a+1,this.indexs[o+4]=a+2,this.indexs[o+5]=a+3;this.batchIndex=0,this.sprites=[],this.canvas.addEventListener("webglcontextlost",(function(t){e._isContextLost=!0,t.preventDefault()}),!1),this.canvas.addEventListener("webglcontextrestored",(function(t){e._isContextLost=!1,e.setupWebGLStateAndResource()}),!1),this.setupWebGLStateAndResource()},setupWebGLStateAndResource:function(){var t=this.gl;t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),t.clearColor(0,0,0,0),t.disable(t.DEPTH_TEST),t.disable(t.CULL_FACE),t.enable(t.BLEND),this._cacheTexture={},this._initShaders(),this.defaultShader.active(),this.positionBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indexs,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,this.positionBuffer),t.bufferData(t.ARRAY_BUFFER,this.arrayBuffer,t.DYNAMIC_DRAW),t.vertexAttribPointer(this.a_position,2,t.FLOAT,!1,this.positionStride,0),t.vertexAttribPointer(this.a_TexCoord,2,t.FLOAT,!1,this.positionStride,8),t.vertexAttribPointer(this.a_tint,4,t.UNSIGNED_BYTE,!0,this.positionStride,16)},context:null,startDraw:function(t){return!!(t.visible&&t.alpha>0)&&(t===this.stage&&this.clear(),!0)},draw:function(t){var e=t.width,i=t.height,n=(t.background,t.drawable),r=n&&n.image;if(r){var o=n.rect,a=o[2],s=o[3];e||i||(e=t.width=a,i=t.height=s),this.batchIndex>=this.maxBatchNum&&this._renderBatches();var h=this._createVertexs(r,o[0],o[1],a,s,0,0,e,i),c=this.batchIndex*this.positionStride,u=this.float32Array,l=this.uint32Array,d=(t.tint>>16)+(65280&t.tint)+((255&t.tint)<<16)+(255*t.__webglRenderAlpha<<24);u[c+0]=h[0],u[c+1]=h[1],u[c+2]=h[2],u[c+3]=h[3],l[c+4]=d,u[c+5]=h[4],u[c+6]=h[5],u[c+7]=h[6],u[c+8]=h[7],l[c+9]=d,u[c+10]=h[8],u[c+11]=h[9],u[c+12]=h[10],u[c+13]=h[11],l[c+14]=d,u[c+15]=h[12],u[c+16]=h[13],u[c+17]=h[14],u[c+18]=h[15],l[c+19]=d;for(var f=t.__webglWorldMatrix,p=0;p<4;p++){var v=u[c+5*p],m=u[c+5*p+1];u[c+5*p]=f.a*v+f.c*m+f.tx,u[c+5*p+1]=f.b*v+f.d*m+f.ty}t.__textureImage=r,this.sprites[this.batchIndex++]=t}},endDraw:function(t){t===this.stage&&this._renderBatches()},transform:function(t){var e=t.drawable;if(e&&e.domElement)r.setElementStyleByView(t);else{var i=t.scaleX,n=t.scaleY;if(t===this.stage){var o=this.canvas.style,s=t._scaleX,h=t._scaleY,c=!1;(!s&&1!=i||s&&s!=i)&&(t._scaleX=i,o.width=i*t.width+"px",c=!0),(!h&&1!=n||h&&h!=n)&&(t._scaleY=n,o.height=n*t.height+"px",c=!0),c&&t.updateViewport(),t.__webglWorldMatrix=t.__webglWorldMatrix||new a(1,0,0,1,0,0)}else t.parent&&(t.__webglWorldMatrix=t.__webglWorldMatrix||new a(1,0,0,1,0,0),this._setConcatenatedMatrix(t,t.parent));t.alpha>0&&(t.parent&&t.parent.__webglRenderAlpha?t.__webglRenderAlpha=t.alpha*t.parent.__webglRenderAlpha:t.__webglRenderAlpha=t.alpha)}},remove:function(t){var e=t.drawable,i=e&&e.domElement;if(i){var n=i.parentNode;n&&n.removeChild(i)}},clear:function(t,e,i,n){this.gl.clear(this.gl.COLOR_BUFFER_BIT)},resize:function(t,e){if(this.width!==t||this.height!==e){var i=this.canvas,n=this.stage,r=i.style;this.width=i.width=t,this.height=i.height=e,r.width=n.width*n.scaleX+"px",r.height=n.height*n.scaleY+"px",this.gl.viewport(0,0,t,e),this.canvasHalfWidth=.5*t,this.canvasHalfHeight=.5*e,this._uploadProjectionTransform(!0)}},_renderBatches:function(){var t=this.gl;t.bufferSubData(t.ARRAY_BUFFER,0,this.uint32Array.subarray(0,this.batchIndex*this.positionStride));for(var e=0,i=null,n=0;n<this.batchIndex;n++){var r=this.sprites[n];i&&i!==r.__textureImage&&(this._renderBatch(e,n),e=n,1),i=r.__textureImage}this._renderBatch(e,this.batchIndex),this.batchIndex=0},_renderBatch:function(t,e){var i=this.gl,n=e-t;n>0&&(i.bindTexture(i.TEXTURE_2D,this._getTexture(this.sprites[t])),i.drawElements(i.TRIANGLES,6*n,i.UNSIGNED_SHORT,6*t*2))},_uploadProjectionTransform:function(t){this._projectionTransformElements&&!t||(this._projectionTransformElements=new Float32Array([1/this.canvasHalfWidth,0,0,0,-1/this.canvasHalfHeight,0,-1,1,1])),this.gl.uniformMatrix3fv(this.u_projectionTransform,!1,this._projectionTransformElements)},_initShaders:function(){this.defaultShader=new c(this,{v:" attribute vec2 a_position;\n attribute vec2 a_TexCoord;\n attribute vec4 a_tint;\n uniform mat3 u_projectionTransform;\n varying vec2 v_TexCoord;\n varying vec4 v_tint;\n void main(){\n gl_Position = vec4((u_projectionTransform * vec3(a_position, 1.0)).xy, 1.0, 1.0);\n v_TexCoord = a_TexCoord;\n v_tint = vec4(a_tint.rgb * a_tint.a, a_tint.a);\n }\n ",f:"\n precision mediump float;\n uniform sampler2D u_Sampler;\n varying vec2 v_TexCoord;\n varying vec4 v_tint;\n void main(){\n gl_FragColor = texture2D(u_Sampler, v_TexCoord) * v_tint;\n }\n "},{attributes:["a_position","a_TexCoord","a_tint"],uniforms:["u_projectionTransform","u_Sampler"]})},_createVertexs:function(t,e,i,n,r,o,a,s,h){var c=this.__tempVertexs||[],u=t.width,l=t.height;(n/=u)+(e/=u)>1&&(n=1-e),(r/=l)+(i/=l)>1&&(r=1-i);var d=0;return c[d++]=o,c[d++]=a,c[d++]=e,c[d++]=i,c[d++]=o+s,c[d++]=a,c[d++]=e+n,c[d++]=i,c[d++]=o,c[d++]=a+h,c[d++]=e,c[d++]=i+r,c[d++]=o+s,c[d++]=a+h,c[d++]=e+n,c[d++]=i+r,c},_setConcatenatedMatrix:function(t,e){var i=t.__webglWorldMatrix,n=1,r=0,o=t.rotation%360,a=t.pivotX,h=t.pivotY,c=t.scaleX,u=t.scaleY,l=t.transform;if(l)i.copy(l);else{if(o){var d=o*s;n=Math.cos(d),r=Math.sin(d)}var f=t.getAlignPosition();i.a=n*c,i.b=r*c,i.c=-r*u,i.d=n*u,i.tx=f.x-i.a*a-i.c*h,i.ty=f.y-i.b*a-i.d*h}i.concat(e.__webglWorldMatrix)},_getTexture:function(t){var e=t.__textureImage,i=this._cacheTexture[e.src];return i||(i=this.activeShader.uploadTexture(e)),i}}),c=function(t,e,i){this.renderer=t,this.gl=t.gl,this.program=this._createProgram(this.gl,e.v,e.f),i=i||{},this.attributes=i.attributes||[],this.uniforms=i.uniforms||[]};c.prototype={active:function(){var t=this,e=t.renderer,i=t.gl,n=t.program;n&&i&&(e.activeShader=t,i.useProgram(n),t.attributes.forEach((function(t){e[t]=i.getAttribLocation(n,t),i.enableVertexAttribArray(e[t])})),t.uniforms.forEach((function(t){e[t]=i.getUniformLocation(n,t)})),t.width===e.width&&t.height===e.height||(t.width=e.width,t.height=e.height,e._uploadProjectionTransform()))},uploadTexture:function(t){var e=this.gl,i=this.renderer,n=e.createTexture(),r=i.u_Sampler;return e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,n),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.uniform1i(r,0),e.bindTexture(e.TEXTURE_2D,null),this.renderer._cacheTexture[t.src]=n,n},_createProgram:function(t,e,i){var n=this._createShader(t,t.VERTEX_SHADER,e),r=this._createShader(t,t.FRAGMENT_SHADER,i);if(!n||!r)return null;var o=t.createProgram();if(o&&(t.attachShader(o,n),t.attachShader(o,r),t.linkProgram(o),t.deleteShader(r),t.deleteShader(n),!t.getProgramParameter(o,t.LINK_STATUS))){t.getProgramInfoLog(o);return t.deleteProgram(o),null}return o},_createShader:function(t,e,i){var n=t.createShader(e);if(n&&(t.shaderSource(n,i),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))){t.getShaderInfoLog(n);return t.deleteShader(n),null}return n}},t.exports=h},854:function(t){var e=function(){function t(t,e,i,n,r){return t=t||{},e&&(t.EaseIn=e),i&&(t.EaseOut=i),n&&(t.EaseInOut=n),r&&(t.EaseNone=r),t}var e=t(null,null,null,null,(function(t){return t})),i=t(null,(function(t){return t*t}),(function(t){return-t*(t-2)}),(function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)})),n=t(null,(function(t){return t*t*t}),(function(t){return--t*t*t+1}),(function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)})),r=t(null,(function(t){return t*t*t*t}),(function(t){return-(--t*t*t*t-1)}),(function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)})),o=t(null,(function(t){return t*t*t*t*t}),(function(t){return(t-=1)*t*t*t*t+1}),(function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)})),a=Math,s=a.PI,h=.5*s,c=a.sin,u=a.cos,l=a.pow,d=a.sqrt,f=t(null,(function(t){return 1-u(t*h)}),(function(t){return c(t*h)}),(function(t){return-.5*(u(s*t)-1)})),p=t(null,(function(t){return 0==t?0:l(2,10*(t-1))}),(function(t){return 1==t?1:1-l(2,-10*t)}),(function(t){return 0==t||1==t?t:(t*=2)<1?.5*l(2,10*(t-1)):.5*(2-l(2,-10*(t-1)))})),v=t(null,(function(t){return-(d(1-t*t)-1)}),(function(t){return d(1- --t*t)}),(function(t){return(t/=.5)<1?-.5*(d(1-t*t)-1):.5*(d(1-(t-=2)*t)+1)})),m=t({a:1,p:.4,s:.1,config:function(t,e){m.a=t,m.p=e,m.s=e/(2*s)*Math.asin(1/t)||0}},(function(t){return-m.a*l(2,10*(t-=1))*c((t-m.s)*(2*s)/m.p)}),(function(t){return m.a*l(2,-10*t)*c((t-m.s)*(2*s)/m.p)+1}),(function(t){return(t*=2)<1?m.a*l(2,10*(t-=1))*c((t-m.s)*(2*s)/m.p)*-.5:m.a*l(2,-10*(t-=1))*c((t-m.s)*(2*s)/m.p)*.5+1})),_=t({o:1.70158,s:2.59491,config:function(t){_.o=t,_.s=1.525*t}},(function(t){return t*t*((_.o+1)*t-_.o)}),(function(t){return(t-=1)*t*((_.o+1)*t+_.o)+1}),(function(t){return(t*=2)<1?t*t*((_.s+1)*t-_.s)*.5:.5*((t-=2)*t*((_.s+1)*t+_.s)+2)})),g=t(null,(function(t){return 1-g.EaseOut(1-t)}),(function(t){return(t/=1)<.36364?7.5625*t*t:t<.72727?7.5625*(t-=.54545)*t+.75:t<.90909?7.5625*(t-=.81818)*t+.9375:7.5625*(t-=.95455)*t+.984375}),(function(t){return t<.5?.5*g.EaseIn(2*t):.5*g.EaseOut(2*t-1)+.5}));return{Linear:e,Quad:i,Cubic:n,Quart:r,Quint:o,Sine:f,Expo:p,Circ:v,Elastic:m,Back:_,Bounce:g}}();t.exports=e},436:function(t,e,i){var n=i(485),r=function(){function t(){return+new Date}return n.create({constructor:function(t,e,i,n){var r=this;for(var o in r.target=t,r._startTime=0,r._seekTime=0,r._pausedTime=0,r._pausedStartTime=0,r._reverseFlag=1,r._repeatCount=0,3==arguments.length&&(n=i,i=e,e=null),n)r[o]=n[o];r._fromProps=e,r._toProps=i,!n.duration&&n.time&&(r.duration=n.time||0,r.time=0)},target:null,duration:1e3,delay:0,paused:!1,loop:!1,reverse:!1,repeat:0,repeatDelay:0,ease:null,time:0,isStart:!1,isComplete:!1,onStart:null,onUpdate:null,onComplete:null,setProps:function(t,e){var i=this,n=i.target,r=t||e,o=i._fromProps={},a=i._toProps={};for(var s in t=t||n,e=e||n,r)a[s]=e[s]||0,n[s]=o[s]=t[s]||0;return i},start:function(){var e=this;return e._startTime=t()+e.delay,e._seekTime=0,e._pausedTime=0,e._reverseFlag=1,e._repeatCount=0,e.paused=!1,e.isStart=!1,e.isComplete=!1,r.add(e),e},stop:function(){return r.remove(this),this},pause:function(){var e=this;return e.paused=!0,e._pausedStartTime=t(),e},resume:function(){var e=this;return e.paused=!1,e._pausedStartTime&&(e._pausedTime+=t()-e._pausedStartTime),e._pausedStartTime=0,e},seek:function(e,i){var n=this,o=t();return n._startTime=o,n._seekTime=e,n._pausedTime=0,void 0!==i&&(n.paused=i),n._update(o,!0),r.add(n),n},link:function(t){var e,i,n=this,o=t.delay,a=n._startTime;return"string"==typeof o&&(e=0==o.indexOf("+"),i=0==o.indexOf("-"),o=e||i?Number(o.substr(1))*(e?1:-1):Number(o)),t.delay=o,t._startTime=e||i?a+n.duration+o:a+o,n._next=t,r.remove(t),t},_render:function(t){var e,i=this,n=i.target,r=i._fromProps;for(e in r)n[e]=r[e]+(i._toProps[e]-r[e])*t},_update:function(e,i){var n=this;if(!n.paused||i){if(n.isComplete)return!0;var o=e-n._startTime-n._pausedTime+n._seekTime;if(!(o<0)){var a,s=o/n.duration;s=s<=0?0:s>=1?1:s;var h=n.ease?n.ease(s):s;n.reverse&&n.isStart&&(n._reverseFlag<0&&(s=1-s,h=1-h),s<1e-7&&(n.repeat>0&&n._repeatCount++>=n.repeat||0==n.repeat&&!n.loop?n.isComplete=!0:(n._startTime=t(),n._pausedTime=0,n._reverseFlag*=-1))),n.isStart||(n.setProps(n._fromProps,n._toProps),n.isStart=!0,n.onStart&&n.onStart.call(n,n)),n.time=o,n._render(h),(a=n.onUpdate)&&a.call(n,h,n),s>=1&&(n.reverse?(n._startTime=t(),n._pausedTime=0,n._reverseFlag*=-1):n.loop||n.repeat>0&&n._repeatCount++<n.repeat?(n._startTime=t()+n.repeatDelay,n._pausedTime=0):n.isComplete=!0);var c=n._next;if(c&&c.time<=0){var u=c._startTime;u>0&&u<=e?(c._render(s),c.time=o,r.add(c)):n.isComplete&&(u<0||u>e)&&c.start()}return n.isComplete?((a=n.onComplete)&&a.call(n,n),!0):void 0}}},Statics:{_tweens:[],tick:function(){var e,i,n=r._tweens,o=n.length;for(i=0;i<o;i++)(e=n[i])&&e._update(t())&&(n.splice(i,1),i--);return r},add:function(t){var e=r._tweens;return-1==e.indexOf(t)&&e.push(t),r},remove:function(t){var e,i;if(t instanceof Array){for(e=0,i=t.length;e<i;e++)r.remove(t[e]);return r}var n=r._tweens;if(t instanceof r)(e=n.indexOf(t))>-1&&n.splice(e,1);else for(e=0;e<n.length;e++)n[e].target===t&&(n.splice(e,1),e--);return r},removeAll:function(){return r._tweens.length=0,r},fromTo:function(t,e,i,n){n=n||{};var o=t instanceof Array;t=o?t:[t];var a,s,h=n.stagger,c=[];for(s=0;s<t.length;s++)a=new r(t[s],e,i,n),h&&(a.delay=(n.delay||0)+(s*h||0)),a.start(),c.push(a);return o?c:a},to:function(t,e,i){return r.fromTo(t,null,e,i)},from:function(t,e,i){return r.fromTo(t,e,null,i)}}})}();t.exports=r},499:function(t,e,i){var n=i(485),r=i(459),o=n.create({constructor:function(t){this._targetFPS=t||60,this._interval=1e3/this._targetFPS,this._tickers=[]},_paused:!1,_targetFPS:0,_interval:0,_intervalId:null,_tickers:null,_lastTime:0,_tickCount:0,_tickTime:0,_measuredFPS:0,start:function(t){if(void 0===t&&(t=!0),!this._intervalId){this._lastTime=+new Date;var e,i=this,n=this._interval,o=window.requestAnimationFrame||window[r.jsVendor+"RequestAnimationFrame"];t&&o&&n<17?(this._useRAF=!0,e=function(){i._intervalId=o(e),i._tick()}):e=function(){i._intervalId=setTimeout(e,n),i._tick()},this._paused=!1,e()}},stop:function(){this._useRAF?(window.cancelAnimationFrame||window[r.jsVendor+"CancelAnimationFrame"])(this._intervalId):clearTimeout(this._intervalId);this._intervalId=null,this._lastTime=0,this._paused=!0},pause:function(){this._paused=!0},resume:function(){this._paused=!1},_tick:function(){if(!this._paused){var t=+new Date,e=t-this._lastTime,i=this._tickers;++this._tickCount>=this._targetFPS?(this._measuredFPS=1e3/(this._tickTime/this._tickCount)+.5>>0,this._tickCount=0,this._tickTime=0):this._tickTime+=t-this._lastTime,this._lastTime=t;for(var n=i.slice(0),r=0,o=n.length;r<o;r++)n[r].tick(e)}},getMeasuredFPS:function(){return Math.min(this._measuredFPS,this._targetFPS)},addTick:function(t){if(!t||"function"!=typeof t.tick)throw new Error("Ticker: The tick object must implement the tick method.");this._tickers.push(t)},removeTick:function(t){var e=this._tickers,i=e.indexOf(t);i>=0&&e.splice(i,1)},nextTick:function(t){var e=this,i={tick:function(n){e.removeTick(i),t()}};return e.addTick(i),i},timeout:function(t,e){var i=this,n=(new Date).getTime()+e,r={tick:function(){(new Date).getTime()-n>=0&&(i.removeTick(r),t())}};return i.addTick(r),r},interval:function(t,e){var i=(new Date).getTime()+e,n={tick:function(){var n=(new Date).getTime(),r=n-i;r>=0&&(r<e&&(n-=r),i=n+e,t())}};return this.addTick(n),n}});t.exports=o},459:function(t){var e=function(){var t=navigator.userAgent,e=document,i=window,n=e.documentElement,r={iphone:/iphone/i.test(t),ipad:/ipad/i.test(t),ipod:/ipod/i.test(t),ios:/iphone|ipad|ipod/i.test(t),android:/android/i.test(t),webkit:/webkit/i.test(t),chrome:/chrome/i.test(t),safari:/safari/i.test(t),firefox:/firefox/i.test(t),ie:/msie/i.test(t),opera:/opera/i.test(t),supportTouch:"ontouchstart"in i,supportCanvas:null!=e.createElement("canvas").getContext,supportStorage:!1,supportOrientation:"orientation"in i||"orientation"in i.screen,supportDeviceMotion:"ondevicemotion"in i};try{var o="hilo";localStorage.setItem(o,o),localStorage.removeItem(o),r.supportStorage=!0}catch(t){}var a=r.jsVendor=r.webkit||r.firefox?"webkit":r.opera?"o":r.ie?"ms":"",s=r.cssVendor="-"+a+"-",h=e.createElement("div"),c=h.style,u=null!=c[a+"Transform"],l=null!=c[a+"Perspective"];l&&(h.id="test3d",(c=e.createElement("style")).textContent="@media ("+s+"transform-3d){#test3d{height:3px}}",e.head.appendChild(c),n.appendChild(h),l=3==h.offsetHeight,e.head.removeChild(c),n.removeChild(h)),r.supportTransform=u,r.supportTransform3D=l;var d=r.supportTouch,f=d?"touchstart":"mousedown",p=d?"touchmove":"mousemove",v=d?"touchend":"mouseup";return r.POINTER_START=f,r.POINTER_MOVE=p,r.POINTER_END=v,r}();t.exports=e},322:function(t){var e={copy:function(t,e,i){for(var n in e)i&&!t.hasOwnProperty(n)&&void 0===t[n]||(t[n]=e[n]);return t}};t.exports=e},836:function(t,e,i){var n=i(930),r=i(485),o=i(760),a=i(126),s=r.create({Extends:o,constructor:function(t){if(t=t||{},this.id=this.id||t.id||n.getUid("Bitmap"),s.superclass.constructor.call(this,t),this.drawable=new a(t),!this.width||!this.height){var e=this.drawable.rect;e&&(this.width=e[2],this.height=e[3])}},setImage:function(t,e,i){return this.drawable.init({image:t,rect:e,crossOrigin:i}),e?(this.width=e[2],this.height=e[3]):this.width||this.height||(e=this.drawable.rect)&&(this.width=e[2],this.height=e[3]),this}});t.exports=s},329:function(t,e,i){var n=i(930),r=i(485),o=i(760),a=r.create({Extends:o,constructor:function(t){t=t||{},this.id=this.id||t.id||n.getUid("Container"),a.superclass.constructor.call(this,t),this.children?this._updateChildren():this.children=[]},children:null,pointerChildren:!0,clipChildren:!1,getNumChildren:function(){return this.children.length},addChildAt:function(t,e){var i=this.children,n=i.length,r=t.parent;e=e<0?0:e>n?n:e;var o=this.getChildIndex(t);if(o==e)return this;if(o>=0?(i.splice(o,1),e=e==n?n-1:e):r&&r.removeChild(t),i.splice(e,0,t),o<0)this._updateChildren(e);else{var a=o<e?o:e,s=o<e?e:o;this._updateChildren(a,s+1)}return this},addChild:function(t){for(var e=this.children.length,i=arguments,n=0,r=i.length;n<r;n++)this.addChildAt(i[n],e+n);return this},removeChildAt:function(t){var e=this.children;if(t<0||t>=e.length)return null;var i=e[t];if(i){if(!i.__renderer)for(var n=i;n=n.parent;){if(n.renderer){i.__renderer=n.renderer;break}if(n.__renderer){i.__renderer=n.__renderer;break}}i.__renderer&&i.__renderer.remove(i),i.parent=null,i.depth=-1}return e.splice(t,1),this._updateChildren(t),i},removeChild:function(t){return this.removeChildAt(this.getChildIndex(t))},removeChildById:function(t){for(var e,i=this.children,n=0,r=i.length;n<r;n++)if((e=i[n]).id===t)return this.removeChildAt(n),e;return null},removeAllChildren:function(){for(;this.children.length;)this.removeChildAt(0);return this},getChildAt:function(t){var e=this.children;return t<0||t>=e.length?null:e[t]},getChildById:function(t){for(var e,i=this.children,n=0,r=i.length;n<r;n++)if((e=i[n]).id===t)return e;return null},getChildIndex:function(t){return this.children.indexOf(t)},setChildIndex:function(t,e){var i=this.children,n=i.indexOf(t);if(n>=0&&n!=e){var r=i.length;e=e<0?0:e>=r?r-1:e,i.splice(n,1),i.splice(e,0,t),this._updateChildren()}return this},swapChildren:function(t,e){var i=this.children,n=this.getChildIndex(t),r=this.getChildIndex(e);t.depth=r,i[r]=t,e.depth=n,i[n]=e},swapChildrenAt:function(t,e){var i=this.children,n=this.getChildAt(t),r=this.getChildAt(e);n.depth=e,i[e]=n,r.depth=t,i[t]=r},sortChildren:function(t){var e=t,i=this.children;if("string"==typeof e){var n=e;e=function(t,e){return e[n]-t[n]}}i.sort(e),this._updateChildren()},_updateChildren:function(t,e){var i,n=this.children;t=t||0,e=e||n.length;for(var r=t;r<e;r++)(i=n[r]).depth=r+1,i.parent=this},contains:function(t){for(;t=t.parent;)if(t===this)return!0;return!1},getViewAtPoint:function(t,e,i,n,r){for(var o,a,s=n?[]:null,h=this.children,c=h.length-1;c>=0;c--)if(!(!(o=h[c])||!o.visible||o.alpha<=0||r&&!o.pointerEnabled))if(o.children&&o.children.length&&(!r||o.pointerChildren)&&(a=o.getViewAtPoint(t,e,i,n,r)),a){if(!n)return a;a.length&&(s=s.concat(a))}else if(o.hitTestPoint(t,e,i)){if(!n)return o;s.push(o)}return n&&s.length?s:null},render:function(t,e){a.superclass.render.call(this,t,e);var i,n,r,o=this.children.slice(0);for(i=0,n=o.length;i<n;i++)(r=o[i]).parent===this&&r._render(t,e)}});t.exports=a},126:function(t,e,i){var n=i(485),r=i(322),o=n.create({constructor:function(t){this.init(t)},image:null,rect:null,init:function(t){var e=this,i=e.image;o.isDrawable(t)?e.image=t:r.copy(e,t,!0);var n=e.image;if("string"==typeof n){if(!i||n!==i.getAttribute("src")){e.image=null;var a=new Image;return t.crossOrigin&&(a.crossOrigin="Anonymous"),a.onload=function(){a.onload=null,e.init(a)},void(a.src=n)}n=e.image=i}n&&!e.rect&&(e.rect=[0,0,n.width,n.height])},Statics:{isDrawable:function(t){if(!t||!t.tagName)return!1;var e=t.tagName.toLowerCase();return"img"===e||"canvas"===e||"video"===e}}});t.exports=o},257:function(t,e,i){var n=i(930),r=i(485),o=i(329),a=i(604),s=i(386),h=i(856),c=i(459),u=i(322),l=r.create({Extends:o,constructor:function(t){t=t||{},this.id=this.id||t.id||n.getUid("Stage"),l.superclass.constructor.call(this,t),this._initRenderer(t);var e=this.width,i=this.height,r=this.updateViewport();t.width||(e=r&&r.width||320),t.height||(i=r&&r.height||480),this.resize(e,i,!0)},canvas:null,renderer:null,paused:!1,viewport:null,_initRenderer:function(t){var e=t.canvas,i=t.container,r=t.renderType||"canvas";if("string"==typeof e&&(e=n.getElement(e)),"string"==typeof i&&(i=n.getElement(i)),e)e.getContext||(r="dom");else{var o="dom"===r?"div":"canvas";e=n.createElement(o,{style:{position:"absolute"}})}this.canvas=e,i&&i.appendChild(e);var c={canvas:e,stage:this};switch(r){case"dom":this.renderer=new s(c);break;case"webgl":h.isSupport()?this.renderer=new h(c):this.renderer=new a(c);break;default:this.renderer=new a(c)}},addTo:function(t){var e=this.canvas;return e.parentNode!==t&&t.appendChild(e),this},tick:function(t){this.paused||this._render(this.renderer,t)},enableDOMEvent:function(t,e){var i=this,n=i.canvas,r=i._domListener||(i._domListener=function(t){i._onDOMEvent(t)});t="string"==typeof t?[t]:t,e=!1!==e;for(var o=0;o<t.length;o++){var a=t[o];e?n.addEventListener(a,r,!1):n.removeEventListener(a,r)}return i},_onDOMEvent:function(t){var e=t.type,i=t,n=0==e.indexOf("touch"),r=t;if(n){var o=t.touches,a=t.changedTouches;r=o&&o.length?o[0]:a&&a.length?a[0]:null}var s=r.pageX||r.clientX,h=r.pageY||r.clientY,l=this.viewport||this.updateViewport();i.stageX=s=(s-l.left)/this.scaleX,i.stageY=h=(h-l.top)/this.scaleY,i.stopPropagation=function(){this._stopPropagationed=!0};var d=this.getViewAtPoint(s,h,!0,!1,!0)||this,f=this.canvas,p=this._eventTarget,v="mouseout"===e;if(p&&(p!=d&&(!p.contains||!p.contains(d))||v)){var m="touchmove"===e?"touchout":"mousemove"===e||v||!d?"mouseout":null;if(m){var _=u.copy({},i);_.type=m,_.eventTarget=p,p._fireMouseEvent(_)}i.lastEventTarget=p,this._eventTarget=null}if(d&&d.pointerEnabled&&"mouseout"!==e&&(i.eventTarget=this._eventTarget=d,d._fireMouseEvent(i)),!n){var g=d&&d.pointerEnabled&&d.useHandCursor?"pointer":"";f.style.cursor=g}c.android&&"touchmove"===e&&t.preventDefault()},updateViewport:function(){var t=this.canvas,e=null;return t.parentNode&&(e=this.viewport=n.getElementRect(t)),e},resize:function(t,e,i){(i||this.width!==t||this.height!==e)&&(this.width=t,this.height=e,this.renderer.resize(t,e),this.updateViewport())}});t.exports=l},760:function(t,e,i){var n=i(930),r=i(485),o=i(111),a=i(739),s=i(322),h=function(){return r.create({Mixes:o,constructor:function(t){t=t||{},this.id=this.id||t.id||n.getUid("View"),s.copy(this,t,!0)},tint:16777215,id:null,x:0,y:0,width:0,height:0,alpha:1,rotation:0,visible:!0,pivotX:0,pivotY:0,scaleX:1,scaleY:1,pointerEnabled:!0,background:null,mask:null,align:null,drawable:null,boundsArea:null,parent:null,depth:-1,transform:null,blendMode:"source-over",getStage:function(){for(var t,e=this;t=e.parent;)e=t;return e.canvas?e:null},getScaledWidth:function(){return this.width*this.scaleX},getScaledHeight:function(){return this.height*this.scaleY},addTo:function(t,e){return"number"==typeof e?t.addChildAt(this,e):t.addChild(this),this},removeFromParent:function(){var t=this.parent;return t&&t.removeChild(this),this},getBounds:function(){for(var t,e,i,n,r,o,a,s=this.width,h=this.height,c=this.getConcatenatedMatrix(),u=this.boundsArea||[{x:0,y:0},{x:s,y:0},{x:s,y:h},{x:0,y:h}],l=[],d=0,f=u.length;d<f;d++)e=(t=c.transformPoint(u[d],!0,!0)).x,i=t.y,0==d?(n=r=e,o=a=i):(n>e?n=e:r<e&&(r=e),o>i?o=i:a<i&&(a=i)),l[d]=t;return l.x=n,l.y=o,l.width=r-n,l.height=a-o,l},getConcatenatedMatrix:function(t){for(var e=new a(1,0,0,1,0,0),i=this;i!=t&&i.parent;i=i.parent){var n=1,r=0,o=i.rotation%360,s=i.pivotX,h=i.pivotY,c=i.scaleX,u=i.scaleY,l=i.transform;if(l)e.concat(l);else{if(o){var d=o*Math.PI/180;n=Math.cos(d),r=Math.sin(d)}0!=s&&(e.tx-=s),0!=h&&(e.ty-=h);var f=i.getAlignPosition();e.concat(n*c,r*c,-r*u,n*u,f.x,f.y)}}return e},getAlignPosition:function(){var t=this.parent,e=this.align,i=this.x,n=this.y;if(t&&this.align){if("function"==typeof e)return this.align();var r=this.width,o=this.height,a=t.width,s=t.height;switch(e){case"TL":i=0,n=0;break;case"T":i=a-r>>1,n=0;break;case"TR":i=a-r,n=0;break;case"L":i=0,n=s-o>>1;break;case"C":i=a-r>>1,n=s-o>>1;break;case"R":i=a-r,n=s-o>>1;break;case"BL":i=0,n=s-o;break;case"B":i=a-r>>1,n=s-o;break;case"BR":i=a-r,n=s-o}}return{x:i,y:n}},hitTestPoint:function(t,e,i){var n=this.getBounds(),r=t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height;return r&&i&&(r=function(t,e,i){for(var n,r,o,a,s=0,h=!1,c=0,u=i.length;c<u;c++){var l=i[c],d=i[(c+1)%u];if(l.y==d.y&&e==l.y&&(l.x>d.x?(n=d.x,r=l.x):(n=l.x,r=d.x),t>=n&&t<=r))h=!0;else if(l.y>d.y?(o=d.y,a=l.y):(o=l.y,a=d.y),!(e<o||e>a)){var f=(e-l.y)*(d.x-l.x)/(d.y-l.y)+l.x;if(f>t?s++:f==t&&(h=!0),l.x>t&&l.y==e){var p=i[(u+c-1)%u];(p.y<e&&d.y>e||p.y>e&&d.y<e)&&s++}}}return h||s%2==1}(t,e,n)),r},hitTestObject:function(e,i){var n,r,o,a=this.getBounds(),s=e.getBounds(),h=a.x<=s.x+s.width&&s.x<=a.x+a.width&&a.y<=s.y+s.height&&s.y<=a.y+a.height;return h&&i&&(h=!!(o=t(n=a,r=s,{overlap:-1/0,normal:{x:0,y:0}}))&&t(r,n,o)),!!h},_render:function(t,e){this.onUpdate&&!1===this.onUpd