@awayfl/awayfl-player
Version:
Flash Player emulator for executing SWF files (published for FP versions 6 and up) in javascript
1 lines • 3.11 MB
JavaScript
var awayflplayer=function(t){"use strict";var e=function(){},i=function(){},n=function(t,n,r,o,s,a,l,u,c,h){this.a=new i,this.b=new i,this.flags=new e,this.dest=t,this.a.format=n,this.a.size=r,this.b.format=o,this.b.size=s,this.opcode=a,this.flags.simple=l,this.flags.horizontal=u,this.flags.fragonly=c,this.flags.matrix=h},r=function(){function t(){}return Object.defineProperty(t,"map",{get:function(){return t._map||(t._map=new Array,t._map.mov=new n("vector","vector",4,"none",0,0,!0,null,null,null),t._map.add=new n("vector","vector",4,"vector",4,1,!0,null,null,null),t._map.sub=new n("vector","vector",4,"vector",4,2,!0,null,null,null),t._map.mul=new n("vector","vector",4,"vector",4,3,!0,null,null,null),t._map.div=new n("vector","vector",4,"vector",4,4,!0,null,null,null),t._map.rcp=new n("vector","vector",4,"none",0,5,!0,null,null,null),t._map.min=new n("vector","vector",4,"vector",4,6,!0,null,null,null),t._map.max=new n("vector","vector",4,"vector",4,7,!0,null,null,null),t._map.frc=new n("vector","vector",4,"none",0,8,!0,null,null,null),t._map.sqt=new n("vector","vector",4,"none",0,9,!0,null,null,null),t._map.rsq=new n("vector","vector",4,"none",0,10,!0,null,null,null),t._map.pow=new n("vector","vector",4,"vector",4,11,!0,null,null,null),t._map.log=new n("vector","vector",4,"none",0,12,!0,null,null,null),t._map.exp=new n("vector","vector",4,"none",0,13,!0,null,null,null),t._map.nrm=new n("vector","vector",4,"none",0,14,!0,null,null,null),t._map.sin=new n("vector","vector",4,"none",0,15,!0,null,null,null),t._map.cos=new n("vector","vector",4,"none",0,16,!0,null,null,null),t._map.crs=new n("vector","vector",4,"vector",4,17,!0,!0,null,null),t._map.dp3=new n("vector","vector",4,"vector",4,18,!0,!0,null,null),t._map.dp4=new n("vector","vector",4,"vector",4,19,!0,!0,null,null),t._map.abs=new n("vector","vector",4,"none",0,20,!0,null,null,null),t._map.neg=new n("vector","vector",4,"none",0,21,!0,null,null,null),t._map.sat=new n("vector","vector",4,"none",0,22,!0,null,null,null),t._map.ted=new n("vector","vector",4,"sampler",1,38,!0,null,!0,null),t._map.kil=new n("none","scalar",1,"none",0,39,!0,null,!0,null),t._map.tex=new n("vector","vector",4,"sampler",1,40,!0,null,!0,null),t._map.m33=new n("vector","matrix",3,"vector",3,23,!0,null,null,!0),t._map.m44=new n("vector","matrix",4,"vector",4,24,!0,null,null,!0),t._map.m43=new n("vector","matrix",3,"vector",4,25,!0,null,null,!0),t._map.ddx=new n("vector","vector",4,"none",0,26,!0,null,!0,null),t._map.ddy=new n("vector","vector",4,"none",0,27,!0,null,!0,null),t._map.sge=new n("vector","vector",4,"vector",4,41,!0,null,null,null),t._map.slt=new n("vector","vector",4,"vector",4,42,!0,null,null,null),t._map.sgn=new n("vector","vector",4,"vector",4,43,!0,null,null,null),t._map.seq=new n("vector","vector",4,"vector",4,44,!0,null,null,null),t._map.sne=new n("vector","vector",4,"vector",4,45,!0,null,null,null)),t._map},enumerable:!1,configurable:!0}),t}(),o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},o(t,e)};function s(t,e){function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var a=function(t){function e(e,i,n){void 0===e&&(e=""),void 0===i&&(i=0),void 0===n&&(n="");var r=t.call(this,e)||this;return r._errorID=0,r._messsage="",r._name="",r._messsage=e,r._name=n,r._errorID=i,r}return s(e,t),Object.defineProperty(e.prototype,"message",{get:function(){return this._messsage},set:function(t){this._messsage=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"errorID",{get:function(){return this._errorID},enumerable:!1,configurable:!0}),e}(Error),l=function(t){function e(e,i){return void 0===e&&(e=null),void 0===i&&(i=0),t.call(this,e||"An abstract method was called! Either an instance of an abstract export class was created,or an abstract method was not overridden by the subclass.",i)||this}return s(e,t),e}(a),u=function(){function t(t){this._iAllowedToPropagate=!0,this._iAllowedToImmediatlyPropagate=!0,this.type=t}return t.prototype.clone=function(){return new t(this.type)},t}(),c=function(t){function e(e,i,n){void 0===n&&(n=null);var r=t.call(this,e)||this;return r._asset=i,r._prevName=n||r._asset.name,r}return s(e,t),Object.defineProperty(e.prototype,"asset",{get:function(){return this._asset},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"prevName",{get:function(){return this._prevName},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return new e(this.type,this._asset,this._prevName)},e.INVALIDATE="invalidate",e.CLEAR="clear",e.RENAME="rename",e.ENTER_FRAME="enterFrame",e.EXIT_FRAME="exitFrame",e.ASSET_CONFLICT_RESOLVED="assetConflictResolved",e.ASSET_COMPLETE="assetComplete",e.TEXTURE_SIZE_ERROR="textureSizeError",e}(u),h=function(){function t(t){void 0===t&&(t=null),this._listenerObjects={},this._t=t||this}return t.prototype.addEventListener=function(t,e){var i=this._listenerObjects[t];void 0===i&&(i=this._listenerObjects[t]=new p),i.addEventListener(e)},t.prototype.removeEventListener=function(t,e){var i=this._listenerObjects[t];i&&(i.removeEventListener(e),0==i.numListeners&&delete this._listenerObjects[t])},t.prototype.dispatchEvent=function(t,e){void 0===e&&(e=null);var i=this._listenerObjects[t.type];i&&(t.target=e||this._t,t.currentTarget=this._t,i.dispatchEvent(t))},t.prototype.hasEventListener=function(t,e){return void 0!==this._listenerObjects[t]&&(null!=e?-1!==this._listenerObjects[t].getEventListenerIndex(e):this._listenerObjects[t].numListeners>0)},t.prototype.removeAllEventListeners=function(){this._listenerObjects={}},t}(),p=function(){function t(){this._index=0,this._listeners=new Array,this.numListeners=0}return t.prototype.addEventListener=function(t){-1===this._listeners.indexOf(t)&&(this._listeners.push(t),this.numListeners++)},t.prototype.removeEventListener=function(t){var e=this._listeners.indexOf(t);-1!==e&&(this._listeners.splice(e,1),e<=this._index&&this._index--,this.numListeners--)},t.prototype.dispatchEvent=function(t){var e=this.numListeners;for(this._index=0;this._index<e&&this._index<this.numListeners&&(this._listeners[this._index](t),t._iAllowedToImmediatlyPropagate);this._index++);},t.prototype.getEventListenerIndex=function(t){return this._listeners.indexOf(t)},t}(),d=function(){function t(){}return Object.defineProperty(t,"Current",{get:function(){return this.id},enumerable:!1,configurable:!0}),t.Next=function(){return this.id++},t.id=0,t}(),_=function(t){function e(){var e=t.call(this)||this;return e._abstractionPool={},e.id=d.Next(),e}return s(e,t),Object.defineProperty(e.prototype,"adaptee",{get:function(){return this},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"adapter",{get:function(){return this._adapter||this},set:function(t){this._adapter=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"assetType",{get:function(){throw new l},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this._name},set:function(t){var e=this._name;this._name=t,null==this._name&&(this._name="null"),this.dispatchEvent(new c(c.RENAME,this,e))},enumerable:!1,configurable:!0}),e.prototype.invalidate=function(){this.dispatchEvent(new c(c.INVALIDATE,this))},e.prototype.dispose=function(){throw new l},e.prototype.clone=function(){throw new l},e.prototype.clear=function(){this.dispatchEvent(new c(c.CLEAR,this))},Object.defineProperty(e.prototype,"assetNamespace",{get:function(){return this._namespace},set:function(t){this._namespace=t||e.DEFAULT_NAMESPACE},enumerable:!1,configurable:!0}),e.prototype.assetPathEquals=function(t,e){return this._name==t&&(!e||this._namespace==e)},e.prototype.isAsset=function(t){return this.assetType==t.assetType},e.prototype.resetAssetPath=function(t,i){void 0===i&&(i=null),this._name=t||"null",this._namespace=i||e.DEFAULT_NAMESPACE},e.prototype.getAbstraction=function(t){return this._abstractionPool[t.id]||(this._abstractionPool[t.id]=this.getNewAbstraction(t))},e.prototype.clearAbstraction=function(t){t.storeAbstraction(this._abstractionPool[t.id]),delete this._abstractionPool[t.id]},e.prototype.getNewAbstraction=function(t){var e=t.requestAbstraction(this);return e.init(this,t),e},e.DEFAULT_NAMESPACE="default",e}(h),f=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._stopped=!1,e._loops=0,e._id=-1,e._isLooping=!1,e._isPlaying=!1,e._isDecoding=!1,e}return s(e,t),Object.defineProperty(e.prototype,"stopped",{get:function(){return this._stopped},enumerable:!1,configurable:!0}),e.prototype.isLooping=function(){return this._isLooping},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isDecoding=function(){return this._isDecoding},e.prototype.play=function(t,e,i,n,r){this._loops="number"==typeof i?i:i?1e3:0,this._id=n||-1},e.prototype.dispatchRestart=function(){this.dispatchEvent(e.RESTART_EVENT)},e.prototype.tryRestartLoop=function(){return this._loops--,!(this._loops<=0)&&(!!this.restart()||(this._loops=0,!1))},e.prototype.completeInternally=function(t,i){void 0===t&&(t=!0),void 0===i&&(i=!0),i&&this.tryRestartLoop()||t&&this.dispatchEvent(e.COMPLETE_EVENT)},e.prototype.dispatchComplete=function(){this.dispatchEvent(e.COMPLETE_EVENT)},e.prototype.dispatchStop=function(t){void 0===t&&(t=!1),this.dispatchEvent(t?e.ERROR_EVENT:e.STOP_EVENT),this.owner=null,this._stopped=!0,this.removeAllEventListeners()},e.COMPLETE="complete",e.RESTART="restart",e.STOP="stop",e.ERROR="error",e.RESTART_EVENT=new u(e.RESTART),e.COMPLETE_EVENT=new u(e.COMPLETE),e.STOP_EVENT=new u(e.STOP),e.ERROR_EVENT=new u(e.ERROR),e}(h),m=function(t){function e(e,i,n){void 0===e&&(e=0),void 0===i&&(i=1),void 0===n&&(n=1);var r=t.call(this)||this;return r._groupID=0,r._groupVolume=1,r._groupPan=0,r._startTime=0,r._groupID=e,r._groupVolume=i,r._groupPan=n,r._sourceOpenDelegate=function(t){return r._sourceOpen(t)},r._updateEndDelegate=function(t){return r._updateEnd(t)},r._audio=new Audio,r._audio.ontimeupdate=function(t){return r._onTimeUpdate(t)},r._updateSource(),r}return s(e,t),e.stopAllSounds=function(t){void 0===t&&(t=-1);var i=e._channels.length;if(t<0){for(var n=0;n<i;n++)e._channels[n].stop();e._channels.length=0}else{var r=[];for(n=0;n<i;n++)e._channels[n].groupID==t?e._channels[n].stop():r[r.length]=e._channels[n];e._channels=r}},e.setChannelGroupVolume=function(t,i){void 0===i&&(i=-1);var n=e._channels.length;if(i<0)for(var r=0;r<n;r++)e._channels[r].groupVolume=t;else for(r=0;r<n;r++)e._channels[r].groupID==i&&(e._channels[r].groupVolume=t)},Object.defineProperty(e.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._audio.currentTime-this._startTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groupID",{get:function(){return this._groupID},set:function(t){this._groupID=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groupVolume",{get:function(){return this._groupVolume},set:function(t){this._groupVolume!=t&&(this._groupVolume=t,this._audio.volume=this._groupVolume*this._volume)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groupPan",{get:function(){return this._groupPan},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._volume},set:function(t){this._volume!=t&&(this._volume=t,this._audio.volume=this._volume)},enumerable:!1,configurable:!0}),e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isLooping=function(){return this._isLooping},e.prototype.isDecoding=function(){return!1},Object.defineProperty(e.prototype,"pan",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),e.prototype.restart=function(){return console.warn("[StreamingAudioChannel] Restart not implemented"),!1},e.prototype.play=function(e,i,n){void 0===i&&(i=0),void 0===n&&(n=!1),t.prototype.play.call(this,e,i,n,0),this._isPlaying=!0,(this._isLooping||this._isLooping!=this._loops>0)&&(this._isLooping=this._loops>0,this._sourceDirty=!0),this._sourceDirty&&this._updateSource(),this._buffer=e,this._offset=i,this._audio.volume=this._groupVolume*this._volume,this._isQueuing||this._isOpening||this._queueBuffer()},e.prototype.stopInternally=function(e){void 0===e&&(e=!1),this._audio.pause(),this._isPlaying=!1,this._isLooping=!1,t.prototype.completeInternally.call(this,e,e)},e.prototype.stop=function(){this.stopInternally(!1),this.dispatchStop(!1)},e.prototype._sourceOpen=function(t){if(this._isOpening=!1,this._mediaSource.activeSourceBuffers.length)return console.log("ERR: double sourceopen event called"),void this.dispatchStop(!0);this._sourceBuffer=this._mediaSource.addSourceBuffer("audio/mpeg"),this._sourceBuffer.addEventListener("updateend",this._updateEndDelegate),this._isPlaying&&this._queueBuffer()},e.prototype._queueBuffer=function(){this._isQueuing=!0,this._startTime=this._sourceBuffer.timestampOffset,this._sourceBuffer.appendBuffer(this._buffer)},e.prototype._updateEnd=function(t){this._isQueuing=!1,this._isLooping&&this._mediaSource.endOfStream(),this._duration=this._sourceBuffer.timestampOffset-this._startTime,this._audio.currentTime=this._startTime+this._offset,this._audio.play()},e.prototype._onTimeUpdate=function(t){!this._isLooping&&this._duration<this._audio.currentTime-this._startTime+.1&&this.stopInternally(!0)},e.prototype._updateSource=function(){this._mediaSource&&this._disposeSource(),this._isQueuing=!1,this._isOpening=!0,this._mediaSource=new MediaSource,this._mediaSource.addEventListener("sourceopen",this._sourceOpenDelegate),this._urlString=URL.createObjectURL(this._mediaSource),this._audio.src=this._urlString,this._audio.loop=this._isLooping,this._sourceDirty=!1},e.prototype._disposeSource=function(){this._isOpening||(this._sourceBuffer.timestampOffset&&this._sourceBuffer.remove(0,this._sourceBuffer.timestampOffset),this._sourceBuffer.removeEventListener("updateend",this._updateEndDelegate),this._mediaSource.removeSourceBuffer(this._sourceBuffer),delete this._sourceBuffer,this._sourceBuffer=null),this._mediaSource.removeEventListener("sourceopen",this._sourceOpenDelegate),URL.revokeObjectURL(this._urlString),delete this._mediaSource,this._mediaSource=null},e.maxChannels=4,e._channels=new Array,e}(f),g=function(t){function e(i,n,r){void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=1);var o=t.call(this)||this;return o._volume=1,o._pan=-1,o._groupID=0,o._groupVolume=1,o._groupPan=0,o._startTime=0,o._groupID=i,o._groupVolume=n,o._groupPan=r,o._audioCtx=e.getAudioContext(),o._usingNativePanner="function"==typeof o._audioCtx.createStereoPanner,o._gainNode=o._audioCtx.createGain(),o._gainNode.gain.value=o._groupVolume*o._volume,o._pannerNode=o._usingNativePanner?o._audioCtx.createStereoPanner():o._audioCtx.createPanner(),o.pan=0,o._gainNode.connect(o._pannerNode),o._pannerNode.connect(o._audioCtx.destination),o._onEndedDelegate=function(t){return o._onEnded(t)},o}return s(e,t),e.getOfflineContext=function(t,e,i){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=44100);var n=self.OfflineAudioContext||self.webkitOfflineAudioContext;return n?new n(t,e,i):null},e.getAudioContext=function(){var t=self.AudioContext||self.webkitAudioContext;return!e._audioCtx&&t&&(e._audioCtx=new t),e._audioCtx&&"suspended"==e._audioCtx.state&&e._audioCtx.resume(),e._audioCtx},e.stopAllSounds=function(t){void 0===t&&(t=-1);var i=e._channels.length;if(t<0){for(var n=0;n<i;n++)e._channels[n].stop();e._channels.length=0}else{var r=[];for(n=0;n<i;n++)e._channels[n].groupID==t?e._channels[n].stop():r[r.length]=e._channels[n];e._channels=r}},e.setChannelGroupVolume=function(t,i){void 0===i&&(i=-1);var n=e._channels.length;if(i<0)for(var r=0;r<n;r++)e._channels[r].groupVolume=t;else for(r=0;r<n;r++)e._channels[r].groupID==i&&(e._channels[r].groupVolume=t)},Object.defineProperty(e.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._isDecoding?this._currentTime:this._audioCtx.currentTime-this._startTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groupID",{get:function(){return this._groupID},set:function(t){this._groupID=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groupVolume",{get:function(){return this._groupVolume},set:function(t){this._groupVolume!=t&&(this._groupVolume=t,this._gainNode.gain.value=this._groupVolume*this._volume)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groupPan",{get:function(){return this._groupPan},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._volume},set:function(t){this._volume!=t&&(this._volume=t,this._gainNode.gain.value=this._groupVolume*this._volume)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pan",{get:function(){return this._pan},set:function(t){if(this._pan!=t)if(this._pan=t,this._usingNativePanner)this._pannerNode.pan.value=this._pan;else{var e=this._pan*(Math.PI/2);this._pannerNode.setPosition(Math.sin(e),0,Math.cos(e))}},enumerable:!1,configurable:!0}),e.prototype.restart=function(){if(this._isPlaying=!1,this._stopped)throw"You can't restart channel that was fully stopped";var t=e._decodeCache[this._id];return!!t&&(this._isPlaying=!0,this.executeBuffer(t),this.dispatchRestart(),!0)},e.prototype.play=function(i,n,r,o,s){void 0===n&&(n=0),void 0===r&&(r=!1),void 0===o&&(o=0),0!==i.byteLength?(t.prototype.play.call(this,i,n,r,o,s),this._isLooping=this._loops>0,this._isPlaying=!0,this._currentTime=n,this._isDecoding=!0,e._decodeCache[o]?this.executeBuffer(e._decodeCache[o]):e._errorCache[o]?(this.stopInternally(!1),this.dispatchStop(!0)):this._decodeAndExecute(i,s)):console.warn("[WabAudioChannel] Input buffer is empty")},e.prototype.stopInternally=function(e){void 0===e&&(e=!0),this._isPlaying&&(this._isPlaying=!1,this._isLooping=!1,this._isDecoding=!1,this._source&&this._disposeSource(),t.prototype.completeInternally.call(this,e,e))},e.prototype.stop=function(){this.stopInternally(!1),this.dispatchStop(!1)},e.prototype._decodeAndExecute=function(t,i){var n=this,r=this._audioCtx;try{i&&i.sampleRate&&i.sampleRate!==this._audioCtx.sampleRate&&i.samplesCount&&(r=e.getOfflineContext(2,i.samplesCount+i.startOffset,i.sampleRate))}catch(t){console.warn("[WebAudioChannel] Error when try create Offline Context:",t.message,i)}var o=r.decodeAudioData(t.slice(0),(function(t){return n._onDecodeComplete(t,i)}),(function(t){return n._onError(t)}));o instanceof self.Promise&&o.catch((function(t){return n._onError(t)}))},e.prototype._onDecodeComplete=function(t,i){e._decodeCache[this._id]||(i&&i.startOffset>0&&(t=this.removeSilent(t,i.startOffset,i.samplesCount,i.sampleRate)),e._decodeCache[this._id]=t),t=e._decodeCache[this._id],this._isPlaying&&this.executeBuffer(t)},e.prototype.executeBuffer=function(t){this._source&&this._disposeSource(),this._isDecoding=!1,this._source=this._audioCtx.createBufferSource(),this._source.connect(this._gainNode),this._source.buffer=t,this._duration=t.duration,this._pan=0,this._startTime=this._audioCtx.currentTime-this._currentTime,this._source.onended=this._onEndedDelegate;try{var e=this._groupVolume,i=this._pan;this._groupVolume=-1,this._pan=-1,this.groupVolume=e,this.pan=i,this._source.start(this._audioCtx.currentTime,this._currentTime)}catch(t){console.warn("[WebAudioChannel] Error starting audio: "+t),this.dispatchStop(!0),this._disposeSource()}},e.prototype._onError=function(t){console.warn("[WebAudioChannel] Error with decoding audio data:",t),e._errorCache[this._id]=!0,this._isDecoding=!1,this.stopInternally(!1),this.dispatchStop(!0)},e.prototype._onEnded=function(t){this.stopInternally(!0)},e.prototype._disposeSource=function(){this._source.onended=null,this._source.stop(this._audioCtx.currentTime),this._source.disconnect(),this._source=null},e.prototype.removeSilent=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),i=i||t.length,n=n||t.sampleRate,e=Math.ceil(t.sampleRate*e/n),i=t.sampleRate*i/n|0;for(var r=Math.min(t.length,i+e),o=this._audioCtx.createBuffer(t.numberOfChannels,i,t.sampleRate),s=0;s<t.numberOfChannels;s++)o.copyToChannel(t.getChannelData(s).subarray(e,r),s,0);return o},e.maxChannels=128,e._channels=new Array,e._decodeCache={},e._errorCache={},e}(f),y=g.getAudioContext();if(y&&"suspended"===y.state){var A=function(){y.resume();var t=y.createBuffer(1,1,22050),e=y.createBufferSource();e.buffer=t,e.connect(y.destination),e.start(),setTimeout((function(){"running"===y.state&&(document.removeEventListener("touchstart",A,!1),document.removeEventListener("touchend",A,!1))}),0)};document.addEventListener("touchstart",A,!1),document.addEventListener("touchend",A,!1)}var v=function(){function t(){this.position=0,this.length=0,this._mode=""}return t.prototype.writeByte=function(t){throw"Virtual method"},t.prototype.readByte=function(){throw"Virtual method"},t.prototype.writeUnsignedByte=function(t){throw"Virtual method"},t.prototype.readUnsignedByte=function(){throw"Virtual method"},t.prototype.writeUnsignedShort=function(t){throw"Virtual method"},t.prototype.readUnsignedShort=function(){throw"Virtual method"},t.prototype.writeUnsignedInt=function(t){throw"Virtual method"},t.prototype.readUnsignedInt=function(){throw"Virtual method"},t.prototype.writeFloat=function(t){throw"Virtual method"},t.prototype.toFloatBits=function(t){throw"Virtual method"},t.prototype.readFloat=function(t){throw"Virtual method"},t.prototype.fromFloatBits=function(t){throw"Virtual method"},t.prototype.getBytesAvailable=function(){throw new l("ByteArrayBase, getBytesAvailable() not implemented ")},t.prototype.toString=function(){return"[ByteArray] ( "+this._mode+" ) position="+this.position+" length="+this.length},t.prototype.compareEqual=function(t,e){(null==e||e>this.length-this.position)&&(e=this.length-this.position),e>t.length-t.position&&(e=t.length-t.position);for(var i=e,n=!0;n&&e>=4;)e-=4,this.readUnsignedInt()!=t.readUnsignedInt()&&(n=!1);for(;n&&e>=1;)e--,this.readUnsignedByte()!=t.readUnsignedByte()&&(n=!1);return this.position-=i-e,t.position-=i-e,n},t.prototype.writeBase64String=function(t){},t.prototype.dumpToConsole=function(){var t=this.position;this.position=0;function e(t,e){for(var i=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",r=0;r<e;r++)n=i[t>>(r<<2)&15]+n;return n}for(var i=0;i<this.length;i+=8){for(var n=e(i,4)+":",r=0;r<8&&i+r<this.length;r++)n+=" "+e(this.readUnsignedByte(),2);console.log(n)}this.position=t},t.prototype.readBase64String=function(e){return(null==e||e>this.length-this.position)&&(e=this.length-this.position),e>0?t.internalGetBase64String(e,this.readUnsignedByte,this):""},t.internalGetBase64String=function(e,i,n){for(var r,o,s,a,l,u,c,h="",p=t.Base64Key;e>=3;)a=(r=i.apply(n))>>2,l=(3&r)<<4|(o=i.apply(n))>>4,u=(15&o)<<2|(s=i.apply(n))>>6,c=63&s,h+=p.charAt(a)+p.charAt(l)+p.charAt(u)+p.charAt(c),e-=3;return 2==e?(a=(r=i.apply(n))>>2,l=(3&r)<<4|(o=i.apply(n))>>4,u=(15&o)<<2,h+=p.charAt(a)+p.charAt(l)+p.charAt(u)+"="):1==e&&(a=(r=i.apply(n))>>2,l=(3&r)<<4,h+=p.charAt(a)+p.charAt(l)+"=="),h},t.Base64Key="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t}(),b=function(t){function e(e){void 0===e&&(e=4);var i=t.call(this)||this;return i._mode="Typed array",i.maxlength=Math.max(e+255&-256,4),i.arraybytes=new ArrayBuffer(i.maxlength),i.unalignedarraybytestemp=new ArrayBuffer(16),i}return s(e,t),e.prototype.ensureWriteableSpace=function(t){this.ensureSpace(t+this.position)},e.prototype.setArrayBuffer=function(t){this.ensureSpace(t.byteLength),this.length=t.byteLength;var e=new Int8Array(t);new Int8Array(this.arraybytes,0,this.length).set(e),this.position=0},e.prototype.writeArrayBuffer=function(t){this.ensureWriteableSpace(t.byteLength);var e=new Int8Array(t);new Int8Array(this.arraybytes,this.length,t.byteLength).set(e),this.length+=t.byteLength,this.position=this.length},e.prototype.writeByteArray=function(t){this.ensureWriteableSpace(t.length);var e=new Int8Array(t.arraybytes,0,t.length);new Int8Array(this.arraybytes,this.length,t.length).set(e),this.length+=t.length,this.position=this.length},e.prototype.getBytesAvailable=function(){return this.length-this.position},e.prototype.ensureSpace=function(t){if(t>this.maxlength){var e=t+255&-256,i=new ArrayBuffer(e),n=new Uint8Array(this.arraybytes,0,this.length);new Uint8Array(i,0,this.length).set(n),this.arraybytes=i,this.maxlength=e}},e.prototype.writeObject=function(t){console.log("writeObject not implemented yet in core/ByteArray")},e.prototype.readObject=function(){return console.log("readObject not implemented yet in core/ByteArray"),{}},e.prototype.writeByte=function(t){this.ensureWriteableSpace(1),new Int8Array(this.arraybytes)[this.position++]=~~t,this.position>this.length&&(this.length=this.position)},e.prototype.readByte=function(){if(this.position>=this.length)throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length;return new Int8Array(this.arraybytes)[this.position++]},e.prototype.readBytes=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),null==i&&(i=t.length),t.ensureWriteableSpace(e+i);var n=new Int8Array(t.arraybytes),r=new Int8Array(this.arraybytes);n.set(r.subarray(this.position,this.position+i),e),this.position+=i,i+e>t.length&&(t.length+=i+e-t.length)},e.prototype.writeUnsignedByte=function(t){this.ensureWriteableSpace(1),new Uint8Array(this.arraybytes)[this.position++]=255&~~t,this.position>this.length&&(this.length=this.position)},e.prototype.readUnsignedByte=function(){if(this.position>=this.length)throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length;return new Uint8Array(this.arraybytes)[this.position++]},e.prototype.writeUnsignedShort=function(t){if(this.ensureWriteableSpace(2),0==(1&this.position)){new Uint16Array(this.arraybytes)[this.position>>1]=65535&~~t}else{new Uint16Array(this.unalignedarraybytestemp,0,1)[0]=65535&~~t;var e=new Uint8Array(this.arraybytes,this.position,2),i=new Uint8Array(this.unalignedarraybytestemp,0,2);e.set(i)}this.position+=2,this.position>this.length&&(this.length=this.position)},e.prototype.readUTFBytes=function(t){for(var e="",i=this.position+t,n=new DataView(this.arraybytes);this.position<i;){var r=n.getUint8(this.position++);if(r<128){if(0==r)break;e+=String.fromCharCode(r)}else if(r<224)e+=String.fromCharCode((63&r)<<6|127&n.getUint8(this.position++));else if(r<240){var o=n.getUint8(this.position++);e+=String.fromCharCode((31&r)<<12|(127&o)<<6|127&n.getUint8(this.position++))}else{o=n.getUint8(this.position++);var s=n.getUint8(this.position++);e+=String.fromCharCode((15&r)<<18|(127&o)<<12|s<<6&127|127&n.getUint8(this.position++))}}return e},e.prototype.writeUTFBytes=function(t){var e=encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(parseInt("0x"+e))}));this.ensureWriteableSpace(4+e.length),this.writeInt(e.length);for(var i=0;i<e.length;i++)this.writeUnsignedByte(e.charCodeAt(i));if(e.length%4){var n=e.length%4;for(i=0;i<n;i++)this.writeUnsignedByte(0)}return e.length},e.prototype.readInt=function(){var t=new DataView(this.arraybytes).getInt32(this.position,!0);return this.position+=4,t},e.prototype.readShort=function(){var t=new DataView(this.arraybytes).getInt16(this.position,!0);return this.position+=2,t},e.prototype.readDouble=function(){var t=new DataView(this.arraybytes).getFloat64(this.position,!0);return this.position+=8,t},e.prototype.readUnsignedShort=function(){if(this.position>this.length+2)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;if(0==(1&this.position)){var t=new Uint16Array(this.arraybytes),e=this.position>>1;return this.position+=2,t[e]}t=new Uint16Array(this.unalignedarraybytestemp,0,1);var i=new Uint8Array(this.arraybytes,this.position,2);return new Uint8Array(this.unalignedarraybytestemp,0,2).set(i),this.position+=2,t[0]},e.prototype.writeUnsignedInt=function(t){if(this.ensureWriteableSpace(4),0==(3&this.position)){new Uint32Array(this.arraybytes)[this.position>>2]=4294967295&~~t}else{new Uint32Array(this.unalignedarraybytestemp,0,1)[0]=4294967295&~~t;var e=new Uint8Array(this.arraybytes,this.position,4),i=new Uint8Array(this.unalignedarraybytestemp,0,4);e.set(i)}this.position+=4,this.position>this.length&&(this.length=this.position)},e.prototype.writeInt=function(t){if(this.ensureWriteableSpace(4),0==(3&this.position)){new Int32Array(this.arraybytes)[this.position>>2]=~~t}else{new Int32Array(this.unalignedarraybytestemp,0,1)[0]=~~t;var e=new Uint8Array(this.arraybytes,this.position,4),i=new Uint8Array(this.unalignedarraybytestemp,0,4);e.set(i)}this.position+=4,this.position>this.length&&(this.length=this.position)},e.prototype.readUnsignedInt=function(){if(this.position>this.length+4)throw"ByteArray out of bounds read. Position="+this.position+", Length="+this.length;if(0==(3&this.position)){var t=new Uint32Array(this.arraybytes),e=this.position>>2;return this.position+=4,t[e]}t=new Uint32Array(this.unalignedarraybytestemp,0,1);var i=new Uint8Array(this.arraybytes,this.position,4);return new Uint8Array(this.unalignedarraybytestemp,0,4).set(i),this.position+=4,t[0]},e.prototype.writeFloat=function(t){if(this.ensureWriteableSpace(4),0==(3&this.position)){new Float32Array(this.arraybytes)[this.position>>2]=t}else{new Float32Array(this.unalignedarraybytestemp,0,1)[0]=t;var e=new Uint8Array(this.arraybytes,this.position,4),i=new Uint8Array(this.unalignedarraybytestemp,0,4);e.set(i)}this.position+=4,this.position>this.length&&(this.length=this.position)},e.prototype.readFloat=function(){if(this.position>this.length+4)throw"ByteArray out of bounds read. Positon="+this.position+", Length="+this.length;if(0==(3&this.position)){var t=new Float32Array(this.arraybytes),e=this.position>>2;return this.position+=4,t[e]}t=new Float32Array(this.unalignedarraybytestemp,0,1);var i=new Uint8Array(this.arraybytes,this.position,4);return new Uint8Array(this.unalignedarraybytestemp,0,4).set(i),this.position+=4,t[0]},e}(v),x=function(){function t(){}return t.arrayBufferToBase64=function(t,e){for(var i="",n=new Uint8Array(t),r=n.byteLength,o=0;o<r;o++)i+=String.fromCharCode(n[o]);return"data:"+e+";base64,"+window.btoa(i)},t.arrayBufferToAudio=function(e,i){var n=t.arrayBufferToBase64(e,"audio/"+i),r=new Audio;return r.src=n,r},t.arrayBufferToImage=function(e){var i=t.arrayBufferToBase64(e,"image/png"),n=new Image;return n.src=i,n},t.byteArrayToImage=function(e){var i=t.arrayBufferToBase64(e.arraybytes,"image/png"),n=new Image;return n.src=i,n},t.byteArrayToAudio=function(e,i){var n=t.arrayBufferToBase64(e.arraybytes,"audio/"+i),r=new Audio;return r.src=n,r},t.blobToImage=function(t){var e=(window.URL||window.webkitURL).createObjectURL(t),i=new Image;return i.src=e,i},t.blobToAudio=function(t){var e=(window.URL||window.webkitURL).createObjectURL(t),i=new Audio;return i.src=e,i},t.toByteArray=function(t){var e=new b;return e.setArrayBuffer(t),e},t.toString=function(t,e){if(void 0===e&&(e=0),"string"==typeof t){var i=t;if(null!=i.substr)return i.substr(0,i.length)}if(t instanceof b){var n=t;return n.position=0,n.readUTFBytes(Math.min(n.getBytesAvailable(),e))}return null},t}(),C=function(t){function e(e,i,n){void 0===e&&(e=0),void 0===i&&(i=1),void 0===n&&(n=1);var r=t.call(this)||this;return r._groupID=0,r._groupVolume=1,r._groupPan=0,r._startTime=0,r._groupID=e,r._groupVolume=i,r._groupPan=n,r._audio=new Audio,r._audio.ontimeupdate=function(t){return r._onTimeUpdate(t)},r}return s(e,t),e.stopAllSounds=function(t){void 0===t&&(t=-1);var i=e._channels.length;if(t<0){for(var n=0;n<i;n++)e._channels[n].stop();e._channels.length=0}else{var r=[];for(n=0;n<i;n++)e._channels[n].groupID==t?e._channels[n].stop():r[r.length]=e._channels[n];e._channels=r}},e.setChannelGroupVolume=function(t,i){void 0===i&&(i=-1);var n=e._channels.length;if(i<0)for(var r=0;r<n;r++)e._channels[r].groupVolume=t;else for(r=0;r<n;r++)e._channels[r].groupID==i&&(e._channels[r].groupVolume=t)},Object.defineProperty(e.prototype,"duration",{get:function(){return this._duration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._audio.currentTime-this._startTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pan",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groupID",{get:function(){return this._groupID},set:function(t){this._groupID=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groupVolume",{get:function(){return this._groupVolume},set:function(t){this._groupVolume!=t&&(this._groupVolume=t,this._audio.volume=this._groupVolume*this._volume)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"groupPan",{get:function(){return this._groupPan},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._volume},set:function(t){this._volume!=t&&(this._volume=t,this._audio.volume=this._volume)},enumerable:!1,configurable:!0}),e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isLooping=function(){return this._isLooping},e.prototype.isDecoding=function(){return!1},e.prototype.restart=function(){if(this._isPlaying=!1,this._stopped)throw"You can't restart channel that was fully stopped";return!!this._audio&&(this._isPlaying=!0,this._audio.play(),this.dispatchRestart(),!0)},e.prototype.play=function(i,n,r,o){var s=this;void 0===n&&(n=0),void 0===r&&(r=!1),void 0===o&&(o=0),t.prototype.play.call(this,i,n,r,o),this._isPlaying=!0,this._isLooping=this._loops>0,this._audio.src=e._base64Cache[o]||(e._base64Cache[o]=x.arrayBufferToBase64(i,"audio/mp3"));var a=this._audio;this._audio.addEventListener("loadedmetadata",(function(){a.currentTime=n,a.play()}),!1),this._audio.addEventListener("error",(function(t){console.log("error in audio",t),s.dispatchStop(!0)}),!1),this._audio.addEventListener("canplay",(function(t){console.log("canplay in audio",t)}),!1),this._audio.addEventListener("canplaythrough",(function(t){console.log("canplaythrough in audio",t)}),!1),this._audio.addEventListener("abort",(function(t){console.log("abort in audio",t),s.dispatchStop(!0)}),!1),this._audio.addEventListener("loadstart",(function(t){console.log("loadstart in audio",t)}),!1),this._audio.addEventListener("suspend",(function(t){console.log("suspend in audio",t)}),!1)},e.prototype.stopInternally=function(e){void 0===e&&(e=!1),this._audio.pause(),this._isPlaying=!1,this._isLooping=!1,t.prototype.completeInternally.call(this,e,e)},e.prototype.stop=function(){this.stopInternally(!1),this.dispatchStop(!1)},e.prototype._onTimeUpdate=function(t){!this._isLooping&&this._audio.duration<this._audio.currentTime-this._startTime+.1&&this.stopInternally(!0)},e.maxChannels=4,e._channels=new Array,e._base64Cache={},e}(f),I=function(){function t(){}return t.setVolume=function(e,i){if(void 0===i&&(i=-1),i<0)for(var n=t._channelGroupVolumes.length,r=0;r<n;r++)t._channelGroupVolumes[r]=e;else t._channelGroupVolumes[i]=e;g.setChannelGroupVolume(e,i),m.setChannelGroupVolume(e,i),C.setChannelGroupVolume(e,i)},t.getVolume=function(e){return void 0===e&&(e=0),t._channelGroupVolumes[e]},t.setExternalSoundInterface=function(e){null!=e.startSound?null!=e.stopSound?t._externalSoundInterface=e:console.log("Could not set the externalSoundInterface, because it does not provide a 'stopSound' function"):console.log("Could not set the externalSoundInterface, because it does not provide a 'startSound' function")},t.getExternalSoundInterface=function(){return t._externalSoundInterface},t.stopAllSounds=function(){g.stopAllSounds(),m.stopAllSounds(),C.stopAllSounds()},t.getChannel=function(e,i){void 0===i&&(i=0);var n=e>5e7?m:g;t.isIE&&(n=C);for(var r=0;n._channels[r]&&n._channels[r].isPlaying();)r++;if(r==n.maxChannels){for(var o=void 0,s=n._channels.length,a=0;a<s;a++)if(!(o=n._channels[a]).isLooping()&&!o.isDecoding())return o.groupID=i,o.groupVolume=t._channelGroupVolumes[i],o.groupPan=t._channelGroupPanning[i],n._channels.push(n._channels.splice(a,1)[0]),o.stop(),o;return null}return n._channels[r]=new n(i,t._channelGroupVolumes[i],t._channelGroupPanning[i])},t.isIE=!!navigator.userAgent.match(/Trident/g)||!!navigator.userAgent.match(/MSIE/g),t._externalSoundInterface=null,t._channelGroupVolumes=[1],t._channelGroupPanning=[.5],t}(),w=function(t){function e(e,i){void 0===i&&(i=0);var n=t.call(this)||this;return n._volume=1,n._pan=0,n._audioChannels=[],n._channelsPlaying=0,n._data=e,n._channelGroup=i,n.onChannelCompleteStopError=n.onChannelCompleteStopError.bind(n),n}return s(e,t),Object.defineProperty(e.prototype,"isPlaying",{get:function(){return this._channelsPlaying>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"assetType",{get:function(){return e.assetType},enumerable:!1,configurable:!0}),e.prototype.detachChannel=function(t){t&&(t.removeEventListener(f.COMPLETE,this.onChannelCompleteStopError),t.removeEventListener(f.STOP,this.onChannelCompleteStopError),t.removeEventListener(f.ERROR,this.onChannelCompleteStopError))},e.prototype.attachChannel=function(t){t&&(t.owner=this,t.addEventListener(f.COMPLETE,this.onChannelCompleteStopError),t.addEventListener(f.STOP,this.onChannelCompleteStopError),t.addEventListener(f.ERROR,this.onChannelCompleteStopError))},e.prototype.onChannelCompleteStopError=function(t){var e=t.target,i=this._audioChannels.indexOf(e);i>=0&&(this.detachChannel(e),this._audioChannels.splice(i,1),this._channelsPlaying--),0===this._channelsPlaying&&this.stopInternal(!1)},Object.defineProperty(e.prototype,"pan",{get:function(){return this._pan},set:function(t){this._pan!=t&&(this._pan=t,this._audioChannel&&(this._audioChannel.pan=this._pan))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"channelGroup",{get:function(){return this._channelGroup},set:function(t){if(this._channelGroup!=t){this._channelGroup=t;for(var e=I.getVolume(t),i=0;i<this._audioChannels.length;i++)this._audioChannels[i].groupVolume=e}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volume",{get:function(){return this._volume},set:function(t){if(this._volume!=t){this._volume=t,this._audioChannel&&(this._audioChannel.volume=this._volume);for(var e=0;e<this._audioChannels.length;e++)this._audioChannels[e].volume=this._volume}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this._audioChannel?this._audioChannel.currentTime:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"duration",{get:function(){return this._audioChannel?this._audioChannel.duration:0},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this.stop()},e.prototype.play=function(t,e){return void 0===e&&(e=!1),this._audioChannel=I.getChannel(this._data.size,this.channelGroup),this._audioChannel&&(this._channelsPlaying++,this._audioChannels.push(this._audioChannel),this._audioChannel.volume=this._volume,this.attachChannel(this._audioChannel),this._data.play(this._audioChannel,t,e,this.id)),this._audioChannel},e.prototype.stopInternal=function(t){void 0===t&&(t=!1);for(var e=0,i=this._audioChannels;e<i.length;e++){var n=i[e];(n.stopped||t)&&this.detachChannel(n),t&&n.stop()}this._channelsPlaying=0,this._audioChannels.length=0,this._audioChannel=null},e.prototype.stop=function(){this.stopInternal(!0)},e.prototype.clone=function(){var t=new e(this._data);return t.name=this.name,t},e.assetType="[asset WaveAudio]",e}(_),E=function(){function t(t,e){t instanceof Blob?this._blob=t:t instanceof b?this._buffer=t.arraybytes:ArrayBuffer.isView(t)?this._buffer=t.buffer:this._buffer=t,this.meta=e}return Object.defineProperty(t.prototype,"size",{get:function(){return this._buffer?this._buffer.byteLength:this._blob.size},enumerable:!1,configurable:!0}),t.prototype.play=function(t,e,i,n){var r=this;if(this._buffer)t.play(this._buffer,e,i,n,this.meta);else if(!this._loading){this._loading=!0;var o=new FileReader;o.onload=function(o){return r._blobConverted(o,t,e,i,n)},o.readAsArrayBuffer(this._blob)}},t.prototype._blobConverted=function(t,e,i,n,r){this._buffer=t.target.result,e.play(this._buffer,i,n,r,this.meta)},t}(),S=function(){function t(){}return t.float32ColorToARGB=function(t){return[(4278190080&t)>>>24,(16711680&t)>>>16,(65280&t)>>>8,255&t]},t.f32_RGBA_To_f32_ARGB=function(t){return(255&t)<<24|(4278190080&t)>>>24<<16|(16711680&t)>>>16<<8|(65280&t)>>>8},t.f32_RGB_To_f32_ARGB=function(t){return(255&t)<<24|(4278190080&t)>>>24<<16|(16711680&t)>>>16<<8|(65280&t)>>>8},t.prototype.getAlphaFromF32RGBA=function(t){return 255&t},t.ARGBtoFloat32=function(t,e,i,n){return t<<24|e<<16|i<<8|n},t.componentToHex=function(t){var e=t.toString(16);return 1==e.length?"0"+e:e},t.RGBToHexString=function(e){return"#"+t.componentToHex(e[1])+t.componentToHex(e[2])+t.componentToHex(e[3])},t.ARGBToHexString=function(e){return"#"+t.componentToHex(e[0])+t.componentToHex(e[1])+t.componentToHex(e[2])+t.componentToHex(e[3])},t.interpolateFloat32Color=function(t,e,i){var n=1-i;return((4278190080&t)>>>24)*n+((4278190080&e)>>>24)*i<<24|((16711680&t)>>>16)*n+((16711680&e)>>>16)*i<<16|((65280&t)>>>8)*n+((65280&e)>>>8)*i<<8|(255&t)*n+(255&e)*i},t}(),P=function(){function t(t,e,i,n,r,o,s,a){void 0===t&&(t=1),void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),void 0===r&&(r=0),void 0===o&&(o=0),void 0===s&&(s=0),void 0===a&&(a=0),this._isDirty=!1,t instanceof Float32Array?this._rawData=t:(this._rawData=new Float32Array(8),this.redMultiplier=Number(t),this.greenMultiplier=e,this.blueMultiplier=i,this.alphaMultiplier=n,this.redOffset=r,this.greenOffset=o,this.blueOffset=s,this.alphaOffset=a)}return Object.defineProperty(t.prototype,"isDirty",{get:function(){return this._isDirty},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isIdentity",{get:function(){return!this._isDirty},enumerable:!1,configurable:!0}),t.prototype.concat=function(t){this._rawData[0]*=t._rawData[0],this._rawData[1]*=t._rawData[1],this._rawData[2]*=t._rawData[2],this._rawData[3]*=t._rawData[3],this._rawData[4]+=t._rawData[4],this._rawData[5]+=t._rawData[5],this._rawData[6]+=t._rawData[6],this._rawData[7]+=t._rawData[7],this._isDirty=this._isDirty||t._isDirty},Object.defineProperty(t.prototype,"alphaMultiplier",{get:function(){return this._rawData[3]},set:function(t){this._rawData[3]=t,this._isDirty=this._isDirty||1!==t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alphaOffset",{get:function(){return this._rawData[7]},set:function(t){this._rawData[7]=t,this._isDirty=this._isDirty||0!==t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blueMultiplier",{get:function(){return this._rawData[2]},set:function(t){this._rawData[2]=t,this._isDirty=this._isDirty||1!==t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"blueOffset",{get:function(){return this._rawData[6]},set:function(t){this._rawData[6]=t,this._isDirty=this._isDirty||0!==t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"greenMultiplier",{get:function(){return this._rawData[1]},set:function(t){this._rawData[1]=t,this._isDirty=this._isDirty||1!==t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"greenOffset",{get:function(){return this._rawData[5]},set:function(t){this._rawData[5]=t,this._isDirty=this._isDirty||0!==t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"redMultiplier",{get:function(){return this._rawData[0]},set:function(t){this._rawData[0]=t,this._isDirty=this._isDirty||1!==t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"redOffset",{get:function(){return this._rawData[4]},set:function(t){this._rawData[4]=t,this._isDirty=this._isDirty||0!==t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this._rawData[4]<<16|this._rawData[5]<<8|this._rawData[6]},set:function(t){var e=S.float32ColorToARGB(t);this._rawData[4]=e[1],this._rawData[5]=e[2],this._rawData[6]=e[3],this._rawData[0]=0,this._rawData[1]=0,this._rawData[2]=0,this._isDirty=!0},enumerable:!1,configurable:!0}),t.prototype.copyRawDataFrom=function(t){var e=this._rawData;e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],this._isDirty=!0},t.prototype.clear=function(){this._rawData[0]=1,this._rawData[1]=1,this._rawData[2]=1,this._rawData[3]=1,this._rawData[4]=0,this._rawData[5]=0,this._rawData[6]=0,this._rawData[7]=0,this._isDirty=!1},t.prototype.clone=function(){var e=new t;return e.copyFrom(this),e},t.prototype.copyFrom=function(t){var e=t._rawData,i=this._rawData;i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],this._isDirty=t._isDirty},t.prototype.copyTo=function(t){t.copyFrom(this)},t.prototype.prepend=function(t){this._rawData[4]+=t._rawData[4]*this._rawData[0],this._rawData[5]+=t._rawData[5]*this._rawData[1],this._rawData[6]+=t._rawData[6]*this._rawData[2],this._rawData[7]+=t._rawData[7]*this._rawData[3],this.redMultiplier*=t.redMultiplier,this.greenMultiplier*=t.greenMultiplier,this.blueMultiplier*=t.blueMultiplier,this.alphaMultiplier*=t.alphaMultiplier,this._isDirty=this._isDirty||t._isDirty},t.prototype._isRenderable=function(){return 0!=this._rawData[3]||this._rawData[7]>0},t}(),T=function(t){function e(e,i){var n=t.call(this,e)||this;return n._transform=i,n}return s(e,t),Object.defineProperty(e.prototype,"transform",{get:function(){return this._transform},enumerable:!1,configurable:!0}),e.prototype.clone=function(){return new e(this.type,this._transform)},e.INVALIDATE_MATRIX3D="invalidateMatrix3D",e.INVALIDATE_COLOR_TRANSFORM="invalidateColorTransform",e}(u),D=function(t){function e(e,i){return void 0===e&&(e=null),void 0===i&&(i=0),t.call(this,e||"ArgumentError",i)||this}return s(e,t),e}(a),M=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this._rawData=new Float32Array(2),this._rawData[0]=t,this._rawData[1]=e}return Object.defineProperty(t.prototype,"x",{get:function(){return this._rawData[0]},set:function(t){this._rawData[0]=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._rawData[1]},set:function(t){this._rawData[1]=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return Math.sqrt(this._rawData[0]*this._rawData[0]+this._rawData[1]*this._rawData[1])},enumerable:!1,configurable:!0}),t.prototype.add=function(e){return new t(this._rawData[0]+e._rawData[0],this._rawData[1]+e._rawData[1])},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.copyFrom=function(t){this._rawData[0]=t._rawData[0],this._rawData[1]=t._rawData[1]},t.prototype.equals=function(t){return this._rawData[0]===t._rawData[0]&&this._rawData[1]==t._rawData[1]},t.prototype.normalize=function(t){void 0===t&&(t=1);var e=this.length;if((0!==this.x||0!==this.y)&&e){var i=t/e;this._rawData[0]*=i,this._rawData[1]*=i}},t.prototype.offset=function(t,e){this._rawData[0]+=t,this._rawData[1]+=e},t.prototype.setTo=function(t,e){this._rawData[0]=t,this._rawData[1]=e},t.prototype.subtract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.toString=function(){return"[Point] (x="+this.x+", y="+this.y+")"},t.distance=function(t,e){var i=e.x-t.x,n=e.y-t.y;return 0===i?Math.abs(n):0===n?Math.abs(i):Math.sqrt(i*i+n*n)},t.interpolate=function(e,i,n){var r=1-n,o=e._rawData,s=i._rawData;return new t(o[0]*n+s[0]*r,o[1]*n+s[1]*r)},t.polar=function(e,i){return new t(e*Math.cos(i),e*Math.sin(i))},t}(),B=function(){function t(t,e,i,n,r,o){if(void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===o&&(o=0),this.rawData=new Float32Array(6),t instanceof Float32Array)this.copyRawDataFrom(t);else{var s=this.rawData;s[0]=Number(t),s[1]=e,s[2]=i,s[3]=n,s[4]=r,s[5]=o}}return Object.defineProperty(t.prototype,"a",{get:function(){return this.rawData[0]},set:function(t){this.rawData[0]=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this.rawData[1]},set:function(t){this.rawData[1]=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"c",{get:function(){return this.rawData[2]},set:function(t){this.rawData[2]=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"d",{get:function(){return this.rawData[3]},set:function(t){this.rawData[3]=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tx",{get:function(){return this.rawData[4]},set:function(t){this.rawData[4]=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ty",{get:function(){return this.rawData[5]},set:function(t){this.rawData[5]=t},enumerable:!1,configurable:!0}),t.prototype.copyRawDataFrom=function(t,e){void 0===e&&(e=0);var i=this.rawData;i[0]=t[e+0],i[1]=t[e+1],i[2]=t[e+2],i[3]=t[e+3],i[4]=t[e+4],i[5]=t[e+5]},t.prototype.clone=function(){var e=this.rawData;return new t(e[0],e[1],e[2],e[3],e[4],e[5])},t.prototype.concat=function(t){var e=this.rawData,i=t.rawData,n=e[0]*i[0],r=0,o=0,s=e[3]*i[3],a=e[4]*i[0]+i[4],l=e[5]*i[3]+i[5];0===e[1]&&0===e[2]&&0===i[1]&&0===i[2]||(n+=e[1]*i[2],s+=e[2]*i[1],r+=e[0]*i[1]+e[1]*i[3],o+=e[2]*i[0]+e[3]*i[2],a+=e[5]*i[2],l+=e[4]*i[1]),e[0]=n,e[1]=r,e[2]=o,e[3]=s,e[4]=a,e[5]=l},t.prototype.copyColumnFrom=function(t,e){var i=this.rawData,n=e._rawData;if(t>2)throw"Column "+t+" out of bounds (2)";0==t?(i[0]=n[0],i[1]=n[1]):1==t?(i[2]=n[0],i[3]=n[1]):(i[4]=n[0],i[5]=n[1])},t.prototype.copyColumnTo=function(t,e){var i=this.rawData,n=e._rawDat