UNPKG

@eva/react-eva-lottie

Version:

React EVA是一个让开发同学能够在React技术体系下,利用EVA JS的游戏研发能力,开发动画、游戏类场景的框架。它可以让开发同学用熟悉的JSX和Hooks语法编写动画、游戏场景的代码。

1 lines 760 kB
!function t(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("react")):"function"==typeof define&&define.amd?define(["react"],r):"object"==typeof exports?exports.dist=r(require("react")):e.dist=r(e.React)}(window,(function(t){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function e(){return t.default}:function e(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="./dist/",r(r.s=112)}([function(t,e,r){"use strict";(function(t){e.__esModule=!0,e.loader=e.prepare=e.particles=e.mesh=e.loaders=e.interaction=e.filters=e.extras=e.extract=e.accessibility=void 0;var n=r(124);Object.keys(n).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return n[t]}})}));var i=r(3);Object.keys(i).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function e(){return i[t]}})}));var o,s=O(r(184)),a,u=w(r(185)),l,h=w(r(187)),c,f=w(r(91)),d,p=w(r(197)),m,v=w(r(204)),y,g=w(r(206)),_,b=w(r(210)),x,T=w(r(215)),E,S=w(r(220));function w(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function O(t){return t&&t.__esModule?t:{default:t}}i.utils.mixins.performMixins();var P=g.shared||null;e.accessibility=u,e.extract=h,e.extras=f,e.filters=p,e.interaction=v,e.loaders=g,e.mesh=b,e.particles=T,e.prepare=S,e.loader=P,"function"==typeof s.default&&(0,s.default)(e),t.PIXI=e}).call(this,r(28))},function(t,e,r){"use strict";r.r(e),r.d(e,"Component",(function(){return V})),r.d(e,"Game",(function(){return Nt})),r.d(e,"GameObject",(function(){return pt})),r.d(e,"IDEProp",(function(){return jt})),r.d(e,"LOAD_EVENT",(function(){return Xt})),r.d(e,"LOAD_SCENE_MODE",(function(){return Mt})),r.d(e,"OBSERVER_TYPE",(function(){return Y})),r.d(e,"RESOURCE_TYPE",(function(){return Ht})),r.d(e,"RESOURCE_TYPE_STRATEGY",(function(){return zt})),r.d(e,"Scene",(function(){return Ct})),r.d(e,"System",(function(){return gt})),r.d(e,"Transform",(function(){return ht})),r.d(e,"componentObserver",(function(){return Bt})),r.d(e,"decorators",(function(){return Yt})),r.d(e,"resource",(function(){return Vt})),r.d(e,"resourceLoader",(function(){return Gt})),r.d(e,"version",(function(){return qt}));var n=r(16),i=r.n(n),o=r(111),s=r(34),a=r(5),u=function(){function t(t,e,r){void 0===e&&(e=!1),this.next=null,this.prev=null,this.owner=null,this.fn=t,this.once=e,this.thisArg=r}return t.prototype.detach=function(){return null!==this.owner&&(this.owner.detach(this),!0)},t.prototype.dispose=function(){this.detach()},t}(),l=function(){function t(){this._head=null,this._tail=null,this._filter=null}return t.prototype.handlers=function(){for(var t=this._head,e=[];t;)e.push(t),t=t.next;return e},t.prototype.hasAny=function(){return!!this._head},t.prototype.has=function(t){return t.owner===this},t.prototype.dispatch=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=this._head;if(!r)return!1;if(this._filter&&!this._filter.apply(this,t))return!1;for(;r;)r.once&&this.detach(r),r.fn.apply(r.thisArg,t),r=r.next;return!0},t.prototype.add=function(t,e){return void 0===e&&(e=null),this._addSignalBinding(new u(t,!1,e))},t.prototype.once=function(t,e){return void 0===e&&(e=null),this._addSignalBinding(new u(t,!0,e))},t.prototype.detach=function(t){var e=t;return e.owner!==this||(e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),e===this._head?(this._head=e.next,null===e.next&&(this._tail=null)):e===this._tail&&(this._tail=e.prev,this._tail&&(this._tail.next=null)),e.owner=null),this},t.prototype.detachAll=function(){var t=this._head;if(!t)return this;for(this._head=null,this._tail=null;t;)t.owner=null,t=t.next;return this},t.prototype.filter=function(t){this._filter=t},t.prototype.proxy=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];for(var n=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t.dispatch.apply(t,e)},i=0;i<e.length;++i)e[i].add(n);return this},t.prototype._addSignalBinding=function(t){var e=t;return this._head?(this._tail&&(this._tail.next=e),e.prev=this._tail,this._tail=e):(this._head=e,this._tail=e),e.owner=this,e},t}(),h=r(18),c=r.n(h),f=function(){function t(t){this.config=t,this.onError=new l,this.onComplete=new l,this.onProgress=new l}return t}(),d=function(t,e){return(d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},p,m;function v(t,e){function r(){this.constructor=t}d(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function y(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var o=arguments[e],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function g(t){var e,r="";if(0===t.indexOf("data:")){var n=t.indexOf("/");r=t.substring(n+1,t.indexOf(";",n))}else{var i=t.indexOf("?"),o=t.indexOf("#"),s=Math.min(i>-1?i:t.length,o>-1?o:t.length);r=(t=t.substring(0,s)).substring(t.lastIndexOf(".")+1)}return r.toLowerCase()}function _(t){throw new Error("Unexpected value. Should have been never.")}!function(t){t[t.Unknown=0]="Unknown",t[t.Buffer=1]="Buffer",t[t.Blob=2]="Blob",t[t.Json=3]="Json",t[t.Xml=4]="Xml",t[t.Image=5]="Image",t[t.Audio=6]="Audio",t[t.Video=7]="Video",t[t.Text=8]="Text"}(p||(p={})),function(t){t[t.NotStarted=0]="NotStarted",t[t.Loading=1]="Loading",t[t.Complete=2]="Complete"}(m||(m={}));var b=function(t){function e(e,r){var n=t.call(this,e)||this;return n.elementType=r,n._boundOnLoad=n._onLoad.bind(n),n._boundOnError=n._onError.bind(n),n._boundOnTimeout=n._onTimeout.bind(n),n._element=n._createElement(),n._elementTimer=0,n}return v(e,t),e.prototype.load=function(){var t=this.config;t.crossOrigin&&(this._element.crossOrigin=t.crossOrigin);var e=t.sourceSet||[t.url];if(navigator.isCocoonJS)this._element.src=e[0];else for(var r=0;r<e.length;++r){var n=e[r],i=t.mimeTypes?t.mimeTypes[r]:void 0;i||(i=this.elementType+"/"+g(n));var o=document.createElement("source");o.src=n,o.type=i,this._element.appendChild(o)}this._element.addEventListener("load",this._boundOnLoad,!1),this._element.addEventListener("canplaythrough",this._boundOnLoad,!1),this._element.addEventListener("error",this._boundOnError,!1),this._element.load(),t.timeout&&(this._elementTimer=window.setTimeout(this._boundOnTimeout,t.timeout))},e.prototype.abort=function(){for(this._clearEvents();this._element.firstChild;)this._element.removeChild(this._element.firstChild);this._error(this.elementType+" load aborted by the user.")},e.prototype._createElement=function(){return this.config.loadElement?this.config.loadElement:document.createElement(this.elementType)},e.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this._element.removeEventListener("load",this._boundOnLoad,!1),this._element.removeEventListener("canplaythrough",this._boundOnLoad,!1),this._element.removeEventListener("error",this._boundOnError,!1)},e.prototype._error=function(t){this._clearEvents(),this.onError.dispatch(t)},e.prototype._complete=function(){this._clearEvents();var t=p.Unknown;switch(this.elementType){case"audio":t=p.Audio;break;case"video":t=p.Video;break;default:_(this.elementType)}this.onComplete.dispatch(t,this._element)},e.prototype._onLoad=function(){this._complete()},e.prototype._onError=function(){this._error(this.elementType+" failed to load.")},e.prototype._onTimeout=function(){this._error(this.elementType+" load timed out.")},e}(f),x=function(t){function e(e){return t.call(this,e,"audio")||this}return v(e,t),e}(b),T="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._boundOnLoad=e._onLoad.bind(e),e._boundOnError=e._onError.bind(e),e._boundOnTimeout=e._onTimeout.bind(e),e._element=e._createElement(),e._elementTimer=0,e}return v(e,t),e.prototype.load=function(){var t=this.config;t.crossOrigin&&(this._element.crossOrigin=t.crossOrigin),this._element.src=t.url,this._element.addEventListener("load",this._boundOnLoad,!1),this._element.addEventListener("error",this._boundOnError,!1),t.timeout&&(this._elementTimer=window.setTimeout(this._boundOnTimeout,t.timeout))},e.prototype.abort=function(){this._clearEvents(),this._element.src=T,this._error("Image load aborted by the user.")},e.prototype._createElement=function(){return this.config.loadElement?this.config.loadElement:document.createElement("img")},e.prototype._clearEvents=function(){clearTimeout(this._elementTimer),this._element.removeEventListener("load",this._boundOnLoad,!1),this._element.removeEventListener("error",this._boundOnError,!1)},e.prototype._error=function(t){this._clearEvents(),this.onError.dispatch(t)},e.prototype._complete=function(){this._clearEvents(),this.onComplete.dispatch(p.Image,this._element)},e.prototype._onLoad=function(){this._complete()},e.prototype._onError=function(){this._error("Image failed to load.")},e.prototype._onTimeout=function(){this._error("Image load timed out.")},e}(f),S=function(t){function e(e){return t.call(this,e,"video")||this}return v(e,t),e}(b),w=!(!window.XDomainRequest||"withCredentials"in new XMLHttpRequest),O;function P(t){return t.toString().replace("object ","")}!function(t){t.Default="text",t.Buffer="arraybuffer",t.Blob="blob",t.Document="document",t.Json="json",t.Text="text"}(O||(O={}));var C=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._boundOnLoad=e._onLoad.bind(e),e._boundOnAbort=e._onAbort.bind(e),e._boundOnError=e._onError.bind(e),e._boundOnTimeout=e._onTimeout.bind(e),e._boundOnProgress=e._onProgress.bind(e),e._xhr=e._createRequest(),e._xhrType=O.Default,e}return v(e,t),e.prototype.load=function(){var t=this.config,e=g(t.url);"string"!=typeof t.xhrType&&(t.xhrType=this._determineXhrType(e));var r=this._xhr;this._xhrType=t.xhrType||O.Default,w?(r.timeout=t.timeout||5e3,r.onload=this._boundOnLoad,r.onerror=this._boundOnError,r.ontimeout=this._boundOnTimeout,r.onprogress=this._boundOnProgress,r.open("GET",t.url,!0),setTimeout((function(){r.send()}),0)):(r.open("GET",t.url,!0),t.timeout&&(r.timeout=t.timeout),t.xhrType===O.Json||t.xhrType===O.Document?r.responseType=O.Text:r.responseType=t.xhrType,r.addEventListener("load",this._boundOnLoad,!1),r.addEventListener("abort",this._boundOnAbort,!1),r.addEventListener("error",this._boundOnError,!1),r.addEventListener("timeout",this._boundOnTimeout,!1),r.addEventListener("progress",this._boundOnProgress,!1),r.send())},e.prototype.abort=function(){w?(this._clearEvents(),this._xhr.abort(),this._onAbort()):this._xhr.abort()},e.prototype._createRequest=function(){return w?new window.XDomainRequest:new XMLHttpRequest},e.prototype._determineXhrType=function(t){return e._xhrTypeMap[t]||O.Default},e.prototype._clearEvents=function(){w?(this._xhr.onload=null,this._xhr.onerror=null,this._xhr.ontimeout=null,this._xhr.onprogress=null):(this._xhr.removeEventListener("load",this._boundOnLoad,!1),this._xhr.removeEventListener("abort",this._boundOnAbort,!1),this._xhr.removeEventListener("error",this._boundOnError,!1),this._xhr.removeEventListener("timeout",this._boundOnTimeout,!1),this._xhr.removeEventListener("progress",this._boundOnProgress,!1))},e.prototype._error=function(t){this._clearEvents(),this.onError.dispatch(t)},e.prototype._complete=function(t,e){this._clearEvents(),this.onComplete.dispatch(t,e)},e.prototype._onLoad=function(){var t=this._xhr,e="",r=void 0===t.status?200:t.status,n;if(void 0!==t.responseType&&""!==t.responseType&&"text"!==t.responseType||(e=t.responseText),0===r&&(e.length>0||t.responseType===O.Buffer)?r=200:1223===r&&(r=204),200===100*Math.floor(r/100))switch(this._xhrType){case O.Buffer:this._complete(p.Buffer,t.response);break;case O.Blob:this._complete(p.Blob,t.response);break;case O.Document:this._parseDocument(e);break;case O.Json:this._parseJson(e);break;case O.Default:case O.Text:this._complete(p.Text,e);break;default:_(this._xhrType)}else this._error("["+t.status+"] "+t.statusText+": "+t.responseURL)},e.prototype._parseDocument=function(t){try{if(window.DOMParser){var e,r=(new DOMParser).parseFromString(t,"text/xml");this._complete(p.Xml,r)}else{var n=document.createElement("div");n.innerHTML=t,this._complete(p.Xml,n)}}catch(t){this._error("Error trying to parse loaded xml: "+t)}},e.prototype._parseJson=function(t){try{var e=JSON.parse(t);this._complete(p.Json,e)}catch(t){this._error("Error trying to parse loaded json: "+t)}},e.prototype._onAbort=function(){var t=this._xhr;this._error(P(t)+" Request was aborted by the user.")},e.prototype._onError=function(){var t=this._xhr;this._error(P(t)+" Request failed. Status: "+t.status+', text: "'+t.statusText+'"')},e.prototype._onTimeout=function(){var t=this._xhr;this._error(P(t)+" Request timed out.")},e.prototype._onProgress=function(t){t&&t.lengthComputable&&this.onProgress.dispatch(t.loaded/t.total)},e.setExtensionXhrType=function(t,r){t&&0===t.indexOf(".")&&(t=t.substring(1)),t&&(e._xhrTypeMap[t]=r)},e.ResponseType=O,e._xhrTypeMap={xhtml:O.Document,html:O.Document,htm:O.Document,xml:O.Document,tmx:O.Document,svg:O.Document,tsx:O.Document,gif:O.Blob,png:O.Blob,bmp:O.Blob,jpg:O.Blob,jpeg:O.Blob,tif:O.Blob,tiff:O.Blob,webp:O.Blob,tga:O.Blob,json:O.Json,text:O.Text,txt:O.Text,ttf:O.Buffer,otf:O.Buffer},e}(f);function M(t){var e=t;return function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];if(null===e)throw new Error("Callback was already called.");var i=e;return e=null,i.apply(this,r)}}var R=function(){function t(t,e){if(void 0===e&&(e=1),this.worker=t,this.concurrency=e,this.workers=0,this.buffer=0,this.paused=!1,this._started=!1,this._tasks=[],this.onSaturated=new l,this.onUnsaturated=new l,this.onEmpty=new l,this.onDrain=new l,this.onError=new l,0===e)throw new Error("Concurrency must not be zero");this.buffer=e/4}return Object.defineProperty(t.prototype,"started",{get:function(){return this._started},enumerable:!0,configurable:!0}),t.prototype.reset=function(){this.onDrain.detachAll(),this.workers=0,this._started=!1,this._tasks=[]},t.prototype.push=function(t,e){this._insert(t,!1,e)},t.prototype.unshift=function(t,e){this._insert(t,!0,e)},t.prototype.process=function(){for(;!this.paused&&this.workers<this.concurrency&&this._tasks.length;){var t=this._tasks.shift();0===this._tasks.length&&this.onEmpty.dispatch(),this.workers+=1,this.workers===this.concurrency&&this.onSaturated.dispatch(),this.worker(t.data,M(this._next(t)))}},t.prototype.length=function(){return this._tasks.length},t.prototype.running=function(){return this.workers},t.prototype.idle=function(){return this._tasks.length+this.workers===0},t.prototype.pause=function(){!0!==this.paused&&(this.paused=!0)},t.prototype.resume=function(){if(!1!==this.paused){this.paused=!1;for(var t=1;t<=this.concurrency;t++)this.process()}},t.prototype.getTask=function(t){return this._tasks[t]},t.prototype._insert=function(t,e,r){var n=this;if(null!=r&&"function"!=typeof r)throw new Error("task callback must be a function");if(this._started=!0,null==t&&this.idle())setTimeout((function(){return n.onDrain.dispatch()}),1);else{var i={data:t,callback:r};e?this._tasks.unshift(i):this._tasks.push(i),setTimeout((function(){return n.process()}),1)}},t.prototype._next=function(t){var e=this;return function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];e.workers-=1,t.callback&&t.callback.apply(t,y([r],n)),r&&e.onError.dispatch(r,t.data),e.workers<=e.concurrency-e.buffer&&e.onUnsaturated.dispatch(),e.idle()&&e.onDrain.dispatch(),e.process()}},t}(),A=function(){function t(e,r){if(this.children=[],this.onStart=new l,this.onProgress=new l,this.onComplete=new l,this.onAfterMiddleware=new l,this.data=null,this.type=p.Unknown,this.error="",this.progressChunk=0,this._dequeue=function(){},this._onCompleteBinding=null,this._state=m.NotStarted,this.name=e,this.metadata=r.metadata,"string"!=typeof r.crossOrigin&&(r.crossOrigin=this._determineCrossOrigin(r.url)),r.strategy&&"function"!=typeof r.strategy)this._strategy=r.strategy,this._strategy.config=r;else{var n=r.strategy;n||(n=t._loadStrategyMap[g(r.url)]),n||(n=t._defaultLoadStrategy),this._strategy=new n(r)}this._strategy.onError.add(this._error,this),this._strategy.onComplete.add(this._complete,this),this._strategy.onProgress.add(this._progress,this)}return t.setDefaultLoadStrategy=function(e){t._defaultLoadStrategy=e},t.setLoadStrategy=function(e,r){e&&0===e.indexOf(".")&&(e=e.substring(1)),e&&(t._loadStrategyMap[e]=r)},Object.defineProperty(t.prototype,"strategy",{get:function(){return this._strategy},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this._strategy.config.url},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isLoading",{get:function(){return this._state===m.Loading},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isComplete",{get:function(){return this._state===m.Complete},enumerable:!0,configurable:!0}),t.prototype.abort=function(){this._strategy.abort()},t.prototype.load=function(){this._state=m.Loading,this.onStart.dispatch(this),this._strategy.load()},t.prototype._error=function(t){this._state=m.Complete,this.error=t,this.onComplete.dispatch(this)},t.prototype._complete=function(t,e){this._state=m.Complete,this.type=t,this.data=e,this.onComplete.dispatch(this)},t.prototype._progress=function(t){this.onProgress.dispatch(this,t)},t.prototype._determineCrossOrigin=function(e,r){if(void 0===r&&(r=window.location),0===e.indexOf("data:")||0===e.indexOf("javascript:"))return"";if(window.origin!==window.location.origin)return"anonymous";t._tempAnchor||(t._tempAnchor=document.createElement("a")),t._tempAnchor.href=e;var n=c()(t._tempAnchor.href,{strictMode:!0}),i=!n.port&&""===r.port||n.port===r.port,o=n.protocol?n.protocol+":":"";return n.host===r.hostname&&i&&o===r.protocol?"":"anonymous"},t._tempAnchor=null,t._defaultLoadStrategy=C,t._loadStrategyMap={gif:E,png:E,bmp:E,jpg:E,jpeg:E,tif:E,tiff:E,webp:E,tga:E,svg:E,"svg+xml":E,mp3:x,ogg:x,wav:x,mp4:S,webm:S,mov:S},t}();function D(t,e,r,n){void 0===n&&(n=!1);var i=0,o=t.length;!function s(a){a||i===o?r&&r(a):n?setTimeout((function(){return e(t[i++],s)}),1):e(t[i++],s)}()}var I=100,k=/(#[\w-]+)?$/,L=function(){function t(e,r){void 0===e&&(e=""),void 0===r&&(r=10),this.progress=0,this.loading=!1,this.defaultQueryString="",this.resources={},this.onError=new l,this.onLoad=new l,this.onStart=new l,this.onComplete=new l,this.onProgress=new l,this._baseUrl="",this._urlResolvers=[],this._middleware=[],this._resourcesParsing=[],this._boundLoadResource=this._loadResource.bind(this),this.baseUrl=e,this._queue=new R(this._boundLoadResource,r),this._queue.pause(),this._middleware=t._defaultMiddleware.slice()}return Object.defineProperty(t.prototype,"baseUrl",{get:function(){return this._baseUrl},set:function(t){for(;t.length&&"/"===t.charAt(t.length-1);)t=t.slice(0,-1);this._baseUrl=t},enumerable:!0,configurable:!0}),t.prototype.add=function(t,e){if(Array.isArray(t)){for(var r=0;r<t.length;++r)this.add(t[r]);return this}var n="",i="",o=this._baseUrl,s={url:""};if("object"==typeof t?(n=t.url,i=t.name||t.url,o=t.baseUrl||o,s=t):(i=t,n="string"==typeof e?e:i),!n)throw new Error("You must specify the `url` property.");if(this.loading&&!s.parentResource)throw new Error("Cannot add root resources while the loader is running.");if(this.resources[i])throw new Error('Resource named "'+i+'" already exists.');n=this._prepareUrl(n,o),s.url=n;var a=new A(i,s);if(this.resources[i]=a,"function"==typeof s.onComplete&&a.onAfterMiddleware.once(s.onComplete),this.loading){for(var u=s.parentResource,l=[],r=0;r<u.children.length;++r)u.children[r].isComplete||l.push(u.children[r]);var h,c=u.progressChunk*(l.length+1)/(l.length+2);u.children.push(a),u.progressChunk=c;for(var r=0;r<l.length;++r)l[r].progressChunk=c;a.progressChunk=c}return this._queue.push(a),this},t.prototype.use=function(e,r){return void 0===r&&(r=t.DefaultMiddlewarePriority),this._middleware.push({fn:e,priority:r}),this._middleware.sort((function(t,e){return t.priority-e.priority})),this},t.prototype.reset=function(){for(var t in this.progress=0,this.loading=!1,this._queue.reset(),this._queue.pause(),this.resources){var e=this.resources[t];e&&(e._onCompleteBinding&&e._onCompleteBinding.detach(),e.isLoading&&e.abort())}return this.resources={},this},t.prototype.load=function(t){if("function"==typeof t&&this.onComplete.once(t),this.loading)return this;if(this._queue.idle())this._onStart(),this._onComplete();else{for(var e,r=100/this._queue.length(),n=0;n<this._queue.length();++n)this._queue.getTask(n).data.progressChunk=r;this._onStart(),this._queue.resume()}return this},Object.defineProperty(t.prototype,"concurrency",{get:function(){return this._queue.concurrency},set:function(t){this._queue.concurrency=t},enumerable:!0,configurable:!0}),t.prototype.addUrlResolver=function(t){return this._urlResolvers.push(t),this},t.prototype._prepareUrl=function(t,e){var r=c()(t,{strictMode:!0});if(this._urlResolvers.forEach((function(e){t=e(t,r),r=c()(t,{strictMode:!0})})),r.protocol||0===t.indexOf("//")||(t=e.length&&"/"!==t.charAt(0)?e+"/"+t:e+t),this.defaultQueryString){var n=k.exec(t);if(n){var i=n[0];-1!==(t=t.substr(0,t.length-i.length)).indexOf("?")?t+="&"+this.defaultQueryString:t+="?"+this.defaultQueryString,t+=i}}return t},t.prototype._loadResource=function(t,e){t._dequeue=e,t._onCompleteBinding=t.onComplete.once(this._onLoad,this),t.load()},t.prototype._onStart=function(){this.progress=0,this.loading=!0,this.onStart.dispatch(this)},t.prototype._onComplete=function(){this.progress=100,this.loading=!1,this.onComplete.dispatch(this,this.resources)},t.prototype._onLoad=function(t){var e=this;t._onCompleteBinding=null,this._resourcesParsing.push(t),t._dequeue(),D(this._middleware,(function(r,n){r.fn.call(e,t,n)}),(function(){t.onAfterMiddleware.dispatch(t),e.progress=Math.min(100,e.progress+t.progressChunk),e.onProgress.dispatch(e,t),t.error?e.onError.dispatch(t.error,e,t):e.onLoad.dispatch(e,t),e._resourcesParsing.splice(e._resourcesParsing.indexOf(t),1),e._queue.idle()&&0===e._resourcesParsing.length&&e._onComplete()}),!0)},t.use=function(e,r){return void 0===r&&(r=t.DefaultMiddlewarePriority),t._defaultMiddleware.push({fn:e,priority:r}),t._defaultMiddleware.sort((function(t,e){return t.priority-e.priority})),t},t.DefaultMiddlewarePriority=50,t._defaultMiddleware=[],t}(),N=function(t,e){return(N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function j(t,e){function r(){this.constructor=t}N(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function B(t,e,r,n){var i=arguments.length,o=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n,s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o}function F(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):new r((function(e){e(t.value)})).then(s,a)}u((n=n.apply(t,e||[])).next())}))}function U(t,e){var r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(t){return function(e){return u([t,e])}}function u(s){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return r.label++,{value:s[1],done:!1};case 5:r.label++,i=s[1],s=[0];continue;case 7:s=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){r=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(6===s[0]&&r.label<o[1]){r.label=o[1],o=s;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(s);break}o[2]&&r.ops.pop(),r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t],i=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function G(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function X(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(void 0===e||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(t){s={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function H(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(X(arguments[e]));return t}function z(t){return t instanceof W?t.name:t instanceof Function?t.componentName:void 0}var W=function(t){function e(e){var r=t.call(this)||this;return r.started=!1,r.name=r.constructor.componentName,r.__componentDefaultParams=e,r}return j(e,t),e}(i.a),V=W,Y;!function(t){t.ADD="ADD",t.REMOVE="REMOVE",t.CHANGE="CHANGE"}(Y||(Y={}));var q={},K={},Q={},J={};function Z(t,e){q[t.gameObject.id]||(q[t.gameObject.id]={});var r=q[t.gameObject.id],n=t.name+"_"+e.join(",");if(r[n])return r[n];for(var i=e.length-1,o=t,s=0;s<i;s++)o=o[e[s]];return r[n]={property:o,key:e[i]},r[n]}function $(t){t.gameObject&&delete q[t.gameObject.id]}function tt(t){var e,r,n=t.systemName,i=t.componentName,o=t.component,s=t.prop,a=t.type;null===(r=null===(e=K[n])||void 0===e?void 0:e.componentObserver)||void 0===r||r.add({component:o,prop:s,type:a,componentName:i})}function et(t){var e=t.prop,r=t.component,n=t.componentName;for(var i in Q){var s,a=(Q[i]||{})[n],u;if(a)a.findIndex((function(t){return Object(o.a)(t,e)}))>-1&&tt({systemName:i,componentName:n,component:r,prop:e,type:Y.CHANGE})}}function rt(t){var e,r,n=t.obj,i=t.key,o=t.prop,a=t.component,u=t.componentName;if(void 0!==n)if(i in n){if(Object.defineProperty(n,"_"+i,{enumerable:!1,writable:!0,value:n[i]}),o.deep&&Object(s.a)(n[i]))try{for(var l=G(Object.keys(n[i])),h=l.next();!h.done;h=l.next()){var c=h.value;rt({obj:n[i],key:c,prop:o,component:a,componentName:u})}}catch(t){e={error:t}}finally{try{h&&!h.done&&(r=l.return)&&r.call(l)}finally{if(e)throw e.error}}Object.defineProperty(n,i,{enumerable:!0,set:function(t){n["_"+i]!==t&&(n["_"+i]=t,et({prop:o,component:a,componentName:u}))},get:function(){return n["_"+i]}})}else console.error("prop "+i+" not in component: "+u+", Can not observer")}function nt(t){return t&&t.constructor&&"componentName"in t.constructor}function it(t){var e,r,n,i,s=[];t instanceof Array?s.push.apply(s,H(t)):s.push(t);try{for(var a=G(s),u=a.next();!u.done;u=a.next()){var l=u.value;for(var h in l.observerInfo){J[h]=J[h]||[];var c=J[h],f=function(t){var e;-1===c.findIndex((function(e){return Object(o.a)(e,t)}))&&J[h].push(t)};try{for(var d=(n=void 0,G(l.observerInfo[h])),p=d.next();!p.done;p=d.next()){var m;f(p.value)}}catch(t){n={error:t}}finally{try{p&&!p.done&&(i=d.return)&&i.call(d)}finally{if(n)throw n.error}}}}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}}function ot(t,e){var r,n;if(void 0===e&&(e=t.name),e&&J[e]){if(!t||!nt(t))throw new Error("component param must be an instance of Component");if(!t.gameObject||!t.gameObject.id)throw new Error("component should be add to a gameObject");try{for(var i=G(J[e]),o=i.next();!o.done;o=i.next()){var s=o.value,a=Z(t,s.prop),u,l;rt({obj:a.property,key:a.key,prop:s,component:t,componentName:e})}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}function st(t,e){var r,n;for(var i in void 0===e&&(e=t.name),Q){var o,s;(Q[i]||{})[e]&&(null===(n=null===(r=K[i])||void 0===r?void 0:r.componentObserver)||void 0===n||n.add({component:t,type:Y.ADD,componentName:e}))}}function at(t,e){var r,n;for(var i in void 0===e&&(e=t.name),Q){var o,s;(Q[i]||{})[e]&&(null===(n=null===(r=K[i])||void 0===r?void 0:r.componentObserver)||void 0===n||n.add({component:t,type:Y.REMOVE,componentName:e}))}$(t)}function ut(t,e){Q[e.systemName]=e.observerInfo,K[e.systemName]=t}var lt,ht=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.name="Transform",e._parent=null,e.inScene=!1,e.children=[],e.position={x:0,y:0},e.size={width:0,height:0},e.origin={x:0,y:0},e.anchor={x:0,y:0},e.scale={x:1,y:1},e.skew={x:0,y:0},e.rotation=0,e}return j(e,t),e.prototype.init=function(t){var e,r;void 0===t&&(t={});var n=["position","size","origin","anchor","scale","skew"];try{for(var i=G(n),o=i.next();!o.done;o=i.next()){var s=o.value;Object.assign(this[s],t[s])}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}this.rotation=t.rotation||this.rotation},Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},set:function(t){t?t.addChild(this):this.parent&&this.parent.removeChild(this)},enumerable:!1,configurable:!0}),e.prototype.addChild=function(t){if(t.parent===this){var e=this.children.findIndex((function(e){return e===t}));this.children.splice(e,1)}else t.parent&&t.parent.removeChild(t);t._parent=this,this.children.push(t)},e.prototype.removeChild=function(t){var e=this.children.findIndex((function(e){return e===t}));e>-1&&(this.children.splice(e,1),t._parent=null)},e.prototype.clearChildren=function(){this.children.length=0},e.componentName="Transform",B([Object(a.b)("vector2"),Object(a.a)(1)],e.prototype,"position",void 0),B([Object(a.b)("size"),Object(a.a)(1)],e.prototype,"size",void 0),B([Object(a.b)("vector2"),Object(a.a)(.1)],e.prototype,"origin",void 0),B([Object(a.b)("vector2"),Object(a.a)(.1)],e.prototype,"anchor",void 0),B([Object(a.b)("vector2"),Object(a.a)(.1)],e.prototype,"scale",void 0),B([Object(a.b)("vector2"),Object(a.a)(.1)],e.prototype,"skew",void 0),B([Object(a.b)("number"),Object(a.a)(.1)],e.prototype,"rotation",void 0),e}(V),ct=0;function ft(){return++ct}var dt,pt=function(){function t(t,e){this._componentCache={},this.components=[],this._name=t,this.id=ft(),this.addComponent(ht,e)}return Object.defineProperty(t.prototype,"transform",{get:function(){return this.getComponent(ht)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.transform&&this.transform.parent&&this.transform.parent.gameObject},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scene",{get:function(){return this._scene},set:function(t){var e,r;if(this._scene!==t){var n=this._scene;if(this._scene=t,this.transform&&this.transform.children)try{for(var i=G(this.transform.children),o=i.next();!o.done;o=i.next()){var s;o.value.gameObject.scene=t}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}t?t.addGameObject(this):n&&n.removeGameObject(this)}},enumerable:!1,configurable:!0}),t.prototype.addChild=function(e){if(e&&e.transform&&e!==this){if(!(e instanceof t))throw new Error("addChild only receive GameObject");if(!this.transform)throw new Error("gameObject '"+this.name+"' has been destroy");e.transform.parent=this.transform,e.scene=this.scene}},t.prototype.removeChild=function(e){return e instanceof t&&e.parent&&e.parent===this?(e.transform.parent=null,e.scene=null,e):e},t.prototype.addComponent=function(t,e){var r=z(t);if(!this._componentCache[r]){var n;if(t instanceof Function)n=new t(e);else{if(!(t instanceof V))throw new Error("addComponent recieve Component and Component Constructor");n=t}if(n.gameObject)throw new Error("component has been added on gameObject "+n.gameObject.name);return n.gameObject=this,n.init&&n.init(n.__componentDefaultParams),st(n,n.name),ot(n,n.name),this.components.push(n),this._componentCache[r]=n,n.awake&&n.awake(),n}},t.prototype.removeComponent=function(t){var e;if("string"==typeof t?e=t:t instanceof V?e=t.name:t.componentName&&(e=t.componentName),"Transform"===e)throw new Error("Transform can't be removed");return this._removeComponent(e)},t.prototype._removeComponent=function(t){var e=this.components.findIndex((function(e){var r;return e.name===t}));if(-1!==e){var r=this.components.splice(e,1)[0];return delete this._componentCache[t],delete r.__componentDefaultParams,r.onDestroy&&r.onDestroy(),at(r,t),r.gameObject=void 0,r}},t.prototype.getComponent=function(t){var e;return"string"==typeof t?e=t:t instanceof V?e=t.name:t.componentName&&(e=t.componentName),void 0!==this._componentCache[e]?this._componentCache[e]:void 0},t.prototype.remove=function(){if(this.parent)return this.parent.removeChild(this)},t.prototype.destroy=function(){if(this.transform){for(var t in Array.from(this.transform.children).forEach((function(t){var e;t.gameObject.destroy()})),this.remove(),this.transform.clearChildren(),this._componentCache)this._removeComponent(t);this.components.length=0}else console.error("Cannot destroy gameObject that have already been destroyed.")},t}(),mt,vt=function(){function t(){this.events=[]}return t.prototype.add=function(t){var e=t.component,r=t.prop,n=t.type,i=t.componentName;if(n===Y.REMOVE){if(this.events.find((function(t){return t.component===e&&t.type===Y.ADD})))return void(this.events=this.events.filter((function(t){return t.component!==e})));this.events=this.events.filter((function(t){return t.component!==e}))}var s=this.events.findIndex((function(t){return t.component===e&&Object(o.a)(t.prop,r)&&t.type===n}));s>-1&&this.events.splice(s,1),this.events.push({gameObject:e.gameObject,component:e,prop:r,type:n,componentName:i})},t.prototype.getChanged=function(){return this.events},Object.defineProperty(t.prototype,"changed",{get:function(){return this.events},enumerable:!1,configurable:!0}),t.prototype.clear=function(){var t=this.events;return this.events=[],t},t}(),yt,gt=function(){function t(t){this.started=!1,this.componentObserver=new vt,this.__systemDefaultParams=t,this.name=this.constructor.systemName}return t.prototype.destroy=function(){var t;this.componentObserver=null,this.__systemDefaultParams=null,null===(t=this.onDestroy)||void 0===t||t.call(this)},t}();function _t(){var t=null;return t=Date.now?Date.now:function(){return(new Date).getTime()}}var bt=_t(),xt={originTime:0,playbackRate:1},Tt,Et=function(){function t(e,r){e instanceof t&&(r=e,e={}),e=Object.assign({},xt,e),r&&(this._parent=r),this._createTime=bt(),this._timeMark=[{globalTime:this.globalTime,localTime:-e.originTime,entropy:-e.originTime,playbackRate:e.playbackRate,globalEntropy:0}],this._parent&&(this._timeMark[0].globalEntropy=this._parent.entropy),this._playbackRate=e.playbackRate}return Object.defineProperty(t.prototype,"globalTime",{get:function(){return this.parent?this.parent.currentTime:bt()-this._createTime},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastTimeMark",{get:function(){return this._timeMark[this._timeMark.length-1]},enumerable:!1,configurable:!0}),t.prototype.markTime=function(t){var e=void 0===t?{}:t,r=e.time,n=void 0===r?this.currentTime:r,i=e.entropy,o=void 0===i?this.entropy:i,s=e.playbackRate,a=void 0===s?this.playbackRate:s,u={globalTime:this.globalTime,localTime:n,entropy:o,playbackRate:a,globalEntropy:this.globalEntropy};this._timeMark.push(u)},Object.defineProperty(t.prototype,"currentTime",{get:function(){var t=this.lastTimeMark,e=t.localTime,r=t.globalTime;return e+(this.globalTime-r)*this.playbackRate},set:function(t){this.markTime({time:t})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"globalEntropy",{get:function(){return this._parent?this._parent.entropy:this.globalTime},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"entropy",{get:function(){var t=this.lastTimeMark,e=t.entropy,r=t.globalEntropy;return e+Math.abs((this.globalEntropy-r)*this.playbackRate)},set:function(t){if(this.entropy>t){var e=this.seekTimeMark(t);this._timeMark.length=e+1}this.markTime({entropy:t})},enumerable:!1,configurable:!0}),t.prototype.fork=function(e){return new t(e,this)},t.prototype.seekGlobalTime=function(t){var e=this.seekTimeMark(t),r=this._timeMark[e],n=r.entropy,i=r.playbackRate,o;return r.globalTime+(t-n)/Math.abs(i)},t.prototype.seekLocalTime=function(t){var e=this.seekTimeMark(t),r=this._timeMark[e],n=r.localTime,i=r.entropy,o;return r.playbackRate>0?n+(t-i):n-(t-i)},t.prototype.seekTimeMark=function(t){var e=this._timeMark,r=0,n=e.length-1;if(t<=e[r].entropy)return r;if(t>=e[n].entropy)return n;for(var i=Math.floor((r+n)/2);i>r&&i<n;){if(t===e[i].entropy)return i;t<e[i].entropy?n=i:t>e[i].entropy&&(r=i),i=Math.floor((r+n)/2)}return r},Object.defineProperty(t.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){t!==this.playbackRate&&(this.markTime({playbackRate:t}),this._playbackRate=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paused",{get:function(){if(0===this.playbackRate)return!0;for(var t=this.parent;t;){if(0===t.playbackRate)return!0;t=t.parent}return!1},enumerable:!1,configurable:!0}),t}(),St={autoStart:!0,frameRate:60},wt,Ot=function(){function t(t){var e=this;t=Object.assign({},St,t),this._frameCount=0,this._frameDuration=1e3/t.frameRate,this.autoStart=t.autoStart,this.frameRate=t.frameRate,this.timeline=new Et({originTime:0,playbackRate:1}),this._lastFrameTime=this.timeline.currentTime,this._tickers=new Set,this._requestId=null,this._ticker=function(){e._started&&(e._requestId=requestAnimationFrame(e._ticker),e.update())},this.autoStart&&this.start()}return t.prototype.update=function(){var t,e,r=this.timeline.currentTime,n=r-this._lastFrameTime;if(n>=this._frameDuration){var i=r-n%this._frameDuration,o=i-this._lastFrameTime;this._lastFrameTime=i;var s={deltaTime:o,time:i,currentTime:i,frameCount:++this._frameCount,fps:Math.round(1e3/o)};try{for(var a=G(this._tickers),u=a.next();!u.done;u=a.next()){var l=u.value;"function"==typeof l&&l(s)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=a.return)&&e.call(a)}finally{if(t)throw t.error}}}},t.prototype.add=function(t){this._tickers.add(t)},t.prototype.remove=function(t){this._tickers.delete(t)},t.prototype.start=function(){this._started||(this._started=!0,this.timeline.playbackRate=1,this._requestId=requestAnimationFrame(this._ticker))},t.prototype.pause=function(){this._started=!1,this.timeline.playbackRate=0},t.prototype.setPlaybackRate=function(t){this.timeline.playbackRate=t},t}(),Pt,Ct=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.gameObjects=[],n.scene=n,n}return j(e,t),e.prototype.addGameObject=function(t){this.gameObjects.push(t),t.transform&&(t.transform.inScene=!0)},e.prototype.removeGameObject=function(t){var e=this.gameObjects.indexOf(t);-1!==e&&(t.transform&&(t.transform.inScene=!1),this.gameObjects.splice(e,1))},e.prototype.destroy=function(){this.scene=null,t.prototype.destroy.call(this),this.gameObjects=null,this.canvas=null},e}(pt),Mt;!function(t){t.SINGLE="SINGLE",t.MULTI_CANVAS="MULTI_CANVAS"}(Mt||(Mt={}));var Rt=function(t){if((t instanceof gt||t instanceof V)&&!t.started){t.started=!0;try{t.start&&t.start()}catch(e){t instanceof V?console.error(t.constructor.componentName+" start error",e):console.error(t.constructor.systemName+" start error",e)}}},At=function(t){var e,r,n,i=(null===(n=null==t?void 0:t.scene)||void 0===n?void 0:n.gameObjects)||[],o=null==t?void 0:t.multiScenes.map((function(t){var e;return t.gameObjects})),s=[];try{for(var a=G(o),u=a.next();!u.done;u=a.next()){var l;s=H(s,u.value)}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}return H(i,s)},Dt=function(t,e){var r,n,i,o,s,a,u,l;void 0===e&&(e=[]);try{for(var h=G(e),c=h.next();!c.done;c=h.next()){var f=c.value;try{for(var d=(i=void 0,G(f.components)),p=d.next();!p.done;p=d.next()){var m=p.value;try{Rt(m),m.update&&m.update(t)}catch(t){console.error("gameObject: "+f.name+" "+m.name+" update error",t)}}}catch(t){i={error:t}}finally{try{p&&!p.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(t){r={error:t}}finally{try{c&&!c.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}try{for(var v=G(e),y=v.next();!y.done;y=v.next()){var f=y.value;try{for(var g=(u=void 0,G(f.components)),_=g.next();!_.done;_=g.next()){var m=_.value;try{m.lateUpdate&&m.lateUpdate(t)}catch(t){console.error("gameObject: "+f.name+" "+m.name+" lateUpdate error",t)}}}catch(t){u={error:t}}finally{try{_&&!_.done&&(l=g.return)&&l.call(g)}finally{if(u)throw u.error}}}}catch(t){s={error:t}}finally{try{y&&!y.done&&(a=v.return)&&a.call(v)}finally{if(s)throw s.error}}},It=function(t){var e,r,n,i;try{for(var o=G(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{for(var u=(n=void 0,G(a.components)),l=u.next();!l.done;l=u.next()){var h=l.value;try{h.onResume&&h.onResume()}catch(t){console.error("gameObject: "+a.name+", "+h.name+", onResume error",t)}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}},kt=function(t){var e,r,n,i;try{for(var o=G(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{for(var u=(n=void 0,G(a.components)),l=u.next();!l.done;l=u.next()){var h=l.value;try{h.onPause&&h.onPause()}catch(t){console.error("gameObject: "+a.name+", "+h.name+", onResume error",t)}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}},Lt,Nt=function(t){function e(e){var r,n,i=void 0===e?{}:e,o=i.systems,s=i.frameRate,a=void 0===s?60:s,u=i.autoStart,l=void 0===u||u,h=i.needScene,c=void 0===h||h,f=t.call(this)||this;if(f.playing=!1,f.started=!1,f.multiScenes=[],f.systems=[],window.__EVA_INSPECTOR_ENV__&&(window.__EVA_GAME_INSTANCE__=f),f.ticker=new Ot({autoStart:!1,frameRate:a}),f.initTicker(),o&&o.length)try{for(var d=G(o),p=d.next();!p.done;p=d.next()){var m=p.value;f.addSystem(m)}}catch(t){r={error:t}}finally{try{p&&!p.done&&(n=d.return)&&n.call(d)}finally{if(r)throw r.error}}return c&&f.loadScene(new Ct("scene")),l&&f.start(),f}return j(e,t),Object.defineProperty(e.prototype,"scene",{get:function(){return this._scene},set:function(t){this._scene=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"gameObjects",{get:function(){return At(this)},enumerable:!1,configurable:!0}),e.prototype.addSystem=function(t,e){var r,n;if(t instanceof Function)r=new t(e);else{if(!(t instanceof gt))return void console.warn("can only add System");r=t}if(!this.systems.find((function(t){return t.constructor===r.constructor}))){r.game=this,r.init&&r.init(r.__systemDefaultParams),ut(r,r.constructor),it(r.constructor);try{r.awake&&r.awake()}catch(t){console.error(r.constructor.systemName+" awake error",t)}return this.systems.push(r),r}console.warn(r.constructor.systemName+" System has been added")},e.prototype.removeSystem=function(t){if(t){var e=-1;"string"==typeof t?e=this.systems.findIndex((function(e){return e.name===t})):t instanceof Function?e=this.systems.findIndex((function(e){return e.constructor===t})):t instanceof gt&&(e=this.systems.findIndex((function(e){return e===t}))),e>-1&&(this.systems[e].destroy&&this.systems[e].destroy(),this.systems.splice(e,1))}},e.prototype.getSystem=function(t){return this.systems.find((function(e){return"string"==typeof t?e.name===t:e instanceof t}))},e.prototype.pause=function(){this.playing&&(this.playing=!1,this.ticker.pause(),this.triggerPause())},e.prototype.start=function(){this.playing||(this.playing=!0,this.started=!0,this.ticker.start())},e.prototype.resume=function(){this.playing||(this.playing=!0,this.ticker.start(),this.triggerResume())},e.prototype.initTicker=function(){var t=this;this.ticker.add((function(e){var r,n,i,o;t.scene&&Dt(e,t.gameObjects);try{for(var s=G(t.systems),a=s.next();!a.done;a=s.next()){var u=a.value;try{Rt(u),u.update&&u.update(e)}catch(e){console.error(u.constructor.systemName+" update error",e)}}}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}try{for(var l=G(t.systems),h=l.next();!h.done;h=l.next()){var u=h.value;try{u.lateUpdate&&u.lateUpdate(e)}catch(e){console.error(u.constructor.systemName+" lateUpdate error",e)}}}catch(t){i={error:t}}finally{try{h&&!h.done&&(o=l.return)&&o.call(l)}finally{if(i)throw i.error}}}))},e.prototype.triggerResume=function(){var t,e;It(this.gameObjects);try{for(var r=G(this.systems),n=r.next();!n.done;n=r.next()){var i=n.value;try{i.onResume&&i.onResume()}catch(t){console.error(i.constructor.systemName+", onResume error",t)}}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e.prototype.triggerPause=function(){var t,e;kt(this.gameObjects);try{for(var r=G(this.systems),n=r.next();!n.done;n=r.next()){var i=n.value;try{i.onPause&&i.onPause()}catch(t){console.error(i.constructor.systemName+", onPause error",t)}}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e.prototype.destroySystems=function(){var t,e;try{for(var r=G(H(this.systems)),n=r.next();!n.done;n=r.next()){var i=n.value;this.removeSystem(i)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}this.systems.length=0},e.prototype.destroy=function(){this.removeAllListeners(),this.pause(),this.scene.destroy(),this.destroySystems(),this.ticker=null,this.scene=null,this.canvas=null,this.multiScenes=null},e.prototype.loadScene=function(t){var e=t.scene,r=t.mode,n=void 0===r?Mt.SINGLE:r,i=t.params,o=void 0===i?{}:i;if(e){switch(n){case Mt.SINGLE:this.scene=e;break;case Mt.MULTI_CANVAS:this.multiScenes.push(e)}this.emit("sceneChanged",{scene:e,mode:n,params:o})}},e}(i.a);function jt(t,e){t.constructor.IDEProps||(t.constructor.IDEProps=[]),t.constructor.IDEProps.push(e)}function Bt(t){return void 0===t&&(t={}),function(e){if(!e.observerInfo){for(var r in t)for(var n in t[r]){"string"==typeof t[r][n]&&(t[r][n]=[t[r][n]]);var i=void 0;Array.isArray(t[r][n])&&(i={prop:t[r][n],deep:!1},t[r][n]=i),"string"==typeof(i=t[r][n]).prop&&(i.prop=[i.prop])}e.observerInfo=t}}}var Ft,Ut=function(t){function e(e){var r=e.resource,n=e.resourceTotal,i=t.call(this)||this;return i.progress=0,i.resourceTotal=0,i.resourceLoadedCount=0,i.resource=r,i.resourceTotal=n,0===n&&i.resource.emit(Xt.COMPLETE,i),i}return j(e,t),e.prototype.onStart=function(){this.resource.emit(Xt.START,this)},e.prototype.onProgress=function(t){this.resourceLoadedCount++,this.progress=Math.floor(this.resourceLoadedCount/this.resourceTotal*100)/100,t.success?this.resource.emit(Xt.LOADED,this,t):this.resource.emit(Xt.ERROR,this,t),this.resource.emit(Xt.PROGRESS,this,t),this.resourceLoadedCount===this.resourceTotal&&this.resource.emit(Xt.COMPLETE,this)},e}(i.a),Gt={AbstractLoadStrategy:f,AudioLoadStrategy:x,ImageLoadStrategy:E,XhrResponseType:O,MediaElementLoadStrategy:b,VideoLoadStrategy:S,XhrLoadStrategy:C,Loader:L,Resource:A,ResourceType:p,ResourceState:m},Xt,Ht;!function(t){t.START="start",t.PROGRESS="progress",t.LOADED="loaded",t.COMPLETE="complete",t.ERROR="error"}(Xt||(Xt={})),function(t){t.IMAGE="IMAGE",t.SPRITE="SPRITE",t.SPRITE_ANIMATION="SPRITE_ANIMATION",t.AUDIO="AUDIO",t.VIDEO="VIDEO"}(Ht||(Ht={})),C.setExtensionXhrType("json",O.Json),C.setExtensionXhrType("tex",O.Json),C.setExtensionXhrType("ske",O.Json),C.setExtensionXhrType("mp3",O.Buffer),C.setExtensionXhrType("wav",O.Buffer),C.setExtensionXhrType("aac",O.Buffer),C.setExtensionXhrType("ogg",O.Buffer);var zt={png:E,jpg:E,jpeg:E,webp:E,json:C,tex:C,ske:C,audio:C,video:S},Wt,Vt=new(function(t){function e(e){var r=t.call(this)||this;return r.timeout=6e3,r.preProcessResourceHandlers=[],r.resourcesMap={},r.makeInstanceFunctions={},r.destroyInstanceFunctions={},r.promiseMap={},r.loaders=[],e&&"number"==typeof e.timeout&&(r.timeout=e.timeout),r}return j(e,t),e.prototype.loadConfig=function(t){this.addResource(t),this.preload()},e.prototype.loadSingle=function(t){return this.addResource([t]),this.getResource(t.name)},e.prototype.addResource=function(t){var e,r;if(!t||t.length<1)console.warn("no resources");else try{for(var n=G(t),i=n.next();!i.done;i=n.next()){var o=i.value;this.resourcesMap[o.name]?console.warn(o.name+" was already added"):(this.resourcesMap[o.name]=o,this.resourcesMap[o.name].data={})}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},e.prototype.addPreProcessResourceHandler=function(t){this.preProcessResourceHandlers.push(t)},e.prototype.removePreProcessResourceHandler=function(t){this.preProcessResourceHandlers.splice(this.preProcessResourceHandlers.indexOf(t),1)},e.prototype.preload=function(){var t=[];for(v